Bundle install has not been working, largely because nobody has
really
used it in months. The main purpose of this patch is to get that back
to working, and the app to start. In the process, it has added partial
fixes to get everything working on Rails 3.2. There are some remaining
issues to be vetted by the community, but this patch gets us closer to
working there (where 'there' == non-rpm environment).
The reason for this disparity is that fedora and rhel have altered the
gemspec for 1 or more of our gem deps, so that versions that cannot coexist
in the ruby world can do so in rpmland. The earliest version of Rails that
works with the newer rack that the rack-restful_submit gem needs is the
3.2 series. All tests and functionality should continue to work on our
current development platforms (rpm distros), but this also gets us a good
chunk of the way to supporting the newest Rails, which we want to move to
at some point anyway.
---
src/Gemfile.in | 11 +-
src/Gemfile.lock | 226 +++++++++++---------
src/app/views/layouts/error.html.haml | 3 +
src/config/application.rb | 9 +-
src/config/environments/development.rb | 4 +-
src/config/initializers/forms_helper.rb | 14 ++
src/features/step_definitions/pool_family_steps.rb | 2 +-
src/features/support/vcr.rb | 4 +-
src/spec/vcr_setup_norec.rb | 3 -
9 files changed, 153 insertions(+), 123 deletions(-)
create mode 100644 src/app/views/layouts/error.html.haml
create mode 100644 src/config/initializers/forms_helper.rb
diff --git a/src/Gemfile.in b/src/Gemfile.in
index c0a86f4..079151d 100644
--- a/src/Gemfile.in
+++ b/src/Gemfile.in
@@ -1,6 +1,6 @@
source :rubygems
-gem 'rails', '>= 3.0.7'
+gem 'rails'
gem 'deltacloud-client', :require => 'deltacloud'
gem 'sass'
@@ -17,22 +17,23 @@ gem 'thin'
gem 'json'
gem 'rails_warden'
gem 'ruby-net-ldap', :require => 'net/ldap'
-gem 'aeolus-image', :require => 'aeolus_image'
+gem 'aeolus-image', '>= 0.4.0', :require =>
'aeolus_image'
gem 'oauth'
-gem 'delayed_job'
+gem 'delayed_job', '~> 2.1.4'
gem 'paranoia'
+
platforms :ruby_18 do
gem 'fastercsv'
end
group :development, :test do
gem 'rspec-rails'
- gem 'factory_girl_rails'
+ gem 'factory_girl_rails', '~> 1.4.0'
gem 'timecop'
gem 'capybara'
gem 'cucumber'
gem 'cucumber-rails', :require => false
gem 'database_cleaner'
- gem 'vcr'
+ gem 'vcr', '< 2.0.0'
gem 'webmock'
gem 'launchy'
end
diff --git a/src/Gemfile.lock b/src/Gemfile.lock
index 132f5b5..715d214 100644
--- a/src/Gemfile.lock
+++ b/src/Gemfile.lock
@@ -1,127 +1,137 @@
GEM
remote:
http://rubygems.org/
specs:
- abstract (1.0.0)
- actionmailer (3.0.10)
- actionpack (= 3.0.10)
- mail (~> 2.3.0)
- actionpack (3.0.10)
- activemodel (= 3.0.10)
- activesupport (= 3.0.10)
- builder (~> 2.1.2)
- erubis (~> 2.6.6)
- i18n (~> 0.5.0)
- rack (>= 1.2.1)
- rack-mount (>= 0.6.14)
- rack-test (>= 0.5.4)
- tzinfo (~> 0.3.23)
- activemodel (3.0.10)
- activesupport (= 3.0.10)
- builder (~> 2.1.2)
- i18n (~> 0.5.0)
- activerecord (3.0.10)
- activemodel (= 3.0.10)
- activesupport (= 3.0.10)
- arel (~> 2.0.9)
- tzinfo (~> 0.3.23)
- activeresource (3.0.10)
- activemodel (= 3.0.10)
- activesupport (= 3.0.10)
- activesupport (3.0.10)
- addressable (2.2.6)
+ actionmailer (3.2.3)
+ actionpack (= 3.2.3)
+ mail (~> 2.4.4)
+ actionpack (3.2.3)
+ activemodel (= 3.2.3)
+ activesupport (= 3.2.3)
+ builder (~> 3.0.0)
+ erubis (~> 2.7.0)
+ journey (~> 1.0.1)
+ rack (~> 1.4.0)
+ rack-cache (~> 1.2)
+ rack-test (~> 0.6.1)
+ sprockets (~> 2.1.2)
+ activemodel (3.2.3)
+ activesupport (= 3.2.3)
+ builder (~> 3.0.0)
+ activerecord (3.2.3)
+ activemodel (= 3.2.3)
+ activesupport (= 3.2.3)
+ arel (~> 3.0.2)
+ tzinfo (~> 0.3.29)
+ activeresource (3.2.3)
+ activemodel (= 3.2.3)
+ activesupport (= 3.2.3)
+ activesupport (3.2.3)
+ i18n (~> 0.6)
+ multi_json (~> 1.0)
+ addressable (2.2.8)
aeolus-image (0.4.0)
- activeresource (~> 3.0.10)
+ activeresource (>= 3.0.10)
nokogiri (>= 0.4.0)
oauth
rest-client
- arel (2.0.9)
- builder (2.1.2)
- capybara (1.1.1)
+ arel (3.0.2)
+ builder (3.0.0)
+ capybara (1.1.2)
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
rack-test (>= 0.5.4)
selenium-webdriver (~> 2.0)
xpath (~> 0.1.4)
- childprocess (0.2.0)
+ childprocess (0.3.2)
ffi (~> 1.0.6)
- crack (0.1.8)
- cucumber (1.0.1)
+ crack (0.3.1)
+ cucumber (1.2.0)
builder (>= 2.1.2)
- diff-lcs (>= 1.1.2)
- gherkin (~> 2.4.5)
+ diff-lcs (>= 1.1.3)
+ gherkin (~> 2.10.0)
json (>= 1.4.6)
- term-ansicolor (>= 1.0.5)
- cucumber-rails (1.0.2)
- capybara (>= 1.0.0)
- cucumber (~> 1.0.0)
- nokogiri (>= 1.4.6)
- daemons (1.0.10)
- database_cleaner (0.6.6)
+ cucumber-rails (1.3.0)
+ capybara (>= 1.1.2)
+ cucumber (>= 1.1.8)
+ nokogiri (>= 1.5.0)
+ daemons (1.1.8)
+ database_cleaner (0.7.2)
delayed_job (2.1.4)
activesupport (~> 3.0)
daemons
deltacloud-client (0.5.0)
nokogiri (>= 1.4.3)
rest-client (>= 1.6.1)
- diff-lcs (1.1.2)
- erubis (2.6.6)
- abstract (>= 1.0.0)
+ diff-lcs (1.1.3)
+ erubis (2.7.0)
eventmachine (0.12.10)
factory_girl (2.3.2)
activesupport
factory_girl_rails (1.4.0)
factory_girl (~> 2.3.0)
railties (>= 3.0.0)
- fastercsv (1.5.4)
- ffi (1.0.9)
- gherkin (2.4.5)
+ fastercsv (1.5.5)
+ ffi (1.0.11)
+ gherkin (2.10.0)
json (>= 1.4.6)
- haml (3.1.2)
- i18n (0.5.0)
- json (1.4.6)
- json_pure (1.5.1)
- launchy (2.0.5)
+ haml (3.1.6)
+ hike (1.2.1)
+ i18n (0.6.0)
+ journey (1.0.3)
+ json (1.7.3)
+ launchy (2.1.0)
addressable (~> 2.2.6)
- mail (2.3.0)
+ libwebsocket (0.1.3)
+ addressable
+ mail (2.4.4)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
- mime-types (1.16)
+ mime-types (1.18)
+ multi_json (1.3.5)
mustache (0.99.4)
nokogiri (1.5.2)
- oauth (0.4.4)
- pg (0.11.0)
- polyglot (0.3.1)
- rack (1.3.0)
- rack-mount (0.7.1)
- rack (>= 1.0.0)
- regin (>= 0.3.7)
- rack-restful_submit (1.2.1)
- rack (~> 1.3.0)
- rack-test (0.6.0)
+ oauth (0.4.6)
+ paranoia (1.1.0)
+ activerecord (>= 3.0.0)
+ pg (0.13.2)
+ polyglot (0.3.3)
+ rack (1.4.1)
+ rack-cache (1.2)
+ rack (>= 0.4)
+ rack-restful_submit (1.2.2)
+ rack (~> 1.3)
+ rack-ssl (1.3.2)
+ rack
+ rack-test (0.6.1)
rack (>= 1.0)
- rails (3.0.10)
- actionmailer (= 3.0.10)
- actionpack (= 3.0.10)
- activerecord (= 3.0.10)
- activeresource (= 3.0.10)
- activesupport (= 3.0.10)
+ rails (3.2.3)
+ actionmailer (= 3.2.3)
+ actionpack (= 3.2.3)
+ activerecord (= 3.2.3)
+ activeresource (= 3.2.3)
+ activesupport (= 3.2.3)
bundler (~> 1.0)
- railties (= 3.0.10)
- rails_warden (0.5.5)
+ railties (= 3.2.3)
+ rails_warden (0.5.6)
warden (>= 1.0.0)
- railties (3.0.10)
- actionpack (= 3.0.10)
- activesupport (= 3.0.10)
+ railties (3.2.3)
+ actionpack (= 3.2.3)
+ activesupport (= 3.2.3)
+ rack-ssl (~> 1.3.2)
rake (>= 0.8.7)
rdoc (~> 3.4)
- thor (~> 0.14.4)
+ thor (~> 0.14.6)
rake (0.9.2.2)
- rdoc (3.8)
- regin (0.3.8)
- rest-client (1.6.1)
+ rdoc (3.12)
+ json (~> 1.4)
+ rest-client (1.6.7)
mime-types (>= 1.16)
+ rspec (2.6.0)
+ rspec-core (~> 2.6.0)
+ rspec-expectations (~> 2.6.0)
+ rspec-mocks (~> 2.6.0)
rspec-core (2.6.4)
rspec-expectations (2.6.0)
diff-lcs (~> 1.1.2)
@@ -130,38 +140,41 @@ GEM
actionpack (~> 3.0)
activesupport (~> 3.0)
railties (~> 3.0)
- rspec-core (~> 2.6.0)
- rspec-expectations (~> 2.6.0)
- rspec-mocks (~> 2.6.0)
+ rspec (~> 2.6.0)
ruby-net-ldap (0.0.4)
- rubyzip (0.9.4)
- sass (3.1.7)
- selenium-webdriver (2.3.2)
- childprocess (>= 0.1.9)
- ffi (>= 1.0.7)
- json_pure
+ rubyzip (0.9.8)
+ sass (3.1.18)
+ selenium-webdriver (2.21.2)
+ childprocess (>= 0.2.5)
+ ffi (~> 1.0)
+ libwebsocket (~> 0.1.3)
+ multi_json (~> 1.0)
rubyzip
- simple-navigation (3.0.0)
+ simple-navigation (3.7.0)
activesupport (>= 2.3.2)
- term-ansicolor (1.0.7)
- thin (1.2.11)
+ sprockets (2.1.3)
+ hike (~> 1.2)
+ rack (~> 1.0)
+ tilt (~> 1.1, != 1.3.0)
+ thin (1.3.1)
daemons (>= 1.0.9)
eventmachine (>= 0.12.6)
rack (>= 1.0.0)
thor (0.14.6)
+ tilt (1.3.3)
timecop (0.3.5)
treetop (1.4.10)
polyglot
polyglot (>= 0.3.1)
- tzinfo (0.3.26)
- uuidtools (2.1.1)
- vcr (1.10.0)
- warden (1.0.5)
+ tzinfo (0.3.33)
+ uuidtools (2.1.2)
+ vcr (1.11.3)
+ warden (1.2.0)
rack (>= 1.0)
- webmock (1.7.6)
- addressable (~> 2.2,> 2.2.5)
+ webmock (1.8.7)
+ addressable (>= 2.2.7)
crack (>= 0.1.7)
- will_paginate (3.0.pre2)
+ will_paginate (3.0.3)
xpath (0.1.4)
nokogiri (~> 1.3)
@@ -169,14 +182,14 @@ PLATFORMS
ruby
DEPENDENCIES
- aeolus-image
+ aeolus-image (>= 0.4.0)
capybara
cucumber
cucumber-rails
database_cleaner
- delayed_job
+ delayed_job (~> 2.1.4)
deltacloud-client
- factory_girl_rails
+ factory_girl_rails (~> 1.4.0)
fastercsv
haml
json
@@ -184,9 +197,10 @@ DEPENDENCIES
mustache
nokogiri
oauth
+ paranoia
pg
rack-restful_submit
- rails (>= 3.0.7)
+ rails
rails_warden
rest-client
rspec-rails
@@ -196,6 +210,6 @@ DEPENDENCIES
thin
timecop
uuidtools
- vcr
+ vcr (< 2.0.0)
webmock
will_paginate (>= 3.0.pre1)
diff --git a/src/app/views/layouts/error.html.haml
b/src/app/views/layouts/error.html.haml
new file mode 100644
index 0000000..3c12a6a
--- /dev/null
+++ b/src/app/views/layouts/error.html.haml
@@ -0,0 +1,3 @@
+- content_for :title do
+ = title
+= errmsg
diff --git a/src/config/application.rb b/src/config/application.rb
index adc5a64..cbc26f2 100644
--- a/src/config/application.rb
+++ b/src/config/application.rb
@@ -69,17 +69,16 @@ module Conductor
config.filter_parameters += [:password, :password_confirmation]
#field_with_errors should be span instead of div
-
#http://www.rabbitcreative.com/2010/09/20/rails-3-still-fucking-up-field_with_errors/
- ActionView::Base.field_error_proc = Proc.new do |html_tag, instance|
- include ActionView::Helpers::RawOutputHelper
- raw %(<span class="field_with_errors">#{html_tag}</span>)
+ config.action_view.field_error_proc = Proc.new do |html_tag, instance|
+ "<span
class=\"field_with_errors\">#{html_tag}</span>".html_safe
end
config.after_initialize do
Haml::Template.options[:format] = :html5
end
- config.middleware.use Rack::RestfulSubmit
+ #config.middleware.swap Rack::MethodOverride, Rack::RestfulSubmit
+ config.middleware.insert_before(Rack::MethodOverride, Rack::RestfulSubmit)
ActiveRecord::Base.include_root_in_json = false
end
end
diff --git a/src/config/environments/development.rb
b/src/config/environments/development.rb
index 421d53c..63d175a 100644
--- a/src/config/environments/development.rb
+++ b/src/config/environments/development.rb
@@ -14,6 +14,8 @@
# limitations under the License.
#
+require 'sass/plugin'
+
Conductor::Application.configure do
# Settings specified here will take precedence over those in config/environment.rb
@@ -27,7 +29,7 @@ Conductor::Application.configure do
# Show full error reports and disable caching
config.consider_all_requests_local = true
- config.action_view.debug_rjs = true
+ #config.action_view.debug_rjs = true
config.action_controller.perform_caching = false
# Don't care if the mailer can't send
diff --git a/src/config/initializers/forms_helper.rb
b/src/config/initializers/forms_helper.rb
new file mode 100644
index 0000000..044478a
--- /dev/null
+++ b/src/config/initializers/forms_helper.rb
@@ -0,0 +1,14 @@
+# This adds back in the id to the generated html for the submit tag, as it
+# was in Rails 3.0.x. We use this id, and it keeps our app compatible between
+# Rais versions
+
+class ActionView::Helpers::FormBuilder
+
+ def submit(value=nil, options={})
+ value, options = nil, value if value.is_a?(Hash)
+ value ||= submit_default_value
+ @template.submit_tag(value,
+ options.reverse_merge(:id =>
"#{object_name}_submit"))
+ end
+
+end
diff --git a/src/features/step_definitions/pool_family_steps.rb
b/src/features/step_definitions/pool_family_steps.rb
index c2d3a34..dc316ab 100644
--- a/src/features/step_definitions/pool_family_steps.rb
+++ b/src/features/step_definitions/pool_family_steps.rb
@@ -15,7 +15,7 @@
#
Given /I'm connected to the warehouse/ do
- use_casette('pool_families')
+ use_cassette('pool_families')
end
Given /^there are these pool families:$/ do |table|
diff --git a/src/features/support/vcr.rb b/src/features/support/vcr.rb
index fed2072..633b2e9 100644
--- a/src/features/support/vcr.rb
+++ b/src/features/support/vcr.rb
@@ -20,8 +20,8 @@ else
require File.expand_path(File.dirname(__FILE__) +
'../../../spec/vcr_setup_norec.rb')
end
-def use_casette(casette)
- path = "#{::Rails.root.to_s}/spec/vcr/cassettes/features/#{casette}.yml"
+def use_cassette(cassette)
+ path = "#{::Rails.root.to_s}/spec/vcr/cassettes/features/#{cassette}.yml"
VCR.config do |c|
c.cassette_library_dir = File.dirname(path)
c.stub_with :webmock
diff --git a/src/spec/vcr_setup_norec.rb b/src/spec/vcr_setup_norec.rb
index 506cf71..b62a980 100644
--- a/src/spec/vcr_setup_norec.rb
+++ b/src/spec/vcr_setup_norec.rb
@@ -46,9 +46,6 @@ file = merge_cassettes
VCR.config do |c|
c.cassette_library_dir = File.dirname(file.path)
c.stub_with :webmock
- # FIXME: This is necessary because the setup for each test will reset the database
and
- # invoke db:seed, which triggers Solr to reindex the newly-created objects, which
- # is done over an HTTP request...
c.allow_http_connections_when_no_cassette = true
end
ACK. Great job!