Added --editor option to open generated gemspec in editor #2224

Merged
merged 1 commit into from Jan 12, 2013

3 participants

@ndbroadbent

Adds an --editor option for the bundle gem command, to open the generated gemspec in the user's editor. Comes with CHANGELOG entry and test.

Similar to rails/rails#8553

@rohit

I personally don't like this and think it would not be used much. But if this is desirable by the maintainers maybe a better option name like --editspec? I don't think --editor is descriptive enough.

Oh btw not to nag but your other PR needs some work: #2143 😁

@rohit

@indirect Are you keen on merging this PR? :)

@indirect
Bundler member

I think it makes sense as an option named --edit. I'm not totally sure how bundle gem foo --edit is more convenient than bundle gem foo↩f⇥↩, though. What's the argument in favor?

@ndbroadbent

I've updated the PR with --edit instead of --editor. What do you mean by bundle gem foo↩f⇥↩? It looks like your suggestion cds into the gem directory, but my PR opens the generated gemspec in your text editor so you can edit authors, homepage, summary, description, etc.

@indirect
Bundler member

Hmm, maybe the special characters aren't visible. I just mean that it's around the same number of typed characters to tab-complete the name of the gemspec and open it than it is to add --edit to the end, so why is an edit option better? :)

@ndbroadbent

Ah, I see. Well, I guess the -e shortcut is a bit shorter. The other solution is just to add this to my .bashrc:

bgem() { bundle gem "$1"; sublime-text-2 "$1/$1.gemspec"; }

So yeah, not the most critical feature, but thought other people might find the editor option useful :)

@indirect
Bundler member

Yeah, -e seems nice. I buy it. Thanks for the patch!

@indirect indirect merged commit 7cdf823 into bundler:master Jan 12, 2013
@ndbroadbent

Awesome, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment