Skip to content

Instantly share code, notes, and snippets.

@rsutphin
Created June 25, 2012 19:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rsutphin/2990831 to your computer and use it in GitHub Desktop.
Save rsutphin/2990831 to your computer and use it in GitHub Desktop.
Demonstrates an issue with selective core_ext and Time.=== on ActiveSupport 3.2.4-3.2.6
ACTIVESUPPORT_SOURCE = ARGV.pop
if ACTIVESUPPORT_SOURCE
if File.directory?(ACTIVESUPPORT_SOURCE)
puts "Using ActiveSupport from #{ACTIVESUPPORT_SOURCE}"
$LOAD_PATH << ACTIVESUPPORT_SOURCE
else ACTIVESUPPORT_SOURCE
puts "Using ActiveSupport gem version #{ACTIVESUPPORT_SOURCE}"
require 'rubygems'
gem 'activesupport', ACTIVESUPPORT_SOURCE
end
else
require 'rubygems' # use whatever's automatically loaded
end
require 'active_support/core_ext/string'
begin
Time === 'foo'
puts "No problem"
rescue => e
puts "Failed.\n#{e.class}: #{e}"
puts e.backtrace.join("\n ")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment