Class: Gemsmith::Generators::Git
- Defined in:
- lib/gemsmith/generators/git.rb
Overview
Generates Git support.
Constant Summary
Constants inherited from Base
Instance Method Summary collapse
- #create_ignore_file ⇒ Object
-
#create_repository ⇒ Object
:reek:TooManyStatements.
- #run ⇒ Object
Methods inherited from Base
Constructor Details
This class inherits a constructor from Gemsmith::Generators::Base
Instance Method Details
#create_ignore_file ⇒ Object
7 8 9 |
# File 'lib/gemsmith/generators/git.rb', line 7 def create_ignore_file cli.template "%gem_name%/.gitignore.tt", configuration end |
#create_repository ⇒ Object
:reek:TooManyStatements
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/gemsmith/generators/git.rb', line 12 def create_repository subject = "Added Gemsmith files." body = "Built with #{Identity.version_label}." Dir.chdir(gem_root) do `git init` `git add .` `git commit --all --no-verify --message "#{subject}" --message "#{body}"` end end |
#run ⇒ Object
23 24 25 26 |
# File 'lib/gemsmith/generators/git.rb', line 23 def run create_ignore_file create_repository end |