Class: Bearonrails::AppGenerator

Inherits:
Rails::Generators::AppGenerator
  • Object
show all
Defined in:
lib/bearonrails/generators/app_generator.rb

Instance Method Summary collapse

Instance Method Details

#add_common_rake_tasksObject



30
31
32
33
# File 'lib/bearonrails/generators/app_generator.rb', line 30

def add_common_rake_tasks
  say 'Add common rake tasks'
  build :add_common_rake_tasks
end

#add_new_relic_configObject



50
51
52
53
54
# File 'lib/bearonrails/generators/app_generator.rb', line 50

def add_new_relic_config
  say 'Add New Relic config'
  build :add_dot_env
  build :add_new_relic_config
end

#add_rubocop_configObject



45
46
47
48
# File 'lib/bearonrails/generators/app_generator.rb', line 45

def add_rubocop_config
  say 'Add rubocop config'
  build :add_rubocop_config
end

#bearonrails_customizationObject



13
14
15
16
17
18
19
20
21
22
# File 'lib/bearonrails/generators/app_generator.rb', line 13

def bearonrails_customization
  invoke :remove_files_we_dont_need
  invoke :add_common_rake_tasks
  invoke :customize_gemfile
  invoke :install_rspec
  invoke :add_rubocop_config
  invoke :add_new_relic_config
  invoke :remove_routes_comment_lines
  invoke :init_git
end

#customize_gemfileObject



35
36
37
38
39
40
41
42
43
# File 'lib/bearonrails/generators/app_generator.rb', line 35

def customize_gemfile
  build :add_custom_gems
  bundle_command 'install'

  # skip origin `bundle install` step
  new_options = options.dup
  options = new_options
  options.merge!(skip_bundle: true)
end

#finish_templateObject



8
9
10
11
# File 'lib/bearonrails/generators/app_generator.rb', line 8

def finish_template
  bearonrails_customization
  super
end

#init_gitObject



67
68
69
70
# File 'lib/bearonrails/generators/app_generator.rb', line 67

def init_git
  say 'Init git'
  build :init_git
end

#install_rspecObject



56
57
58
59
60
# File 'lib/bearonrails/generators/app_generator.rb', line 56

def install_rspec
  say 'Install rspec'
  build :install_rspec
  build :add_rspec_helper_addon
end

#remove_files_we_dont_needObject



24
25
26
27
28
# File 'lib/bearonrails/generators/app_generator.rb', line 24

def remove_files_we_dont_need
  say 'remove files we don\'t need'
  build :remove_public_index
  build :remove_rails_logo_image
end

#remove_routes_comment_linesObject



62
63
64
65
# File 'lib/bearonrails/generators/app_generator.rb', line 62

def remove_routes_comment_lines
  say 'Remove routes comment lines'
  build :remove_routes_comment_lines
end