Class: Hexx::Suit::Install

Inherits:
Thor::Group
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/hexx/suit/install.rb

Overview

The generator creates a Rakefile in a destination root

Class Method Summary collapse

Class Method Details

.create_gemfileObject



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_guardfileObject



45
46
47
# File 'lib/hexx/suit/install.rb', line 45

def create_guardfile
  template "Guardfile.erb", "Guardfile"
end

.create_metricsObject



55
56
57
# File 'lib/hexx/suit/install.rb', line 55

def create_metrics
  directory "metrics", "config/metrics"
end

.create_metrics_loaderObject



60
61
62
# File 'lib/hexx/suit/install.rb', line 60

def create_metrics_loader
  copy_file "_metrics", ".metrics"
end

.create_rakefileObject



40
41
42
# File 'lib/hexx/suit/install.rb', line 40

def create_rakefile
  template "Rakefile.erb", "Rakefile"
end

.create_rubocop_loaderObject



65
66
67
# File 'lib/hexx/suit/install.rb', line 65

def create_rubocop_loader
  copy_file "_rubocop.yml", ".rubocop.yml"
end

.create_yardoptsObject



50
51
52
# File 'lib/hexx/suit/install.rb', line 50

def create_yardopts
  template "_yardopts.erb", ".yardopts"
end

.install_rspecObject



30
31
32
# File 'lib/hexx/suit/install.rb', line 30

def install_rspec
  Hexx::RSpec::Install.start %w(--no-rakefile)
end

.source_rootObject



22
23
24
# File 'lib/hexx/suit/install.rb', line 22

def self.source_root
  @source_root ||= File.expand_path "../install", __FILE__
end

.start(args) ⇒ undefined

Populates the necessary files into current directory

Parameters:

  • args (Array<String>)

    An array of arguments from CLI (ARGV etc.)

Returns:

  • (undefined)


# File 'lib/hexx/suit/install.rb', line 11


.update_spec_helperObject



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