hebrew_date 1.0.25 → 1.1.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 904efbf6c07ea3fa679fafdf5e299e0f077b3962
4
- data.tar.gz: 5c7a8e25b45f643bd586c1728608d0b5aec51623
2
+ SHA256:
3
+ metadata.gz: 8b0cc14110988839df920e5f6162f7443b62b1920402a0129b7ef2460132966c
4
+ data.tar.gz: 7c4eb731a3752ec1039eacfed6d9c2e6fcfb442dce91dec55a4cd6651d70c1a5
5
5
  SHA512:
6
- metadata.gz: 7b98fe239687307da1f405e30aea11f200f9e3ef925f1e2a43720b95788b4ed6b767443a53910ca24b9d7ab91e735cac3926a0411203f58a9f6021d21601388a
7
- data.tar.gz: bfe6209b892df990fb6281bde1312446a42d1a193687ceb01d75006210a598446c5a5df3c91d57d5fe63e1c4722c5f7150b6efdd8ec99b28649b082c5fd23cb3
6
+ metadata.gz: a7ec2ccfe8044383c632c26b7bff477aa4bce44f9182958b594f9b2643a9daae07d3d119585371575ec2367172683d9cbe212fed6a708d08ea55e554237b7266
7
+ data.tar.gz: 19ad714286d39917b77ea4677fa81994ca7a7190aefc6c40af88a1e36bd40c0889be9914fa4effd99f1af88b1bae03f8c486ddeec16b3d02de80b5bd3a1ab6d7
@@ -0,0 +1,29 @@
1
+ name: CI
2
+
3
+ on: [push, pull_request]
4
+
5
+ jobs:
6
+ test:
7
+ strategy:
8
+ fail-fast: false
9
+ matrix:
10
+ ruby: ['2.7', '3.0', '3.1', '3.2', '3.3', '3.4']
11
+ os: [ubuntu-latest, macos-latest, windows-latest]
12
+ runs-on: ${{ matrix.os }}
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+ - uses: ruby/setup-ruby@v1
16
+ with:
17
+ ruby-version: ${{ matrix.ruby }}
18
+ bundler-cache: true
19
+ - run: bundle exec rspec
20
+
21
+ docs:
22
+ runs-on: ubuntu-latest
23
+ steps:
24
+ - uses: actions/checkout@v4
25
+ - uses: ruby/setup-ruby@v1
26
+ with:
27
+ ruby-version: '3.4'
28
+ bundler-cache: true
29
+ - run: bundle exec yard doc
@@ -0,0 +1,31 @@
1
+ name: Release Gem
2
+ on:
3
+ push:
4
+ branches:
5
+ - main
6
+ tags:
7
+ - 'v*.*.*' # Matches semantic versioning tags like v1.0.0
8
+ workflow_dispatch: # Allows manual triggering of the workflow
9
+
10
+ jobs:
11
+ push:
12
+ name: Push gem to RubyGems.org
13
+ runs-on: ubuntu-latest
14
+
15
+ permissions:
16
+ id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
17
+ contents: write # IMPORTANT: this permission is required for `rake release` to push the release tag
18
+
19
+ steps:
20
+ # Set up
21
+ - uses: actions/checkout@v4
22
+ with:
23
+ persist-credentials: false
24
+ - name: Set up Ruby
25
+ uses: ruby/setup-ruby@v1
26
+ with:
27
+ bundler-cache: true
28
+ ruby-version: ruby
29
+
30
+ # Release
31
+ - uses: rubygems/release-gem@v1
data/.gitignore CHANGED
@@ -2,7 +2,6 @@
2
2
  *.sassc
3
3
  .sass-cache
4
4
  capybara-*.html
5
- .rspec
6
5
  .rvmrc
7
6
  /.bundle
8
7
  /vendor/bundle
@@ -17,3 +16,6 @@ rerun.txt
17
16
  pickle-email-*.html
18
17
  .project
19
18
  config/initializers/secret_token.rb
19
+
20
+ # Gem build artifacts
21
+ *.gem
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 3.4.7
data/.tool-versions ADDED
@@ -0,0 +1 @@
1
+ ruby 3.4.7
data/Gemfile CHANGED
@@ -1,6 +1,3 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- group :development, :test do
4
- gem 'rspec', '~> 2.14.1'
5
- gem 'yard', '~> 0.8.7.3'
6
- end
3
+ gemspec
data/Gemfile.lock CHANGED
@@ -1,20 +1,36 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ hebrew_date (1.1.0)
5
+
1
6
  GEM
2
7
  remote: https://rubygems.org/
3
8
  specs:
4
9
  diff-lcs (1.2.5)
5
- rspec (2.14.1)
6
- rspec-core (~> 2.14.0)
7
- rspec-expectations (~> 2.14.0)
8
- rspec-mocks (~> 2.14.0)
9
- rspec-core (2.14.7)
10
- rspec-expectations (2.14.4)
11
- diff-lcs (>= 1.1.3, < 2.0)
12
- rspec-mocks (2.14.4)
13
- yard (0.8.7.3)
10
+ rake (13.3.1)
11
+ rspec (3.13.2)
12
+ rspec-core (~> 3.13.0)
13
+ rspec-expectations (~> 3.13.0)
14
+ rspec-mocks (~> 3.13.0)
15
+ rspec-core (3.13.6)
16
+ rspec-support (~> 3.13.0)
17
+ rspec-expectations (3.13.5)
18
+ diff-lcs (>= 1.2.0, < 2.0)
19
+ rspec-support (~> 3.13.0)
20
+ rspec-mocks (3.13.7)
21
+ diff-lcs (>= 1.2.0, < 2.0)
22
+ rspec-support (~> 3.13.0)
23
+ rspec-support (3.13.6)
24
+ yard (0.9.38)
14
25
 
15
26
  PLATFORMS
16
27
  ruby
17
28
 
18
29
  DEPENDENCIES
19
- rspec (~> 2.14.1)
20
- yard (~> 0.8.7.3)
30
+ hebrew_date!
31
+ rake
32
+ rspec (~> 3.13)
33
+ yard (~> 0.9.37)
34
+
35
+ BUNDLED WITH
36
+ 2.6.9
data/Rakefile ADDED
@@ -0,0 +1,3 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bundler/gem_tasks'
data/hebrew_date.gemspec CHANGED
@@ -1,8 +1,8 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'hebrew_date'
3
3
  s.require_paths = %w(. lib)
4
- s.version = '1.0.25'
5
- s.date = '2015-03-08'
4
+ s.version = '1.1.0'
5
+ s.date = '2025-12-10'
6
6
  s.summary = 'Hebrew/Jewish dates, times, and holidays.'
7
7
  s.description = <<-EOF
8
8
  hebrew_date is a library designed to provide information about the Jewish
@@ -14,9 +14,10 @@ EOF
14
14
  s.files = `git ls-files`.split($/)
15
15
  s.homepage = 'https://github.com/dorner/hebrew_date'
16
16
  s.license = 'MIT'
17
+ s.required_ruby_version = '>= 2.7.0'
17
18
 
18
- # s.add_dependency 'ruby-sun-times'
19
- s.add_development_dependency 'yard'
20
- s.add_development_dependency 'rspec'
19
+ s.add_development_dependency 'yard', '~> 0.9.37'
20
+ s.add_development_dependency 'rspec', '~> 3.13'
21
+ s.add_development_dependency 'rake'
21
22
 
22
- end
23
+ end
data/lib/hebrew_date.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'date'
2
4
  require 'delegate'
3
5
  require_relative 'support/holidays.rb'
@@ -110,7 +112,7 @@ class HebrewDate < Delegator
110
112
  # do nothing
111
113
  end
112
114
 
113
- # @param other [Fixnum]
115
+ # @param other [Integer]
114
116
  # @return [HebrewDate]
115
117
  def +(other)
116
118
  date = self.clone
@@ -120,7 +122,7 @@ class HebrewDate < Delegator
120
122
  date
121
123
  end
122
124
 
123
- # @param other [Fixnum]
125
+ # @param other [Integer]
124
126
  # @return [HebrewDate]
125
127
  def -(other)
126
128
  date = self.clone
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module HebrewDateSupport
2
4
  module HolidayMethods
3
5
  module ClassMethods
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module HebrewDateSupport
2
4
  module ParshaMethods
3
5
  # Parsha names in Ashkenazi and Sephardi pronunciation.
@@ -1,8 +1,10 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative '../lib/hebrew_date'
2
4
 
3
5
  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
+ expect(HebrewDate.new_from_hebrew(hebrew_year, hebrew_month, hebrew_date).to_date).to eq(
7
+ Date.new(year, month, date))
6
8
  end
7
9
 
8
10
  describe HebrewDate do
@@ -20,76 +22,55 @@ describe HebrewDate do
20
22
  end
21
23
 
22
24
  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
25
+ expect(HebrewDate.new(2014, 1, 1).parsha).to be_nil
26
+ expect(HebrewDate.new(2014, 1, 4).parsha).to eq('Bo')
27
+ expect(HebrewDate.new(2014, 3, 1).parsha).to eq('Pekudei/Shekalim')
28
+ expect(HebrewDate.new(2014, 3, 15).parsha).to eq('Tzav/Zachor')
29
+ expect(HebrewDate.new(2014, 3, 22).parsha).to eq('Shmini/Parah')
30
+ expect(HebrewDate.new(2014, 3, 29).parsha).to eq('Tazria/Hachodesh')
31
+ expect(HebrewDate.new(2014, 3, 19).parsha).to be_nil
32
+ expect(HebrewDate.new(2001, 1, 6).parsha).to eq('Vayigash')
33
+ expect(HebrewDate.new(2001, 4, 14).parsha).to be_nil
32
34
  end
33
35
 
34
36
  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
37
+ expect(HebrewDate.new(2014, 2, 14).holiday).to eq('Purim Katan')
38
+ expect(HebrewDate.new(2014, 3, 13).holiday).to eq("Ta'anit Esther")
39
+ expect(HebrewDate.new(2014, 3, 16).holiday).to eq('Purim')
40
+ expect(HebrewDate.new(2014, 4, 15).holiday).to eq('Pesach')
41
+ expect(HebrewDate.new(2014, 4, 22).holiday).to eq('Pesach')
42
+ expect(HebrewDate.new(2014, 5, 6).holiday).to eq("Yom Ha'atzmaut")
43
+ expect(HebrewDate.new(2014, 6, 3).holiday).to eq('Erev Shavuot')
44
+ expect(HebrewDate.new(2014, 7, 15).holiday).to eq('Tzom Tammuz')
45
+ expect(HebrewDate.new(2014, 9, 25).holiday).to eq('Rosh Hashanah')
46
+ expect(HebrewDate.new(2014, 9, 26).holiday).to eq('Rosh Hashanah')
47
+ expect(HebrewDate.new(2014, 12, 15).holiday).to be_nil
48
+ expect(HebrewDate.new(2014, 12, 16).holiday).to eq('Erev Chanukah')
49
+ expect(HebrewDate.new(2014, 12, 17).holiday).to eq('Chanukah')
50
+ expect(HebrewDate.new(2014, 12, 25).holiday).to be_nil
49
51
  end
50
52
 
51
53
  specify 'from holidays' do
52
- HebrewDate.from_holiday(:ROSH_HASHANA, 5774).to_date.
53
- should == Date.new(2013, 9, 5)
54
- HebrewDate.from_holiday(:TZOM_GEDALIA, 5774).to_date.
55
- should == Date.new(2013, 9, 8)
56
- HebrewDate.from_holiday(:YOM_KIPPUR, 5774).to_date.
57
- should == Date.new(2013, 9, 14)
58
- HebrewDate.from_holiday(:SUKKOT, 5774).to_date.
59
- should == Date.new(2013, 9, 19)
60
- HebrewDate.from_holiday(:SHMINI_ATZERET, 5774).to_date.
61
- should == Date.new(2013, 9, 26)
62
- HebrewDate.from_holiday(:CHANUKAH, 5774).to_date.
63
- should == Date.new(2013, 11, 28)
64
- HebrewDate.from_holiday(:TZOM_TEVET, 5774).to_date.
65
- should == Date.new(2013, 12, 13)
66
- HebrewDate.from_holiday(:TU_BISHVAT, 5774).to_date.
67
- should == Date.new(2014, 1, 16)
68
- HebrewDate.from_holiday(:PURIM_KATAN, 5774).to_date.
69
- should == Date.new(2014, 2, 14)
70
- HebrewDate.from_holiday(:TAANIT_ESTHER, 5774).to_date.
71
- should == Date.new(2014, 3, 13)
72
- HebrewDate.from_holiday(:PURIM, 5774).to_date.
73
- should == Date.new(2014, 3, 16)
74
- HebrewDate.from_holiday(:EREV_PESACH, 5774).to_date.
75
- should == Date.new(2014, 4, 14)
76
- HebrewDate.from_holiday(:PESACH, 5774).to_date.
77
- should == Date.new(2014, 4, 15)
78
- HebrewDate.from_holiday(:PESACH_2, 5774).to_date.
79
- should == Date.new(2014, 4, 21)
80
- HebrewDate.from_holiday(:YOM_HAZIKARON, 5774).to_date.
81
- should == Date.new(2014, 5, 5)
82
- HebrewDate.from_holiday(:YOM_HAATZMAUT, 5774).to_date.
83
- should == Date.new(2014, 5, 6)
84
- HebrewDate.from_holiday(:LAG_BAOMER, 5774).to_date.
85
- should == Date.new(2014, 5, 18)
86
- HebrewDate.from_holiday(:YOM_YERUSHALAYIM, 5774).to_date.
87
- should == Date.new(2014, 5, 28)
88
- HebrewDate.from_holiday(:SHAVUOT, 5774).to_date.
89
- should == Date.new(2014, 6, 4)
90
- HebrewDate.from_holiday(:TZOM_TAMMUZ, 5774).to_date.
91
- should == Date.new(2014, 7, 15)
92
- HebrewDate.from_holiday(:TISHA_BAV, 5774).to_date.
93
- should == Date.new(2014, 8, 5)
54
+ expect(HebrewDate.from_holiday(:ROSH_HASHANA, 5774).to_date).to eq(Date.new(2013, 9, 5))
55
+ expect(HebrewDate.from_holiday(:TZOM_GEDALIA, 5774).to_date).to eq(Date.new(2013, 9, 8))
56
+ expect(HebrewDate.from_holiday(:YOM_KIPPUR, 5774).to_date).to eq(Date.new(2013, 9, 14))
57
+ expect(HebrewDate.from_holiday(:SUKKOT, 5774).to_date).to eq(Date.new(2013, 9, 19))
58
+ expect(HebrewDate.from_holiday(:SHMINI_ATZERET, 5774).to_date).to eq(Date.new(2013, 9, 26))
59
+ expect(HebrewDate.from_holiday(:CHANUKAH, 5774).to_date).to eq(Date.new(2013, 11, 28))
60
+ expect(HebrewDate.from_holiday(:TZOM_TEVET, 5774).to_date).to eq(Date.new(2013, 12, 13))
61
+ expect(HebrewDate.from_holiday(:TU_BISHVAT, 5774).to_date).to eq(Date.new(2014, 1, 16))
62
+ expect(HebrewDate.from_holiday(:PURIM_KATAN, 5774).to_date).to eq(Date.new(2014, 2, 14))
63
+ expect(HebrewDate.from_holiday(:TAANIT_ESTHER, 5774).to_date).to eq(Date.new(2014, 3, 13))
64
+ expect(HebrewDate.from_holiday(:PURIM, 5774).to_date).to eq(Date.new(2014, 3, 16))
65
+ expect(HebrewDate.from_holiday(:EREV_PESACH, 5774).to_date).to eq(Date.new(2014, 4, 14))
66
+ expect(HebrewDate.from_holiday(:PESACH, 5774).to_date).to eq(Date.new(2014, 4, 15))
67
+ expect(HebrewDate.from_holiday(:PESACH_2, 5774).to_date).to eq(Date.new(2014, 4, 21))
68
+ expect(HebrewDate.from_holiday(:YOM_HAZIKARON, 5774).to_date).to eq(Date.new(2014, 5, 5))
69
+ expect(HebrewDate.from_holiday(:YOM_HAATZMAUT, 5774).to_date).to eq(Date.new(2014, 5, 6))
70
+ expect(HebrewDate.from_holiday(:LAG_BAOMER, 5774).to_date).to eq(Date.new(2014, 5, 18))
71
+ expect(HebrewDate.from_holiday(:YOM_YERUSHALAYIM, 5774).to_date).to eq(Date.new(2014, 5, 28))
72
+ expect(HebrewDate.from_holiday(:SHAVUOT, 5774).to_date).to eq(Date.new(2014, 6, 4))
73
+ expect(HebrewDate.from_holiday(:TZOM_TAMMUZ, 5774).to_date).to eq(Date.new(2014, 7, 15))
74
+ expect(HebrewDate.from_holiday(:TISHA_BAV, 5774).to_date).to eq(Date.new(2014, 8, 5))
94
75
  end
95
76
  end
metadata CHANGED
@@ -1,41 +1,54 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hebrew_date
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.25
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Orner
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2015-03-08 00:00:00.000000000 Z
10
+ date: 2025-12-10 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: yard
15
14
  requirement: !ruby/object:Gem::Requirement
16
15
  requirements:
17
- - - '>='
16
+ - - "~>"
18
17
  - !ruby/object:Gem::Version
19
- version: '0'
18
+ version: 0.9.37
20
19
  type: :development
21
20
  prerelease: false
22
21
  version_requirements: !ruby/object:Gem::Requirement
23
22
  requirements:
24
- - - '>='
23
+ - - "~>"
25
24
  - !ruby/object:Gem::Version
26
- version: '0'
25
+ version: 0.9.37
27
26
  - !ruby/object:Gem::Dependency
28
27
  name: rspec
29
28
  requirement: !ruby/object:Gem::Requirement
30
29
  requirements:
31
- - - '>='
30
+ - - "~>"
31
+ - !ruby/object:Gem::Version
32
+ version: '3.13'
33
+ type: :development
34
+ prerelease: false
35
+ version_requirements: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '3.13'
40
+ - !ruby/object:Gem::Dependency
41
+ name: rake
42
+ requirement: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
32
45
  - !ruby/object:Gem::Version
33
46
  version: '0'
34
47
  type: :development
35
48
  prerelease: false
36
49
  version_requirements: !ruby/object:Gem::Requirement
37
50
  requirements:
38
- - - '>='
51
+ - - ">="
39
52
  - !ruby/object:Gem::Version
40
53
  version: '0'
41
54
  description: |2+
@@ -47,11 +60,17 @@ executables: []
47
60
  extensions: []
48
61
  extra_rdoc_files: []
49
62
  files:
50
- - .gitignore
63
+ - ".github/workflows/ci.yml"
64
+ - ".github/workflows/release.yml"
65
+ - ".gitignore"
66
+ - ".rspec"
67
+ - ".ruby-version"
68
+ - ".tool-versions"
51
69
  - Gemfile
52
70
  - Gemfile.lock
53
71
  - LICENSE
54
72
  - README.md
73
+ - Rakefile
55
74
  - doc/HebrewDate.html
56
75
  - doc/HebrewDateSupport.html
57
76
  - doc/HebrewDateSupport/HolidayMethods.html
@@ -81,26 +100,23 @@ homepage: https://github.com/dorner/hebrew_date
81
100
  licenses:
82
101
  - MIT
83
102
  metadata: {}
84
- post_install_message:
85
103
  rdoc_options: []
86
104
  require_paths:
87
- - .
105
+ - "."
88
106
  - lib
89
107
  required_ruby_version: !ruby/object:Gem::Requirement
90
108
  requirements:
91
- - - '>='
109
+ - - ">="
92
110
  - !ruby/object:Gem::Version
93
- version: '0'
111
+ version: 2.7.0
94
112
  required_rubygems_version: !ruby/object:Gem::Requirement
95
113
  requirements:
96
- - - '>='
114
+ - - ">="
97
115
  - !ruby/object:Gem::Version
98
116
  version: '0'
99
117
  requirements: []
100
- rubyforge_project:
101
- rubygems_version: 2.1.11
102
- signing_key:
118
+ rubygems_version: 3.6.9
103
119
  specification_version: 4
104
120
  summary: Hebrew/Jewish dates, times, and holidays.
105
121
  test_files: []
106
- has_rdoc:
122
+ ...