diff --git a/lib/rails_appengine.rb b/lib/rails_appengine.rb index c6c667b..349a46a 100644 --- a/lib/rails_appengine.rb +++ b/lib/rails_appengine.rb @@ -1,4 +1,3 @@ # patches for Rails 2.3.5 to 2.3.8 -RAILS_GEM_VERSION = '2.3.5' unless defined? RAILS_GEM_VERSION require 'rails_appengine/multiparameter_assignments' require 'rails_appengine/active_support_conversions' diff --git a/lib/rails_appengine/action_mailer_vendored.rb b/lib/rails_appengine/action_mailer_vendored.rb index 6f1635f..134a14d 100644 --- a/lib/rails_appengine/action_mailer_vendored.rb +++ b/lib/rails_appengine/action_mailer_vendored.rb @@ -1,4 +1,6 @@ -am = "#{ENV['GEM_PATH']}/gems/actionmailer-" + - "#{RAILS_GEM_VERSION}/lib/action_mailer/vendor" -tmail_ver = RAILS_GEM_VERSION.eql?('2.3.5') ? 'tmail-1.2.3' : 'tmail-1.2.7' +base = nil +pre = File.dirname(__FILE__).split('/')[0..-4].join('/') + "/actionmailer-2.3" +5.upto(8) { |v| base = "#{pre}.#{v}" if File.exist?("#{pre}.#{v}") } +am = "#{base}/lib/action_mailer/vendor" +tmail_ver = base[-5..-1].eql?('2.3.5') ? 'tmail-1.2.3' : 'tmail-1.2.7' $LOAD_PATH.unshift "#{am}/#{tmail_ver}" diff --git a/lib/rails_appengine/active_support_vendored.rb b/lib/rails_appengine/active_support_vendored.rb index c7e546d..d4e83be 100644 --- a/lib/rails_appengine/active_support_vendored.rb +++ b/lib/rails_appengine/active_support_vendored.rb @@ -1,6 +1,8 @@ -as = "#{ENV['GEM_PATH']}/gems/activesupport-" + - "#{RAILS_GEM_VERSION}/lib/active_support/vendor" -i18n_ver = RAILS_GEM_VERSION.eql?('2.3.5') ? 'i18n-0.1.3/lib' : 'i18n-0.3.7' +base = nil +pre = File.dirname(__FILE__).split('/')[0..-4].join('/') + "/activesupport-2.3" +5.upto(8) { |v| base = "#{pre}.#{v}" if File.exist?("#{pre}.#{v}") } +as = "#{base}/lib/active_support/vendor" +i18n_ver = base[-5..-1].eql?('2.3.5') ? 'i18n-0.1.3/lib' : 'i18n-0.3.7' $LOAD_PATH.unshift "#{as}/builder-2.1.2" $LOAD_PATH.unshift "#{as}/memcache-client-1.7.4" $LOAD_PATH.unshift "#{as}/tzinfo-0.3.12"