hebrew_date 1.0.5 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 74f197a39c9a10c1a44b0891a03ecb3d46fe5dd7
4
- data.tar.gz: 586235c103424c0e6ba844f9bf90bc3caea38724
3
+ metadata.gz: ed501da770884bb19509220ee67fe9070ada1072
4
+ data.tar.gz: a8115661af9a5d5f5d2c141b1c456fd8d368ff7f
5
5
  SHA512:
6
- metadata.gz: 3b58d2961d534b8e1ae594ec0b5effdcea04dd8f18d5cae699b610f1859b26be445b74471497e4dfdcbf5a496a4214c67525b63eaa1523510d0321670c45950e
7
- data.tar.gz: 1db6e4284f3ec8933908f70e85d147e0ba039ec3231de001c3a55f070a6c5c5b07e166f88da5fa968652d20d47c2b21a3c5acef929e3d1b54d1da49aa4af8613
6
+ metadata.gz: 1826d00264e75d19a8faedfa13765caa7523199f9b38e92db560ecd373003442a058dd6707eb0cf17c809d5803a1a5ac513d5569546552b22c8507209a4d6122
7
+ data.tar.gz: 768850c75fb273074c214a57e91892916e6af7e00ed150a5369cb16e04ee430c0428cc4746c820765e327a612273e7d38f19e2f9c2c46948964afb63a0b1d551
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.5'
4
+ s.version = '1.0.6'
5
5
  s.date = '2014-01-27'
6
6
  s.summary = 'Hebrew/Jewish dates, times, and holidays.'
7
7
  s.description = <<-EOF
data/lib/hebrew_date.rb CHANGED
@@ -110,6 +110,36 @@ class HebrewDate < Delegator
110
110
  HebrewDate.new(self.to_date)
111
111
  end
112
112
 
113
+ # Comparison operator.
114
+ # @param other [HebrewDate]
115
+ # @return [Integer] -1, 0, or 1
116
+ def <=>(other)
117
+ self.to_date <=> other.to_date
118
+ end
119
+
120
+ # Iterates evaluation of the given block, which takes a HebrewDate object.
121
+ # The limit should be a Date or HebrewDate object.
122
+ def step(limit, step=1)
123
+ return to_enum(:step, limit, step) unless block_given?
124
+ (self..limit).step(step) { |date| yield(date) }
125
+ end
126
+
127
+ # This method is equivalent to step(min, -1){|date| ...}.
128
+ # @param min [Integer]
129
+ # @return [Enumerator|self]
130
+ def downto(min)
131
+ return to_enum(:downto, min) unless block_given?
132
+ self.step(min, -1, &block)
133
+ end
134
+
135
+ # This method is equivalent to step(max, 1){ |date| ...}.
136
+ # @param max [Integer]
137
+ # @return [Enumerator|self]
138
+ def upto(max)
139
+ return to_enum(:upto, max) unless block_given?
140
+ self.step(max, 1, &block)
141
+ end
142
+
113
143
  # Create a HebrewDate with initialized Hebrew date values.
114
144
  # @param year [Integer] the Hebrew year (e.g. 5774)
115
145
  # @param month [Integer] the Hebrew month (1-13)
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.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Orner