chronic 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,7 @@
1
+ = 0.2.2
2
+
3
+ * added missing files (damn you manifest!)
4
+
1
5
  = 0.2.1
2
6
 
3
7
  * fixed time overflow issue
data/Manifest.txt CHANGED
@@ -26,6 +26,7 @@ lib/chronic/repeaters/repeater_weekend.rb
26
26
  lib/chronic/repeaters/repeater_year.rb
27
27
  lib/chronic/scalar.rb
28
28
  lib/chronic/separator.rb
29
+ lib/chronic/time_zone.rb
29
30
  lib/numerizer/numerizer.rb
30
31
  test/suite.rb
31
32
  test/test_Chronic.rb
@@ -41,5 +42,6 @@ test/test_RepeaterWeek.rb
41
42
  test/test_RepeaterWeekend.rb
42
43
  test/test_RepeaterYear.rb
43
44
  test/test_Span.rb
45
+ test/test_Time.rb
44
46
  test/test_Token.rb
45
47
  test/test_parsing.rb
data/lib/chronic.rb CHANGED
@@ -39,7 +39,7 @@ require 'chronic/time_zone'
39
39
  require 'numerizer/numerizer'
40
40
 
41
41
  module Chronic
42
- VERSION = "0.2.1"
42
+ VERSION = "0.2.2"
43
43
 
44
44
  def self.debug; false; end
45
45
  end
@@ -0,0 +1,22 @@
1
+ module Chronic
2
+ class TimeZone < Tag #:nodoc:
3
+ def self.scan(tokens)
4
+ tokens.each_index do |i|
5
+ if t = self.scan_for_all(tokens[i]) then tokens[i].tag(t); next end
6
+ end
7
+ tokens
8
+ end
9
+
10
+ def self.scan_for_all(token)
11
+ scanner = {/[PMCE][DS]T/i => :tz}
12
+ scanner.keys.each do |scanner_item|
13
+ return self.new(scanner[scanner_item]) if scanner_item =~ token.word
14
+ end
15
+ return nil
16
+ end
17
+
18
+ def to_s
19
+ 'timezone'
20
+ end
21
+ end
22
+ end
metadata CHANGED
@@ -3,7 +3,7 @@ rubygems_version: 0.9.0
3
3
  specification_version: 1
4
4
  name: chronic
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.2.1
6
+ version: 0.2.2
7
7
  date: 2007-04-21 00:00:00 -07:00
8
8
  summary: A natural language date parser
9
9
  require_paths:
@@ -57,6 +57,7 @@ files:
57
57
  - lib/chronic/repeaters/repeater_year.rb
58
58
  - lib/chronic/scalar.rb
59
59
  - lib/chronic/separator.rb
60
+ - lib/chronic/time_zone.rb
60
61
  - lib/numerizer/numerizer.rb
61
62
  - test/suite.rb
62
63
  - test/test_Chronic.rb
@@ -72,6 +73,7 @@ files:
72
73
  - test/test_RepeaterWeekend.rb
73
74
  - test/test_RepeaterYear.rb
74
75
  - test/test_Span.rb
76
+ - test/test_Time.rb
75
77
  - test/test_Token.rb
76
78
  - test/test_parsing.rb
77
79
  test_files: