Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TZ indicators: UTC and ±HH:MM #56

Merged
merged 3 commits into from
Jul 27, 2011
Merged

Conversation

solidsnack
Copy link
Contributor

Kind sir, please accept these patches to allow Chronic to recognize two common TZ indicators.

This allows for a common UTC timestamp format, recognizable to `date' among
others, to be used.
@leejarvis
Copy link
Collaborator

Assuming all current tests pass, could you possibly add some more tests for these features? That way I can just merge, otherwise I'll look at this some time in the next couple of days and add tests myself.

Thanks a lot!

@solidsnack
Copy link
Contributor Author

There seems to be a problem with the tests. A clean clone from master fails in test_parse_guess_gr:

 :; git clone git://github.com/mojombo/chronic.git
Cloning into chronic...
remote: Counting objects: 2059, done.
remote: Compressing objects: 100% (955/955), done.
remote: Total 2059 (delta 1344), reused 1784 (delta 1085)
Receiving objects: 100% (2059/2059), 277.02 KiB | 338 KiB/s, done.
Resolving deltas: 100% (1344/1344), done.
 :; cd chronic/
 :; rake test                                                                   (in /home/solidsnack/sandbox/chronic/tmp/chronic)
/usr/bin/ruby1.8 -I"lib:lib:test" "/var/lib/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb" "test/test_RepeaterWeekend.rb" "test/test_RepeaterHour.rb" "test/test_Span.rb" "test/test_MiniDate.rb" "test/test_parsing.rb" "test/test_RepeaterMinute.rb" "test/test_RepeaterYear.rb" "test/test_Handler.rb" "test/test_RepeaterMonth.rb" "test/test_RepeaterTime.rb" "test/test_RepeaterFortnight.rb" "test/test_RepeaterWeek.rb" "test/test_RepeaterDayName.rb" "test/test_RepeaterWeekday.rb" "test/test_Numerizer.rb" "test/test_RepeaterSeason.rb" "test/test_Token.rb" "test/test_DaylightSavings.rb" "test/test_RepeaterMonthName.rb" "test/test_Chronic.rb"                                                                        Loaded suite /var/lib/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader        Started
............................................................F.............................................................                                      Finished in 0.434959 seconds.                                                
  1) Failure:
test_parse_guess_gr(TestParsing) [./test/test_parsing.rb:409]:
<Tue Oct 24 12:30:00 +0000 2006> expected but was
<Tue Oct 24 12:00:00 +0000 2006>.

122 tests, 506 assertions, 1 failures, 0 errors
rake aborted!
Command failed with status (1): [/usr/bin/ruby1.8 -I"lib:lib:test" "/var/li...]                                                                                                                                                                 (See full trace by running task with --trace)

This test and the one after are the only two that fail; commenting them out leads to success. I will write some some tests for the TZ stuff but I am not sure what to be done about these year tests.

@leejarvis
Copy link
Collaborator

Interesting. Could you post your ruby version and current timezone, please. Thanks for adding those tests!

@solidsnack
Copy link
Contributor Author

 :; ruby --version && date +%Z 
ruby 1.8.7 (2010-08-16 patchlevel 302) [x86_64-linux]
UTC

@leejarvis
Copy link
Collaborator

Strange, I can't reproduce this failure, and everyone I've asked can't reproduce it. I'll have a closer look at it tomorrow and merge this pull

@solidsnack
Copy link
Contributor Author

Did anyone else try on Linux?

 :; cat /etc/issue && uname -a
Ubuntu 11.04 \n \l

Linux nimbrethil 2.6.38-10-generic #46-Ubuntu SMP Tue Jun 28 15:07:17 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux

@leejarvis
Copy link
Collaborator

Hah, nice. Yeah I have a repro on Ubuntu 10.10 on a VPS. I'll look more into this tomorrow. Thanks!

leejarvis pushed a commit that referenced this pull request Jul 27, 2011
TZ indicators: UTC and ±HH:MM
@leejarvis leejarvis merged commit 0b06fc3 into mojombo:master Jul 27, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants