Class: Barebones::AppGenerator

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

Instance Method Summary collapse

Instance Method Details

#configure_appObject



46
47
48
49
# File 'lib/barebones/generators/app_generator.rb', line 46

def configure_app
  say "Configuring application..."
  build :setup_autoload_paths
end

#customizationsObject



27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/barebones/generators/app_generator.rb', line 27

def customizations
  say "Invoking customizations..."
  invoke :setup_ruby
  invoke :configure_app
  invoke :setup_webserver
  invoke :setup_routes
  invoke :setup_api
  invoke :setup_secrets
  invoke :setup_environments
  invoke :setup_gems
  invoke :outro
end

#outroObject



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

def outro
  say "\e[34mSweet, we're done!\e[0m"
end

#setup_apiObject



61
62
63
64
65
66
67
68
69
70
# File 'lib/barebones/generators/app_generator.rb', line 61

def setup_api
  unless options[:skip_api]
    say "Setting up an API..."
    build :setup_oj
    build :create_api_constraints
    build :create_api_v1_defaults
    build :create_api_configurations
    build :create_api_layouts
  end
end

#setup_carrierwaveObject



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

def setup_carrierwave
  unless options[:setup_carrierwave]
    say "Setting up Carrierwave gem..."
    build :configure_carrierwave
  end
end

#setup_development_environmentObject



84
85
86
# File 'lib/barebones/generators/app_generator.rb', line 84

def setup_development_environment
  build :raise_on_delivery_errors
end

#setup_environmentsObject



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

def setup_environments
  say "Setting up environments..."
  invoke :setup_development_environment
  invoke :setup_staging_environment
  invoke :setup_production_environment
end

#setup_factory_girlObject



103
104
105
106
107
108
# File 'lib/barebones/generators/app_generator.rb', line 103

def setup_factory_girl
  unless options[:skip_factory_girl]
    say "Setting up FactoryGirl gem..."
    build :configure_factory_girl
  end
end

#setup_gemsObject



95
96
97
98
99
100
101
# File 'lib/barebones/generators/app_generator.rb', line 95

def setup_gems
  invoke :setup_minitest
  invoke :setup_factory_girl
  invoke :setup_resque
  invoke :setup_sidekiq
  invoke :setup_carrierwave
end

#setup_minitestObject



110
111
112
113
114
115
# File 'lib/barebones/generators/app_generator.rb', line 110

def setup_minitest
  unless options[:skip_minitest]
    say "Setting up Minitest gem..."
    build :configure_minitest
  end
end

#setup_production_environmentObject



92
93
# File 'lib/barebones/generators/app_generator.rb', line 92

def setup_production_environment
end

#setup_pumaObject



145
146
147
148
# File 'lib/barebones/generators/app_generator.rb', line 145

def setup_puma
  say "Setting up Puma..."
  build :configure_puma
end

#setup_resqueObject



117
118
119
120
121
122
123
124
125
126
# File 'lib/barebones/generators/app_generator.rb', line 117

def setup_resque
  unless options[:skip_resque]
    say "Setting up Resque/Redis gems..."
    build :configure_active_job_for_resque
    build :configure_redis
    build :configure_resque
    build :create_test_job
    build :create_resque_rake_task
  end
end

#setup_routesObject



56
57
58
59
# File 'lib/barebones/generators/app_generator.rb', line 56

def setup_routes
  say "Setting up custom routes..."
  build :customize_routes
end

#setup_rubyObject



40
41
42
43
44
# File 'lib/barebones/generators/app_generator.rb', line 40

def setup_ruby
  say "Setting ruby version..."
  build :set_ruby_version
  build :set_gemset
end

#setup_secretsObject



72
73
74
75
# File 'lib/barebones/generators/app_generator.rb', line 72

def setup_secrets
  say "Setting up secrets..."
  build :customize_secrets
end

#setup_sidekiqObject



128
129
130
131
132
133
134
135
136
# File 'lib/barebones/generators/app_generator.rb', line 128

def setup_sidekiq
  unless options[:skip_sidekiq]
    say "Setting up Sidekiq/Redis gems..."
    build :configure_active_job_for_sidekiq
    build :configure_redis
    build :configure_sidekiq
    build :create_test_job
  end
end

#setup_staging_environmentObject



88
89
90
# File 'lib/barebones/generators/app_generator.rb', line 88

def setup_staging_environment
  build :create_staging_environment
end

#setup_webserverObject



51
52
53
54
# File 'lib/barebones/generators/app_generator.rb', line 51

def setup_webserver
  say "Setting up webserver..."
  invoke :setup_puma
end