Suggesting typos in 'bundle open foo' #2050

Merged
merged 0 commits into from Aug 20, 2012

Projects

None yet

3 participants

@jdelStrother

This is more like an RFC than a genuine pull request, but anyway:

I use 'bundle open' a ridiculous number of times each day, but can never remember whether it's thinking_sphinx or thinking-sphinx, delayed-job or delayed_job, and so on.

This commit crowbars some Levenshtein loving into cli.rb

$ bundle open thinking_sphinx
Could not find gem 'thinking_sphinx' in the current bundle.
Did you mean thinking-sphinx?
$ bundle open rke
Could not find gem 'rke' in the current bundle.
Did you mean one of rake, hike or ffi?
$ bundle open awss3  
Could not find gem 'awss3' in the current bundle.
Did you mean aws-s3?

But it does feel kinda messy and inconsistent - it doesn't work with "bundle update foo", for example, mostly because it doesn't fit so easily into the top-level CLI#update and it seems wrong to start putting stuff like this deeper into the library.

Any thoughts? Would you like to see something like this in Bundler, or is it better off waiting for the fabled plugin architecture?

@travisbot

This pull request passes (merged 3d744bea into 3a1121a).

@indirect
Member
indirect commented Aug 9, 2012

This seems useful. Abstracting it so we could use it on bundle update foo would also fix the currently open bug where bundle update foo doesn't recognize non-existent gems. :)

On Aug 9, 2012, at 1:49 AM, Jonathan del Strother wrote:

This is more like an RFC than a genuine pull request, but anyway:

I use 'bundle open' a ridiculous number of times each day, but can never remember whether it's thinking_sphinx or thinking-sphinx, delayed-job or delayed_job, and so on.

This commit crowbars some Levenshtein loving into cli.rb

$ bundle open thinking_sphinx
Could not find gem 'thinking_sphinx' in the current bundle.
Did you mean thinking-sphinx?
$ bundle open rke
Could not find gem 'rke' in the current bundle.
Did you mean one of rake, hike or ffi?
$ bundle open awss3
Could not find gem 'awss3' in the current bundle.
Did you mean aws-s3?
But it does feel kinda messy and inconsistent - it doesn't work with "bundle update foo", for example, mostly because it doesn't fit so easily into the top-level CLI#update and it seems wrong to start putting stuff like this deeper into the library.

Any thoughts? Would you like to see something like this in Bundler, or is it better off waiting for the fabled plugin architecture?

You can merge this Pull Request by running:

git pull https://github.com/jdelStrother/bundler master
Or view, comment on, or merge it at:

#2050

Commit Summary

Suggest typos in 'bundle open foo', based on Levenshtein distances
File Changes

M lib/bundler/cli.rb (47)
Patch Links

https://github.com/carlhuda/bundler/pull/2050.patch
https://github.com/carlhuda/bundler/pull/2050.diff

Reply to this email directly or view it on GitHub.

@travisbot

This pull request fails (merged 0b47ff87 into 3a1121a).

@travisbot

This pull request fails (merged 0eb1f83 into 3a1121a).

@jdelStrother

I'm not quite sure what that failing test (http://travis-ci.org/#!/carlhuda/bundler/jobs/2081118/L455) is checking - is it important that 'bundle update foo' should both update 'foo', and install missing gems (rack) ?

@indirect
Member

Yes, that's pretty important -- bundle update foo needs to result in a successful resolve of the Gemfile. If it doesn't, your Bundle could end up in an un-runnable state, which would be pretty sucky.

On Aug 10, 2012, at 8:22 AM, Jonathan del Strother wrote:

I'm not quite sure what that failing test (http://travis-ci.org/#!/carlhuda/bundler/jobs/2081118/L455) is checking - is it important that 'bundle update foo' should both update 'foo', and install missing gems (rack) ?


Reply to this email directly or view it on GitHub.

@jdelStrother

Hm. Here's a second take on it : #2060

@jdelStrother jdelStrother merged commit 4d163e8 into bundler:master Aug 20, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment