Skip to content
Browse files

Upgrade to Rails 4

* Manually create .gitkeep directories. The
  `empty_directory_with_gitkeep` method is removed in Railties 4.
* Remove custom strong_parameters gem. Rails 4 includes it by default.
* Fix syntax. Syntastic reported an issue with some regular expressions.
  • Loading branch information...
1 parent 4565d00 commit 142bafd796d3b00b49f20975f200ee92872c8b99 @croaky croaky committed Jul 7, 2013
View
128 Gemfile.lock
@@ -4,106 +4,102 @@ PATH
suspenders (1.3.0)
bundler (~> 1.3)
hub (~> 1.10)
- rails (= 3.2.13)
+ rails (= 4.0.0)
GEM
remote: https://rubygems.org/
specs:
- actionmailer (3.2.13)
- actionpack (= 3.2.13)
+ actionmailer (4.0.0)
+ actionpack (= 4.0.0)
mail (~> 2.5.3)
- actionpack (3.2.13)
- activemodel (= 3.2.13)
- activesupport (= 3.2.13)
- builder (~> 3.0.0)
+ actionpack (4.0.0)
+ activesupport (= 4.0.0)
+ builder (~> 3.1.0)
erubis (~> 2.7.0)
- journey (~> 1.0.4)
- rack (~> 1.4.5)
- rack-cache (~> 1.2)
- rack-test (~> 0.6.1)
- sprockets (~> 2.2.1)
- activemodel (3.2.13)
- activesupport (= 3.2.13)
- builder (~> 3.0.0)
- activerecord (3.2.13)
- activemodel (= 3.2.13)
- activesupport (= 3.2.13)
- arel (~> 3.0.2)
- tzinfo (~> 0.3.29)
- activeresource (3.2.13)
- activemodel (= 3.2.13)
- activesupport (= 3.2.13)
- activesupport (3.2.13)
- i18n (= 0.6.1)
- multi_json (~> 1.0)
- arel (3.0.2)
- aruba (0.5.2)
- childprocess (~> 0.3.6)
+ rack (~> 1.5.2)
+ rack-test (~> 0.6.2)
+ activemodel (4.0.0)
+ activesupport (= 4.0.0)
+ builder (~> 3.1.0)
+ activerecord (4.0.0)
+ activemodel (= 4.0.0)
+ activerecord-deprecated_finders (~> 1.0.2)
+ activesupport (= 4.0.0)
+ arel (~> 4.0.0)
+ activerecord-deprecated_finders (1.0.3)
+ activesupport (4.0.0)
+ i18n (~> 0.6, >= 0.6.4)
+ minitest (~> 4.2)
+ multi_json (~> 1.3)
+ thread_safe (~> 0.1)
+ tzinfo (~> 0.3.37)
+ arel (4.0.0)
+ aruba (0.5.3)
+ childprocess (>= 0.3.6)
cucumber (>= 1.1.1)
rspec-expectations (>= 2.7.0)
- builder (3.0.4)
+ atomic (1.1.10)
+ builder (3.1.4)
childprocess (0.3.9)
ffi (~> 1.0, >= 1.0.11)
- cucumber (1.3.2)
+ cucumber (1.3.3)
builder (>= 2.1.2)
diff-lcs (>= 1.1.3)
gherkin (~> 2.12.0)
- multi_json (~> 1.3)
+ multi_json (~> 1.7.5)
+ multi_test (~> 0.0.1)
diff-lcs (1.2.4)
erubis (2.7.0)
- ffi (1.8.1)
- ffi (1.8.1-x86-mingw32)
+ ffi (1.9.0)
+ ffi (1.9.0-x86-mingw32)
gherkin (2.12.0)
multi_json (~> 1.3)
gherkin (2.12.0-x86-mingw32)
multi_json (~> 1.3)
- hike (1.2.2)
+ hike (1.2.3)
hub (1.10.6)
- i18n (0.6.1)
- journey (1.0.4)
- json (1.8.0)
- mail (2.5.3)
- i18n (>= 0.4.0)
+ i18n (0.6.4)
+ mail (2.5.4)
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.23)
- multi_json (1.7.4)
+ minitest (4.7.5)
+ multi_json (1.7.7)
+ multi_test (0.0.1)
polyglot (0.3.3)
- rack (1.4.5)
- rack-cache (1.2)
- rack (>= 0.4)
- rack-ssl (1.3.3)
- rack
+ rack (1.5.2)
rack-test (0.6.2)
rack (>= 1.0)
- rails (3.2.13)
- actionmailer (= 3.2.13)
- actionpack (= 3.2.13)
- activerecord (= 3.2.13)
- activeresource (= 3.2.13)
- activesupport (= 3.2.13)
- bundler (~> 1.0)
- railties (= 3.2.13)
- railties (3.2.13)
- actionpack (= 3.2.13)
- activesupport (= 3.2.13)
- rack-ssl (~> 1.3.2)
+ rails (4.0.0)
+ actionmailer (= 4.0.0)
+ actionpack (= 4.0.0)
+ activerecord (= 4.0.0)
+ activesupport (= 4.0.0)
+ bundler (>= 1.3.0, < 2.0)
+ railties (= 4.0.0)
+ sprockets-rails (~> 2.0.0)
+ railties (4.0.0)
+ actionpack (= 4.0.0)
+ activesupport (= 4.0.0)
rake (>= 0.8.7)
- rdoc (~> 3.4)
- thor (>= 0.14.6, < 2.0)
- rake (10.0.4)
- rdoc (3.12.2)
- json (~> 1.4)
- rspec-expectations (2.13.0)
+ thor (>= 0.18.1, < 2.0)
+ rake (10.1.0)
+ rspec-expectations (2.14.0)
diff-lcs (>= 1.1.3, < 2.0)
- sprockets (2.2.2)
+ sprockets (2.10.0)
hike (~> 1.2)
multi_json (~> 1.0)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
+ sprockets-rails (2.0.0)
+ actionpack (>= 3.0)
+ activesupport (>= 3.0)
+ sprockets (~> 2.8)
thor (0.18.1)
+ thread_safe (0.1.0)
+ atomic
tilt (1.4.1)
- treetop (1.4.12)
+ treetop (1.4.14)
polyglot
polyglot (>= 0.3.1)
tzinfo (0.3.37)
View
10 features/step_definitions/suspenders_steps.rb
@@ -28,7 +28,7 @@
run_simple "#{suspenders_bin} #{project_name}"
end
-When /^I suspend a project called "([^"]*)" with:$/ do |project_name, arguments_table|
+When %r{I suspend a project called "([^"]*)" with:} do |project_name, arguments_table|
suspenders_bin = File.expand_path(File.join('..', '..', 'bin', 'suspenders'), File.dirname(__FILE__))
arguments = arguments_table.hashes.inject([]) do |accum, argument|
accum << "#{argument['argument']}=#{argument['value']}"
@@ -49,20 +49,20 @@
}
end
-Then /^"(.*)" should not be installed$/ do |gem_name|
+Then %r{"(.*)" should not be installed} do |gem_name|
in_current_dir do
system("bundle show #{gem_name} 2>&1 > /dev/null").should be_false
end
end
-Then /^"(.*)" should not be included in "(.*)"$/ do |content, file_path|
+Then %r{"(.*)" should not be included in "(.*)"} do |content, file_path|
check_file_content file_path, content, false
end
-Then /^the "([^"]*)" Heroku app should exist$/ do |app_name|
+Then %r{the "([^"]*)" Heroku app should exist} do |app_name|
FakeHeroku.should have_created_app(app_name)
end
-Then /^the "([^"]*)" Github repo should exist$/ do |repo_name|
+Then %r{the "([^"]*)" Github repo should exist} do |repo_name|
FakeGithub.should have_created_repo(repo_name)
end
View
13 lib/suspenders/app_builder.rb
@@ -164,16 +164,6 @@ def configure_background_jobs_for_rspec
run 'rails g delayed_job:active_record'
end
- def blacklist_active_record_attributes
- replace_in_file 'config/application.rb',
- 'config.active_record.whitelist_attributes = true',
- 'config.active_record.whitelist_attributes = false'
- end
-
- def configure_strong_parameters
- copy_file 'strong_parameters.rb', 'config/initializers/strong_parameters.rb'
- end
-
def configure_time_zone
config = <<-RUBY
config.active_record.default_timezone = :utc
@@ -247,7 +237,8 @@ def gitignore_files
'spec/support/mixins',
'spec/support/shared_examples'
].each do |dir|
- empty_directory_with_gitkeep dir
+ run "mkdir #{dir}"
+ run "touch #{dir}/.gitkeep"
end
end
View
2 suspenders.gemspec
@@ -7,7 +7,7 @@ Gem::Specification.new do |s|
s.required_ruby_version = '>= 1.9.2'
s.add_dependency 'bundler', '~> 1.3'
s.add_dependency 'hub', '~> 1.10'
- s.add_dependency 'rails', '3.2.13'
+ s.add_dependency 'rails', '4.0.0'
s.add_development_dependency 'aruba', '~> 0.5.2'
s.add_development_dependency 'cucumber', '~> 1.2'
s.authors = ['thoughtbot']
View
3 templates/Gemfile_clean
@@ -9,10 +9,9 @@ gem 'high_voltage'
gem 'jquery-rails'
gem 'pg'
gem 'rack-timeout'
-gem 'rails', '>= 3.2.11'
+gem 'rails', '>= 4.0.0'
gem 'recipient_interceptor'
gem 'simple_form'
-gem 'strong_parameters'
gem 'unicorn'
group :assets do
View
1 templates/strong_parameters.rb
@@ -1 +0,0 @@
-ActiveRecord::Base.send :include, ActiveModel::ForbiddenAttributesProtection

0 comments on commit 142bafd

Please sign in to comment.
Something went wrong with that request. Please try again.