hebrew_date 1.0.9 → 1.0.10

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: caa2551e03b3046a8465f3f4c089aabddaa0fb60
4
- data.tar.gz: c17044991f93ea53302c17aa9c36c920376c9411
3
+ metadata.gz: d41b0baeb363a75a7b4e026cc80fadb18883a903
4
+ data.tar.gz: c0cd4fe726dec3935c9369f008f66fd3f900e287
5
5
  SHA512:
6
- metadata.gz: e17754d8f17a67e26ff377300614df40c5947ffec06c11541272180675cd67314eb3d91f35abca93b0a0e93c6f16ffd9de671648f526d71997624b92e0341d26
7
- data.tar.gz: d1b9fb3ecc905124d0b70d839223fbe374f93d0d37b1effe8017ab8119e4a6a261fdaf3a66abe1c4cb5c81747263ad1391b47c45538b9c1beefecc94f2546979
6
+ metadata.gz: eaec13486cd97491208b38df44c159cc932d80fcbacc25a2663b8fc33ff2fe2a5da13fd31ba4578b02ee49df8b1a83a263aab7b71b74fd5ed2377e6f094d1b99
7
+ data.tar.gz: d04648a8a27f0c5ad2c0ca324249fb94d9f80b966a657286d13326dc3325c2b9afb2f71c2a8eca7252eb4ad046bbef167c2d2f4a6d371ec45f272075c138c5a8
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.9'
4
+ s.version = '1.0.10'
5
5
  s.date = '2014-01-31'
6
6
  s.summary = 'Hebrew/Jewish dates, times, and holidays.'
7
7
  s.description = <<-EOF
data/lib/hebrew_date.rb CHANGED
@@ -304,7 +304,7 @@ class HebrewDate < Delegator
304
304
  # Get the name of the current Hebrew month.
305
305
  # @return [String]
306
306
  def hebrew_month_to_s
307
- self.class.hebrew_month_to_s(@hebrew_month)
307
+ self.class.hebrew_month_to_s(@hebrew_month, @hebrew_year)
308
308
  end
309
309
 
310
310
  # Get the name of the given Hebrew month.
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.9
4
+ version: 1.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Orner
@@ -75,7 +75,6 @@ files:
75
75
  - lib/hebrew_date.rb
76
76
  - lib/support/holidays.rb
77
77
  - lib/support/parshiot.rb
78
- - lib/support/printing.rb
79
78
  - spec/hebrew_date_spec.rb
80
79
  homepage: https://github.com/dorner/hebrew_date
81
80
  licenses:
@@ -1,84 +0,0 @@
1
- module HebrewDateSupport
2
- module PrintMethods
3
- module ClassMethods
4
- # Get the name of the given Hebrew month.
5
- # @param month [Integer] the Hebrew month.
6
- # @return [String]
7
- def hebrew_month_to_s(month)
8
- if hebrew_leap_year?(month) && month == 12
9
- 'Adar I'
10
- else
11
- name = HEBREW_MONTH_NAMES[month - 1]
12
- if name == 'Teves' && !self.ashkenaz
13
- name = 'Tevet'
14
- end
15
- name
16
- end
17
- end
18
-
19
- end
20
-
21
- alias_method :shabbos?, :saturday?
22
- alias_method :shabbat?, :saturday?
23
-
24
- # Extend the Date strftime method by replacing Hebrew fields. You can denote
25
- # Hebrew fields by using the * flag. Also note that ::replace_saturday will
26
- # replace the %A, %^A, %a and %^a flags with Shabbat/Shabbos.
27
- # Supported flags are:
28
- # * *Y - Hebrew year
29
- # * *m - Hebrew month, zero-padded
30
- # * *_m - Hebrew month, blank-padded
31
- # * *-m - Hebrew month, no-padded
32
- # * *B - Hebrew month, full name
33
- # * *^B - Hebrew month, full name uppercase
34
- # * *b - Hebrew month, 3 letters
35
- # * *^b - Hebrew month, 3 letters uppercase
36
- # * *h - same as %*b
37
- # * *d - Hebrew day of month, zero-padded
38
- # * *-d - Hebrew day of month, no-padded
39
- # * *e - Hebrew day of month, blank-padded
40
- # @param format [String]
41
- # @return [String]
42
- def strftime(format)
43
- format = format.gsub('*Y', @hebrew_year.to_s)
44
- .gsub('*m', @hebrew_month.to_s.rjust(2, '0'))
45
- .gsub('*_m', @hebrew_month.to_s.rjust(2, ' '))
46
- .gsub('*-m', @hebrew_month.to_s)
47
- .gsub('*B', hebrew_month_to_s)
48
- .gsub('*^B', hebrew_month_to_s.upcase)
49
- .gsub('*b', hebrew_month_to_s[0, 3])
50
- .gsub('*^b', hebrew_month_to_s[0, 3].upcase)
51
- .gsub('*h', hebrew_month_to_s[0, 3])
52
- .gsub('*d', @hebrew_date.to_s.rjust(2, '0'))
53
- .gsub('*-d', @hebrew_date.to_s)
54
- .gsub('*e', @hebrew_date.to_s.rjust(2, ' '))
55
- if HebrewDate.replace_saturday && @hebrew_date.day == 7
56
- shab_name = HebrewDate.ashkenaz ? 'Shabbos' : 'Shabbat'
57
- format = format.gsub('%A', shab_name)
58
- .gsub('%^A', shab_name.upcase)
59
- .gsub('%a', shab_name[0..2])
60
- .gsub('%^a', shab_name[0..2].upcase)
61
- end
62
- super(format)
63
- end
64
-
65
-
66
- # @private
67
- HEBREW_MONTH_NAMES = ['Nissan', 'Iyar', 'Sivan', 'Tammuz', 'Av', 'Elul',
68
- 'Tishrei', 'Cheshvan', 'Kislev', 'Teves', 'Shvat',
69
- 'Adar', 'Adar II']
70
-
71
- # @private
72
- def inspect
73
- strftime('*Y-*-m-*-d (%Y-%-m-%-d)')
74
- end
75
-
76
- # Get the name of the current Hebrew month.
77
- # @return [String]
78
- def hebrew_month_to_s
79
- self.hebrew_month_to_s(@hebrew_month)
80
- end
81
-
82
-
83
- end
84
- end