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_tasks ⇒ Object



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_pry_config ⇒ Object



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

def add_pry_config
  say 'Add pry config'
  build :add_pryrc
  build :add_pry_config
end

#add_rubocop_config ⇒ Object



40
41
42
43
# File 'lib/bearonrails/generators/app_generator.rb', line 40

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

#bearonrails_customization ⇒ Object



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_pry_config
  invoke :remove_routes_comment_lines
  invoke :init_git
end

#customize_gemfile ⇒ Object



35
36
37
38
# File 'lib/bearonrails/generators/app_generator.rb', line 35

def customize_gemfile
  build :add_custom_gems
  bundle_command 'install'
end

#finish_template ⇒ Object



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

def finish_template
  bearonrails_customization
  super
end

#init_git ⇒ Object



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

def init_git
  say 'Init git'
  build :init_git
end

#install_rspec ⇒ Object



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

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

#remove_files_we_dont_need ⇒ Object



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_lines ⇒ Object



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

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