ruby-ore / ore

Mine beautiful RubyGems from Ore
MIT License
241 stars 29 forks source link

Added --gitignore option to CLI #28

Closed MafcoCinco closed 11 years ago

MafcoCinco commented 11 years ago

Description

Added CLI option to specify parameters to the gitignore gem. If this option is specified and the gitignore gem is installed, ore will invoke gitignore with specified options to update the .gitignore file. The update happens as an append so previously ignored files and directories will not be overwritten.

If the option is specified and the gitignore gem is not installed, ore will display a red message informing the user and indicating how to get the gitignore gem.

Usage Examples

If you are developing a Ruby app/gem on OS X using Emacs, you might specify something like this:

$ mine my_gem --gitignore Ruby OSX Emacs

The .gitignore file will contain the results from gitignore's templates for Ruby, OS X and Emacs.

If gitignore is not installed, the user will see the following output

    create  lib/my_awesome_gem.rb
       run  git init from "."
       run  git add . from "."
       run  git commit -m "Initial commit." from "."
'gitignore' not installed.  'gem install gitignore' to use --gitignore option

Questions

Provided this is something that you would be interested in adding to ore, there is one open question I had. Given that Ruby will always be the language if the user is using ore, should gitignore automatically be invoked with the Ruby option, even when --gitignore is not specified? This seems to make sense in a narrow context but at the same time, I was worried it would be a much bigger change overall and perhaps a bit over reaching or confusing. For example, what happens if gitignore is not installed? Should there be a message indicating how to install even though the user did not specify any option related to gitignore? Could cause some confusion.

Also, I'm not sure if this requires a bump of the version number and, if so, if it should be the build or the minor version number that is bumped.

postmodern commented 11 years ago

I took a look at gitignore and it seems better suited for generating your global ~/.gitignore file. Ore already defines ignore patterns in each of it's templates.

These patterns are then added to the resulting .gitignore or .hgignore files.

I'm afraid I'll have to pass on this feature. :/

MafcoCinco commented 11 years ago

No worries. That makes sense. Thanks for checking it out.

On Monday, October 8, 2012, Postmodern wrote:

I took a look at gitignore https://github.com/github/gitignore and it seems better suited for generating your global ~/.gitignore file. Ore already defines ignore patterns in each of it's templates.

  • bundlerhttps://github.com/ruby-ore/ore/blob/master/data/ore/templates/bundler/template.yml#L1-3
  • rdochttps://github.com/ruby-ore/ore/blob/master/data/ore/templates/rdoc/template.yml#L4-5
  • yardhttps://github.com/ruby-ore/ore/blob/master/data/ore/templates/yard/template.yml#L4-5

These patterns are then added to the resulting .gitignorehttps://github.com/ruby-ore/ore/blob/master/data/ore/templates/git/.gitignore.erbor .hgignorehttps://github.com/ruby-ore/ore/blob/master/data/ore/templates/hg/.hgignore.erbfiles.

I'm afraid I'll have to pass on this feature. :/

— Reply to this email directly or view it on GitHubhttps://github.com/ruby-ore/ore/pull/28#issuecomment-9244485.