Class: Kratos::AppGenerator

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

Instance Method Summary collapse

Instance Method Details

#configure_appObject



107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# File 'lib/kratos/generators/app_generator.rb', line 107

def configure_app
  say 'Configuring app'
  build :copy_dotfiles
  build :configure_default_url_options
  build :configure_action_mailer
  build :configure_routes
  build :configure_redis
  build :configure_sidekiq
  build :configure_time_formats
  build :configure_i18n_messages
  build :configure_whenever
  build :configure_app_services
  build :configure_rubocop
  build :setup_brazilian_app
  build :setup_dalli_store
  build :disable_xml_params
  build :copy_miscellaneous_files
  build :fix_i18n_deprecation_warning
  build :setup_default_rake_task
  build :configure_puma
  build :set_up_forego
  build :customize_error_pages
  build :remove_config_comment_lines
end

#create_viewsObject



100
101
102
103
104
105
# File 'lib/kratos/generators/app_generator.rb', line 100

def create_views
  say 'Creating views'
  build :create_partials_directory
  build :create_shared_javascripts
  build :create_application_layout
end

#customize_gemfileObject



39
40
41
42
43
44
# File 'lib/kratos/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



18
19
20
21
# File 'lib/kratos/generators/app_generator.rb', line 18

def finish_template
  invoke :kratos_customization
  super
end

#kratos_customizationObject



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

def kratos_customization
  invoke :customize_gemfile
  invoke :setup_development_environment
  invoke :setup_test_environment
  invoke :setup_production_environment
  invoke :setup_staging_environment
  invoke :setup_secret_token
  invoke :create_views
  invoke :configure_app
  invoke :setup_stylesheets
  invoke :setup_git
  invoke :setup_database
  invoke :setup_capistrano
  invoke :setup_quality_control
end

#setup_capistranoObject



153
154
155
156
157
158
159
160
# File 'lib/kratos/generators/app_generator.rb', line 153

def setup_capistrano
  say 'Setting up Capistrano'

  build :create_capistrano_tasks
  build :create_capfile
  build :create_capistrano_config
  build :create_capistrano_environments
end

#setup_databaseObject



144
145
146
147
148
149
150
151
# File 'lib/kratos/generators/app_generator.rb', line 144

def setup_database
  say 'Setting up database'

  build :use_postgres_config_template if 'postgresql' == options[:database]
  build :use_mysql_config_template if 'mysql' == options[:database]

  build :create_database
end

#setup_development_environmentObject



46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/kratos/generators/app_generator.rb', line 46

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

#setup_gitObject



137
138
139
140
141
142
# File 'lib/kratos/generators/app_generator.rb', line 137

def setup_git
  return if options[:skip_git]

  say 'Initializing git'
  build :init_git
end

#setup_production_environmentObject



78
79
80
81
82
83
84
85
86
87
88
# File 'lib/kratos/generators/app_generator.rb', line 78

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

#setup_quality_controlObject



162
163
164
165
166
167
# File 'lib/kratos/generators/app_generator.rb', line 162

def setup_quality_control
  say 'Setting up quality control tools'
  build :setup_bundler_audit
  build :setup_rubocop
  build :setup_brakeman
end

#setup_secret_tokenObject



95
96
97
98
# File 'lib/kratos/generators/app_generator.rb', line 95

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

#setup_staging_environmentObject



90
91
92
93
# File 'lib/kratos/generators/app_generator.rb', line 90

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

#setup_stylesheetsObject



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

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

#setup_test_environmentObject



60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/kratos/generators/app_generator.rb', line 60

def setup_test_environment
  say 'Setting up the test environment'
  build :set_up_factory_girl_for_rspec
  build :create_factories_directory
  build :generate_rspec
  build :configure_rspec
  build :enable_database_cleaner
  build :provide_shoulda_matchers_config
  build :configure_spec_support_features
  build :configure_ci
  build :configure_i18n_for_test_environment
  build :configure_action_mailer_in_specs
  build :configure_capybara_poltergeist
  build :configure_rspec_api_documentation
  build :configure_acceptance_helpers
  build :configure_i18n_tasks
end