Class: Commitment::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/commitment/generators/install_generator.rb

Instance Method Summary collapse

Instance Method Details

#build_default_rake_taskObject



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/commitment/generators/install_generator.rb', line 26

def build_default_rake_task
  append_file('Rakefile') do %(
# BEGIN `commitment:install` generator
# This was added via commitment:install generator. You are free to change this.
Rake::Task["default"].clear
task(
  default: [
'commitment:rubocop',
'commitment:jshint',
'commitment:fasterer',
'commitment:scss_lint',
'commitment:configure_test_for_code_coverage',
'#{test_framework}',
'commitment:code_coverage',
'commitment:brakeman'
  ]
)
# END `commitment:install` generator
)
  end
end

#create_coverage_helperObject



21
22
23
24
# File 'lib/commitment/generators/install_generator.rb', line 21

def create_coverage_helper
  # Putting this file in the root directory of the project
  template('coverage_helper.rb', "#{test_framework}/coverage_helper.rb")
end

#create_fastererObject



17
18
19
# File 'lib/commitment/generators/install_generator.rb', line 17

def create_fasterer
  template('.fasterer.yml', '.fasterer.yml')
end

#create_hound_optionsObject



9
10
11
# File 'lib/commitment/generators/install_generator.rb', line 9

def create_hound_options
  template('.hound.yml', '.hound.yml')
end

#create_jshint_optionsObject



5
6
7
# File 'lib/commitment/generators/install_generator.rb', line 5

def create_jshint_options
  template('.jshintrc', '.jshintrc')
end

#create_scss_lintObject



13
14
15
# File 'lib/commitment/generators/install_generator.rb', line 13

def create_scss_lint
  template('.scss_lint.yml', '.scss_lint.yml')
end

#inject_spec_helperObject



48
49
50
# File 'lib/commitment/generators/install_generator.rb', line 48

def inject_spec_helper
  prepend_file("#{test_framework}/#{test_framework}_helper.rb", "require 'coverage_helper'\n")
end