rvm.el icon indicating copy to clipboard operation
rvm.el copied to clipboard

Near beats far: Conform to RVM's behavior when rc files are found several depths up-tree

Open jrep opened this issue 11 years ago • 3 comments

(See #45)

RVM does

  • For each containing directory above the start point
    • if there's a .rvmrc, use it; else use .ruby-version; else use Gemfile
    • else, recurse up-tree

In this way, the precedence among files at a given depth is ".rvmrc > .ruby-version > Gemfile", but nearer files of any name win over remoter files of any name.

rvm.el currently uses different logic:

  • Search all the way up-tree for .rvmrc; if found, use it
  • Else search all over again, for .ruby-version; if found, use it
  • Else search one more time for Gemfile; use or give up

Where there are several rc files up-tree, of different depths and different types (file names), rvm and rvm.el may choose different settings.

This fixes that.

jrep avatar Apr 26 '14 01:04 jrep

hey @jrep

Thank you for improving rvm.el. Since I created this project I moved on to rbenv and https://github.com/senny/rbenv.el . I think your suggested changes are good but I don't have a rvm enabled system anymore to verify the changes. The change looks fundamental and I don't want to break stuff for other users of rvm, that's why I'm hesitant to merge.

/cc @rejeep

senny avatar May 01 '14 15:05 senny

I understand your hesitation. Experience suggests that there probably is someone, somewhere, who has become dependent on this misbehavior. And as it happens, this is not urgent for me: I was able to remove the interfering file. So I'm OK if you want to let this drop.

But still: if there's something I could do to increase confidence, I'm happy to do it.

jrep avatar May 05 '14 23:05 jrep

@jrep I recently became the maintainer of this and I think this is a good addition for v2.0. Please see my comments/questions.

sshaw avatar Nov 22 '17 00:11 sshaw