rough_draft 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE +22 -0
- data/README.md +21 -0
- data/bin/rough_draft +14 -0
- data/lib/rough_draft/actions.rb +13 -0
- data/lib/rough_draft/app_builder.rb +437 -0
- data/lib/rough_draft/app_generator.rb +137 -0
- data/lib/rough_draft/version.rb +3 -0
- data/lib/rough_draft.rb +2 -0
- metadata +70 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: e09997bba0ca980cb909fd7dd485b4e795541bf2
|
4
|
+
data.tar.gz: d4ff2645264ca60db7a9912afbd27184b8611bff
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 927607fa82f8eabb18743c62b3261075b3ce1750ac77fed9ecd5a0c76e833602d54d2f8e7ec70083eedc825a4778d645d86c3807ddcfb5fbee7a215b117b5316
|
7
|
+
data.tar.gz: ae4942594576a02fa1036a86c45840ee153bf6afcdd3f5256040543d9ab8981d5f9b23d5bbdf4b049fda6e4b80c33cde0b1599cf4326975a0e9bbbc136d63de3
|
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 Jeff Felchner
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
# RoughDraft
|
2
|
+
|
3
|
+
TODO: Write a gem description
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'rough_draft'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install rough_draft
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
$ rough_draft
|
data/bin/rough_draft
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'pathname'
|
3
|
+
|
4
|
+
source_path = (Pathname.new(__FILE__).dirname + '../lib').expand_path
|
5
|
+
$LOAD_PATH << source_path
|
6
|
+
|
7
|
+
require 'rough_draft'
|
8
|
+
|
9
|
+
source_root = File.expand_path(File.join('..', 'source'), File.dirname(__FILE__))
|
10
|
+
|
11
|
+
RoughDraft::AppGenerator.source_root source_root
|
12
|
+
RoughDraft::AppGenerator.source_paths << Rails::Generators::AppGenerator.source_root << source_root
|
13
|
+
|
14
|
+
RoughDraft::AppGenerator.start
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module RoughDraft
|
2
|
+
module Actions
|
3
|
+
def copy_source_file(source)
|
4
|
+
copy_file source, source, force: true
|
5
|
+
end
|
6
|
+
|
7
|
+
def git_commit(message, options = {})
|
8
|
+
git :add => '-A'
|
9
|
+
git :reset => '-- config/settings/*' unless options[:include_settings]
|
10
|
+
git :commit => "-m '#{message}' --quiet --no-status"
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,437 @@
|
|
1
|
+
require 'rails/generators/rails/app/app_generator'
|
2
|
+
require 'rough_draft/actions'
|
3
|
+
|
4
|
+
module RoughDraft
|
5
|
+
class AppBuilder < Rails::AppBuilder
|
6
|
+
include RoughDraft::Actions
|
7
|
+
|
8
|
+
def readme
|
9
|
+
template 'README.md.erb', 'README.md'
|
10
|
+
end
|
11
|
+
|
12
|
+
def gemfile
|
13
|
+
template 'Gemfile.erb', 'Gemfile'
|
14
|
+
end
|
15
|
+
|
16
|
+
def gitignore
|
17
|
+
copy_file 'kompanee-gitignore', '.gitignore'
|
18
|
+
end
|
19
|
+
|
20
|
+
def app
|
21
|
+
super
|
22
|
+
|
23
|
+
remove_file 'app/controllers/concerns'
|
24
|
+
remove_file 'app/models/concerns'
|
25
|
+
|
26
|
+
empty_directory_with_keep_file 'app/assets/fonts'
|
27
|
+
|
28
|
+
empty_directory_with_keep_file 'app/assets/images/backgrounds'
|
29
|
+
empty_directory_with_keep_file 'app/assets/images/decorations'
|
30
|
+
empty_directory_with_keep_file 'app/assets/images/emails'
|
31
|
+
empty_directory_with_keep_file 'app/assets/images/icons'
|
32
|
+
empty_directory_with_keep_file 'app/assets/images/logos'
|
33
|
+
empty_directory_with_keep_file 'app/assets/images/placeholders'
|
34
|
+
empty_directory_with_keep_file 'app/assets/images/text'
|
35
|
+
empty_directory_with_keep_file 'app/assets/images/ui'
|
36
|
+
end
|
37
|
+
|
38
|
+
def public_directory
|
39
|
+
super
|
40
|
+
|
41
|
+
remove_file 'public/favicon.ico'
|
42
|
+
end
|
43
|
+
|
44
|
+
def config
|
45
|
+
super
|
46
|
+
|
47
|
+
remove_commented_route_lines
|
48
|
+
|
49
|
+
staging_environment
|
50
|
+
end
|
51
|
+
|
52
|
+
def database_yml
|
53
|
+
if options[:database] == 'postgresql'
|
54
|
+
template 'config/database-example.yml.erb', 'config/database.yml'
|
55
|
+
else
|
56
|
+
super
|
57
|
+
end
|
58
|
+
|
59
|
+
copy_file "#{destination_root}/config/database.yml", 'config/database-example.yml'
|
60
|
+
end
|
61
|
+
|
62
|
+
def db
|
63
|
+
super
|
64
|
+
|
65
|
+
bundle_command 'exec rake db:drop:all db:create:all db:migrate db:test:prepare'
|
66
|
+
end
|
67
|
+
|
68
|
+
def git_repo
|
69
|
+
git :init => '--quiet'
|
70
|
+
git_commit 'Initial App Generation'
|
71
|
+
git :branch => 'rough-draft --quiet'
|
72
|
+
git :checkout => 'rough-draft --quiet'
|
73
|
+
end
|
74
|
+
|
75
|
+
def git_finalize
|
76
|
+
git_commit 'Completed Template Initialization'
|
77
|
+
git :checkout => 'master --quiet'
|
78
|
+
git :merge => '--no-ff rough-draft --quiet --no-edit'
|
79
|
+
git :branch => '-D rough-draft --quiet'
|
80
|
+
end
|
81
|
+
|
82
|
+
def ruby_version
|
83
|
+
template 'ruby-version.erb', '.ruby-version'
|
84
|
+
|
85
|
+
git_commit 'Add .ruby-version'
|
86
|
+
end
|
87
|
+
|
88
|
+
def environment_banners
|
89
|
+
empty_directory 'app/assets/images/decorations/environment-banners'
|
90
|
+
copy_source_file 'app/assets/images/decorations/environment-banners/development-banner.png'
|
91
|
+
copy_source_file 'app/assets/images/decorations/environment-banners/test-banner.png'
|
92
|
+
copy_source_file 'app/assets/images/decorations/environment-banners/staging-banner.png'
|
93
|
+
|
94
|
+
git_commit 'Add Environment Banners'
|
95
|
+
end
|
96
|
+
|
97
|
+
def raise_on_delivery_errors
|
98
|
+
gsub_file 'config/environments/development.rb',
|
99
|
+
'raise_delivery_errors = false',
|
100
|
+
'raise_delivery_errors = true'
|
101
|
+
|
102
|
+
git_commit 'Raise Delivery Errors in Development'
|
103
|
+
end
|
104
|
+
|
105
|
+
def raise_on_unpermitted_parameters
|
106
|
+
action_on_unpermitted_parameters = <<-RUBY
|
107
|
+
|
108
|
+
|
109
|
+
# Raise an ActionController::UnpermittedParameters exception when
|
110
|
+
# a parameter is not explcitly permitted but is passed anyway.
|
111
|
+
config.action_controller.action_on_unpermitted_parameters = :raise
|
112
|
+
RUBY
|
113
|
+
|
114
|
+
inject_into_file(
|
115
|
+
'config/environments/development.rb',
|
116
|
+
action_on_unpermitted_parameters.chomp,
|
117
|
+
before: "\nend"
|
118
|
+
)
|
119
|
+
|
120
|
+
git_commit 'Raise Errors in Development when unpermitted parameters are used'
|
121
|
+
end
|
122
|
+
|
123
|
+
def setup_script
|
124
|
+
copy_source_file 'bin/setup'
|
125
|
+
chmod 'bin/setup', 0755
|
126
|
+
|
127
|
+
git_commit 'Generate setup script'
|
128
|
+
end
|
129
|
+
|
130
|
+
def disable_generators
|
131
|
+
config = <<-RUBY
|
132
|
+
config.generators do |generate|
|
133
|
+
generate.helper false
|
134
|
+
generate.javascript_engine false
|
135
|
+
generate.request_specs false
|
136
|
+
generate.routing_specs false
|
137
|
+
generate.stylesheets false
|
138
|
+
generate.test_framework :rspec
|
139
|
+
generate.view_specs false
|
140
|
+
end
|
141
|
+
|
142
|
+
RUBY
|
143
|
+
|
144
|
+
inject_into_class 'config/application.rb', 'Application', config
|
145
|
+
|
146
|
+
git_commit 'Disable generators'
|
147
|
+
end
|
148
|
+
|
149
|
+
def rspec
|
150
|
+
generate 'rspec:install'
|
151
|
+
|
152
|
+
empty_directory_with_keep_file 'spec/shared_examples'
|
153
|
+
empty_directory_with_keep_file 'spec/support'
|
154
|
+
empty_directory_with_keep_file 'spec/helpers'
|
155
|
+
empty_directory_with_keep_file 'spec/acceptance'
|
156
|
+
|
157
|
+
copy_source_file 'spec/spec_helper.rb'
|
158
|
+
|
159
|
+
git_commit 'Setup RSpec'
|
160
|
+
end
|
161
|
+
|
162
|
+
def factories
|
163
|
+
copy_source_file 'spec/factories/user.rb'
|
164
|
+
copy_source_file 'spec/factories/all_factories_are_valid_spec.rb'
|
165
|
+
|
166
|
+
git_commit 'Setup Factories'
|
167
|
+
end
|
168
|
+
|
169
|
+
def travis
|
170
|
+
template 'travis.yml.erb', '.travis.yml'
|
171
|
+
|
172
|
+
git_commit 'Setup Travis CI'
|
173
|
+
end
|
174
|
+
|
175
|
+
def rack_deflator
|
176
|
+
config = <<-RUBY
|
177
|
+
|
178
|
+
# Enable deflate / gzip compression of controller-generated responses
|
179
|
+
config.middleware.use Rack::Deflater
|
180
|
+
|
181
|
+
RUBY
|
182
|
+
|
183
|
+
inject_into_file 'config/environments/production.rb',
|
184
|
+
config.chomp,
|
185
|
+
after: "config.serve_static_assets = false\n"
|
186
|
+
|
187
|
+
staging_environment
|
188
|
+
|
189
|
+
git_commit 'Setup Rack Deflator'
|
190
|
+
end
|
191
|
+
|
192
|
+
def stylesheets
|
193
|
+
remove_file 'app/assets/stylesheets/application.css'
|
194
|
+
|
195
|
+
get 'http://necolas.github.io/normalize.css/latest/normalize.css', 'app/assets/stylesheets/normalize.scss'
|
196
|
+
copy_file 'app/assets/stylesheets/application.css.scss'
|
197
|
+
|
198
|
+
git_commit 'Setup Base Stylesheets'
|
199
|
+
end
|
200
|
+
|
201
|
+
def disable_turbolinks
|
202
|
+
gsub_file 'app/assets/javascripts/application.js',
|
203
|
+
%r{//= require turbolinks\n},
|
204
|
+
''
|
205
|
+
|
206
|
+
git_commit 'Disable Turbolinks'
|
207
|
+
end
|
208
|
+
|
209
|
+
def human_text
|
210
|
+
template 'public/humans.txt.erb', 'public/humans.txt'
|
211
|
+
|
212
|
+
git_commit 'Add human.txt'
|
213
|
+
end
|
214
|
+
|
215
|
+
def helpers
|
216
|
+
remove_file 'app/helpers/application_helper.rb'
|
217
|
+
|
218
|
+
git_commit 'Remove uneeded helper'
|
219
|
+
end
|
220
|
+
|
221
|
+
def views
|
222
|
+
replace_application_layout
|
223
|
+
install_shared_partials
|
224
|
+
install_maintenance_page
|
225
|
+
end
|
226
|
+
|
227
|
+
def devise
|
228
|
+
route "root :to => 'devise/sessions#new'"
|
229
|
+
comment_lines 'config/routes.rb', /root/
|
230
|
+
|
231
|
+
git_commit 'Add Default (Commented) Devise Route'
|
232
|
+
end
|
233
|
+
|
234
|
+
def simple_form
|
235
|
+
generate 'simple_form:install'
|
236
|
+
remove_dir 'lib/templates'
|
237
|
+
|
238
|
+
git_commit 'Configure SimpleForm'
|
239
|
+
end
|
240
|
+
|
241
|
+
def chamber
|
242
|
+
uncomment_lines 'Gemfile', /chamber/
|
243
|
+
bundle_command 'update'
|
244
|
+
run "cd #{destination_root} && chamber init"
|
245
|
+
|
246
|
+
git_commit 'Configure Chamber'
|
247
|
+
|
248
|
+
remove_file 'config/secrets.yml'
|
249
|
+
create_file 'config/settings.yml', '', force: true
|
250
|
+
empty_directory 'config/settings'
|
251
|
+
template 'config/settings/http.yml.erb', 'config/settings/http.yml'
|
252
|
+
|
253
|
+
git_commit 'Setup default settings files'
|
254
|
+
end
|
255
|
+
|
256
|
+
def i18n
|
257
|
+
template 'config/initializers/i18n.rb.erb', 'config/initializers/i18n.rb'
|
258
|
+
|
259
|
+
git_commit 'Configure i18n'
|
260
|
+
end
|
261
|
+
|
262
|
+
def xml_parsing
|
263
|
+
copy_source_file 'config/initializers/xml.rb'
|
264
|
+
|
265
|
+
git_commit 'Disable XML Parsing'
|
266
|
+
end
|
267
|
+
|
268
|
+
def dirty_url
|
269
|
+
uncomment_lines 'Gemfile', /dirty_url/
|
270
|
+
bundle_command 'update'
|
271
|
+
|
272
|
+
git_commit 'Install dirty_url for default_url_options'
|
273
|
+
end
|
274
|
+
|
275
|
+
def rack_timeout
|
276
|
+
copy_source_file 'config/initializers/rack_timeout.rb'
|
277
|
+
|
278
|
+
git_commit 'Configure Rack Timeout'
|
279
|
+
end
|
280
|
+
|
281
|
+
def unicorn
|
282
|
+
copy_source_file 'config/unicorn.rb'
|
283
|
+
|
284
|
+
git_commit 'Configure Unicorn'
|
285
|
+
end
|
286
|
+
|
287
|
+
def foreman
|
288
|
+
copy_source_file 'Procfile'
|
289
|
+
|
290
|
+
git_commit 'Configure Foreman'
|
291
|
+
end
|
292
|
+
|
293
|
+
def mail_safe
|
294
|
+
copy_source_file 'config/initializers/mail_safe.rb'
|
295
|
+
|
296
|
+
git_commit 'Configure Mail Safe'
|
297
|
+
end
|
298
|
+
|
299
|
+
def skylight
|
300
|
+
bundle_command 'exec skylight setup'
|
301
|
+
template 'config/initializers/skylight.rb.erb', 'config/initializers/skylight.rb'
|
302
|
+
|
303
|
+
require 'yaml'
|
304
|
+
skylight_config = YAML.load(File.read("#{destination_root}/config/skylight.yml"))
|
305
|
+
remove_file 'config/skylight.yml'
|
306
|
+
create_file 'config/settings/skylight.yml' do
|
307
|
+
<<-SKYLIGHT
|
308
|
+
skylight:
|
309
|
+
_secure_application: "#{skylight_config['application']}"
|
310
|
+
_secure_authentication: "#{skylight_config['authentication']}"
|
311
|
+
SKYLIGHT
|
312
|
+
end
|
313
|
+
|
314
|
+
git_commit 'Configure Skylight'
|
315
|
+
end
|
316
|
+
|
317
|
+
def code_climate
|
318
|
+
template 'config/settings/code_climate.yml.erb', 'config/settings/code_climate.yml'
|
319
|
+
|
320
|
+
git_commit 'Configure CodeClimate'
|
321
|
+
end
|
322
|
+
|
323
|
+
def bugsnag
|
324
|
+
copy_source_file 'config/initializers/bugsnag.rb'
|
325
|
+
template 'config/settings/bugsnag.yml.erb', 'config/settings/bugsnag.yml'
|
326
|
+
|
327
|
+
git_commit 'Configure BugSnag'
|
328
|
+
end
|
329
|
+
|
330
|
+
def database_seeding
|
331
|
+
remove_file 'db/seeds.rb'
|
332
|
+
|
333
|
+
copy_source_file 'lib/tasks/db-seed.rake'
|
334
|
+
copy_source_file 'db/seed.rb'
|
335
|
+
copy_source_file 'db/samplize.rb'
|
336
|
+
|
337
|
+
git_commit 'Setup Database Seeding and Sampling Tasks'
|
338
|
+
end
|
339
|
+
|
340
|
+
def database_backup
|
341
|
+
copy_source_file 'lib/tasks/db-backup.rake'
|
342
|
+
|
343
|
+
git_commit 'Setup Database Backup Tasks'
|
344
|
+
end
|
345
|
+
|
346
|
+
def smtp
|
347
|
+
copy_source_file 'config/initializers/action_mailer.rb'
|
348
|
+
template 'config/settings/smtp.yml.erb', 'config/settings/smtp.yml'
|
349
|
+
|
350
|
+
git_commit 'Configure SMTP Options'
|
351
|
+
end
|
352
|
+
|
353
|
+
def locales
|
354
|
+
copy_file 'config/locales/date-formats-en.yml', 'config/locales/en.yml', force: true
|
355
|
+
|
356
|
+
git_commit 'Add default date/time formats'
|
357
|
+
end
|
358
|
+
|
359
|
+
def github_repo(repo_name)
|
360
|
+
run "hub create #{repo_name}"
|
361
|
+
end
|
362
|
+
|
363
|
+
def heroku_specific_gems
|
364
|
+
uncomment_lines 'Gemfile', /rails_12factor/
|
365
|
+
bundle_command 'update'
|
366
|
+
|
367
|
+
git_commit 'Add Heroku-specific gems'
|
368
|
+
end
|
369
|
+
|
370
|
+
def heroku_apps
|
371
|
+
valid_heroku_app_name=app_name.gsub(/_/, '-')
|
372
|
+
|
373
|
+
run "heroku create #{valid_heroku_app_name}-production --remote=production"
|
374
|
+
run "heroku create #{valid_heroku_app_name}-staging --remote=staging"
|
375
|
+
run "heroku config:add RACK_ENV=staging RAILS_ENV=staging --app=#{valid_heroku_app_name}-staging --remote=staging"
|
376
|
+
end
|
377
|
+
|
378
|
+
def heroku_remotes
|
379
|
+
valid_heroku_app_name=app_name.gsub(/_/, '-')
|
380
|
+
|
381
|
+
remotes = <<-RUBY
|
382
|
+
|
383
|
+
# Set up staging and production git remotes
|
384
|
+
git remote add staging git@heroku.com:#{valid_heroku_app_name}-staging.git
|
385
|
+
git remote add production git@heroku.com:#{valid_heroku_app_name}-production.git
|
386
|
+
RUBY
|
387
|
+
|
388
|
+
append_file 'bin/setup', remotes
|
389
|
+
|
390
|
+
git_commit 'Add staging and production remotes to setup script'
|
391
|
+
end
|
392
|
+
|
393
|
+
def secret_token
|
394
|
+
gsub_file 'config/initializers/secret_token.rb', /\s=\s.*/, ' = Chamber.env.application.secret_key'
|
395
|
+
template 'config/settings/application.yml.erb', 'config/settings/application.yml'
|
396
|
+
|
397
|
+
git_commit 'Secure the Secure Application Token'
|
398
|
+
end
|
399
|
+
|
400
|
+
def secure_configuration_settings
|
401
|
+
run "cd #{destination_root} && chamber secure"
|
402
|
+
|
403
|
+
git_commit 'Add all configuration settings', :include_settings => true
|
404
|
+
end
|
405
|
+
|
406
|
+
private
|
407
|
+
|
408
|
+
def remove_commented_route_lines
|
409
|
+
gsub_file 'config/routes.rb', /\s+#.*/, ''
|
410
|
+
gsub_file 'config/routes.rb', /\n\n/, "\n"
|
411
|
+
end
|
412
|
+
|
413
|
+
def staging_environment
|
414
|
+
copy_file File.expand_path('config/environments/production.rb'), 'config/environments/staging.rb', force: true
|
415
|
+
end
|
416
|
+
|
417
|
+
def replace_application_layout
|
418
|
+
template 'app/views/layouts/application.html.erb.erb', 'app/views/layouts/application.html.erb', force: true
|
419
|
+
|
420
|
+
git_commit 'Replace the default application layout'
|
421
|
+
end
|
422
|
+
|
423
|
+
def install_shared_partials
|
424
|
+
directory 'app/views/shared'
|
425
|
+
copy_source_file 'app/views/shared/_flashes.html.erb'
|
426
|
+
copy_source_file 'app/views/shared/_javascript.html.erb'
|
427
|
+
|
428
|
+
git_commit 'Add shared partials'
|
429
|
+
end
|
430
|
+
|
431
|
+
def install_maintenance_page
|
432
|
+
template 'public/maintenance.html.erb.erb', 'public/maintenance.html.erb'
|
433
|
+
|
434
|
+
git_commit 'Add basic maintenance page'
|
435
|
+
end
|
436
|
+
end
|
437
|
+
end
|
@@ -0,0 +1,137 @@
|
|
1
|
+
require 'rails/generators'
|
2
|
+
require 'rails/generators/rails/app/app_generator'
|
3
|
+
require 'rough_draft/app_builder'
|
4
|
+
|
5
|
+
module RoughDraft
|
6
|
+
class AppGenerator < Rails::Generators::AppGenerator
|
7
|
+
class_option :database, :type => :string,
|
8
|
+
:aliases => '-d',
|
9
|
+
:default => 'postgresql',
|
10
|
+
:desc => "Preconfigure for selected database (options: #{DATABASES.join('/')})"
|
11
|
+
|
12
|
+
class_option :heroku, :type => :boolean,
|
13
|
+
:aliases => '-H',
|
14
|
+
:default => false,
|
15
|
+
:desc => 'Create staging and production Heroku apps'
|
16
|
+
|
17
|
+
class_option :skip_test_unit, :type => :boolean,
|
18
|
+
:aliases => '-T',
|
19
|
+
:default => true,
|
20
|
+
:desc => 'Skip Test::Unit files'
|
21
|
+
|
22
|
+
class_option :skip_bundle, :type => :boolean,
|
23
|
+
:aliases => '-B',
|
24
|
+
:default => true,
|
25
|
+
:desc => "Don't run bundle install"
|
26
|
+
|
27
|
+
class_option :github, :type => :string,
|
28
|
+
:aliases => '-G',
|
29
|
+
:default => nil,
|
30
|
+
:desc => 'Create Github repository and add remote origin pointed to repo'
|
31
|
+
|
32
|
+
def finish_template
|
33
|
+
super
|
34
|
+
|
35
|
+
build :git_repo
|
36
|
+
|
37
|
+
bundle_command 'install'
|
38
|
+
|
39
|
+
# Development
|
40
|
+
build :ruby_version
|
41
|
+
build :environment_banners
|
42
|
+
build :raise_on_delivery_errors
|
43
|
+
build :raise_on_unpermitted_parameters
|
44
|
+
build :setup_script
|
45
|
+
build :disable_generators
|
46
|
+
|
47
|
+
# Test
|
48
|
+
build :rspec
|
49
|
+
build :factories
|
50
|
+
build :travis
|
51
|
+
|
52
|
+
# Production
|
53
|
+
build :rack_deflator
|
54
|
+
|
55
|
+
# Stylesheets
|
56
|
+
build :stylesheets
|
57
|
+
|
58
|
+
# Javascript
|
59
|
+
build :disable_turbolinks
|
60
|
+
|
61
|
+
# Views
|
62
|
+
build :human_text
|
63
|
+
build :helpers
|
64
|
+
build :views
|
65
|
+
|
66
|
+
# Gem Configuration
|
67
|
+
build :devise
|
68
|
+
build :simple_form
|
69
|
+
build :chamber
|
70
|
+
build :i18n
|
71
|
+
build :xml_parsing
|
72
|
+
build :dirty_url
|
73
|
+
build :rack_timeout
|
74
|
+
build :unicorn
|
75
|
+
build :foreman
|
76
|
+
build :mail_safe
|
77
|
+
build :skylight
|
78
|
+
build :code_climate
|
79
|
+
build :bugsnag
|
80
|
+
|
81
|
+
# Database
|
82
|
+
build :database_seeding
|
83
|
+
build :database_backup
|
84
|
+
|
85
|
+
# Mail
|
86
|
+
build :smtp
|
87
|
+
|
88
|
+
# Formats and Localization
|
89
|
+
build :locales
|
90
|
+
|
91
|
+
# Github
|
92
|
+
if !options[:skip_git] && options[:github]
|
93
|
+
build :github_repo, options[:github]
|
94
|
+
end
|
95
|
+
|
96
|
+
# Heroku
|
97
|
+
if options[:heroku]
|
98
|
+
build :heroku_specific_gems
|
99
|
+
build :heroku_apps
|
100
|
+
build :heroku_remotes
|
101
|
+
end
|
102
|
+
|
103
|
+
# Security
|
104
|
+
build :secret_token
|
105
|
+
build :secure_configuration_settings
|
106
|
+
|
107
|
+
bundle_command 'update'
|
108
|
+
|
109
|
+
build :git_finalize
|
110
|
+
|
111
|
+
say ''
|
112
|
+
say 'Congratulations'
|
113
|
+
say 'You just made a rough draft of your Rails app!!'
|
114
|
+
say ''
|
115
|
+
end
|
116
|
+
|
117
|
+
private
|
118
|
+
|
119
|
+
def slack_room
|
120
|
+
@@slack_room ||= ask "What is the Slack room you would like CI notifications posted to?"
|
121
|
+
end
|
122
|
+
|
123
|
+
def code_climate_repo_token
|
124
|
+
@@code_climate_repo_token ||= ask "What is the repo token for this app on Code Climate?"
|
125
|
+
end
|
126
|
+
|
127
|
+
def bugsnag_api_key
|
128
|
+
@@bugsnag_api_key ||= ask "What is the API key for this app on BugSnag?"
|
129
|
+
end
|
130
|
+
|
131
|
+
protected
|
132
|
+
|
133
|
+
def get_builder_class
|
134
|
+
RoughDraft::AppBuilder
|
135
|
+
end
|
136
|
+
end
|
137
|
+
end
|
data/lib/rough_draft.rb
ADDED
metadata
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rough_draft
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- jfelchner
|
8
|
+
- m5rk
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2014-04-02 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rails
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - "~>"
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: '4.0'
|
21
|
+
type: :development
|
22
|
+
prerelease: false
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - "~>"
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: '4.0'
|
28
|
+
description: ''
|
29
|
+
email: support@chirrpy.com
|
30
|
+
executables:
|
31
|
+
- rough_draft
|
32
|
+
extensions: []
|
33
|
+
extra_rdoc_files:
|
34
|
+
- README.md
|
35
|
+
- LICENSE
|
36
|
+
files:
|
37
|
+
- LICENSE
|
38
|
+
- README.md
|
39
|
+
- bin/rough_draft
|
40
|
+
- lib/rough_draft.rb
|
41
|
+
- lib/rough_draft/actions.rb
|
42
|
+
- lib/rough_draft/app_builder.rb
|
43
|
+
- lib/rough_draft/app_generator.rb
|
44
|
+
- lib/rough_draft/version.rb
|
45
|
+
homepage: https://github.com/thekompanee/blueprints/rails
|
46
|
+
licenses: []
|
47
|
+
metadata: {}
|
48
|
+
post_install_message:
|
49
|
+
rdoc_options:
|
50
|
+
- "--charset = UTF-8"
|
51
|
+
require_paths:
|
52
|
+
- lib
|
53
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
54
|
+
requirements:
|
55
|
+
- - ">="
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: '0'
|
58
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - ">="
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0'
|
63
|
+
requirements: []
|
64
|
+
rubyforge_project: rough_draft
|
65
|
+
rubygems_version: 2.2.2
|
66
|
+
signing_key:
|
67
|
+
specification_version: 4
|
68
|
+
summary: Rails Generator a la The Kompanee
|
69
|
+
test_files: []
|
70
|
+
has_rdoc:
|