hebrew_date 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,50 @@
1
+ require_relative '../lib/hebrew_date'
2
+
3
+ def check_date(hebrew_year, hebrew_month, hebrew_date, year, month, date)
4
+ HebrewDate.new_from_hebrew(hebrew_year, hebrew_month, hebrew_date).to_date.should ==
5
+ Date.new(year, month, date)
6
+ end
7
+
8
+ describe HebrewDate do
9
+
10
+ specify 'Hebrew date calendar confirmation' do
11
+ check_date(5773, 1, 1, 2013, 3, 12)
12
+ check_date(5773, 2, 14, 2013, 4, 24)
13
+ check_date(5773, 5, 1, 2013, 7, 8)
14
+ check_date(5773, 6, 29, 2013, 9, 4)
15
+ check_date(5774, 7, 1, 2013, 9, 5)
16
+ check_date(5774, 12, 1, 2014, 2, 1)
17
+ check_date(5774, 12, 30, 2014, 3, 2)
18
+ check_date(5774, 13, 1, 2014, 3, 3)
19
+ check_date(5774, 1, 1, 2014, 4, 1)
20
+ end
21
+
22
+ specify 'parshiot' do
23
+ HebrewDate.new(2014, 1, 1).parsha.should be_nil
24
+ HebrewDate.new(2014, 1, 4).parsha.should == 'Bo'
25
+ HebrewDate.new(2014, 3, 1).parsha.should == 'Pekudei/Shekalim'
26
+ HebrewDate.new(2014, 3, 15).parsha.should == 'Tzav/Zachor'
27
+ HebrewDate.new(2014, 3, 22).parsha.should == 'Shmini/Parah'
28
+ HebrewDate.new(2014, 3, 29).parsha.should == 'Tazria/Hachodesh'
29
+ HebrewDate.new(2014, 3, 19).parsha.should be_nil
30
+ HebrewDate.new(2001, 1, 6).parsha.should == 'Vayigash'
31
+ HebrewDate.new(2001, 4, 14).parsha.should be_nil
32
+ end
33
+
34
+ specify 'holidays' do
35
+ HebrewDate.new(2014, 2, 14).holiday.should == 'Purim Katan'
36
+ HebrewDate.new(2014, 3, 13).holiday.should == "Ta'anit Esther"
37
+ HebrewDate.new(2014, 3, 16).holiday.should == 'Purim'
38
+ HebrewDate.new(2014, 4, 15).holiday.should == 'Pesach'
39
+ HebrewDate.new(2014, 4, 22).holiday.should == 'Pesach'
40
+ HebrewDate.new(2014, 5, 6).holiday.should == "Yom Ha'atzmaut"
41
+ HebrewDate.new(2014, 6, 3).holiday.should == 'Erev Shavuot'
42
+ HebrewDate.new(2014, 7, 15).holiday.should == 'Tzom Tammuz'
43
+ HebrewDate.new(2014, 9, 25).holiday.should == 'Rosh Hashanah'
44
+ HebrewDate.new(2014, 9, 26).holiday.should == 'Rosh Hashanah'
45
+ HebrewDate.new(2014, 12, 15).holiday.should be_nil
46
+ HebrewDate.new(2014, 12, 16).holiday.should == 'Erev Chanukah'
47
+ HebrewDate.new(2014, 12, 17).holiday.should == 'Chanukah'
48
+ HebrewDate.new(2014, 12, 25).holiday.should be_nil
49
+ end
50
+ end
metadata ADDED
@@ -0,0 +1,106 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: hebrew_date
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Daniel Orner
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-01-09 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: yard
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rspec
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ description: |2+
42
+ hebrewdate is a library designed to provide information about the Jewish
43
+ calendar. This includes dates, times, holidays, and parsha of the week.
44
+
45
+ email: dmorner@gmail.com
46
+ executables: []
47
+ extensions: []
48
+ extra_rdoc_files: []
49
+ files:
50
+ - .gitignore
51
+ - Gemfile
52
+ - Gemfile.lock
53
+ - LICENSE
54
+ - README.md
55
+ - doc/HebrewDate.html
56
+ - doc/HebrewDateSupport.html
57
+ - doc/HebrewDateSupport/Holidays.html
58
+ - doc/HebrewDateSupport/Parshiot.html
59
+ - doc/JqrHelpers/Rails.html
60
+ - doc/_index.html
61
+ - doc/class_list.html
62
+ - doc/css/common.css
63
+ - doc/css/full_list.css
64
+ - doc/css/style.css
65
+ - doc/file.README.html
66
+ - doc/file_list.html
67
+ - doc/frames.html
68
+ - doc/index.html
69
+ - doc/js/app.js
70
+ - doc/js/full_list.js
71
+ - doc/js/jquery.js
72
+ - doc/method_list.html
73
+ - doc/top-level-namespace.html
74
+ - hebrew_date.gemspec
75
+ - lib/hebrew_date.rb
76
+ - lib/support/holidays.rb
77
+ - lib/support/parshiot.rb
78
+ - spec/hebrew_date_spec.rb
79
+ homepage: https://github.com/dmorner/hebrew_date
80
+ licenses:
81
+ - MIT
82
+ metadata: {}
83
+ post_install_message:
84
+ rdoc_options: []
85
+ require_paths:
86
+ - .
87
+ - lib
88
+ - lib/hebrewdate
89
+ required_ruby_version: !ruby/object:Gem::Requirement
90
+ requirements:
91
+ - - '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ required_rubygems_version: !ruby/object:Gem::Requirement
95
+ requirements:
96
+ - - '>='
97
+ - !ruby/object:Gem::Version
98
+ version: '0'
99
+ requirements: []
100
+ rubyforge_project:
101
+ rubygems_version: 2.1.11
102
+ signing_key:
103
+ specification_version: 4
104
+ summary: Hebrew/Jewish dates, times, and holidays.
105
+ test_files: []
106
+ has_rdoc: