Skip to content

Commit

Permalink
removed verbose error checking output
Browse files Browse the repository at this point in the history
  • Loading branch information
mojombo committed Oct 20, 2006
1 parent 89360d9 commit 2929d10
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 14 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
0.1.4
* removed verbose error checking code. oops. :-/

0.1.3
* improved regexes for word variations (Josh Goebel)
* fixed a bug that caused "today at 3am" to return nil if current time is
Expand Down
2 changes: 1 addition & 1 deletion chronic.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ require 'rubygems'

SPEC = Gem::Specification.new do |s|
s.name = 'chronic'
s.version = '0.1.3'
s.version = '0.1.4'
s.author = 'Tom Preston-Werner'
s.email = 'tom@rubyisawesome.com'
s.homepage = 'http://chronic.rubyforge.org'
Expand Down
5 changes: 1 addition & 4 deletions lib/chronic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@
require 'chronic/separator'

module Chronic
@version = "0.1.3"
def self.debug=(val); @debug = val; end
def self.debug; false; end
end

Chronic.debug = true

2 changes: 1 addition & 1 deletion lib/chronic/chronic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def parse(text, specified_options = {})
# strip any non-tagged tokens
@tokens = @tokens.select { |token| token.tagged? }

if true
if Chronic.debug
puts "+---------------------------------------------------"
puts "| " + @tokens.to_s
puts "+---------------------------------------------------"
Expand Down
9 changes: 2 additions & 7 deletions lib/chronic/handlers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ def tokens_to_span(tokens, options) #:nodoc:
self.definitions[:date].each do |handler|
if handler.match(tokens, self.definitions)
good_tokens = tokens.select { |o| !o.get_tag Separator }
puts "--#{handler}"
return self.send(handler.handler_method, good_tokens, options)
end
end
Expand Down Expand Up @@ -68,7 +67,6 @@ def tokens_to_span(tokens, options) #:nodoc:
end

# I guess you're out of luck!
puts "--SUCKY"
return nil
end

Expand Down Expand Up @@ -289,10 +287,7 @@ def get_anchor(tokens, options) #:nodoc:
when :last
outer_span = head.next(:past)
when :this
puts "--THIS"
puts "--#{repeaters}"
if repeaters.size > 0
puts "--NONE"
outer_span = head.this(:none)
else
outer_span = head.this(options[:context])
Expand All @@ -302,7 +297,7 @@ def get_anchor(tokens, options) #:nodoc:
else raise(ChronicPain, "Invalid grabber")
end

puts "--#{outer_span}"
puts "--#{outer_span}" if Chronic.debug
anchor = find_within(repeaters, outer_span, pointer)
end

Expand All @@ -320,7 +315,7 @@ def get_repeaters(tokens) #:nodoc:
# Returns a Span representing the innermost time span
# or nil if no repeater union could be found
def find_within(tags, span, pointer) #:nodoc:
puts "--#{span}"
puts "--#{span}" if Chronic.debug
return span if tags.empty?

head, *rest = tags
Expand Down
1 change: 0 additions & 1 deletion test/test_parsing.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ def setup
# Wed Aug 16 14:00:00 UTC 2006
@time_2006_08_16_14_00_00 = Time.local(2006, 8, 16, 14, 0, 0, 0)
@time_2006_08_16_03_00_00 = Time.local(2006, 8, 16, 3, 0, 0, 0)
Chronic.debug = false
end

def test__parse_guess_dates
Expand Down

0 comments on commit 2929d10

Please sign in to comment.