Near beats far: Conform to RVM's behavior when rc files are found several depths up-tree
(See #45)
RVM does
- For each containing directory above the start point
- if there's a
.rvmrc, use it; else use.ruby-version; else useGemfile - else, recurse up-tree
- if there's a
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.
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
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 I recently became the maintainer of this and I think this is a good addition for v2.0. Please see my comments/questions.