Class: Hexx::RSpec::Install

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

Overview

The generator creates a Rakefile in a destination root

Class Method Summary collapse

Class Method Details

.create_rakefileObject



36
37
38
39
# File 'lib/hexx-rspec/install.rb', line 36

def create_rakefile
  return unless options[:rakefile]
  copy_file "Rakefile"
end

.create_rspecObject



42
43
44
# File 'lib/hexx-rspec/install.rb', line 42

def create_rspec
  copy_file "_rspec", ".rspec"
end

.create_simplecovObject



47
48
49
# File 'lib/hexx-rspec/install.rb', line 47

def create_simplecov
  copy_file "simplecov.yml", "config/metrics/simplecov.yml"
end

.create_spec_helperObject



52
53
54
# File 'lib/hexx-rspec/install.rb', line 52

def create_spec_helper
  template "spec_helper.erb", "spec/spec_helper.rb"
end

.source_rootObject



28
29
30
# File 'lib/hexx-rspec/install.rb', line 28

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

.startundefined

Populates files into current directory

Returns:

  • (undefined)


20
21
22
23
24
25
# File 'lib/hexx-rspec/install.rb', line 20

class_option(
  :rakefile,
  default: true,
  desc: "Create the Rakefile",
  type: :boolean
)