Class: Yupi::AppGenerator

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

Instance Method Summary collapse

Instance Method Details

#add_root_routeObject



185
186
187
# File 'lib/yupi/generators/app_generator.rb', line 185

def add_root_route
  build :add_root_route
end

#configure_appObject



113
114
115
116
117
118
119
120
121
122
123
124
125
126
# File 'lib/yupi/generators/app_generator.rb', line 113

def configure_app
  say 'Configuring app'
  build :setup_figaro
  build :configure_action_mailer
  build :configure_active_job
  build :configure_time_formats
  build :configure_rack_timeout
  build :configure_simple_form
  build :disable_xml_params
  build :fix_i18n_deprecation_warning
  build :setup_default_rake_task
  build :configure_puma
  build :setup_foreman
end

#configure_mail_interceptorObject



134
135
136
137
# File 'lib/yupi/generators/app_generator.rb', line 134

def configure_mail_interceptor
  say 'Configure mail interceptor'
  build :configure_mail_interceptor
end

#copy_miscellaneous_filesObject



171
172
173
174
# File 'lib/yupi/generators/app_generator.rb', line 171

def copy_miscellaneous_files
  say 'Copying miscellaneous support files'
  build :copy_miscellaneous_files
end

#create_heroku_appsObject



147
148
149
150
151
152
153
154
155
156
# File 'lib/yupi/generators/app_generator.rb', line 147

def create_heroku_apps
  if options[:heroku]
    say "Creating Heroku apps"
    build :create_heroku_apps, options[:heroku_flags]
    build :set_heroku_serve_static_files
    build :set_heroku_remotes
    build :set_heroku_rails_secrets
    build :provide_deploy_script
  end
end

#create_yupi_viewsObject



106
107
108
109
110
111
# File 'lib/yupi/generators/app_generator.rb', line 106

def create_yupi_views
  say 'Creating yupi views'
  build :create_partials
  build :create_application_layout
  build :create_home_page
end

#customize_error_pagesObject



176
177
178
179
# File 'lib/yupi/generators/app_generator.rb', line 176

def customize_error_pages
  say 'Customizing the 500/404/422 pages'
  build :customize_error_pages
end

#customize_gemfileObject



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

def customize_gemfile
  build :replace_gemfile
  build :set_ruby_to_version_being_used

  bundle_command 'install'
end

#finish_templateObject



21
22
23
24
25
# File 'lib/yupi/generators/app_generator.rb', line 21

def finish_template
  invoke :yupi_customization
  super
  invoke :run_bin_setup
end

#init_gitObject



167
168
169
# File 'lib/yupi/generators/app_generator.rb', line 167

def init_git
  build :init_git
end

#outroObject



193
194
195
# File 'lib/yupi/generators/app_generator.rb', line 193

def outro
  say 'Congratulations! Now start creating a great app.'
end

#remove_routes_comment_linesObject



181
182
183
# File 'lib/yupi/generators/app_generator.rb', line 181

def remove_routes_comment_lines
  build :remove_routes_comment_lines
end

#run_bin_setupObject



189
190
191
# File 'lib/yupi/generators/app_generator.rb', line 189

def run_bin_setup
  build :run_bin_setup
end

#setup_assetsObject



128
129
130
131
132
# File 'lib/yupi/generators/app_generator.rb', line 128

def setup_assets
  say 'Set up assets'
  build :setup_stylesheets
  build :setup_javascripts
end

#setup_bundler_auditObject



162
163
164
165
# File 'lib/yupi/generators/app_generator.rb', line 162

def setup_bundler_audit
  say "Setting up bundler-audit"
  build :setup_bundler_audit
end

#setup_databaseObject



54
55
56
57
58
59
60
61
62
# File 'lib/yupi/generators/app_generator.rb', line 54

def setup_database
  say 'Setting up database'

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

  build :create_database
end

#setup_development_environmentObject



64
65
66
67
68
69
70
71
72
73
# File 'lib/yupi/generators/app_generator.rb', line 64

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

#setup_gitObject



139
140
141
142
143
144
145
# File 'lib/yupi/generators/app_generator.rb', line 139

def setup_git
  if !options[:skip_git]
    say 'Initializing git'
    invoke :setup_gitignore
    invoke :init_git
  end
end

#setup_gitignoreObject



158
159
160
# File 'lib/yupi/generators/app_generator.rb', line 158

def setup_gitignore
  build :gitignore_files
end

#setup_production_environmentObject



88
89
90
91
92
93
94
# File 'lib/yupi/generators/app_generator.rb', line 88

def setup_production_environment
  say 'Setting up the production environment'
  build :configure_newrelic
  build :configure_smtp
  build :enable_rack_deflater
  build :setup_asset_host
end

#setup_secret_tokenObject



101
102
103
104
# File 'lib/yupi/generators/app_generator.rb', line 101

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

#setup_staging_environmentObject



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

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

#setup_test_environmentObject



75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/yupi/generators/app_generator.rb', line 75

def setup_test_environment
  say 'Setting up the test environment'
  build :set_up_factory_girl_for_rspec
  build :generate_rspec
  build :configure_rspec
  build :configure_background_jobs_for_rspec
  build :enable_database_cleaner
  build :configure_spec_support_features
  build :configure_i18n_for_test_environment
  build :configure_i18n_tasks
  build :configure_action_mailer_in_specs
end

#yupi_customizationObject



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

def yupi_customization
  invoke :customize_gemfile
  invoke :setup_secret_token
  invoke :create_yupi_views
  invoke :configure_app
  invoke :setup_development_environment
  invoke :setup_test_environment
  invoke :setup_production_environment
  invoke :setup_assets
  invoke :configure_mail_interceptor
  invoke :copy_miscellaneous_files
  invoke :customize_error_pages
  invoke :remove_routes_comment_lines
  invoke :add_root_route
  invoke :setup_git
  invoke :setup_database
  invoke :setup_bundler_audit
  invoke :outro
end