Class: Kazan::AppGenerator

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

Instance Method Summary collapse

Instance Method Details

#customizationObject



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

def customization
  invoke :setup_ruby
  invoke :setup_gems
  invoke :setup_secrets
  invoke :setup_puma
  invoke :setup_development_environment
  invoke :setup_test_environment
  invoke :setup_production_environment
  invoke :setup_database

  invoke :setup_assets
  invoke :setup_helpers
  invoke :setup_error_pages
  invoke :setup_locales

  invoke :setup_static

  invoke :setup_bundler_audit
  invoke :setup_spring
  invoke :setup_empty_directories
  invoke :setup_project_repository
  invoke :outro
end

#finish_templateObject



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

def finish_template
  invoke :customization
  super
end

#outroObject



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

def outro
  say 'Last preparation'
end

#setup_assetsObject



112
113
114
115
116
117
118
119
120
121
122
# File 'lib/kazan/generators/app_generator.rb', line 112

def setup_assets
  unless options[:api]
    say 'Setup assets'
    build :shared_views_directory
    build :shared_flash
    build :shared_javascript
    build :shared_styles
    build :assets_config
    build :shared_layout
  end
end

#setup_bundler_auditObject



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

def setup_bundler_audit
  say 'Setup bundler audit'
  build :bundler_audit_config
end

#setup_databaseObject



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

def setup_database
  say 'Setup database'
  build :postgres_config if options[:database] == 'postgresql'
  build :database_tables
end

#setup_development_environmentObject



70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/kazan/generators/app_generator.rb', line 70

def setup_development_environment
  say 'Setup development environment'
  build :exception_on_delivery_errors
  build :exception_on_unpermitted_parameters
  build :exception_on_missing_translations
  build :letter_opener_config
  build :bullet_config
  build :foreman_config
  build :rails_generators_config

  unless options[:api]
    build :quiet_assets_config
  end
end

#setup_empty_directoriesObject



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

def setup_empty_directories
  say 'Setup empty directories'
  build :empty_directories
end

#setup_error_pagesObject



143
144
145
146
147
148
# File 'lib/kazan/generators/app_generator.rb', line 143

def setup_error_pages
  unless options[:api]
    say 'Customizing the 500/404/422 pages'
    build :static_pages
  end
end

#setup_gemsObject



52
53
54
55
56
57
# File 'lib/kazan/generators/app_generator.rb', line 52

def setup_gems
  if options[:api]
    say 'Setup gems'
    build :gemfile_api
  end
end

#setup_helpersObject



124
125
126
127
128
129
# File 'lib/kazan/generators/app_generator.rb', line 124

def setup_helpers
  unless options[:api]
    build :simple_form_config
    build :rack_mini_profiler_config
  end
end

#setup_localesObject



150
151
152
153
154
155
# File 'lib/kazan/generators/app_generator.rb', line 150

def setup_locales
  unless options[:api]
    say 'Setup locales tools'
    build :setup_locales
  end
end

#setup_production_environmentObject



97
98
99
100
101
102
103
104
# File 'lib/kazan/generators/app_generator.rb', line 97

def setup_production_environment
  say 'Setup production environment'
  build :smtp_config
  build :rack_timeout_config
  build :rack_canonical_host_config
  build :rack_deflater_config
  build :rollbar_config
end

#setup_project_repositoryObject



172
173
174
175
# File 'lib/kazan/generators/app_generator.rb', line 172

def setup_project_repository
  say 'Setup git reposirory'
  build :init_commit
end

#setup_pumaObject



65
66
67
68
# File 'lib/kazan/generators/app_generator.rb', line 65

def setup_puma
  say 'Setup puma'
  build :puma_config
end

#setup_rubyObject



47
48
49
50
# File 'lib/kazan/generators/app_generator.rb', line 47

def setup_ruby
  say 'Setup ruby'
  build :ruby_version
end

#setup_secretsObject



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

def setup_secrets
  say 'Setup secrets'
  build :dotenvs
  build :settings
end

#setup_springObject



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

def setup_spring
  say 'Setup spring binstubs'
  build :spring
end

#setup_staticObject



131
132
133
134
135
136
137
138
139
140
141
# File 'lib/kazan/generators/app_generator.rb', line 131

def setup_static
  unless options[:api]
    if options[:static]
      say 'Setup static'

      build :remove_turbolinks
      build :stylesheets_gems
      build :stylesheets_manifest
    end
  end
end

#setup_test_environmentObject



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

def setup_test_environment
  say 'Setup test environment'
  build :exception_on_missing_assets_in_test
  build :spec_translations_config
  build :spec_action_mailer_config
  build :spec_database_cleaner_config
  build :spec_shoulda_matchers_config
  build :spec_factory_girl_config
  build :rspec_config
  build :rspec_replace_config
end