Comments (19)
I'm thinking yes...
Perhaps check for a $HOME/.ruby
, if it exists, use it, otherwise, try to default to something (system). Less confusion for those getting started, but good options for those that need something more specific. Of course, the option to do chruby $(cat ~/.ruby)
continues to be available for those that prefer that workflow.
from chruby.
Also, what is the preferred file for specifying (fuzzy) Ruby versions: .ruby
or .ruby-version
? I know rbfu supports .ruby-version
, yet most people use .rbenv-version
.
from chruby.
I feel in my gut that .<language-version>
is the right thing to do and everything else is an anti-pattern; however, given there is much mind-share already (shame on them for not being generic in the first place), I would say:
- .ruby-version (default)
- .rbenv-version (for compat)
- .whatever-else-is-popular (for compat)
from chruby.
I'm starting to think of not supporting rbenv-version
, since rbenv/ruby-build uses specific names for their Rubies; I prefer the full NAME-VERSION
form. I like the idea of standardizing on a .ruby-version
containing (RUBY-)?(X(.Y(.Z)?)?)?
.
from chruby.
Looks like @mpapis already requested .ruby-version
support in rbenv, 10 months ago. There's even a Pull Request for this.
from chruby.
Interesting that it's still open. Seems like that should have gotten merged post-haste.
from chruby.
I would vote for .ruby-version
over .ruby
- just try to follow existing conventions ;) and .ruby
could be some dir with either rubies or configurations, so might be conflicting.
from chruby.
.ruby-version
👍
from chruby.
So now to shoe-horn this functionality into the chruby
function. What do you think about being able to pass a directory to chruby, which is then checked for .ruby-version
?
chruby .
chruby ~
chruby /path/to/project
Or should we only allow a keyword that indicates to check for $PWD/.ruby-version
, such as chruby project
, chruby local
, chruby .
?
from chruby.
try to keep it simple, rvm allows all the kind path/file loading, including:
rvm in /path do command...
which will cd to the dir, load project file and execute the command there.
if you are about to allow chruby project
which will default to $PWD/.ruby-version
you could easily make it chruby project [path]
with %{1:-$PWD}
.
from chruby.
chruby local
seems like magic to avoid.chruby .
is pretty intention revealing and concise and should be equivalent tochruby $PWD
.- as such, to mitigate confusion, it should also be allowed to do
chruby /path/to/project
orchruby /path/to/whatever
.
from chruby.
from chruby.
@wilmoore what about the off chance you're working in a project that has a jruby
directory? What should take precedence, check for jruby/.ruby-version
or fuzzy matching for jruby
in RUBIES
.
from chruby.
@postmodern matching rubies should have precedence, you can always say it's path with ./jruby
from chruby.
Yup, what @mpapis said :)
from chruby.
Just realized this. .
will always fuzzy match the first Ruby. :) So directory matching should happen last, or this feature should be implemented in auto-switching by hooking cd/chpwd.
from chruby.
If we decide to keep manual loading of .ruby-version
, it should probably be in a separate function/script. Given chruby NAME
, NAME
should directly map to a Ruby by name/version.
from chruby.
maybe consider replacing .
to -
or anything else so the unix meaning of .
is preserved for directories and you can still match any ruby ... or use ./.
for current dir ;)
from chruby.
Closing this in favour of chruby $(cat .chruby)
in .bashrc
and Auto-Switching on chdir (issue #40).
from chruby.
Related Issues (20)
- Add safe local bin directory to PATH HOT 4
- Filter out rubies that lack a bin/ruby file
- chruby reports exit status 0 under Bash, but still throws a Ruby exception when switching to mruby HOT 1
- `setup.sh` script is broken on WSL2 Ubuntu 20.04 HOT 1
- Integrate with vscode HOT 2
- Won't able to remove chruby from MacOS Shell HOT 5
- Cannot install latest ruby through chruby on Mac M2 Apple Chip HOT 1
- "chruby: unknown Ruby: ruby-3.1.2" was shown everytime launch terminal HOT 4
- Wrong $PATH in Nova Editor process
- Is there a deterministic way of checking whether bundle exec is necessary? HOT 5
- Release 0.4.0
- Chruby puts a missing directory on the PATH HOT 2
- Rename `share/chruby/dev.sh` to `share/chruby/testing.sh` (or other) HOT 7
- chruby not available system-wide HOT 1
- Unable to install on macOS 12.6.7 HOT 2
- yaourt alternative needed HOT 1
- Wiki instructions for Ruby.md - move to 3.3.0 HOT 1
- [Wiki] Incorrect wget path for Ruby install HOT 1
- chruby picking the wrong ruby on substring match HOT 3
- Non-interactive `chruby-exec` fails with `zsh:1: command not found: chruby` HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chruby.