hebruby 2.0.3 → 2.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,5 @@
1
+ v2.0.4 Handle Jewish leap year thanks to Uri Lewin
2
+
1
3
  v2.0.3 Change to transliterated month name to Adar Sheni
2
4
 
3
5
  v2.0.2 Minor tweaks for Ruby 1.9 compatibility
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2005-2010 Ron Evans
1
+ Copyright (c) 2005-2011 Ron Evans
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/hebruby.gemspec CHANGED
@@ -2,25 +2,24 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{hebruby}
5
- s.version = "2.0.3"
5
+ s.version = "2.0.4"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
- s.authors = ["Ron Evans"]
9
- s.date = %q{2010-09-01}
8
+ s.authors = [%q{Ron Evans}]
9
+ s.date = %q{2011-06-25}
10
10
  s.description = %q{Hebruby is a Ruby library to convert julian dates to hebrew dates, and vice-versa.}
11
11
  s.email = %q{}
12
- s.extra_rdoc_files = ["CHANGELOG", "LICENSE", "README", "README.rdoc", "lib/hebruby.rb"]
13
- s.files = ["CHANGELOG", "LICENSE", "Manifest", "README", "README.rdoc", "Rakefile", "lib/hebruby.rb", "test/hebruby_tests.rb", "hebruby.gemspec"]
12
+ s.extra_rdoc_files = [%q{CHANGELOG}, %q{LICENSE}, %q{README}, %q{README.rdoc}, %q{lib/hebruby.rb}]
13
+ s.files = [%q{CHANGELOG}, %q{LICENSE}, %q{Manifest}, %q{README}, %q{README.rdoc}, %q{Rakefile}, %q{lib/hebruby.rb}, %q{test/hebruby_tests.rb}, %q{hebruby.gemspec}]
14
14
  s.homepage = %q{http://deadprogrammersociety.com/}
15
15
  s.post_install_message = %q{*** Hebruby was installed ***}
16
- s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Hebruby", "--main", "README"]
17
- s.require_paths = ["lib"]
16
+ s.rdoc_options = [%q{--line-numbers}, %q{--inline-source}, %q{--title}, %q{Hebruby}, %q{--main}, %q{README}]
17
+ s.require_paths = [%q{lib}]
18
18
  s.rubyforge_project = %q{hebruby}
19
- s.rubygems_version = %q{1.3.7}
19
+ s.rubygems_version = %q{1.8.5}
20
20
  s.summary = %q{Hebruby is a Ruby library to convert julian dates to hebrew dates, and vice-versa.}
21
21
 
22
22
  if s.respond_to? :specification_version then
23
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
24
23
  s.specification_version = 3
25
24
 
26
25
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
data/lib/hebruby.rb CHANGED
@@ -95,7 +95,11 @@ module Hebruby
95
95
 
96
96
  # Provide Hebrew month name in Hebrew letters
97
97
  def heb_month_name
98
- return HEB_MONTH_NAMES[@hm]
98
+ if HebrewDate.leap?(@hy) and @hm >= 12 # leap year and from adar
99
+ return HEB_MONTH_NAMES[@hm + 1]
100
+ else
101
+ return HEB_MONTH_NAMES[@hm]
102
+ end
99
103
  end
100
104
 
101
105
  # Provide Hebrew day of the month, in hebrew letters.
@@ -103,6 +103,14 @@ class TC_MyTest2 < Test::Unit::TestCase
103
103
  assert_equal(29, @hb.day, "Wrong day.")
104
104
  end
105
105
 
106
+ def test_h2j_10
107
+ @hb = Hebruby::HebrewDate.new(Date.new(2005, 3, 18))
108
+ assert_equal(13, @hb.month, "Wrong month.")
109
+ assert_equal("Adar Sheni", @hb.month_name, "Wrong month name.")
110
+ assert_equal(5765, @hb.year, "Wrong year.")
111
+ assert_equal(7, @hb.day, "Wrong day.")
112
+ end
113
+
106
114
  def test_jd
107
115
  orig=2454946
108
116
 
@@ -196,7 +204,5 @@ class TC_MyTest2 < Test::Unit::TestCase
196
204
  assert_equal(Date.new(1941, 12, 10).jd, @hb.jd, "Wrong Julian date.")
197
205
  end
198
206
 
199
-
200
-
201
207
  end
202
208
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hebruby
3
3
  version: !ruby/object:Gem::Version
4
- hash: 9
5
- prerelease: false
4
+ hash: 7
5
+ prerelease:
6
6
  segments:
7
7
  - 2
8
8
  - 0
9
- - 3
10
- version: 2.0.3
9
+ - 4
10
+ version: 2.0.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ron Evans
@@ -15,8 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-09-01 00:00:00 -07:00
19
- default_executable:
18
+ date: 2011-06-25 00:00:00 Z
20
19
  dependencies: []
21
20
 
22
21
  description: Hebruby is a Ruby library to convert julian dates to hebrew dates, and vice-versa.
@@ -41,7 +40,6 @@ files:
41
40
  - lib/hebruby.rb
42
41
  - test/hebruby_tests.rb
43
42
  - hebruby.gemspec
44
- has_rdoc: true
45
43
  homepage: http://deadprogrammersociety.com/
46
44
  licenses: []
47
45
 
@@ -77,7 +75,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
77
75
  requirements: []
78
76
 
79
77
  rubyforge_project: hebruby
80
- rubygems_version: 1.3.7
78
+ rubygems_version: 1.8.5
81
79
  signing_key:
82
80
  specification_version: 3
83
81
  summary: Hebruby is a Ruby library to convert julian dates to hebrew dates, and vice-versa.