Skip to content

Instantly share code, notes, and snippets.

@rdp
Created March 14, 2014 13:45
Show Gist options
  • Save rdp/9547906 to your computer and use it in GitHub Desktop.
Save rdp/9547906 to your computer and use it in GitHub Desktop.
substruct 1.9'ish perhaps?
diff --git a/config/environment.rb b/config/environment.rb
index e08b1e4..7caf387 100644
--- a/config/environment.rb
+++ b/config/environment.rb
@@ -6,7 +6,7 @@
# Specifies gem version of Rails to use when vendor/rails is not present
RAILS_GEM_VERSION = '2.3.8' unless defined? RAILS_GEM_VERSION
-
+$: << '.' if RUBY_VERSION >= '1.9.0'
diff --git a/config/environment.rb b/config/environment.rb
index ca66f05..e08b1e4 100644
--- a/config/environment.rb
+++ b/config/environment.rb
@@ -6,6 +6,7 @@
# Specifies gem version of Rails to use when vendor/rails is not present
RAILS_GEM_VERSION = '2.3.8' unless defined? RAILS_GEM_VERSION
+
# Bootstrap the Rails environment, frameworks, and default configuration
require File.join(File.dirname(__FILE__), 'boot')
require File.join(File.dirname(__FILE__), '../vendor/plugins/engines/boot')
@@ -17,11 +18,30 @@ Rails::Initializer.run do |config|
# Settings in config/environments/* take precedence over those specified here
config.load_paths += %W( #{RAILS_ROOT}/vendor/plugins/substruct )
config.action_controller.session_store = :active_record_store
+
+ # It seems Rack 1.1.0 SPECIFICALLY is required by Rails 2.3.8
+ config.gem "rack", :version => '1.1.0'
- config.gem 'RedCloth'
+ config.gem 'RedCloth', :lib => 'redcloth'
config.gem 'fastercsv' if RUBY_VERSION < '1.9.0'
config.gem 'mime-types', :lib => 'mime/types'
config.gem 'mini_magick', :version => '1.3.3'
config.gem 'ezcrypto'
config.gem 'subexec'
-end
\ No newline at end of file
+
+ # All of these gems are just so we can attach inline-css styles
+ # to the order receipt HTML email! :(
+ config.gem 'css_parser'
+ config.gem 'text-hyphen', :lib => 'text/hyphen'
+ config.gem 'text-reform', :lib => 'text/reform'
+ config.gem 'htmlentities'
+ # http://github.com/SunDawg/premailer
+ config.gem 'sundawg_premailer', :lib => 'premailer'
+
+end
+
+if RUBY_VERSION >= '1.9.0'
+ # use the new CSV for CSV generation...
+ require 'csv'
+ FasterCSV = CSV
+end
diff --git a/vendor/rails/actionpack/lib/action_controller/test_process.rb b/vendor/rails/actionpack/lib/action_contro
index fd9f90b..5c4686c 100644
--- a/vendor/rails/actionpack/lib/action_controller/test_process.rb
+++ b/vendor/rails/actionpack/lib/action_controller/test_process.rb
@@ -1,4 +1,5 @@
require 'rack/session/abstract/id'
+require 'test/unit'
module ActionController #:nodoc:
class TestRequest < Request #:nodoc:
attr_accessor :cookies, :session_options
diff --git a/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb b/vendor/rail
index e050210..e2f6f3b 100644
--- a/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb
+++ b/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb
@@ -220,7 +220,7 @@ module ActiveRecord
private
def new_connection
- p 'sending', spec.adapter_method
+# p 'sending', spec.adapter_method
ActiveRecord::Base.send(spec.adapter_method, spec.config)
end
diff --git a/vendor/rails/activesupport/lib/active_support/testing/setup_and_teardown.rb b/vendor/rails/activesupport/
index aaf9f8f..10e6955 100644
--- a/vendor/rails/activesupport/lib/active_support/testing/setup_and_teardown.rb
+++ b/vendor/rails/activesupport/lib/active_support/testing/setup_and_teardown.rb
@@ -23,7 +23,7 @@ module ActiveSupport
run_callbacks :setup
result = super
rescue Exception => e
- result = runner.puke(self.class, self.name, e)
+ result = runner.puke(self.class, self.__name__, e)
ensure
begin
run_callbacks :teardown, :enumerator => :reverse_each
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment