Commit graph

761 commits

Author SHA1 Message Date
Mislav Marohnić
76e64ff2ea Have shims survive symlinked rbenv updates a la Homebrew
Homebrew places the rbenv executable in a location such as
`/usr/local/bin/rbenv`, which is in PATH. However, that is a symlink to
`/usr/local/Cellar/rbenv/<VERSION>/bin/rbenv`, which is itself a symlink to
`/usr/local/Cellar/rbenv/<VERSION>/libexec/rbenv`. Upon executing, rbenv
will add its own directory to PATH so that it can easily invoke its
subcommands.

When generating shims during `rbenv rehash`, rbenv will try to put the
absolute path to itself inside each shim so that shims would work even
if rbenv itself isn't in PATH. Under Homebrew, rbenv's directory will be
the versioned directory in Homebrew's Cellar. However, due to Homebrew's
auto-cleanup functionality, shims generated this way will be broken
after upgrading rbenv because of the versioned Cellar path.

This changes how rbenv discovers itself in PATH: it will look at the
original PATH, not in the one modified by rbenv, with the intention of
excluding results under rbenv's own `libexec/`. If rbenv wasn't found in
PATH, return the absolute path to rbenv's own `bin/rbenv`.
2021-09-29 19:54:36 +02:00
Mislav Marohnić
b0fb351419 GitHub now auto-generates a Table of Contents 2021-09-28 13:41:20 +02:00
Mislav Marohnić
e7fd07dd91
Merge pull request #1334 from rbenv/rehash-speedup
Speed up rehash
2021-09-28 13:25:38 +02:00
Mislav Marohnić
faf999211b Speed up rehash
Before (20 ruby versions, producing 200 shims total):

    mean:    0.124 s
    stdev:   0.003

After:

    mean:    0.090 s
    stdev:   0.004
2021-05-11 11:51:00 +02:00
Mislav Marohnić
585ed84283
Merge pull request #1099 from blueyed/init-shell
Improve init: warn about missing shell and use it in the template
2021-05-06 00:46:43 +02:00
Daniel Hahler
d061cb4651 Have rbenv init print instructions that hardcode the detected shell
This speeds up subsequent `rbenv init -` executions for the user who
followed these instructions because the shell will no longer have to be
detected each time.
2021-05-06 00:43:16 +02:00
Mislav Marohnić
059bb2c151
Merge pull request #1243 from scop/nounset
Make work in set -u (nounset) mode
2021-05-06 00:13:20 +02:00
Mislav Marohnić
b904ea54cc
Merge pull request #1332 from rbenv/head-flag
Supply `head -n` flag explicitly
2021-05-06 00:10:23 +02:00
Mislav Marohnić
dcba8b4064 Supply head -n flag explicitly
The syntax `head -NUM` was deprecated in the POSIX standard.
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/head.html
2021-05-05 22:42:56 +02:00
Jason Karns
633436706f
Merge pull request #1331 from AmritD/patch-1
Updated rbenv-doctor url to reflect renaming master branch to main
2021-05-04 16:22:48 -04:00
Jason Karns
4092eba274
Update rbenv-doctor link master -> main 2021-05-04 16:20:33 -04:00
Amrit Dhakal
064e1c48ba
Updated rbenv-doctor url to reflect renaming master branch to main
Updated rbenv-doctor url to reflect renaming master branch to main
2021-05-04 09:46:36 -04:00
Hiroshi SHIBATA
462bb67709
Merge pull request #1330 from neilparikh/patch-1
Fix link to rbenv-doctor
2021-05-04 15:53:11 +09:00
Neil Parikh
b424d452d0
Fix link to rbenv-doctor
master -> main
2021-05-04 02:03:11 -04:00
Hiroshi SHIBATA
80af359232
Merge pull request #1307 from native-api/ps4
Use a better PS4 as recommeneded by Bash Hackers Wiki
2021-04-27 13:30:49 +09:00
Hiroshi SHIBATA
ccb4601f3a
Merge pull request #1311 from scop/shell-detect-improvements
Shell detect improvements
2021-04-27 13:14:58 +09:00
Hiroshi SHIBATA
5d6f998c52
Merge pull request #1320 from scop/test/misleading-parent-shell-arg
test(init): remove misleading arg in detect from parent shell case
2021-04-27 13:14:42 +09:00
Ville Skyttä
6b842a7670 test(init): remove misleading arg in detect from parent shell case
The generated script does not take/use any arguments, so passing
/bin/zsh to it serves only to cause confusion.
2021-03-23 23:41:55 +02:00
Ville Skyttä
45951d2cbb feat(init): strip -<suffix> when autodetecting shell
For example bash-5.1, bash-static.
2021-03-01 07:49:47 +02:00
Hiroshi SHIBATA
d604acb78a
Merge pull request #1308 from avronr/patch-2
[DOCS] Typo and formatting fix.
2021-02-12 07:49:56 +09:00
Abraham Raji
37405c3249
[DOCS] Typo and formatting fix.
- fixing typos and formatting issues.
2021-02-12 03:47:31 +05:30
Hiroshi SHIBATA
268c61a69c
Merge pull request #1289 from avronr/patch-1
Update README.md
2021-02-11 08:32:34 +09:00
Ivan Pozdeev
b5429624c2 Use a better PS4 as recommeneded by Bash Hackers Wiki
it allows to see functions as well as lines, therefore making it possible to see the control flow
2021-02-10 22:46:08 +03:00
Abraham Raji
5f7597e754
Update README.md
Added Installation and uninstallation instructions for Debian and Arch Linux Family
Give a little more details about Ubuntu's .bash_profile issue
2020-12-15 21:08:56 +05:30
Hiroshi SHIBATA
62d7798270
Merge pull request #1015 from advaitju/master
Documentation unclear about installing Ruby version
2020-12-03 13:45:17 +09:00
Hiroshi SHIBATA
4086bbe562
Merge pull request #1119 from blueyed/test-run
test/run: handle optional paths/args for bats
2020-12-03 13:41:17 +09:00
Hiroshi SHIBATA
60c9339685
Merge pull request #1275 from metalefty/readme
README: reflect changes in rbenv/ruby-build#1402
2020-10-19 15:59:40 +09:00
Koichiro IWAO
d3f8de4c04
README: reflect changes in rbenv/ruby-build#1402 2020-10-19 15:31:05 +09:00
Hiroshi SHIBATA
0843745be9
Merge pull request #1253 from scop/bash-completion-globbing
bash completion: avoid unintentional globbing
2020-08-09 08:13:04 +09:00
Jason Karns
d4d69ed0cd
Merge pull request #1260 from rbenv/rename-conduct-1
Rename CONDUCT.md to CODE_OF_CONDUCT.md
2020-08-03 12:24:53 -04:00
Jason Karns
0493a33f59
Rename CONDUCT.md to CODE_OF_CONDUCT.md
GitHub's expected filename is CODE_OF_CONDUCT.md. Whether that is the best name or even the current de facto standard is to be debated. But moving forward, this is likely the filename that will become the most common within the community, as that is the name GitHub expects and suggests.

This simply renames the existing code of conduct file from CONDUCT.md to CODE_OF_CONDUCT.md to conform to GitHub's preference.
2020-08-03 11:59:24 -04:00
Ville Skyttä
8bc71e9161 bash completion: avoid unintentional globbing 2020-05-26 22:31:38 +03:00
Ville Skyttä
a5a1c4d50d Make work in set -u (nounset) mode 2020-05-24 09:08:05 +03:00
Hiroshi SHIBATA
c879cb0f2f
Merge pull request #1242 from scop/spelling
Spelling fix
2020-04-23 14:57:02 +09:00
Ville Skyttä
59004d77ed Spelling fix 2020-04-23 07:59:28 +03:00
Mislav Marohnić
c2cfbd1e8b
Merge pull request #1227 from jasonkarns/agignore
Remove .agignore
2020-03-17 12:35:53 +01:00
Jason Karns
a17c5fb596
Remove agignore
Silver Searcher respects .gitignore, so having an .agignore file is
redundant. (Both patterns present in .agignore are already present in
.gitignore.)

It's also worth noting that silver searcher uses .agignore _in addition
to_ .gitignore, so removing this file will not cause ag to start
ignoring _additional_ patterns from .gitignore (it's already respecting
those patterns).
2020-03-16 17:02:27 -04:00
Mislav Marohnić
c6324ff45a
Merge pull request #1220 from romanlevin/patch-1
Fix fish shell initialization
2020-02-17 23:50:04 +01:00
Roman Levin
74c2486a2c Fix fish instructions test 2020-02-17 21:46:25 +01:00
Roman Levin
ac5dce9014 Remove another fish psub usage 2020-02-17 21:38:46 +01:00
Roman Levin
19ae300eb8 Fix fish shell initialization
Since fish 3.10 at least, the current way of loading rbenv in `fish` is misbehaving, at least in some environments:

```
source: Error encountered while sourcing file '/var/folders/pj/jn249gcn7ddfrjzj2_9mxjhw0000gp/T//.psub.f0iJSWRByB':
source: No such file or directory
```

This changes the initialization to the method recommended by a `fish` developer here: https://github.com/fish-shell/fish-shell/issues/6613#issuecomment-586679958
2020-02-17 21:38:46 +01:00
Mislav Marohnić
e429cc0bd8 Use actions/checkout v2 2020-02-17 20:55:12 +01:00
Mislav Marohnić
d58cf6ec71 Run CI for pull requests from forks 2020-02-17 20:55:12 +01:00
Mislav Marohnić
143b2c9c02
Merge pull request #1216 from gibfahn/re-add_zsh_completions_and_remove_fish
Re-add zsh completion script and remove fish completion script
2020-01-29 11:51:15 +01:00
Gibson Fahnestock
f977248086
Re-add zsh completion script and remove fish completion script
Looks like the zsh completion script was removed by mistake.

Fixes: https://github.com/rbenv/rbenv/issues/1215
Refs: 569d464d36
2020-01-29 10:07:10 +00:00
Mislav Marohnić
569d464d36 Remove fish completion script
fish ships with a much more capable rbenv completion script since fish 2.0.

Fixes #1212
2020-01-28 17:47:59 +01:00
Mislav Marohnić
7795476af1
Merge pull request #1203 from jf/fix_misleading_set_by_message_for_system_ruby
libexec/rbenv-version: get rid of misleading "set by $(rbenv-version-origin)" message when system ruby is in use
2020-01-16 19:47:52 +01:00
Jeffrey 'jf' Lim
137e705db7 Fix (revert) test/version-origin.bats 2020-01-16 23:24:42 +08:00
Jeffrey 'jf' Lim
302797ba41 libexec/rbenv-version{,-origin}: move "missing rbenv-version-file detection" logic as per @mislav 2020-01-16 23:15:09 +08:00
Jeffrey 'jf' Lim
40db754168 Fix tests for #1203 2020-01-08 16:41:14 +08:00