Class: Cybele::AppGenerator

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ AppGenerator

Returns a new instance of AppGenerator.



76
77
78
79
80
81
82
83
# File 'lib/cybele/generators/app_generator.rb', line 76

def initialize(*args)
  super
  # Set options
  @options = options.dup

  dependency_control(@options) if @options[:skip_ask]
  ask_questions(@options) unless @options[:skip_ask]
end

Class Method Details



274
275
276
# File 'lib/cybele/generators/app_generator.rb', line 274

def self.banner
  "cybele #{arguments.map(&:usage).join(' ')} [options]"
end

Instance Method Details

#active_storageObject



197
198
199
200
# File 'lib/cybele/generators/app_generator.rb', line 197

def active_storage
  say 'Make active_storage amazon configuration', :green
  build :active_storage_setting
end

#configure_error_pagesObject



220
221
222
223
# File 'lib/cybele/generators/app_generator.rb', line 220

def configure_error_pages
  say 'Setup custom exception pages and 404 page', :green
  build :configure_error_pages
end

#configure_locale_languageObject



164
165
166
167
# File 'lib/cybele/generators/app_generator.rb', line 164

def configure_locale_language
  say 'Configure locale', :green
  build :configure_locale_language
end

#configure_mail_settingObject



209
210
211
212
213
# File 'lib/cybele/generators/app_generator.rb', line 209

def configure_mail_setting
  say 'Setup mail settings'
  build :configure_action_mailer
  build :configure_smtp
end

#configure_recipient_interceptorObject



149
150
151
152
# File 'lib/cybele/generators/app_generator.rb', line 149

def configure_recipient_interceptor
  say 'Setup mail settings with recipient_interceptor in staging', :green
  build :configure_recipient_interceptor
end

#customize_app_filesObject



235
236
237
238
239
240
# File 'lib/cybele/generators/app_generator.rb', line 235

def customize_app_files
  say 'Customize default files', :green
  build :customize_model_files
  build :customize_mailer_files
  build :customize_default_view_files
end

#customize_gemfileObject

:reek:TooManyStatements



86
87
88
89
90
91
92
93
94
95
# File 'lib/cybele/generators/app_generator.rb', line 86

def customize_gemfile
  say 'Customize gem file', :green
  build :add_gems
  bundle_command 'update thor'
  build :add_simple_form_gem unless @options[:skip_simple_form]
  build :add_show_for_gem unless @options[:skip_show_for]
  build :add_haml_gems unless @options[:skip_haml]
  build :add_required_view_gems unless @options[:skip_view_files]
  bundle_command 'install --binstubs=bin/stubs'
end

#customize_optional_view_filesObject

:reek:TooManyStatements



243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
# File 'lib/cybele/generators/app_generator.rb', line 243

def customize_optional_view_files
  return if @options[:skip_view_files]
  say 'Customize optional view files', :green
  build :customize_assets_files
  build :customize_vendor_files
  build :customize_helper_files
  build :customize_view_files_with_option
  build :generate_devise_views
  build :configure_routes
  build :customize_controller_files
  build :add_devise_protect_from_forgery
  build :add_devise_strong_parameter
  build :add_devise_authenticate_admin
  build :configure_basic_authentication
end

#docker_development_envObject



259
260
261
262
263
# File 'lib/cybele/generators/app_generator.rb', line 259

def docker_development_env
  return if @options[:skip_docker]
  say 'Setup docker development environment', :green
  build :setup_docker_development_env
end

#force_sslObject



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

def force_ssl
  say 'Add ssl control into staging.rb and production.rb', :green
  build :force_ssl_setting
end

#gitignore_files_and_foldersObject



215
216
217
218
# File 'lib/cybele/generators/app_generator.rb', line 215

def gitignore_files_and_folders
  build :setup_gitignore_files
  build :setup_gitignore_folders
end

#goodbyeObject



270
271
272
# File 'lib/cybele/generators/app_generator.rb', line 270

def goodbye
  say 'Congratulations! That\'s all...', :green
end

#remove_files_we_dont_needObject



107
108
109
110
# File 'lib/cybele/generators/app_generator.rb', line 107

def remove_files_we_dont_need
  say 'Remove files we don\'t need', :green
  build :remove_readme_rdoc
end

#setup_auditedObject



230
231
232
233
# File 'lib/cybele/generators/app_generator.rb', line 230

def setup_audited
  say 'Setup audited gem', :green
  build :configure_audited
end

#setup_bullet_configObject



187
188
189
190
# File 'lib/cybele/generators/app_generator.rb', line 187

def setup_bullet_config
  say 'Setup bullet config'
  build :configure_bullet
end

#setup_configObject



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

def setup_config
  say 'Generate config', :green
  build :generate_config
end

#setup_cybele_versionObject



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

def setup_cybele_version
  say 'Add .VERSION.txt file', :green
  build :add_cybele_version
end

#setup_databaseObject



122
123
124
125
126
127
128
129
130
131
# File 'lib/cybele/generators/app_generator.rb', line 122

def setup_database
  if @options[:database] == 'postgresql'
    say 'Set up postgresql template', :green
    build :use_postgres_config_template
  end

  return if @options[:skip_create_database]
  say 'Create database', :green
  build :create_database
end

#setup_deviseObject



202
203
204
205
206
207
# File 'lib/cybele/generators/app_generator.rb', line 202

def setup_devise
  say 'Generate devise'
  build :generate_devise_settings
  say 'Adding devise models'
  build :generate_devise_models
end

#setup_dotenvObject



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

def setup_dotenv
  say 'Generate .env.* files', :green
  build :configure_dotenv
end

#setup_editor_configObject



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

def setup_editor_config
  say 'Add .editor_config file', :green
  build :add_editor_config
end

#setup_git_and_git_flowObject



265
266
267
268
# File 'lib/cybele/generators/app_generator.rb', line 265

def setup_git_and_git_flow
  say 'Initialize git and git flow'
  build :git_and_git_flow_commands
end

#setup_guardObject



159
160
161
162
# File 'lib/cybele/generators/app_generator.rb', line 159

def setup_guard
  say 'Generate guard', :green
  build :generate_guard
end

#setup_hamlObject



181
182
183
184
185
# File 'lib/cybele/generators/app_generator.rb', line 181

def setup_haml
  return if @options[:skip_haml]
  say 'Setting up haml and generate haml-rails', :green
  build :configure_haml
end

#setup_pronto_configObject



225
226
227
228
# File 'lib/cybele/generators/app_generator.rb', line 225

def setup_pronto_config
  say 'Setup pronto config', :green
  build :configure_pronto
end

#setup_respondersObject



139
140
141
142
# File 'lib/cybele/generators/app_generator.rb', line 139

def setup_responders
  say 'Setting up responders', :green
  build :configure_responders
end

#setup_rollbarObject



154
155
156
157
# File 'lib/cybele/generators/app_generator.rb', line 154

def setup_rollbar
  say 'Generate rollbar', :green
  build :generate_rollbar
end

#setup_show_forObject



169
170
171
172
173
# File 'lib/cybele/generators/app_generator.rb', line 169

def setup_show_for
  return if @options[:skip_show_for]
  say 'Generate show_for', :green
  build :configure_show_for
end

#setup_sidekiqObject



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

def setup_sidekiq
  return if @options[:skip_sidekiq]
  say 'Setting up sidekiq', :green
  build :configure_sidekiq
end

#setup_simple_formObject



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

def setup_simple_form
  return if @options[:skip_simple_form]
  say 'Setting up simple_form', :green
  build :configure_simple_form
end

#setup_staging_environmentObject



144
145
146
147
# File 'lib/cybele/generators/app_generator.rb', line 144

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