From aa35181cee1b66b49f37f68cf9b7dd99f86d0352 Mon Sep 17 00:00:00 2001 From: Cody Cutrer Date: Fri, 22 Nov 2013 12:57:45 -0700 Subject: [PATCH] tzinfo patch no longer needed we have a newer tzinfo in our gemfile than rails has, so this method doesn't need patched (it's already been fixed) Change-Id: I2cee60da0187965f680d73dbe53a0fc751d33984 Reviewed-on: https://gerrit.instructure.com/26598 Tested-by: Jenkins Reviewed-by: Brian Palmer QA-Review: Cody Cutrer Product-Review: Cody Cutrer --- config/initializers/ruby_version_compat.rb | 32 ---------------------- 1 file changed, 32 deletions(-) diff --git a/config/initializers/ruby_version_compat.rb b/config/initializers/ruby_version_compat.rb index 9e659960703..8a40e81534e 100644 --- a/config/initializers/ruby_version_compat.rb +++ b/config/initializers/ruby_version_compat.rb @@ -37,38 +37,6 @@ if RUBY_VERSION < '2.0' end if CANVAS_RAILS2 - # See http://developer.uservoice.com/entries/how-to-upgrade-a-rails-2.3.14-app-to-ruby-1.9.3/ - # TZInfo needs to be patched. In particular, you'll need to re-implement the datetime_new! method: - require 'tzinfo' - - module TZInfo - # Methods to support different versions of Ruby. - module RubyCoreSupport #:nodoc: - HALF_DAYS_IN_DAY = rational_new!(1, 2) - - # Rails 2.3 defines datetime_new! in terms of methods that don't exist in - # Ruby 1.9.3, so we have to redefine it here - def self.datetime_new!(ajd = 0, of = 0, sg = Date::ITALY) - # Convert from an Astronomical Julian Day number to a civil Julian Day number. - jd = ajd + of + HALF_DAYS_IN_DAY - - # Ruby trunk revision 31862 changed the behaviour of DateTime.jd so that it will no - # longer accept a fractional civil Julian Day number if further arguments are specified. - # Calculate the hours, minutes and seconds to pass to jd. - - jd_i = jd.to_i - jd_i -= 1 if jd < 0 - hours = (jd - jd_i) * 24 - hours_i = hours.to_i - minutes = (hours - hours_i) * 60 - minutes_i = minutes.to_i - seconds = (minutes - minutes_i) * 60 - - DateTime.jd(jd_i, hours_i, minutes_i, seconds, of, sg) - end - end - end - require "active_support/core_ext/string/output_safety" class ERB module Util