re-rails 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 31b1f58d081ea561755fb7e70cebcc19f7c01f0b
4
- data.tar.gz: b7fd33845ca286f9f451c1371b93796f9a2b05e7
3
+ metadata.gz: 43719f88bb959f94ec20d1e3c42806914c480c90
4
+ data.tar.gz: 31f8c647c8d34da8ce80b70cc7464f54360c6d45
5
5
  SHA512:
6
- metadata.gz: 7c96f353dd16ac94bf4a0388bc3eeb71fb872837e9bd63f93c67df15e2b7fd332c947245ba8c37f86aadcfed5c1baec1ec35ac742fdaf9ef28fa3791e5cac64c
7
- data.tar.gz: 1d3d5d1630ecaa9a94ded5b274a1e6944b7fbe370be1246fc3d36eb67071e19ed904db5c0489ef6faded6771e89b652af7e59579d6b2ad883c70730aca20bf5f
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
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- re-rails (0.1.1)
4
+ re-rails (0.1.2)
5
5
  bundler (~> 1.3)
6
6
  rails (= 4.0.0)
7
7
 
@@ -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
- def configure_spec_support_features
164
- empty_directory_with_keep_file 'spec/features'
165
- empty_directory_with_keep_file 'spec/support/features'
166
- end
155
+ def enable_database_cleaner
156
+ copy_file 'database_cleaner_rspec.rb', 'spec/support/database_cleaner.rb'
157
+ end
167
158
 
168
- def configure_rspec
169
- remove_file 'spec/spec_helper.rb'
170
- copy_file 'spec_helper.rb', 'spec/spec_helper.rb'
171
- end
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
- def use_spring_binstubs
174
- run 'bundle exec spring binstub --all'
175
- end
176
- def configure_background_jobs_for_rspec
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
- def configure_time_zone
182
- config = <<-RUBY
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
- RUBY
186
- inject_into_class 'config/application.rb', 'Application', config
187
- end
181
+ RUBY
182
+ inject_into_class 'config/application.rb', 'Application', config
183
+ end
188
184
 
189
- def configure_time_formats
190
- remove_file 'config/locales/en.yml'
191
- copy_file 'config_locales_en.yml', 'config/locales/en.yml'
192
- end
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
- def configure_rack_timeout
195
- copy_file 'rack_timeout.rb', 'config/initializers/rack_timeout.rb'
196
- end
190
+ def configure_rack_timeout
191
+ copy_file 'rack_timeout.rb', 'config/initializers/rack_timeout.rb'
192
+ end
197
193
 
198
- def configure_action_mailer
199
- action_mailer_host 'development', "#{app_name}.local"
200
- action_mailer_host 'test', 'www.example.com'
201
- action_mailer_host 'staging', "staging.#{app_name}.com"
202
- action_mailer_host 'production', "#{app_name}.com"
203
- end
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
- def generate_rspec
206
- generate 'rspec:install'
207
- end
201
+ def generate_rspec
202
+ generate 'rspec:install'
203
+ end
208
204
 
209
- def configure_unicorn
210
- copy_file 'unicorn.rb', 'config/unicorn.rb'
211
- end
205
+ def configure_unicorn
206
+ copy_file 'unicorn.rb', 'config/unicorn.rb'
207
+ end
212
208
 
213
- def setup_foreman
214
- copy_file 'sample.env', '.sample.env'
215
- copy_file 'Procfile', 'Procfile'
216
- end
209
+ def setup_foreman
210
+ copy_file 'sample.env', '.sample.env'
211
+ copy_file 'Procfile', 'Procfile'
212
+ end
217
213
 
218
- def setup_stylesheets
219
- remove_file 'app/assets/stylesheets/application.css'
220
- copy_file 'application.css.scss',
221
- 'app/assets/stylesheets/application.css.scss'
222
- end
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
- def gitignore_files
225
- remove_file '.gitignore'
226
- copy_file 'suspenders_gitignore', '.gitignore'
227
- [
228
- 'app/views/pages',
229
- 'spec/lib',
230
- 'spec/controllers',
231
- 'spec/helpers',
232
- 'spec/support/matchers',
233
- 'spec/support/mixins',
234
- 'spec/support/shared_examples'
235
- ].each do |dir|
236
- run "mkdir #{dir}"
237
- run "touch #{dir}/.keep"
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
- def init_git
242
- run 'git init'
243
- end
237
+ def init_git
238
+ run 'git init'
239
+ end
244
240
 
245
- def create_heroku_apps
246
- path_addition = override_path_for_tests
247
- run "#{path_addition} heroku create #{app_name}-production --remote=production"
248
- run "#{path_addition} heroku create #{app_name}-staging --remote=staging"
249
- run "#{path_addition} heroku config:add RACK_ENV=staging RAILS_ENV=staging --remote=staging"
250
- end
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
- def set_heroku_remotes
253
- remotes = <<-RUBY
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
- append_file 'bin/setup', remotes
261
- end
256
+ append_file 'bin/setup', remotes
257
+ end
262
258
 
263
- def set_heroku_rails_secrets
264
- path_addition = override_path_for_tests
265
- run "#{path_addition} heroku config:add SECRET_KEY_BASE=#{generate_secret} --remote=staging"
266
- run "#{path_addition} heroku config:add SECRET_KEY_BASE=#{generate_secret} --remote=production"
267
- end
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
- def create_github_repo(repo_name)
270
- path_addition = override_path_for_tests
271
- run "#{path_addition} hub create #{repo_name}"
272
- end
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
- def copy_miscellaneous_files
275
- copy_file 'errors.rb', 'config/initializers/errors.rb'
276
- end
270
+ def copy_miscellaneous_files
271
+ copy_file 'errors.rb', 'config/initializers/errors.rb'
272
+ end
277
273
 
278
- def customize_error_pages
279
- meta_tags =<<-EOS
280
- <meta charset='utf-8' />
281
- <meta name='ROBOTS' content='NOODP' />
282
- EOS
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
- %w(500 404 422).each do |page|
285
- inject_into_file "public/#{page}.html", meta_tags, :after => "<head>\n"
286
- replace_in_file "public/#{page}.html", /<!--.+-->\n/, ''
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
- def remove_routes_comment_lines
291
- replace_in_file 'config/routes.rb',
292
- /Application\.routes\.draw do.*end/m,
293
- "Application.routes.draw do\nend"
294
- end
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
- def disable_xml_params
297
- copy_file 'disable_xml_params.rb', 'config/initializers/disable_xml_params.rb'
298
- end
292
+ def disable_xml_params
293
+ copy_file 'disable_xml_params.rb', 'config/initializers/disable_xml_params.rb'
294
+ end
299
295
 
300
- def setup_default_rake_task
301
- append_file 'Rakefile' do
302
- "task(:default).clear\ntask :default => [:spec]\n"
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
- private
302
+ private
307
303
 
308
- def override_path_for_tests
309
- if ENV['TESTING']
310
- support_bin = File.expand_path(File.join('..', '..', 'spec', 'fakes', 'bin'))
311
- "PATH=#{support_bin}:$PATH"
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
- def factories_spec_rake_task
316
- IO.read find_in_source_paths('factories_spec_rake_task.rb')
317
- end
311
+ def factories_spec_rake_task
312
+ IO.read find_in_source_paths('factories_spec_rake_task.rb')
313
+ end
318
314
 
319
- def generate_secret
320
- SecureRandom.hex(64)
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 .ruby-gemset"
22
- run "echo #{gemset_name} >> .ruby-gemset"
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
- build :set_ruby_to_version_being_used
55
+ invoke :make_gemset
54
56
  bundle_command 'install'
55
57
  end
56
58
 
@@ -1,3 +1,3 @@
1
1
  module Suspenders
2
- VERSION = '0.1.1'
2
+ VERSION = '0.1.2'
3
3
  end
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.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
- - ".ruby-gemset"
109
+ - ".rvmrc"
110
110
  - CONTRIBUTING.md
111
111
  - Gemfile
112
112
  - Gemfile.lock
data/.ruby-gemset DELETED
@@ -1 +0,0 @@
1
- re-rails-source