Class: Cybele::AppGenerator
- Inherits:
-
Rails::Generators::AppGenerator
- Object
- Rails::Generators::AppGenerator
- Cybele::AppGenerator
- Defined in:
- lib/cybele/generators/app_generator.rb
Class Method Summary collapse
Instance Method Summary collapse
- #active_storage ⇒ Object
- #configure_error_pages ⇒ Object
- #configure_locale_language ⇒ Object
- #configure_mail_setting ⇒ Object
- #configure_recipient_interceptor ⇒ Object
- #customize_app_files ⇒ Object
-
#customize_gemfile ⇒ Object
:reek:TooManyStatements.
-
#customize_optional_view_files ⇒ Object
:reek:TooManyStatements.
- #docker_development_env ⇒ Object
- #force_ssl ⇒ Object
- #gitignore_files_and_folders ⇒ Object
- #goodbye ⇒ Object
-
#initialize(*args) ⇒ AppGenerator
constructor
A new instance of AppGenerator.
- #remove_files_we_dont_need ⇒ Object
- #setup_audited ⇒ Object
- #setup_bullet_config ⇒ Object
- #setup_config ⇒ Object
- #setup_cybele_version ⇒ Object
- #setup_database ⇒ Object
- #setup_devise ⇒ Object
- #setup_dotenv ⇒ Object
- #setup_editor_config ⇒ Object
- #setup_environment_generator ⇒ Object
- #setup_git_and_git_flow ⇒ Object
- #setup_haml ⇒ Object
- #setup_pronto ⇒ Object
- #setup_pronto_config ⇒ Object
- #setup_responders ⇒ Object
- #setup_rollbar ⇒ Object
- #setup_show_for ⇒ Object
- #setup_sidekiq ⇒ Object
- #setup_simple_form ⇒ Object
- #setup_staging_environment ⇒ Object
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 = .dup dependency_control(@options) if @options[:skip_ask] ask_questions(@options) unless @options[:skip_ask] end |
Class Method Details
.banner ⇒ Object
278 279 280 |
# File 'lib/cybele/generators/app_generator.rb', line 278 def self. "cybele #{arguments.map(&:usage).join(' ')} [options]" end |
Instance Method Details
#active_storage ⇒ Object
191 192 193 194 |
# File 'lib/cybele/generators/app_generator.rb', line 191 def active_storage say 'Make active_storage amazon configuration', :green build :active_storage_setting end |
#configure_error_pages ⇒ Object
214 215 216 217 |
# File 'lib/cybele/generators/app_generator.rb', line 214 def configure_error_pages say 'Setup custom exception pages and 404 page', :green build :configure_error_pages end |
#configure_locale_language ⇒ Object
158 159 160 161 |
# File 'lib/cybele/generators/app_generator.rb', line 158 def configure_locale_language say 'Configure locale', :green build :configure_locale_language end |
#configure_mail_setting ⇒ Object
203 204 205 206 207 |
# File 'lib/cybele/generators/app_generator.rb', line 203 def configure_mail_setting say 'Setup mail settings' build :configure_action_mailer build :configure_smtp end |
#configure_recipient_interceptor ⇒ Object
148 149 150 151 |
# File 'lib/cybele/generators/app_generator.rb', line 148 def configure_recipient_interceptor say 'Setup mail settings with recipient_interceptor in staging', :green build :configure_recipient_interceptor end |
#customize_app_files ⇒ Object
229 230 231 232 233 234 |
# File 'lib/cybele/generators/app_generator.rb', line 229 def customize_app_files say 'Customize default files', :green build :customize_model_files build :customize_mailer_files build :customize_default_view_files end |
#customize_gemfile ⇒ Object
:reek:TooManyStatements
86 87 88 89 90 91 92 93 94 |
# File 'lib/cybele/generators/app_generator.rb', line 86 def customize_gemfile say 'Customize gem file', :green build :add_gems 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_files ⇒ Object
:reek:TooManyStatements
237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 |
# File 'lib/cybele/generators/app_generator.rb', line 237 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_env ⇒ Object
253 254 255 256 257 |
# File 'lib/cybele/generators/app_generator.rb', line 253 def docker_development_env return if @options[:skip_docker] say 'Setup docker development environment', :green build :setup_docker_development_env end |
#force_ssl ⇒ Object
186 187 188 189 |
# File 'lib/cybele/generators/app_generator.rb', line 186 def force_ssl say 'Add ssl control into staging.rb and production.rb', :green build :force_ssl_setting end |
#gitignore_files_and_folders ⇒ Object
209 210 211 212 |
# File 'lib/cybele/generators/app_generator.rb', line 209 def gitignore_files_and_folders build :setup_gitignore_files build :setup_gitignore_folders end |
#goodbye ⇒ Object
274 275 276 |
# File 'lib/cybele/generators/app_generator.rb', line 274 def goodbye say 'Congratulations! That\'s all...', :green end |
#remove_files_we_dont_need ⇒ Object
106 107 108 109 |
# File 'lib/cybele/generators/app_generator.rb', line 106 def remove_files_we_dont_need say 'Remove files we don\'t need', :green build :remove_readme_rdoc end |
#setup_audited ⇒ Object
224 225 226 227 |
# File 'lib/cybele/generators/app_generator.rb', line 224 def setup_audited say 'Setup audited gem', :green build :configure_audited end |
#setup_bullet_config ⇒ Object
181 182 183 184 |
# File 'lib/cybele/generators/app_generator.rb', line 181 def setup_bullet_config say 'Setup bullet config' build :configure_bullet end |
#setup_config ⇒ Object
111 112 113 114 |
# File 'lib/cybele/generators/app_generator.rb', line 111 def setup_config say 'Generate config', :green build :generate_config end |
#setup_cybele_version ⇒ Object
101 102 103 104 |
# File 'lib/cybele/generators/app_generator.rb', line 101 def setup_cybele_version say 'Add .VERSION.txt file', :green build :add_cybele_version end |
#setup_database ⇒ Object
121 122 123 124 125 126 127 128 129 130 |
# File 'lib/cybele/generators/app_generator.rb', line 121 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_devise ⇒ Object
196 197 198 199 200 201 |
# File 'lib/cybele/generators/app_generator.rb', line 196 def setup_devise say 'Generate devise' build :generate_devise_settings say 'Adding devise models' build :generate_devise_models end |
#setup_dotenv ⇒ Object
116 117 118 119 |
# File 'lib/cybele/generators/app_generator.rb', line 116 def setup_dotenv say 'Generate .env.* files', :green build :configure_dotenv end |
#setup_editor_config ⇒ Object
96 97 98 99 |
# File 'lib/cybele/generators/app_generator.rb', line 96 def setup_editor_config say 'Add .editor_config file', :green build :add_editor_config end |
#setup_environment_generator ⇒ Object
264 265 266 267 |
# File 'lib/cybele/generators/app_generator.rb', line 264 def setup_environment_generator say 'Environment generator setup', :green build :add_environment_to_lib end |
#setup_git_and_git_flow ⇒ Object
269 270 271 272 |
# File 'lib/cybele/generators/app_generator.rb', line 269 def setup_git_and_git_flow say 'Initialize git and git flow' build :git_and_git_flow_commands end |
#setup_haml ⇒ Object
175 176 177 178 179 |
# File 'lib/cybele/generators/app_generator.rb', line 175 def setup_haml return if @options[:skip_haml] say 'Setting up haml and generate haml-rails', :green build :configure_haml end |
#setup_pronto ⇒ Object
259 260 261 262 |
# File 'lib/cybele/generators/app_generator.rb', line 259 def setup_pronto say 'Pronto is setup', :green build :add_pronto_to_gemfile end |
#setup_pronto_config ⇒ Object
219 220 221 222 |
# File 'lib/cybele/generators/app_generator.rb', line 219 def setup_pronto_config say 'Setup pronto config', :green build :configure_pronto end |
#setup_responders ⇒ Object
138 139 140 141 |
# File 'lib/cybele/generators/app_generator.rb', line 138 def setup_responders say 'Setting up responders', :green build :configure_responders end |
#setup_rollbar ⇒ Object
153 154 155 156 |
# File 'lib/cybele/generators/app_generator.rb', line 153 def say 'Generate rollbar', :green build :generate_rollbar end |
#setup_show_for ⇒ Object
163 164 165 166 167 |
# File 'lib/cybele/generators/app_generator.rb', line 163 def setup_show_for return if @options[:skip_show_for] say 'Generate show_for', :green build :configure_show_for end |
#setup_sidekiq ⇒ Object
132 133 134 135 136 |
# File 'lib/cybele/generators/app_generator.rb', line 132 def setup_sidekiq return if @options[:skip_sidekiq] say 'Setting up sidekiq', :green build :configure_sidekiq end |
#setup_simple_form ⇒ Object
169 170 171 172 173 |
# File 'lib/cybele/generators/app_generator.rb', line 169 def setup_simple_form return if @options[:skip_simple_form] say 'Setting up simple_form', :green build :configure_simple_form end |
#setup_staging_environment ⇒ Object
143 144 145 146 |
# File 'lib/cybele/generators/app_generator.rb', line 143 def setup_staging_environment say 'Setting up the staging environment', :green build :setup_staging_environment end |