timeliness 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.rdoc +3 -0
- data/lib/timeliness/parser.rb +2 -2
- data/lib/timeliness/version.rb +1 -1
- data/spec/timeliness/parser_spec.rb +12 -2
- metadata +4 -4
data/CHANGELOG.rdoc
CHANGED
data/lib/timeliness/parser.rb
CHANGED
@@ -16,8 +16,8 @@ module Timeliness
|
|
16
16
|
|
17
17
|
make_time(time_array[0..7], options[:zone])
|
18
18
|
rescue NoMethodError => ex
|
19
|
-
raise ex unless ex.message =~ /zone/
|
20
|
-
raise MissingTimezoneSupport, "ActiveSupport must be loaded to use timezones other than :utc and :local."
|
19
|
+
raise ex unless ex.message =~ /undefined method `(zone|use_zone|current)' for Time:Class/
|
20
|
+
raise MissingTimezoneSupport, "ActiveSupport timezone support must be loaded to use timezones other than :utc and :local."
|
21
21
|
end
|
22
22
|
|
23
23
|
def make_time(time_array, zone_option=nil)
|
data/lib/timeliness/version.rb
CHANGED
@@ -164,9 +164,19 @@ describe Timeliness::Parser do
|
|
164
164
|
|
165
165
|
context "without ActiveSupport loaded" do
|
166
166
|
it 'should output message' do
|
167
|
-
|
167
|
+
expect {
|
168
168
|
Time.should_receive(:zone).and_raise(NoMethodError.new("undefined method `zone' for Time:Class"))
|
169
|
-
|
169
|
+
parse("2000-06-01 12:13:14", :zone => :current)
|
170
|
+
}.should raise_error(Timeliness::Parser::MissingTimezoneSupport)
|
171
|
+
|
172
|
+
expect {
|
173
|
+
Time.should_receive(:current).and_raise(NoMethodError.new("undefined method `current' for Time:Class"))
|
174
|
+
parse("12:13:14", :zone => :current)
|
175
|
+
}.should raise_error(Timeliness::Parser::MissingTimezoneSupport)
|
176
|
+
|
177
|
+
expect {
|
178
|
+
Time.should_receive(:use_zone).and_raise(NoMethodError.new("undefined method `use_zone' for Time:Class"))
|
179
|
+
parse("2000-06-01 12:13:14", :zone => 'London')
|
170
180
|
}.should raise_error(Timeliness::Parser::MissingTimezoneSupport)
|
171
181
|
end
|
172
182
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: timeliness
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 3
|
9
|
-
-
|
10
|
-
version: 0.3.
|
9
|
+
- 2
|
10
|
+
version: 0.3.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Adam Meehan
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-11-
|
18
|
+
date: 2010-11-28 00:00:00 +11:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|