lib/tzinfo/timezone.rb in tzinfo-0.3.20 vs lib/tzinfo/timezone.rb in tzinfo-0.3.21
- old
+ new
@@ -1,7 +1,7 @@
#--
-# Copyright (c) 2005-2006 Philip Ross
+# Copyright (c) 2005-2010 Philip Ross
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@@ -19,13 +19,10 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#++
require 'date'
-require 'tzinfo/country'
-require 'tzinfo/time_or_datetime'
-require 'tzinfo/timezone_period'
module TZInfo
# Indicate a specified time in a local timezone has more than one
# possible time in UTC. This happens when switching from daylight savings time
# to normal time where the clocks are rolled back. Thrown by period_for_local
@@ -76,10 +73,10 @@
#
# Raises InvalidTimezoneIdentifier if the timezone couldn't be found.
def self.get(identifier)
instance = @@loaded_zones[identifier]
unless instance
- raise InvalidTimezoneIdentifier, 'Invalid identifier' if identifier !~ /^[A-z0-9\+\-_]+(\/[A-z0-9\+\-_]+)*$/
+ raise InvalidTimezoneIdentifier, 'Invalid identifier' if identifier !~ /^[A-Za-z0-9\+\-_]+(\/[A-Za-z0-9\+\-_]+)*$/
identifier = identifier.gsub(/-/, '__m__').gsub(/\+/, '__p__')
begin
# Use a temporary variable to avoid an rdoc warning
file = "tzinfo/definitions/#{identifier}".untaint
require file