postmodern / chruby

Changes the current Ruby
MIT License
2.88k stars 189 forks source link

Support 'chruby -' to switch to previous version #243

Closed aprescott closed 10 years ago

aprescott commented 10 years ago

From a discussion at #242, this implements chruby - to switch to the previous version.

$ chruby system # system Ruby
$ chruby 2.0    # 2.0
$ chruby -      # system
$ chruby -      # 2.0
$ chruby 2.1    # 2.1
$ chruby -      # 2.0

I realise that the contributing guidelines say don't add further environment variables, but @postmodern thought chruby - was a good idea and I don't think there's a better way to implement this.

aprescott commented 10 years ago

As an aside, I had trouble getting a test environment up and running. Seems rvm.io doesn't have an available file for me to download at http://rvm.io/binaries/arch/libc-2.18/x86_64/ruby-2.0.0-p353.tar.bz2.

postmodern commented 10 years ago

Ping @mpapis, arch needs a libc-2.18/ directory.

postmodern commented 10 years ago

Also, you should base your branch off of the 0.4.0 branch, since this is a new feature.

aprescott commented 10 years ago

OLD_RUBY_ROOT sounds better to me!

I'll switch it to a noop, since a chruby_reset might be unexpected. New shell → "hey, new chruby feature!" → chruby - → "where's my Ruby?".

mpapis commented 10 years ago

I'm still puzzled on arch support, so far the official statement is - it is not supported, but I'm still thinking on it, I would love to get some input on compatibility of binaries on a moving target OS like Arch - if anyone knows a bit about it please open a ticket for me on rvm or rvm-binary ... for sure I will be adding a static binary.

aprescott commented 10 years ago

@postmodern do you want a message on stderr, or just completely silent?

aprescott commented 10 years ago

Looks like GitHub commit comments get lost (PR diff comments are persisted, fyi), but I'm moving this to a new issue to change the base of the PR.

postmodern commented 10 years ago

@aprescott I wonder if you can just rebase against 0.4.0 branch, and force push?

aprescott commented 10 years ago

@postmodern yeah that's what I tried at first but it brought all of the 0.4.0 commits into this PR to be merged into master. :)