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



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

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

#create_startblock_viewsObject



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

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



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

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



128
129
130
# File 'lib/startblock/generators/app_generator.rb', line 128

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

#remove_routes_comment_linesObject



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

def remove_routes_comment_lines
  build :remove_routes_comment_lines
end

#run_bundleObject



132
133
134
# File 'lib/startblock/generators/app_generator.rb', line 132

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

#setup_databaseObject



108
109
110
111
112
113
114
115
116
# File 'lib/startblock/generators/app_generator.rb', line 108

def setup_database
  say 'Setting up database'

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

  build :create_database
end

#setup_development_environmentObject



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

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



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

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

#setup_javascriptsObject



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

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

#setup_mixpanelObject



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

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

#setup_pumaObject



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

def setup_puma
  say 'Setting up puma'
  build :copy_puma_config
end

#setup_rubocopObject



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

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

#setup_secret_tokenObject



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

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

#setup_staging_environmentObject



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

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

#setup_stylesheetsObject



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

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

#setup_testing_environmentObject



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

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
37
# 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_puma
  invoke :setup_git
  invoke :setup_database
  invoke :setup_mixpanel
  invoke :setup_rubocop
  invoke :outro
end