Created
June 25, 2012 19:50
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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