re-rails 0.1.1 → 0.1.2
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 +4 -4
- data/.rvmrc +1 -0
- data/Gemfile.lock +1 -1
- data/lib/suspenders/app_builder.rb +128 -132
- data/lib/suspenders/generators/app_generator.rb +5 -3
- data/lib/suspenders/version.rb +1 -1
- metadata +2 -2
- data/.ruby-gemset +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 43719f88bb959f94ec20d1e3c42806914c480c90
|
4
|
+
data.tar.gz: 31f8c647c8d34da8ce80b70cc7464f54360c6d45
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee70abb5c5efe8467ca67bb3bf71dd734a0436b4105c1d77b2ce01b3ed21cef1a3070d5fef4860c12cd9abacce585b8a398bd8c5c25086ad5cdb4edc14b69e30
|
7
|
+
data.tar.gz: 464f7455e0124d54c15f50d3bb6232febed4d73f64c93a933aa2169a692ab4f736b263ffa70f516ebce5d2fc905bc025967e09cb8231fff54b9c6e53074cbcdc
|
data/.rvmrc
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
rvm --create use 2.1.0@re-rails-source
|
data/Gemfile.lock
CHANGED
@@ -150,174 +150,170 @@ module Suspenders
|
|
150
150
|
copy_file 'Gemfile_clean', 'Gemfile'
|
151
151
|
end
|
152
152
|
|
153
|
-
def set_ruby_to_version_being_used
|
154
|
-
inject_into_file 'Gemfile', "\n\nruby '#{RUBY_VERSION}'",
|
155
|
-
after: /source 'https:\/\/rubygems.org'/
|
156
|
-
create_file '.ruby-version', "#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}\n"
|
157
|
-
end
|
158
153
|
|
159
|
-
def enable_database_cleaner
|
160
|
-
copy_file 'database_cleaner_rspec.rb', 'spec/support/database_cleaner.rb'
|
161
|
-
end
|
162
154
|
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
end
|
155
|
+
def enable_database_cleaner
|
156
|
+
copy_file 'database_cleaner_rspec.rb', 'spec/support/database_cleaner.rb'
|
157
|
+
end
|
167
158
|
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
159
|
+
def configure_spec_support_features
|
160
|
+
empty_directory_with_keep_file 'spec/features'
|
161
|
+
empty_directory_with_keep_file 'spec/support/features'
|
162
|
+
end
|
172
163
|
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
copy_file 'background_jobs_rspec.rb', 'spec/support/background_jobs.rb'
|
178
|
-
run 'rails g delayed_job:active_record'
|
179
|
-
end
|
164
|
+
def configure_rspec
|
165
|
+
remove_file 'spec/spec_helper.rb'
|
166
|
+
copy_file 'spec_helper.rb', 'spec/spec_helper.rb'
|
167
|
+
end
|
180
168
|
|
181
|
-
|
182
|
-
|
169
|
+
def use_spring_binstubs
|
170
|
+
run 'bundle exec spring binstub --all'
|
171
|
+
end
|
172
|
+
def configure_background_jobs_for_rspec
|
173
|
+
copy_file 'background_jobs_rspec.rb', 'spec/support/background_jobs.rb'
|
174
|
+
run 'rails g delayed_job:active_record'
|
175
|
+
end
|
176
|
+
|
177
|
+
def configure_time_zone
|
178
|
+
config = <<-RUBY
|
183
179
|
config.active_record.default_timezone = :utc
|
184
180
|
|
185
|
-
|
186
|
-
|
187
|
-
|
181
|
+
RUBY
|
182
|
+
inject_into_class 'config/application.rb', 'Application', config
|
183
|
+
end
|
188
184
|
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
185
|
+
def configure_time_formats
|
186
|
+
remove_file 'config/locales/en.yml'
|
187
|
+
copy_file 'config_locales_en.yml', 'config/locales/en.yml'
|
188
|
+
end
|
193
189
|
|
194
|
-
|
195
|
-
|
196
|
-
|
190
|
+
def configure_rack_timeout
|
191
|
+
copy_file 'rack_timeout.rb', 'config/initializers/rack_timeout.rb'
|
192
|
+
end
|
197
193
|
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
194
|
+
def configure_action_mailer
|
195
|
+
action_mailer_host 'development', "#{app_name}.local"
|
196
|
+
action_mailer_host 'test', 'www.example.com'
|
197
|
+
action_mailer_host 'staging', "staging.#{app_name}.com"
|
198
|
+
action_mailer_host 'production', "#{app_name}.com"
|
199
|
+
end
|
204
200
|
|
205
|
-
|
206
|
-
|
207
|
-
|
201
|
+
def generate_rspec
|
202
|
+
generate 'rspec:install'
|
203
|
+
end
|
208
204
|
|
209
|
-
|
210
|
-
|
211
|
-
|
205
|
+
def configure_unicorn
|
206
|
+
copy_file 'unicorn.rb', 'config/unicorn.rb'
|
207
|
+
end
|
212
208
|
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
209
|
+
def setup_foreman
|
210
|
+
copy_file 'sample.env', '.sample.env'
|
211
|
+
copy_file 'Procfile', 'Procfile'
|
212
|
+
end
|
217
213
|
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
214
|
+
def setup_stylesheets
|
215
|
+
remove_file 'app/assets/stylesheets/application.css'
|
216
|
+
copy_file 'application.css.scss',
|
217
|
+
'app/assets/stylesheets/application.css.scss'
|
218
|
+
end
|
223
219
|
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
end
|
220
|
+
def gitignore_files
|
221
|
+
remove_file '.gitignore'
|
222
|
+
copy_file 'suspenders_gitignore', '.gitignore'
|
223
|
+
[
|
224
|
+
'app/views/pages',
|
225
|
+
'spec/lib',
|
226
|
+
'spec/controllers',
|
227
|
+
'spec/helpers',
|
228
|
+
'spec/support/matchers',
|
229
|
+
'spec/support/mixins',
|
230
|
+
'spec/support/shared_examples'
|
231
|
+
].each do |dir|
|
232
|
+
run "mkdir #{dir}"
|
233
|
+
run "touch #{dir}/.keep"
|
239
234
|
end
|
235
|
+
end
|
240
236
|
|
241
|
-
|
242
|
-
|
243
|
-
|
237
|
+
def init_git
|
238
|
+
run 'git init'
|
239
|
+
end
|
244
240
|
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
241
|
+
def create_heroku_apps
|
242
|
+
path_addition = override_path_for_tests
|
243
|
+
run "#{path_addition} heroku create #{app_name}-production --remote=production"
|
244
|
+
run "#{path_addition} heroku create #{app_name}-staging --remote=staging"
|
245
|
+
run "#{path_addition} heroku config:add RACK_ENV=staging RAILS_ENV=staging --remote=staging"
|
246
|
+
end
|
251
247
|
|
252
|
-
|
253
|
-
|
248
|
+
def set_heroku_remotes
|
249
|
+
remotes = <<-RUBY
|
254
250
|
|
255
|
-
# Set up staging and production git remotes
|
256
|
-
git remote add staging git@heroku.com:#{app_name}-staging.git
|
257
|
-
git remote add production git@heroku.com:#{app_name}-production.git
|
251
|
+
# Set up staging and production git remotes
|
252
|
+
git remote add staging git@heroku.com:#{app_name}-staging.git
|
253
|
+
git remote add production git@heroku.com:#{app_name}-production.git
|
258
254
|
RUBY
|
259
255
|
|
260
|
-
|
261
|
-
|
256
|
+
append_file 'bin/setup', remotes
|
257
|
+
end
|
262
258
|
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
259
|
+
def set_heroku_rails_secrets
|
260
|
+
path_addition = override_path_for_tests
|
261
|
+
run "#{path_addition} heroku config:add SECRET_KEY_BASE=#{generate_secret} --remote=staging"
|
262
|
+
run "#{path_addition} heroku config:add SECRET_KEY_BASE=#{generate_secret} --remote=production"
|
263
|
+
end
|
268
264
|
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
265
|
+
def create_github_repo(repo_name)
|
266
|
+
path_addition = override_path_for_tests
|
267
|
+
run "#{path_addition} hub create #{repo_name}"
|
268
|
+
end
|
273
269
|
|
274
|
-
|
275
|
-
|
276
|
-
|
270
|
+
def copy_miscellaneous_files
|
271
|
+
copy_file 'errors.rb', 'config/initializers/errors.rb'
|
272
|
+
end
|
277
273
|
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
274
|
+
def customize_error_pages
|
275
|
+
meta_tags =<<-EOS
|
276
|
+
<meta charset='utf-8' />
|
277
|
+
<meta name='ROBOTS' content='NOODP' />
|
278
|
+
EOS
|
283
279
|
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
end
|
280
|
+
%w(500 404 422).each do |page|
|
281
|
+
inject_into_file "public/#{page}.html", meta_tags, :after => "<head>\n"
|
282
|
+
replace_in_file "public/#{page}.html", /<!--.+-->\n/, ''
|
288
283
|
end
|
284
|
+
end
|
289
285
|
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
286
|
+
def remove_routes_comment_lines
|
287
|
+
replace_in_file 'config/routes.rb',
|
288
|
+
/Application\.routes\.draw do.*end/m,
|
289
|
+
"Application.routes.draw do\nend"
|
290
|
+
end
|
295
291
|
|
296
|
-
|
297
|
-
|
298
|
-
|
292
|
+
def disable_xml_params
|
293
|
+
copy_file 'disable_xml_params.rb', 'config/initializers/disable_xml_params.rb'
|
294
|
+
end
|
299
295
|
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
end
|
296
|
+
def setup_default_rake_task
|
297
|
+
append_file 'Rakefile' do
|
298
|
+
"task(:default).clear\ntask :default => [:spec]\n"
|
304
299
|
end
|
300
|
+
end
|
305
301
|
|
306
|
-
|
302
|
+
private
|
307
303
|
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
end
|
304
|
+
def override_path_for_tests
|
305
|
+
if ENV['TESTING']
|
306
|
+
support_bin = File.expand_path(File.join('..', '..', 'spec', 'fakes', 'bin'))
|
307
|
+
"PATH=#{support_bin}:$PATH"
|
313
308
|
end
|
309
|
+
end
|
314
310
|
|
315
|
-
|
316
|
-
|
317
|
-
|
311
|
+
def factories_spec_rake_task
|
312
|
+
IO.read find_in_source_paths('factories_spec_rake_task.rb')
|
313
|
+
end
|
318
314
|
|
319
|
-
|
320
|
-
|
321
|
-
end
|
315
|
+
def generate_secret
|
316
|
+
SecureRandom.hex(64)
|
322
317
|
end
|
323
318
|
end
|
319
|
+
end
|
@@ -17,9 +17,11 @@ module Suspenders
|
|
17
17
|
|
18
18
|
def make_gemset
|
19
19
|
gemset_name = ask "Name your gemset"
|
20
|
+
ruby_version = ask "Name your gemset"
|
20
21
|
run "rvm gemset use #{gemset_name} --create"
|
21
|
-
run "touch .
|
22
|
-
run "echo #{gemset_name} >> .
|
22
|
+
run "touch .rvmrc"
|
23
|
+
run "echo #{RUBY_VERSION}@#{gemset_name} >> .rvmrc"
|
24
|
+
run "rvm rvmrc trust pwd"
|
23
25
|
end
|
24
26
|
|
25
27
|
def finish_template
|
@@ -50,7 +52,7 @@ module Suspenders
|
|
50
52
|
|
51
53
|
def customize_gemfile
|
52
54
|
build :replace_gemfile
|
53
|
-
|
55
|
+
invoke :make_gemset
|
54
56
|
bundle_command 'install'
|
55
57
|
end
|
56
58
|
|
data/lib/suspenders/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: re-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- thoughtbot
|
@@ -106,7 +106,7 @@ extra_rdoc_files:
|
|
106
106
|
- LICENSE
|
107
107
|
files:
|
108
108
|
- ".gitignore"
|
109
|
-
- ".
|
109
|
+
- ".rvmrc"
|
110
110
|
- CONTRIBUTING.md
|
111
111
|
- Gemfile
|
112
112
|
- Gemfile.lock
|
data/.ruby-gemset
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
re-rails-source
|