time_crisis 0.1.8 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION.yml +2 -2
- data/lib/time_crisis.rb +5 -12
- data/lib/time_crisis/ext.rb +60 -0
- data/lib/time_crisis/support/conversions.rb +4 -0
- data/lib/time_crisis/tzinfo.rb +3 -0
- data/lib/time_crisis/tzinfo/LICENSE +21 -0
- data/lib/time_crisis/tzinfo/data_timezone.rb +27 -0
- data/lib/time_crisis/tzinfo/data_timezone_info.rb +208 -0
- data/lib/time_crisis/tzinfo/definitions/Africa/Algiers.rb +55 -0
- data/lib/time_crisis/tzinfo/definitions/Africa/Cairo.rb +219 -0
- data/lib/time_crisis/tzinfo/definitions/Africa/Casablanca.rb +42 -0
- data/lib/time_crisis/tzinfo/definitions/Africa/Harare.rb +18 -0
- data/lib/time_crisis/tzinfo/definitions/Africa/Johannesburg.rb +25 -0
- data/lib/time_crisis/tzinfo/definitions/Africa/Monrovia.rb +22 -0
- data/lib/time_crisis/tzinfo/definitions/Africa/Nairobi.rb +23 -0
- data/lib/time_crisis/tzinfo/definitions/America/Argentina/Buenos_Aires.rb +84 -0
- data/lib/time_crisis/tzinfo/definitions/America/Argentina/San_Juan.rb +86 -0
- data/lib/time_crisis/tzinfo/definitions/America/Bogota.rb +23 -0
- data/lib/time_crisis/tzinfo/definitions/America/Caracas.rb +23 -0
- data/lib/time_crisis/tzinfo/definitions/America/Chicago.rb +283 -0
- data/lib/time_crisis/tzinfo/definitions/America/Chihuahua.rb +136 -0
- data/lib/time_crisis/tzinfo/definitions/America/Denver.rb +204 -0
- data/lib/time_crisis/tzinfo/definitions/America/Godthab.rb +161 -0
- data/lib/time_crisis/tzinfo/definitions/America/Guatemala.rb +27 -0
- data/lib/time_crisis/tzinfo/definitions/America/Halifax.rb +274 -0
- data/lib/time_crisis/tzinfo/definitions/America/Indiana/Indianapolis.rb +149 -0
- data/lib/time_crisis/tzinfo/definitions/America/Juneau.rb +194 -0
- data/lib/time_crisis/tzinfo/definitions/America/La_Paz.rb +22 -0
- data/lib/time_crisis/tzinfo/definitions/America/Lima.rb +35 -0
- data/lib/time_crisis/tzinfo/definitions/America/Los_Angeles.rb +232 -0
- data/lib/time_crisis/tzinfo/definitions/America/Mazatlan.rb +139 -0
- data/lib/time_crisis/tzinfo/definitions/America/Mexico_City.rb +144 -0
- data/lib/time_crisis/tzinfo/definitions/America/Monterrey.rb +131 -0
- data/lib/time_crisis/tzinfo/definitions/America/New_York.rb +282 -0
- data/lib/time_crisis/tzinfo/definitions/America/Phoenix.rb +30 -0
- data/lib/time_crisis/tzinfo/definitions/America/Regina.rb +74 -0
- data/lib/time_crisis/tzinfo/definitions/America/Santiago.rb +205 -0
- data/lib/time_crisis/tzinfo/definitions/America/Sao_Paulo.rb +171 -0
- data/lib/time_crisis/tzinfo/definitions/America/St_Johns.rb +288 -0
- data/lib/time_crisis/tzinfo/definitions/America/Tijuana.rb +196 -0
- data/lib/time_crisis/tzinfo/definitions/Asia/Almaty.rb +67 -0
- data/lib/time_crisis/tzinfo/definitions/Asia/Baghdad.rb +73 -0
- data/lib/time_crisis/tzinfo/definitions/Asia/Baku.rb +161 -0
- data/lib/time_crisis/tzinfo/definitions/Asia/Bangkok.rb +20 -0
- data/lib/time_crisis/tzinfo/definitions/Asia/Chongqing.rb +33 -0
- data/lib/time_crisis/tzinfo/definitions/Asia/Colombo.rb +30 -0
- data/lib/time_crisis/tzinfo/definitions/Asia/Dhaka.rb +29 -0
- data/lib/time_crisis/tzinfo/definitions/Asia/Hong_Kong.rb +87 -0
- data/lib/time_crisis/tzinfo/definitions/Asia/Irkutsk.rb +165 -0
- data/lib/time_crisis/tzinfo/definitions/Asia/Jakarta.rb +30 -0
- data/lib/time_crisis/tzinfo/definitions/Asia/Jerusalem.rb +163 -0
- data/lib/time_crisis/tzinfo/definitions/Asia/Kabul.rb +20 -0
- data/lib/time_crisis/tzinfo/definitions/Asia/Kamchatka.rb +163 -0
- data/lib/time_crisis/tzinfo/definitions/Asia/Karachi.rb +114 -0
- data/lib/time_crisis/tzinfo/definitions/Asia/Kathmandu.rb +20 -0
- data/lib/time_crisis/tzinfo/definitions/Asia/Kolkata.rb +25 -0
- data/lib/time_crisis/tzinfo/definitions/Asia/Krasnoyarsk.rb +163 -0
- data/lib/time_crisis/tzinfo/definitions/Asia/Kuala_Lumpur.rb +31 -0
- data/lib/time_crisis/tzinfo/definitions/Asia/Kuwait.rb +18 -0
- data/lib/time_crisis/tzinfo/definitions/Asia/Magadan.rb +163 -0
- data/lib/time_crisis/tzinfo/definitions/Asia/Muscat.rb +18 -0
- data/lib/time_crisis/tzinfo/definitions/Asia/Novosibirsk.rb +164 -0
- data/lib/time_crisis/tzinfo/definitions/Asia/Rangoon.rb +24 -0
- data/lib/time_crisis/tzinfo/definitions/Asia/Riyadh.rb +18 -0
- data/lib/time_crisis/tzinfo/definitions/Asia/Seoul.rb +34 -0
- data/lib/time_crisis/tzinfo/definitions/Asia/Shanghai.rb +35 -0
- data/lib/time_crisis/tzinfo/definitions/Asia/Singapore.rb +33 -0
- data/lib/time_crisis/tzinfo/definitions/Asia/Taipei.rb +59 -0
- data/lib/time_crisis/tzinfo/definitions/Asia/Tashkent.rb +47 -0
- data/lib/time_crisis/tzinfo/definitions/Asia/Tbilisi.rb +78 -0
- data/lib/time_crisis/tzinfo/definitions/Asia/Tehran.rb +121 -0
- data/lib/time_crisis/tzinfo/definitions/Asia/Tokyo.rb +30 -0
- data/lib/time_crisis/tzinfo/definitions/Asia/Ulaanbaatar.rb +65 -0
- data/lib/time_crisis/tzinfo/definitions/Asia/Urumqi.rb +33 -0
- data/lib/time_crisis/tzinfo/definitions/Asia/Vladivostok.rb +164 -0
- data/lib/time_crisis/tzinfo/definitions/Asia/Yakutsk.rb +163 -0
- data/lib/time_crisis/tzinfo/definitions/Asia/Yekaterinburg.rb +165 -0
- data/lib/time_crisis/tzinfo/definitions/Asia/Yerevan.rb +165 -0
- data/lib/time_crisis/tzinfo/definitions/Atlantic/Azores.rb +270 -0
- data/lib/time_crisis/tzinfo/definitions/Atlantic/Cape_Verde.rb +23 -0
- data/lib/time_crisis/tzinfo/definitions/Atlantic/South_Georgia.rb +18 -0
- data/lib/time_crisis/tzinfo/definitions/Australia/Adelaide.rb +187 -0
- data/lib/time_crisis/tzinfo/definitions/Australia/Brisbane.rb +35 -0
- data/lib/time_crisis/tzinfo/definitions/Australia/Darwin.rb +29 -0
- data/lib/time_crisis/tzinfo/definitions/Australia/Hobart.rb +193 -0
- data/lib/time_crisis/tzinfo/definitions/Australia/Melbourne.rb +185 -0
- data/lib/time_crisis/tzinfo/definitions/Australia/Perth.rb +37 -0
- data/lib/time_crisis/tzinfo/definitions/Australia/Sydney.rb +185 -0
- data/lib/time_crisis/tzinfo/definitions/Etc/UTC.rb +16 -0
- data/lib/time_crisis/tzinfo/definitions/Europe/Amsterdam.rb +228 -0
- data/lib/time_crisis/tzinfo/definitions/Europe/Athens.rb +185 -0
- data/lib/time_crisis/tzinfo/definitions/Europe/Belgrade.rb +163 -0
- data/lib/time_crisis/tzinfo/definitions/Europe/Berlin.rb +188 -0
- data/lib/time_crisis/tzinfo/definitions/Europe/Bratislava.rb +13 -0
- data/lib/time_crisis/tzinfo/definitions/Europe/Brussels.rb +232 -0
- data/lib/time_crisis/tzinfo/definitions/Europe/Bucharest.rb +181 -0
- data/lib/time_crisis/tzinfo/definitions/Europe/Budapest.rb +197 -0
- data/lib/time_crisis/tzinfo/definitions/Europe/Copenhagen.rb +179 -0
- data/lib/time_crisis/tzinfo/definitions/Europe/Dublin.rb +276 -0
- data/lib/time_crisis/tzinfo/definitions/Europe/Helsinki.rb +163 -0
- data/lib/time_crisis/tzinfo/definitions/Europe/Istanbul.rb +218 -0
- data/lib/time_crisis/tzinfo/definitions/Europe/Kiev.rb +168 -0
- data/lib/time_crisis/tzinfo/definitions/Europe/Lisbon.rb +268 -0
- data/lib/time_crisis/tzinfo/definitions/Europe/Ljubljana.rb +13 -0
- data/lib/time_crisis/tzinfo/definitions/Europe/London.rb +288 -0
- data/lib/time_crisis/tzinfo/definitions/Europe/Madrid.rb +211 -0
- data/lib/time_crisis/tzinfo/definitions/Europe/Minsk.rb +170 -0
- data/lib/time_crisis/tzinfo/definitions/Europe/Moscow.rb +181 -0
- data/lib/time_crisis/tzinfo/definitions/Europe/Paris.rb +232 -0
- data/lib/time_crisis/tzinfo/definitions/Europe/Prague.rb +187 -0
- data/lib/time_crisis/tzinfo/definitions/Europe/Riga.rb +176 -0
- data/lib/time_crisis/tzinfo/definitions/Europe/Rome.rb +215 -0
- data/lib/time_crisis/tzinfo/definitions/Europe/Sarajevo.rb +13 -0
- data/lib/time_crisis/tzinfo/definitions/Europe/Skopje.rb +13 -0
- data/lib/time_crisis/tzinfo/definitions/Europe/Sofia.rb +173 -0
- data/lib/time_crisis/tzinfo/definitions/Europe/Stockholm.rb +165 -0
- data/lib/time_crisis/tzinfo/definitions/Europe/Tallinn.rb +172 -0
- data/lib/time_crisis/tzinfo/definitions/Europe/Vienna.rb +183 -0
- data/lib/time_crisis/tzinfo/definitions/Europe/Vilnius.rb +170 -0
- data/lib/time_crisis/tzinfo/definitions/Europe/Warsaw.rb +212 -0
- data/lib/time_crisis/tzinfo/definitions/Europe/Zagreb.rb +13 -0
- data/lib/time_crisis/tzinfo/definitions/Pacific/Auckland.rb +202 -0
- data/lib/time_crisis/tzinfo/definitions/Pacific/Fiji.rb +23 -0
- data/lib/time_crisis/tzinfo/definitions/Pacific/Guam.rb +22 -0
- data/lib/time_crisis/tzinfo/definitions/Pacific/Honolulu.rb +28 -0
- data/lib/time_crisis/tzinfo/definitions/Pacific/Majuro.rb +20 -0
- data/lib/time_crisis/tzinfo/definitions/Pacific/Midway.rb +25 -0
- data/lib/time_crisis/tzinfo/definitions/Pacific/Noumea.rb +25 -0
- data/lib/time_crisis/tzinfo/definitions/Pacific/Pago_Pago.rb +26 -0
- data/lib/time_crisis/tzinfo/definitions/Pacific/Port_Moresby.rb +20 -0
- data/lib/time_crisis/tzinfo/definitions/Pacific/Tongatapu.rb +27 -0
- data/lib/time_crisis/tzinfo/info_timezone.rb +32 -0
- data/lib/time_crisis/tzinfo/linked_timezone.rb +32 -0
- data/lib/time_crisis/tzinfo/linked_timezone_info.rb +24 -0
- data/lib/time_crisis/tzinfo/offset_rationals.rb +79 -0
- data/lib/time_crisis/tzinfo/ruby_core_support.rb +33 -0
- data/lib/time_crisis/tzinfo/time_or_datetime.rb +309 -0
- data/lib/time_crisis/tzinfo/timezone.rb +486 -0
- data/lib/time_crisis/tzinfo/timezone_definition.rb +36 -0
- data/lib/time_crisis/tzinfo/timezone_info.rb +20 -0
- data/lib/time_crisis/tzinfo/timezone_offset_info.rb +75 -0
- data/lib/time_crisis/tzinfo/timezone_period.rb +179 -0
- data/lib/time_crisis/tzinfo/timezone_transition_info.rb +109 -0
- data/time_crisis.gemspec +142 -2
- metadata +142 -2
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'time_crisis/tzinfo/data_timezone_info'
|
2
|
+
require 'time_crisis/tzinfo/linked_timezone_info'
|
3
|
+
|
4
|
+
module TimeCrisis
|
5
|
+
module TZInfo
|
6
|
+
|
7
|
+
# TimezoneDefinition is included into Timezone definition modules.
|
8
|
+
# TimezoneDefinition provides the methods for defining timezones.
|
9
|
+
module TimezoneDefinition #:nodoc:
|
10
|
+
# Add class methods to the includee.
|
11
|
+
def self.append_features(base)
|
12
|
+
super
|
13
|
+
base.extend(ClassMethods)
|
14
|
+
end
|
15
|
+
|
16
|
+
# Class methods for inclusion.
|
17
|
+
module ClassMethods #:nodoc:
|
18
|
+
# Returns and yields a DataTimezoneInfo object to define a timezone.
|
19
|
+
def timezone(identifier)
|
20
|
+
yield @timezone = DataTimezoneInfo.new(identifier)
|
21
|
+
end
|
22
|
+
|
23
|
+
# Defines a linked timezone.
|
24
|
+
def linked_timezone(identifier, link_to_identifier)
|
25
|
+
@timezone = LinkedTimezoneInfo.new(identifier, link_to_identifier)
|
26
|
+
end
|
27
|
+
|
28
|
+
# Returns the last TimezoneInfo to be defined with timezone or
|
29
|
+
# linked_timezone.
|
30
|
+
def get
|
31
|
+
@timezone
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module TimeCrisis
|
2
|
+
module TZInfo
|
3
|
+
# Represents a timezone defined in a data module.
|
4
|
+
class TimezoneInfo #:nodoc:
|
5
|
+
|
6
|
+
# The timezone identifier.
|
7
|
+
attr_reader :identifier
|
8
|
+
|
9
|
+
# Constructs a new TimezoneInfo with an identifier.
|
10
|
+
def initialize(identifier)
|
11
|
+
@identifier = identifier
|
12
|
+
end
|
13
|
+
|
14
|
+
# Returns internal object state as a programmer-readable string.
|
15
|
+
def inspect
|
16
|
+
"#<#{self.class}: #@identifier>"
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,75 @@
|
|
1
|
+
module TimeCrisis
|
2
|
+
module TZInfo
|
3
|
+
# Represents an offset defined in a Timezone data file.
|
4
|
+
class TimezoneOffsetInfo #:nodoc:
|
5
|
+
# The base offset of the timezone from UTC in seconds.
|
6
|
+
attr_reader :utc_offset
|
7
|
+
|
8
|
+
# The offset from standard time for the zone in seconds (i.e. non-zero if
|
9
|
+
# daylight savings is being observed).
|
10
|
+
attr_reader :std_offset
|
11
|
+
|
12
|
+
# The total offset of this observance from UTC in seconds
|
13
|
+
# (utc_offset + std_offset).
|
14
|
+
attr_reader :utc_total_offset
|
15
|
+
|
16
|
+
# The abbreviation that identifies this observance, e.g. "GMT"
|
17
|
+
# (Greenwich Mean Time) or "BST" (British Summer Time) for "Europe/London". The returned identifier is a
|
18
|
+
# symbol.
|
19
|
+
attr_reader :abbreviation
|
20
|
+
|
21
|
+
# Constructs a new TimezoneOffsetInfo. utc_offset and std_offset are
|
22
|
+
# specified in seconds.
|
23
|
+
def initialize(utc_offset, std_offset, abbreviation)
|
24
|
+
@utc_offset = utc_offset
|
25
|
+
@std_offset = std_offset
|
26
|
+
@abbreviation = abbreviation
|
27
|
+
|
28
|
+
@utc_total_offset = @utc_offset + @std_offset
|
29
|
+
end
|
30
|
+
|
31
|
+
# True if std_offset is non-zero.
|
32
|
+
def dst?
|
33
|
+
@std_offset != 0
|
34
|
+
end
|
35
|
+
|
36
|
+
# Converts a UTC DateTime to local time based on the offset of this period.
|
37
|
+
def to_local(utc)
|
38
|
+
TimeOrDateTime.wrap(utc) {|wrapped|
|
39
|
+
wrapped + @utc_total_offset
|
40
|
+
}
|
41
|
+
end
|
42
|
+
|
43
|
+
# Converts a local DateTime to UTC based on the offset of this period.
|
44
|
+
def to_utc(local)
|
45
|
+
TimeOrDateTime.wrap(local) {|wrapped|
|
46
|
+
wrapped - @utc_total_offset
|
47
|
+
}
|
48
|
+
end
|
49
|
+
|
50
|
+
# Returns true if and only if toi has the same utc_offset, std_offset
|
51
|
+
# and abbreviation as this TimezoneOffsetInfo.
|
52
|
+
def ==(toi)
|
53
|
+
toi.respond_to?(:utc_offset) && toi.respond_to?(:std_offset) && toi.respond_to?(:abbreviation) &&
|
54
|
+
utc_offset == toi.utc_offset && std_offset == toi.std_offset && abbreviation == toi.abbreviation
|
55
|
+
end
|
56
|
+
|
57
|
+
# Returns true if and only if toi has the same utc_offset, std_offset
|
58
|
+
# and abbreviation as this TimezoneOffsetInfo.
|
59
|
+
def eql?(toi)
|
60
|
+
self == toi
|
61
|
+
end
|
62
|
+
|
63
|
+
# Returns a hash of this TimezoneOffsetInfo.
|
64
|
+
def hash
|
65
|
+
utc_offset.hash ^ std_offset.hash ^ abbreviation.hash
|
66
|
+
end
|
67
|
+
|
68
|
+
# Returns internal object state as a programmer-readable string.
|
69
|
+
def inspect
|
70
|
+
"#<#{self.class}: #@utc_offset,#@std_offset,#@abbreviation>"
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
end
|
@@ -0,0 +1,179 @@
|
|
1
|
+
require 'time_crisis/tzinfo/offset_rationals'
|
2
|
+
require 'time_crisis/tzinfo/time_or_datetime'
|
3
|
+
|
4
|
+
module TimeCrisis
|
5
|
+
module TZInfo
|
6
|
+
# A period of time in a timezone where the same offset from UTC applies.
|
7
|
+
#
|
8
|
+
# All the methods that take times accept instances of Time, DateTime or
|
9
|
+
# integer timestamps.
|
10
|
+
class TimezonePeriod
|
11
|
+
# The TimezoneTransitionInfo that defines the start of this TimezonePeriod
|
12
|
+
# (may be nil if unbounded).
|
13
|
+
attr_reader :start_transition
|
14
|
+
|
15
|
+
# The TimezoneTransitionInfo that defines the end of this TimezonePeriod
|
16
|
+
# (may be nil if unbounded).
|
17
|
+
attr_reader :end_transition
|
18
|
+
|
19
|
+
# The TimezoneOffsetInfo for this period.
|
20
|
+
attr_reader :offset
|
21
|
+
|
22
|
+
# Initializes a new TimezonePeriod.
|
23
|
+
def initialize(start_transition, end_transition, offset = nil)
|
24
|
+
@start_transition = start_transition
|
25
|
+
@end_transition = end_transition
|
26
|
+
|
27
|
+
if offset
|
28
|
+
raise ArgumentError, 'Offset specified with transitions' if @start_transition || @end_transition
|
29
|
+
@offset = offset
|
30
|
+
else
|
31
|
+
if @start_transition
|
32
|
+
@offset = @start_transition.offset
|
33
|
+
elsif @end_transition
|
34
|
+
@offset = @end_transition.previous_offset
|
35
|
+
else
|
36
|
+
raise ArgumentError, 'No offset specified and no transitions to determine it from'
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
@utc_total_offset_rational = nil
|
41
|
+
end
|
42
|
+
|
43
|
+
# Base offset of the timezone from UTC (seconds).
|
44
|
+
def utc_offset
|
45
|
+
@offset.utc_offset
|
46
|
+
end
|
47
|
+
|
48
|
+
# Offset from the local time where daylight savings is in effect (seconds).
|
49
|
+
# E.g.: utc_offset could be -5 hours. Normally, std_offset would be 0.
|
50
|
+
# During daylight savings, std_offset would typically become +1 hours.
|
51
|
+
def std_offset
|
52
|
+
@offset.std_offset
|
53
|
+
end
|
54
|
+
|
55
|
+
# The identifier of this period, e.g. "GMT" (Greenwich Mean Time) or "BST"
|
56
|
+
# (British Summer Time) for "Europe/London". The returned identifier is a
|
57
|
+
# symbol.
|
58
|
+
def abbreviation
|
59
|
+
@offset.abbreviation
|
60
|
+
end
|
61
|
+
|
62
|
+
alias :zone_identifier :abbreviation
|
63
|
+
|
64
|
+
# Total offset from UTC (seconds). Equal to utc_offset + std_offset.
|
65
|
+
def utc_total_offset
|
66
|
+
@offset.utc_total_offset
|
67
|
+
end
|
68
|
+
|
69
|
+
# Total offset from UTC (days). Result is a Rational.
|
70
|
+
def utc_total_offset_rational
|
71
|
+
unless @utc_total_offset_rational
|
72
|
+
@utc_total_offset_rational = OffsetRationals.rational_for_offset(utc_total_offset)
|
73
|
+
end
|
74
|
+
@utc_total_offset_rational
|
75
|
+
end
|
76
|
+
|
77
|
+
# The start time of the period in UTC as a DateTime. May be nil if unbounded.
|
78
|
+
def utc_start
|
79
|
+
@start_transition ? @start_transition.at.to_datetime : nil
|
80
|
+
end
|
81
|
+
|
82
|
+
# The end time of the period in UTC as a DateTime. May be nil if unbounded.
|
83
|
+
def utc_end
|
84
|
+
@end_transition ? @end_transition.at.to_datetime : nil
|
85
|
+
end
|
86
|
+
|
87
|
+
# The start time of the period in local time as a DateTime. May be nil if
|
88
|
+
# unbounded.
|
89
|
+
def local_start
|
90
|
+
@start_transition ? @start_transition.local_start.to_datetime : nil
|
91
|
+
end
|
92
|
+
|
93
|
+
# The end time of the period in local time as a DateTime. May be nil if
|
94
|
+
# unbounded.
|
95
|
+
def local_end
|
96
|
+
@end_transition ? @end_transition.local_end.to_datetime : nil
|
97
|
+
end
|
98
|
+
|
99
|
+
# true if daylight savings is in effect for this period; otherwise false.
|
100
|
+
def dst?
|
101
|
+
@offset.dst?
|
102
|
+
end
|
103
|
+
|
104
|
+
# true if this period is valid for the given UTC DateTime; otherwise false.
|
105
|
+
def valid_for_utc?(utc)
|
106
|
+
utc_after_start?(utc) && utc_before_end?(utc)
|
107
|
+
end
|
108
|
+
|
109
|
+
# true if the given UTC DateTime is after the start of the period
|
110
|
+
# (inclusive); otherwise false.
|
111
|
+
def utc_after_start?(utc)
|
112
|
+
!@start_transition || @start_transition.at <= utc
|
113
|
+
end
|
114
|
+
|
115
|
+
# true if the given UTC DateTime is before the end of the period
|
116
|
+
# (exclusive); otherwise false.
|
117
|
+
def utc_before_end?(utc)
|
118
|
+
!@end_transition || @end_transition.at > utc
|
119
|
+
end
|
120
|
+
|
121
|
+
# true if this period is valid for the given local DateTime; otherwise false.
|
122
|
+
def valid_for_local?(local)
|
123
|
+
local_after_start?(local) && local_before_end?(local)
|
124
|
+
end
|
125
|
+
|
126
|
+
# true if the given local DateTime is after the start of the period
|
127
|
+
# (inclusive); otherwise false.
|
128
|
+
def local_after_start?(local)
|
129
|
+
!@start_transition || @start_transition.local_start <= local
|
130
|
+
end
|
131
|
+
|
132
|
+
# true if the given local DateTime is before the end of the period
|
133
|
+
# (exclusive); otherwise false.
|
134
|
+
def local_before_end?(local)
|
135
|
+
!@end_transition || @end_transition.local_end > local
|
136
|
+
end
|
137
|
+
|
138
|
+
# Converts a UTC DateTime to local time based on the offset of this period.
|
139
|
+
def to_local(utc)
|
140
|
+
@offset.to_local(utc)
|
141
|
+
end
|
142
|
+
|
143
|
+
# Converts a local DateTime to UTC based on the offset of this period.
|
144
|
+
def to_utc(local)
|
145
|
+
@offset.to_utc(local)
|
146
|
+
end
|
147
|
+
|
148
|
+
# Returns true if this TimezonePeriod is equal to p. This compares the
|
149
|
+
# start_transition, end_transition and offset using ==.
|
150
|
+
def ==(p)
|
151
|
+
p.respond_to?(:start_transition) && p.respond_to?(:end_transition) &&
|
152
|
+
p.respond_to?(:offset) && start_transition == p.start_transition &&
|
153
|
+
end_transition == p.end_transition && offset == p.offset
|
154
|
+
end
|
155
|
+
|
156
|
+
# Returns true if this TimezonePeriods is equal to p. This compares the
|
157
|
+
# start_transition, end_transition and offset using eql?
|
158
|
+
def eql?(p)
|
159
|
+
p.respond_to?(:start_transition) && p.respond_to?(:end_transition) &&
|
160
|
+
p.respond_to?(:offset) && start_transition.eql?(p.start_transition) &&
|
161
|
+
end_transition.eql?(p.end_transition) && offset.eql?(p.offset)
|
162
|
+
end
|
163
|
+
|
164
|
+
# Returns a hash of this TimezonePeriod.
|
165
|
+
def hash
|
166
|
+
result = @start_transition.hash ^ @end_transition.hash
|
167
|
+
result ^= @offset.hash unless @start_transition || @end_transition
|
168
|
+
result
|
169
|
+
end
|
170
|
+
|
171
|
+
# Returns internal object state as a programmer-readable string.
|
172
|
+
def inspect
|
173
|
+
result = "#<#{self.class}: #{@start_transition.inspect},#{@end_transition.inspect}"
|
174
|
+
result << ",#{@offset.inspect}>" unless @start_transition || @end_transition
|
175
|
+
result + '>'
|
176
|
+
end
|
177
|
+
end
|
178
|
+
end
|
179
|
+
end
|
@@ -0,0 +1,109 @@
|
|
1
|
+
require 'time_crisis/tzinfo/time_or_datetime'
|
2
|
+
|
3
|
+
module TimeCrisis
|
4
|
+
module TZInfo
|
5
|
+
# Represents an offset defined in a Timezone data file.
|
6
|
+
class TimezoneTransitionInfo #:nodoc:
|
7
|
+
# The offset this transition changes to (a TimezoneOffsetInfo instance).
|
8
|
+
attr_reader :offset
|
9
|
+
|
10
|
+
# The offset this transition changes from (a TimezoneOffsetInfo instance).
|
11
|
+
attr_reader :previous_offset
|
12
|
+
|
13
|
+
# The numerator of the DateTime if the transition time is defined as a
|
14
|
+
# DateTime, otherwise the transition time as a timestamp.
|
15
|
+
attr_reader :numerator_or_time
|
16
|
+
protected :numerator_or_time
|
17
|
+
|
18
|
+
# Either the denominotor of the DateTime if the transition time is defined
|
19
|
+
# as a DateTime, otherwise nil.
|
20
|
+
attr_reader :denominator
|
21
|
+
protected :denominator
|
22
|
+
|
23
|
+
# Creates a new TimezoneTransitionInfo with the given offset,
|
24
|
+
# previous_offset (both TimezoneOffsetInfo instances) and UTC time.
|
25
|
+
# if denominator is nil, numerator_or_time is treated as a number of
|
26
|
+
# seconds since the epoch. If denominator is specified numerator_or_time
|
27
|
+
# and denominator are used to create a DateTime as follows:
|
28
|
+
#
|
29
|
+
# DateTime.new!(Rational.send(:new!, numerator_or_time, denominator), 0, Date::ITALY)
|
30
|
+
#
|
31
|
+
# For performance reasons, the numerator and denominator must be specified
|
32
|
+
# in their lowest form.
|
33
|
+
def initialize(offset, previous_offset, numerator_or_time, denominator = nil)
|
34
|
+
@offset = offset
|
35
|
+
@previous_offset = previous_offset
|
36
|
+
@numerator_or_time = numerator_or_time
|
37
|
+
@denominator = denominator
|
38
|
+
|
39
|
+
@at = nil
|
40
|
+
@local_end = nil
|
41
|
+
@local_start = nil
|
42
|
+
end
|
43
|
+
|
44
|
+
# A TimeOrDateTime instance representing the UTC time when this transition
|
45
|
+
# occurs.
|
46
|
+
def at
|
47
|
+
unless @at
|
48
|
+
unless @denominator
|
49
|
+
@at = TimeOrDateTime.new(@numerator_or_time)
|
50
|
+
else
|
51
|
+
r = RubyCoreSupport.rational_new!(@numerator_or_time, @denominator)
|
52
|
+
dt = RubyCoreSupport.datetime_new!(r, 0, (::Date::ITALY rescue 2299161))
|
53
|
+
@at = TimeOrDateTime.new(dt)
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
@at
|
58
|
+
end
|
59
|
+
|
60
|
+
# A TimeOrDateTime instance representing the local time when this transition
|
61
|
+
# causes the previous observance to end (calculated from at using
|
62
|
+
# previous_offset).
|
63
|
+
def local_end
|
64
|
+
@local_end = at.add_with_convert(@previous_offset.utc_total_offset) unless @local_end
|
65
|
+
@local_end
|
66
|
+
end
|
67
|
+
|
68
|
+
# A TimeOrDateTime instance representing the local time when this transition
|
69
|
+
# causes the next observance to start (calculated from at using offset).
|
70
|
+
def local_start
|
71
|
+
@local_start = at.add_with_convert(@offset.utc_total_offset) unless @local_start
|
72
|
+
@local_start
|
73
|
+
end
|
74
|
+
|
75
|
+
# Returns true if this TimezoneTransitionInfo is equal to the given
|
76
|
+
# TimezoneTransitionInfo. Two TimezoneTransitionInfo instances are
|
77
|
+
# considered to be equal by == if offset, previous_offset and at are all
|
78
|
+
# equal.
|
79
|
+
def ==(tti)
|
80
|
+
tti.respond_to?(:offset) && tti.respond_to?(:previous_offset) && tti.respond_to?(:at) &&
|
81
|
+
offset == tti.offset && previous_offset == tti.previous_offset && at == tti.at
|
82
|
+
end
|
83
|
+
|
84
|
+
# Returns true if this TimezoneTransitionInfo is equal to the given
|
85
|
+
# TimezoneTransitionInfo. Two TimezoneTransitionInfo instances are
|
86
|
+
# considered to be equal by eql? if offset, previous_offset,
|
87
|
+
# numerator_or_time and denominator are all equal. This is stronger than ==,
|
88
|
+
# which just requires the at times to be equal regardless of how they were
|
89
|
+
# originally specified.
|
90
|
+
def eql?(tti)
|
91
|
+
tti.respond_to?(:offset) && tti.respond_to?(:previous_offset) &&
|
92
|
+
tti.respond_to?(:numerator_or_time) && tti.respond_to?(:denominator) &&
|
93
|
+
offset == tti.offset && previous_offset == tti.previous_offset &&
|
94
|
+
numerator_or_time == tti.numerator_or_time && denominator == tti.denominator
|
95
|
+
end
|
96
|
+
|
97
|
+
# Returns a hash of this TimezoneTransitionInfo instance.
|
98
|
+
def hash
|
99
|
+
@offset.hash ^ @previous_offset.hash ^ @numerator_or_time.hash ^ @denominator.hash
|
100
|
+
end
|
101
|
+
|
102
|
+
# Returns internal object state as a programmer-readable string.
|
103
|
+
def inspect
|
104
|
+
"#<#{self.class}: #{at.inspect},#{@offset.inspect}>"
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
end
|
data/time_crisis.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{time_crisis}
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.2.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Travis Tilley"]
|
12
|
-
s.date = %q{2009-12-
|
12
|
+
s.date = %q{2009-12-23}
|
13
13
|
s.description = %q{date and time related extensions}
|
14
14
|
s.email = %q{ttilley@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -31,6 +31,7 @@ Gem::Specification.new do |s|
|
|
31
31
|
"lib/third_base/datetime.rb",
|
32
32
|
"lib/time_crisis.rb",
|
33
33
|
"lib/time_crisis/date_range.rb",
|
34
|
+
"lib/time_crisis/ext.rb",
|
34
35
|
"lib/time_crisis/holiday.rb",
|
35
36
|
"lib/time_crisis/meteorological_seasons.rb",
|
36
37
|
"lib/time_crisis/named_months.rb",
|
@@ -42,6 +43,145 @@ Gem::Specification.new do |s|
|
|
42
43
|
"lib/time_crisis/support/conversions.rb",
|
43
44
|
"lib/time_crisis/support/current.rb",
|
44
45
|
"lib/time_crisis/support/readable_inspect.rb",
|
46
|
+
"lib/time_crisis/tzinfo.rb",
|
47
|
+
"lib/time_crisis/tzinfo/LICENSE",
|
48
|
+
"lib/time_crisis/tzinfo/data_timezone.rb",
|
49
|
+
"lib/time_crisis/tzinfo/data_timezone_info.rb",
|
50
|
+
"lib/time_crisis/tzinfo/definitions/Africa/Algiers.rb",
|
51
|
+
"lib/time_crisis/tzinfo/definitions/Africa/Cairo.rb",
|
52
|
+
"lib/time_crisis/tzinfo/definitions/Africa/Casablanca.rb",
|
53
|
+
"lib/time_crisis/tzinfo/definitions/Africa/Harare.rb",
|
54
|
+
"lib/time_crisis/tzinfo/definitions/Africa/Johannesburg.rb",
|
55
|
+
"lib/time_crisis/tzinfo/definitions/Africa/Monrovia.rb",
|
56
|
+
"lib/time_crisis/tzinfo/definitions/Africa/Nairobi.rb",
|
57
|
+
"lib/time_crisis/tzinfo/definitions/America/Argentina/Buenos_Aires.rb",
|
58
|
+
"lib/time_crisis/tzinfo/definitions/America/Argentina/San_Juan.rb",
|
59
|
+
"lib/time_crisis/tzinfo/definitions/America/Bogota.rb",
|
60
|
+
"lib/time_crisis/tzinfo/definitions/America/Caracas.rb",
|
61
|
+
"lib/time_crisis/tzinfo/definitions/America/Chicago.rb",
|
62
|
+
"lib/time_crisis/tzinfo/definitions/America/Chihuahua.rb",
|
63
|
+
"lib/time_crisis/tzinfo/definitions/America/Denver.rb",
|
64
|
+
"lib/time_crisis/tzinfo/definitions/America/Godthab.rb",
|
65
|
+
"lib/time_crisis/tzinfo/definitions/America/Guatemala.rb",
|
66
|
+
"lib/time_crisis/tzinfo/definitions/America/Halifax.rb",
|
67
|
+
"lib/time_crisis/tzinfo/definitions/America/Indiana/Indianapolis.rb",
|
68
|
+
"lib/time_crisis/tzinfo/definitions/America/Juneau.rb",
|
69
|
+
"lib/time_crisis/tzinfo/definitions/America/La_Paz.rb",
|
70
|
+
"lib/time_crisis/tzinfo/definitions/America/Lima.rb",
|
71
|
+
"lib/time_crisis/tzinfo/definitions/America/Los_Angeles.rb",
|
72
|
+
"lib/time_crisis/tzinfo/definitions/America/Mazatlan.rb",
|
73
|
+
"lib/time_crisis/tzinfo/definitions/America/Mexico_City.rb",
|
74
|
+
"lib/time_crisis/tzinfo/definitions/America/Monterrey.rb",
|
75
|
+
"lib/time_crisis/tzinfo/definitions/America/New_York.rb",
|
76
|
+
"lib/time_crisis/tzinfo/definitions/America/Phoenix.rb",
|
77
|
+
"lib/time_crisis/tzinfo/definitions/America/Regina.rb",
|
78
|
+
"lib/time_crisis/tzinfo/definitions/America/Santiago.rb",
|
79
|
+
"lib/time_crisis/tzinfo/definitions/America/Sao_Paulo.rb",
|
80
|
+
"lib/time_crisis/tzinfo/definitions/America/St_Johns.rb",
|
81
|
+
"lib/time_crisis/tzinfo/definitions/America/Tijuana.rb",
|
82
|
+
"lib/time_crisis/tzinfo/definitions/Asia/Almaty.rb",
|
83
|
+
"lib/time_crisis/tzinfo/definitions/Asia/Baghdad.rb",
|
84
|
+
"lib/time_crisis/tzinfo/definitions/Asia/Baku.rb",
|
85
|
+
"lib/time_crisis/tzinfo/definitions/Asia/Bangkok.rb",
|
86
|
+
"lib/time_crisis/tzinfo/definitions/Asia/Chongqing.rb",
|
87
|
+
"lib/time_crisis/tzinfo/definitions/Asia/Colombo.rb",
|
88
|
+
"lib/time_crisis/tzinfo/definitions/Asia/Dhaka.rb",
|
89
|
+
"lib/time_crisis/tzinfo/definitions/Asia/Hong_Kong.rb",
|
90
|
+
"lib/time_crisis/tzinfo/definitions/Asia/Irkutsk.rb",
|
91
|
+
"lib/time_crisis/tzinfo/definitions/Asia/Jakarta.rb",
|
92
|
+
"lib/time_crisis/tzinfo/definitions/Asia/Jerusalem.rb",
|
93
|
+
"lib/time_crisis/tzinfo/definitions/Asia/Kabul.rb",
|
94
|
+
"lib/time_crisis/tzinfo/definitions/Asia/Kamchatka.rb",
|
95
|
+
"lib/time_crisis/tzinfo/definitions/Asia/Karachi.rb",
|
96
|
+
"lib/time_crisis/tzinfo/definitions/Asia/Kathmandu.rb",
|
97
|
+
"lib/time_crisis/tzinfo/definitions/Asia/Kolkata.rb",
|
98
|
+
"lib/time_crisis/tzinfo/definitions/Asia/Krasnoyarsk.rb",
|
99
|
+
"lib/time_crisis/tzinfo/definitions/Asia/Kuala_Lumpur.rb",
|
100
|
+
"lib/time_crisis/tzinfo/definitions/Asia/Kuwait.rb",
|
101
|
+
"lib/time_crisis/tzinfo/definitions/Asia/Magadan.rb",
|
102
|
+
"lib/time_crisis/tzinfo/definitions/Asia/Muscat.rb",
|
103
|
+
"lib/time_crisis/tzinfo/definitions/Asia/Novosibirsk.rb",
|
104
|
+
"lib/time_crisis/tzinfo/definitions/Asia/Rangoon.rb",
|
105
|
+
"lib/time_crisis/tzinfo/definitions/Asia/Riyadh.rb",
|
106
|
+
"lib/time_crisis/tzinfo/definitions/Asia/Seoul.rb",
|
107
|
+
"lib/time_crisis/tzinfo/definitions/Asia/Shanghai.rb",
|
108
|
+
"lib/time_crisis/tzinfo/definitions/Asia/Singapore.rb",
|
109
|
+
"lib/time_crisis/tzinfo/definitions/Asia/Taipei.rb",
|
110
|
+
"lib/time_crisis/tzinfo/definitions/Asia/Tashkent.rb",
|
111
|
+
"lib/time_crisis/tzinfo/definitions/Asia/Tbilisi.rb",
|
112
|
+
"lib/time_crisis/tzinfo/definitions/Asia/Tehran.rb",
|
113
|
+
"lib/time_crisis/tzinfo/definitions/Asia/Tokyo.rb",
|
114
|
+
"lib/time_crisis/tzinfo/definitions/Asia/Ulaanbaatar.rb",
|
115
|
+
"lib/time_crisis/tzinfo/definitions/Asia/Urumqi.rb",
|
116
|
+
"lib/time_crisis/tzinfo/definitions/Asia/Vladivostok.rb",
|
117
|
+
"lib/time_crisis/tzinfo/definitions/Asia/Yakutsk.rb",
|
118
|
+
"lib/time_crisis/tzinfo/definitions/Asia/Yekaterinburg.rb",
|
119
|
+
"lib/time_crisis/tzinfo/definitions/Asia/Yerevan.rb",
|
120
|
+
"lib/time_crisis/tzinfo/definitions/Atlantic/Azores.rb",
|
121
|
+
"lib/time_crisis/tzinfo/definitions/Atlantic/Cape_Verde.rb",
|
122
|
+
"lib/time_crisis/tzinfo/definitions/Atlantic/South_Georgia.rb",
|
123
|
+
"lib/time_crisis/tzinfo/definitions/Australia/Adelaide.rb",
|
124
|
+
"lib/time_crisis/tzinfo/definitions/Australia/Brisbane.rb",
|
125
|
+
"lib/time_crisis/tzinfo/definitions/Australia/Darwin.rb",
|
126
|
+
"lib/time_crisis/tzinfo/definitions/Australia/Hobart.rb",
|
127
|
+
"lib/time_crisis/tzinfo/definitions/Australia/Melbourne.rb",
|
128
|
+
"lib/time_crisis/tzinfo/definitions/Australia/Perth.rb",
|
129
|
+
"lib/time_crisis/tzinfo/definitions/Australia/Sydney.rb",
|
130
|
+
"lib/time_crisis/tzinfo/definitions/Etc/UTC.rb",
|
131
|
+
"lib/time_crisis/tzinfo/definitions/Europe/Amsterdam.rb",
|
132
|
+
"lib/time_crisis/tzinfo/definitions/Europe/Athens.rb",
|
133
|
+
"lib/time_crisis/tzinfo/definitions/Europe/Belgrade.rb",
|
134
|
+
"lib/time_crisis/tzinfo/definitions/Europe/Berlin.rb",
|
135
|
+
"lib/time_crisis/tzinfo/definitions/Europe/Bratislava.rb",
|
136
|
+
"lib/time_crisis/tzinfo/definitions/Europe/Brussels.rb",
|
137
|
+
"lib/time_crisis/tzinfo/definitions/Europe/Bucharest.rb",
|
138
|
+
"lib/time_crisis/tzinfo/definitions/Europe/Budapest.rb",
|
139
|
+
"lib/time_crisis/tzinfo/definitions/Europe/Copenhagen.rb",
|
140
|
+
"lib/time_crisis/tzinfo/definitions/Europe/Dublin.rb",
|
141
|
+
"lib/time_crisis/tzinfo/definitions/Europe/Helsinki.rb",
|
142
|
+
"lib/time_crisis/tzinfo/definitions/Europe/Istanbul.rb",
|
143
|
+
"lib/time_crisis/tzinfo/definitions/Europe/Kiev.rb",
|
144
|
+
"lib/time_crisis/tzinfo/definitions/Europe/Lisbon.rb",
|
145
|
+
"lib/time_crisis/tzinfo/definitions/Europe/Ljubljana.rb",
|
146
|
+
"lib/time_crisis/tzinfo/definitions/Europe/London.rb",
|
147
|
+
"lib/time_crisis/tzinfo/definitions/Europe/Madrid.rb",
|
148
|
+
"lib/time_crisis/tzinfo/definitions/Europe/Minsk.rb",
|
149
|
+
"lib/time_crisis/tzinfo/definitions/Europe/Moscow.rb",
|
150
|
+
"lib/time_crisis/tzinfo/definitions/Europe/Paris.rb",
|
151
|
+
"lib/time_crisis/tzinfo/definitions/Europe/Prague.rb",
|
152
|
+
"lib/time_crisis/tzinfo/definitions/Europe/Riga.rb",
|
153
|
+
"lib/time_crisis/tzinfo/definitions/Europe/Rome.rb",
|
154
|
+
"lib/time_crisis/tzinfo/definitions/Europe/Sarajevo.rb",
|
155
|
+
"lib/time_crisis/tzinfo/definitions/Europe/Skopje.rb",
|
156
|
+
"lib/time_crisis/tzinfo/definitions/Europe/Sofia.rb",
|
157
|
+
"lib/time_crisis/tzinfo/definitions/Europe/Stockholm.rb",
|
158
|
+
"lib/time_crisis/tzinfo/definitions/Europe/Tallinn.rb",
|
159
|
+
"lib/time_crisis/tzinfo/definitions/Europe/Vienna.rb",
|
160
|
+
"lib/time_crisis/tzinfo/definitions/Europe/Vilnius.rb",
|
161
|
+
"lib/time_crisis/tzinfo/definitions/Europe/Warsaw.rb",
|
162
|
+
"lib/time_crisis/tzinfo/definitions/Europe/Zagreb.rb",
|
163
|
+
"lib/time_crisis/tzinfo/definitions/Pacific/Auckland.rb",
|
164
|
+
"lib/time_crisis/tzinfo/definitions/Pacific/Fiji.rb",
|
165
|
+
"lib/time_crisis/tzinfo/definitions/Pacific/Guam.rb",
|
166
|
+
"lib/time_crisis/tzinfo/definitions/Pacific/Honolulu.rb",
|
167
|
+
"lib/time_crisis/tzinfo/definitions/Pacific/Majuro.rb",
|
168
|
+
"lib/time_crisis/tzinfo/definitions/Pacific/Midway.rb",
|
169
|
+
"lib/time_crisis/tzinfo/definitions/Pacific/Noumea.rb",
|
170
|
+
"lib/time_crisis/tzinfo/definitions/Pacific/Pago_Pago.rb",
|
171
|
+
"lib/time_crisis/tzinfo/definitions/Pacific/Port_Moresby.rb",
|
172
|
+
"lib/time_crisis/tzinfo/definitions/Pacific/Tongatapu.rb",
|
173
|
+
"lib/time_crisis/tzinfo/info_timezone.rb",
|
174
|
+
"lib/time_crisis/tzinfo/linked_timezone.rb",
|
175
|
+
"lib/time_crisis/tzinfo/linked_timezone_info.rb",
|
176
|
+
"lib/time_crisis/tzinfo/offset_rationals.rb",
|
177
|
+
"lib/time_crisis/tzinfo/ruby_core_support.rb",
|
178
|
+
"lib/time_crisis/tzinfo/time_or_datetime.rb",
|
179
|
+
"lib/time_crisis/tzinfo/timezone.rb",
|
180
|
+
"lib/time_crisis/tzinfo/timezone_definition.rb",
|
181
|
+
"lib/time_crisis/tzinfo/timezone_info.rb",
|
182
|
+
"lib/time_crisis/tzinfo/timezone_offset_info.rb",
|
183
|
+
"lib/time_crisis/tzinfo/timezone_period.rb",
|
184
|
+
"lib/time_crisis/tzinfo/timezone_transition_info.rb",
|
45
185
|
"lib/time_crisis/weekend.rb",
|
46
186
|
"test/test_helper.rb",
|
47
187
|
"test/time_crisis_test.rb",
|