Giter Club home page Giter Club logo

Comments (19)

wilmoore avatar wilmoore commented on September 1, 2024

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.

postmodern avatar postmodern commented on September 1, 2024

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.

wilmoore avatar wilmoore commented on September 1, 2024

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.

postmodern avatar postmodern commented on September 1, 2024

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.

postmodern avatar postmodern commented on September 1, 2024

Looks like @mpapis already requested .ruby-version support in rbenv, 10 months ago. There's even a Pull Request for this.

from chruby.

wilmoore avatar wilmoore commented on September 1, 2024

Interesting that it's still open. Seems like that should have gotten merged post-haste.

from chruby.

mpapis avatar mpapis commented on September 1, 2024

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.

wilmoore avatar wilmoore commented on September 1, 2024

.ruby-version 👍

from chruby.

postmodern avatar postmodern commented on September 1, 2024

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.

mpapis avatar mpapis commented on September 1, 2024

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.

wilmoore avatar wilmoore commented on September 1, 2024
  • chruby local seems like magic to avoid.
  • chruby . is pretty intention revealing and concise and should be equivalent to chruby $PWD.
  • as such, to mitigate confusion, it should also be allowed to do chruby /path/to/project or chruby /path/to/whatever.

from chruby.

mpapis avatar mpapis commented on September 1, 2024

@wilmoore 👍

from chruby.

postmodern avatar postmodern commented on September 1, 2024

@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.

mpapis avatar mpapis commented on September 1, 2024

@postmodern matching rubies should have precedence, you can always say it's path with ./jruby

from chruby.

wilmoore avatar wilmoore commented on September 1, 2024

Yup, what @mpapis said :)

from chruby.

postmodern avatar postmodern commented on September 1, 2024

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.

postmodern avatar postmodern commented on September 1, 2024

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.

mpapis avatar mpapis commented on September 1, 2024

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.

postmodern avatar postmodern commented on September 1, 2024

Closing this in favour of chruby $(cat .chruby) in .bashrc and Auto-Switching on chdir (issue #40).

from chruby.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.