Class: Startblock::AppGenerator

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

Instance Method Summary collapse

Instance Method Details

#configure_appObject



76
77
78
79
80
# File 'lib/startblock/generators/app_generator.rb', line 76

def configure_app
  say 'Configuring app'
  build :configure_action_mailer
  build :setup_foreman
end

#create_startblock_viewsObject



68
69
70
71
72
73
74
# File 'lib/startblock/generators/app_generator.rb', line 68

def create_startblock_views
  say 'Creating Startblock views'
  build :create_partials_directory
  build :create_shared_flashes
  build :create_shared_javascripts
  build :create_application_layout
end

#customize_gemfileObject



38
39
40
41
42
43
# File 'lib/startblock/generators/app_generator.rb', line 38

def customize_gemfile
  build :replace_gemfile
  build :set_ruby_to_version_being_used

  bundle_command 'install'
end

#finish_templateObject



15
16
17
18
# File 'lib/startblock/generators/app_generator.rb', line 15

def finish_template
  invoke :startblock_customization
  super
end

#outroObject



122
123
124
# File 'lib/startblock/generators/app_generator.rb', line 122

def outro
  say 'Congratulations! You just entered our startblock.'
end

#remove_routes_comment_linesObject



92
93
94
# File 'lib/startblock/generators/app_generator.rb', line 92

def remove_routes_comment_lines
  build :remove_routes_comment_lines
end

#run_bundleObject



126
127
128
# File 'lib/startblock/generators/app_generator.rb', line 126

def run_bundle
  # Let's not: We'll bundle manually at the right spot
end

#setup_databaseObject



102
103
104
105
106
107
108
109
110
# File 'lib/startblock/generators/app_generator.rb', line 102

def setup_database
  say 'Setting up database'

  if 'postgresql' == options[:database]
    build :use_postgres_config_template
  end

  build :create_database
end

#setup_development_environmentObject



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

def setup_development_environment
  say 'Setting up the development environment'
  build :raise_on_delivery_errors
  build :raise_on_unpermitted_parameters
  build :provide_setup_script
  build :configure_i18n_for_missing_translations
end

#setup_gitObject



96
97
98
99
100
# File 'lib/startblock/generators/app_generator.rb', line 96

def setup_git
  say 'Initializing git'
  build :gitignore_files
  build :init_git
end

#setup_javascriptsObject



87
88
89
90
# File 'lib/startblock/generators/app_generator.rb', line 87

def setup_javascripts
  say "Set up javascripts"
  build :setup_javascripts
end

#setup_mixpanelObject



112
113
114
115
# File 'lib/startblock/generators/app_generator.rb', line 112

def setup_mixpanel
  say 'Setting up Mixpanel'
  build :setup_mixpanel
end

#setup_rubocopObject



117
118
119
120
# File 'lib/startblock/generators/app_generator.rb', line 117

def setup_rubocop
  say "Setting up Rubocop"
  build :setup_rubocop
end

#setup_secret_tokenObject



63
64
65
66
# File 'lib/startblock/generators/app_generator.rb', line 63

def setup_secret_token
  say 'Moving secret token out of version control'
  build :setup_secret_token
end

#setup_staging_environmentObject



58
59
60
61
# File 'lib/startblock/generators/app_generator.rb', line 58

def setup_staging_environment
  say 'Setting up the staging environment'
  build :setup_staging_environment
end

#setup_stylesheetsObject



82
83
84
85
# File 'lib/startblock/generators/app_generator.rb', line 82

def setup_stylesheets
  say 'Set up stylesheets'
  build :setup_stylesheets
end

#setup_testing_environmentObject



53
54
55
56
# File 'lib/startblock/generators/app_generator.rb', line 53

def setup_testing_environment
  say "Setting up the testing environment"
  build :configuring_test_helper
end

#startblock_customizationObject



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/startblock/generators/app_generator.rb', line 20

def startblock_customization
  invoke :customize_gemfile
  invoke :setup_development_environment
  invoke :setup_testing_environment
  invoke :setup_staging_environment
  invoke :setup_secret_token
  invoke :create_startblock_views
  invoke :configure_app
  invoke :setup_stylesheets
  invoke :setup_javascripts
  invoke :remove_routes_comment_lines
  invoke :setup_git
  invoke :setup_database
  invoke :setup_mixpanel
  invoke :setup_rubocop
  invoke :outro
end