Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

rvm-activate-corresponding-ruby gets wrong gemset name #25

Closed
tmcgilchrist opened this Issue · 8 comments

2 participants

@tmcgilchrist

I have rvm-mode setup like so

   (require 'rvm)
   (add-hook 'ruby-mode-hook 'rvm-activate-corresponding-ruby)

I've found that when my .rvmrc file contains comments after rvm use it doesn't correctly pickup the gemset name
eg

rvm use --create 1.9.2@project

# Something

It'll try setting the gemset to project#

I assume that the regex "\\([^\"\s]+\\)\\)?\\(?:\"\\|\\)" that is checking for the gemset name is not halting at the newline and is picking up the # from comment.

@senny
Owner

you're right ig rvm.el does not recognize the gemset it's probably the regexp, that does not match. I've added detected for the .rvmrc generated by rvm which is also multiline. I'll look into your specific issue.

@tmcgilchrist

Maybe changing it to something like "\\([^\"\s\n]+\\)?\\(?:\"\\|\\)" would be better. I wouldn't expect a valid gem set name can include a newline.

I've tried that combination in Emacs RE-Builder and it seems to match on both the rvm generated .rvmrc and my one above.

If you're happy with that I can create a pull request plus tests.

@senny
Owner

if you create a test the modified regexp passes all existing scenarios it's fine for me. Just create a pull request and I'll merge it back.

@senny
Owner

is this still an issue? Please report back if so I'll look into it.

@tmcgilchrist

Yes this is still an issue.

But unfortunately I haven't found the time to submit a fix plus test for it. Sorry.

@senny
Owner

@tmcgilchrist I'll look into it when I got a few minutes.

@senny senny closed this in 454be97
@senny
Owner

@tmcgilchrist I pushed a fix, can you update to the latest version and see if it works?

@tmcgilchrist

Looks good to me. Nice work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.