Allow `uru .` to use .ruby-version
Issue #23
resolved
chruby, rvm and rbenv have normalized in the .ruby-version
schema:
https://gist.github.com/fnichol/1912050
Since version activation is on-demand, I thought the usage of uru .
could trigger the parsing of .ruby-version
file found in current directory.
In rbenv for example, it will lookup for .ruby-version
in current or parent directories until it reaches $HOME
This will allow easy switching to a particular version when moving between projects.
Thank you.
Comments (5)
-
repo owner -
repo owner - marked as major
-
repo owner - write private
walkUp
helper similar to go's filepath.Walk() - walk up from
.
to root (no cross volume skipping for windows) and use contents from first.ruby-version
found; look in$HOME | %UserProfile%
as the final location check. - exact match (no fuzzy matching) on ruby registry
ID
andExe
fields to support the following (single line).ruby-version
styles:
2.0.0-p457 ruby-1.9.3-p430 jruby-1.7.4
- since
ID
andExe
don't uniquely identify a ruby, ensure support for multiple exact matches, i.eruby-2.0.0-p197
could match both x86 and x64 registered rubies. - get real-world
.ruby-version
samples from chruby/rbenv/rvm users to see if previous support needs changed. update: appears chruby and others use fuzzy mapping. - ensure a corresponding
GEM_HOME
is generated for the switch - TODO: how to handle jruby and ruby 1.8.7 version wackiness; their
ID
values look like1.7.4
and1.8.7
and don't contain patch info because the current regex parsing doesn't grok their funky version strings. Revisit current regex
- write private
-
repo owner impl started on rebase friendly use-dot branch
-
repo owner - changed status to resolved
Initial .ruby-version support. Closes
#23Support exact matching against ID and fuzzy matching against TagLabel when
.ruby-version
contains single line contents such as:200 1.7.4 2.0.0-p197 200p197-x64 system
→ <<cset bbc050626fcc>>
- Log in to comment
I also like what I've read on
.ruby-version
and thinkuru .
is a very clever idea.I originally was thinking about if/how to hook
cd
, but this looks much cleaner