Class: Hexx::Suit::Install
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- Hexx::Suit::Install
- Includes:
- Thor::Actions
- Defined in:
- lib/hexx/suit/install.rb
Overview
The generator creates a Rakefile in a destination root
Class Method Summary collapse
- .create_gemfile ⇒ Object
- .create_guardfile ⇒ Object
- .create_metrics ⇒ Object
- .create_metrics_loader ⇒ Object
- .create_rakefile ⇒ Object
- .create_rubocop_loader ⇒ Object
- .create_yardopts ⇒ Object
- .install_rspec ⇒ Object
- .source_root ⇒ Object
-
.start(args) ⇒ undefined
Populates the necessary files into current directory.
- .update_spec_helper ⇒ Object
Class Method Details
.create_gemfile ⇒ Object
70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/hexx/suit/install.rb', line 70 def create_gemfile copy_file "Gemfile", skip: true append_to_file( "Gemfile", %( |group :metrics do | gem "hexx-suit", "~> #{version}" if RUBY_ENGINE == "ruby" |end |).gsub(/ *\|/, ""), skip: true ) end |
.create_guardfile ⇒ Object
45 46 47 |
# File 'lib/hexx/suit/install.rb', line 45 def create_guardfile template "Guardfile.erb", "Guardfile" end |
.create_metrics ⇒ Object
55 56 57 |
# File 'lib/hexx/suit/install.rb', line 55 def create_metrics directory "metrics", "config/metrics" end |
.create_metrics_loader ⇒ Object
60 61 62 |
# File 'lib/hexx/suit/install.rb', line 60 def create_metrics_loader copy_file "_metrics", ".metrics" end |
.create_rakefile ⇒ Object
40 41 42 |
# File 'lib/hexx/suit/install.rb', line 40 def create_rakefile template "Rakefile.erb", "Rakefile" end |
.create_rubocop_loader ⇒ Object
65 66 67 |
# File 'lib/hexx/suit/install.rb', line 65 def create_rubocop_loader copy_file "_rubocop.yml", ".rubocop.yml" end |
.create_yardopts ⇒ Object
50 51 52 |
# File 'lib/hexx/suit/install.rb', line 50 def create_yardopts template "_yardopts.erb", ".yardopts" end |
.install_rspec ⇒ Object
30 31 32 |
# File 'lib/hexx/suit/install.rb', line 30 def install_rspec Hexx::RSpec::Install.start %w(--no-rakefile) end |
.source_root ⇒ Object
22 23 24 |
# File 'lib/hexx/suit/install.rb', line 22 def self.source_root @source_root ||= File. "../install", __FILE__ end |
.start(args) ⇒ undefined
Populates the necessary files into current directory
|
|
# File 'lib/hexx/suit/install.rb', line 11
|
.update_spec_helper ⇒ Object
35 36 37 |
# File 'lib/hexx/suit/install.rb', line 35 def update_spec_helper template "spec/spec_helper.erb", "spec/spec_helper.rb", force: true end |