... today ... 2009-3-25 ... it's broken.
$ cat foo.rbSeems simple enough, right? I mean Hebruby is in the current list of gems today, and it's not like we change the calendaring system everyday.
require 'rubygems'
require 'hebruby'
# the 24th
@day = Date.new(2009, 3, 24)
@hb = Hebruby::HebrewDate.new(@day)
puts @day.to_s + " = " + @hb.heb_date
# the 26th
@day = Date.new(2009, 3, 26)
@hb = Hebruby::HebrewDate.new(@day)
puts @day.to_s + " = " + @hb.heb_date
# the 25th ???
@day = Date.new(2009, 3, 25)
@hb = Hebruby::HebrewDate.new(@day)
puts @day.to_s + " = " + @hb.heb_date
# gem list Hebruby --details --remoteYou cant make this stuff up.
Hebruby (1.2.1)
Author: Ron Evans
Homepage: http://www.deadprogrammersociety.com
Hebruby is a Ruby library to convert julian dates to hebrew dates,
and vice-versa.
$ ruby foo.rbI guess there is no word in Hebrew for "coincidence"?2009-03-24 = כ"ז באדר התשס"ט2009-03-26 = א' בניסן התשס"ט/usr/lib/ruby/gems/1.8/gems/Hebruby-1.2.1/lib/hebruby.rb:101:in `heb_date': undefined method `+' for nil:NilClass (NoMethodError)
from foo.rb:17
$
5 comments:
Ouch! Sounds like I need to take a look at the Hebruby gem. It has not been updated in a while, but since the Hebrew calendar has not changed in the last few thousand years, that should not be allowed!
Thanks. I tried to email you before blogging about it, but did not get a reply. Feel free to email me if you'd like this post removed or whatever after it's fixed.
No need to remove posts, I can live with reality. :) However, perhaps you can update this once I see what the problem is.
I have just moved the code over to Github at http://github.com/deadprogrammer/hebruby/tree/master so that should make it easier to work on, both individually and collectively.
So I finally got around to trying this again with version 2.0.2 and it worked as follows:
$ ruby foo.rb
2009-03-24 = כ"ז באדר התשס"ט
2009-03-26 = א' בניסן התשס"ט
2009-03-25 = כ"ט באדר התשס"ט
Thanks, Ron.
So it is functional, if only I could verify that the Hebrew dates are correct.
Is there a way to get it to print out the Torah Portions and the Holidays? I was using HebCal (Written in C) on PHP pages but I am switching the site over to Rails and wondered how to do that.
Thanks for the Gem.
Post a Comment