chronic 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -34,9 +34,6 @@ require 'chronic/ordinal'
34
34
  require 'chronic/separator'
35
35
 
36
36
  module Chronic
37
- @version = "0.1.3"
38
- def self.debug=(val); @debug = val; end
37
+ def self.debug; false; end
39
38
  end
40
39
 
41
- Chronic.debug = true
42
-
@@ -73,7 +73,7 @@ module Chronic
73
73
  # strip any non-tagged tokens
74
74
  @tokens = @tokens.select { |token| token.tagged? }
75
75
 
76
- if true
76
+ if Chronic.debug
77
77
  puts "+---------------------------------------------------"
78
78
  puts "| " + @tokens.to_s
79
79
  puts "+---------------------------------------------------"
@@ -35,7 +35,6 @@ module Chronic
35
35
  self.definitions[:date].each do |handler|
36
36
  if handler.match(tokens, self.definitions)
37
37
  good_tokens = tokens.select { |o| !o.get_tag Separator }
38
- puts "--#{handler}"
39
38
  return self.send(handler.handler_method, good_tokens, options)
40
39
  end
41
40
  end
@@ -68,7 +67,6 @@ module Chronic
68
67
  end
69
68
 
70
69
  # I guess you're out of luck!
71
- puts "--SUCKY"
72
70
  return nil
73
71
  end
74
72
 
@@ -289,10 +287,7 @@ module Chronic
289
287
  when :last
290
288
  outer_span = head.next(:past)
291
289
  when :this
292
- puts "--THIS"
293
- puts "--#{repeaters}"
294
290
  if repeaters.size > 0
295
- puts "--NONE"
296
291
  outer_span = head.this(:none)
297
292
  else
298
293
  outer_span = head.this(options[:context])
@@ -302,7 +297,7 @@ module Chronic
302
297
  else raise(ChronicPain, "Invalid grabber")
303
298
  end
304
299
 
305
- puts "--#{outer_span}"
300
+ puts "--#{outer_span}" if Chronic.debug
306
301
  anchor = find_within(repeaters, outer_span, pointer)
307
302
  end
308
303
 
@@ -320,7 +315,7 @@ module Chronic
320
315
  # Returns a Span representing the innermost time span
321
316
  # or nil if no repeater union could be found
322
317
  def find_within(tags, span, pointer) #:nodoc:
323
- puts "--#{span}"
318
+ puts "--#{span}" if Chronic.debug
324
319
  return span if tags.empty?
325
320
 
326
321
  head, *rest = tags
@@ -7,7 +7,6 @@ class TestParsing < Test::Unit::TestCase
7
7
  # Wed Aug 16 14:00:00 UTC 2006
8
8
  @time_2006_08_16_14_00_00 = Time.local(2006, 8, 16, 14, 0, 0, 0)
9
9
  @time_2006_08_16_03_00_00 = Time.local(2006, 8, 16, 3, 0, 0, 0)
10
- Chronic.debug = false
11
10
  end
12
11
 
13
12
  def test__parse_guess_dates
metadata CHANGED
@@ -3,7 +3,7 @@ rubygems_version: 0.8.11
3
3
  specification_version: 1
4
4
  name: chronic
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.1.3
6
+ version: 0.1.4
7
7
  date: 2006-10-20 00:00:00 -07:00
8
8
  summary: A natural language date parser
9
9
  require_paths: