hebrew_date 1.0.14 → 1.0.15

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
2
  SHA1:
3
- metadata.gz: 24c146c4c58232286cf5cfe8ac789e07e246d9b0
4
- data.tar.gz: f81c77183286ccf9f8ac87d6dd8b80dd471f9575
3
+ metadata.gz: cc5ea4f193fb1abfb9f8cde7e26e5e92183811ad
4
+ data.tar.gz: b2e5b309c52d59bbe67e9aef4a9bf54575009375
5
5
  SHA512:
6
- metadata.gz: 9aa41de1d3016df7283254e07eb9c274d3f4ebfc11912e112dbbed63643959a270f120529c07698e91b0cdf4a8e1429c6458232bf55f8a52886d9b6e598fffa1
7
- data.tar.gz: 34d709e9f784ab26c2a3ba10a238df7096c894212e777a15ec18f67a884058c0ef5c5d378381b9e9f3c0d3c29155f0068242bb0fb56526aab7a60a8e0806025d
6
+ metadata.gz: d4680aa9fdbfaa0ebe37b7e5f8d51da1a5985fa138fc59c6baa2a89e42e1cbe9dbd4fb2398edf782c939e92a160d6b7918445dd4db39aef477eacc5dcd3ac303
7
+ data.tar.gz: 9d0e7ff105fcbe310fc1f4bd7a695f476cfb271e6b38d09a8fa7d65059004355f15489b32aba921258a6c5b3cf13f8b12f553778c931403290b9036c7f7d28e9
data/hebrew_date.gemspec CHANGED
@@ -1,7 +1,7 @@
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.14'
4
+ s.version = '1.0.15'
5
5
  s.date = '2014-02-21'
6
6
  s.summary = 'Hebrew/Jewish dates, times, and holidays.'
7
7
  s.description = <<-EOF
@@ -260,16 +260,23 @@ module HebrewDateSupport
260
260
  end
261
261
 
262
262
  # Get the number of the Omer for this day, or nil if there isn't one.
263
+ # @param for_night [Boolean] if true, give the Omer count for the previous
264
+ # night - i.e. 1 more than the Omer for the current day.
263
265
  # @return [Integer]
264
- def omer
265
- if @hebrew_month == 1 && @hebrew_date >= 16
266
+ def omer(for_night=false)
267
+ for_night_offset = for_night ? 1 : 0
268
+ if for_night && @hebrew_month == 1 && @hebrew_date == 15
269
+ 1
270
+ elsif for_night && @hebrew_month == 3 && @hebrew_date == 5
271
+ nil
272
+ elsif @hebrew_month == 1 && @hebrew_date >= 16
266
273
  # Nissan, second day of Pesach and on
267
- @hebrew_date - 15
274
+ @hebrew_date - 15 + for_night_offset
268
275
  elsif @hebrew_month == 2 # Iyar
269
- @hebrew_date + 15
276
+ @hebrew_date + 15 + for_night_offset
270
277
  elsif @hebrew_month == 3 && @hebrew_date < 6
271
278
  # Sivan, before Shavuos
272
- @hebrew_date + 44
279
+ @hebrew_date + 44 + for_night_offset
273
280
  end
274
281
  end
275
282
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hebrew_date
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.14
4
+ version: 1.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Orner