hiccup 0.6.0 → 0.6.1

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: 65667b19946a8c1a0f340632b1573a086cbf6703
4
- data.tar.gz: 13711342f02bbfe9aafdd40d7dd176869acf21d9
3
+ metadata.gz: 387f7c01d2222a097f3f217469826a82bb33ea56
4
+ data.tar.gz: cc3c8e31744ad0dd1e28a2a53213de5d1aed50f0
5
5
  SHA512:
6
- metadata.gz: 0499a77cc41eb22337b6ffea764a6658cc9566b61dac2e1789294ee08494bb749d9214c5d5730a0a363078cd6fefabfd62f79cadd4d4f6b7d533e3f387fdad71
7
- data.tar.gz: 3bfde7a8eba8c66e6c7b30ff1fe2b86ae1501cc6a910364de860c22cd8be87cdf80417c0237c17661a0063df08a46c76fa06ea09b92736b7a8603f5566a3d9a2
6
+ metadata.gz: 40718f786db47800243fac9eaa637fafefa4fd4a6573bd20121272b3bd3d3dc4bd40833a79701fe21f6f5b59be9cc01ec5ad9e24d814d22996b0129ab18cd125
7
+ data.tar.gz: c4bf292ca44128f2d59b686b699adce465c78cd491641111271e1f99ca96530d7f818406742eb3956d83b3786b7974a12be6ba044a0ee4b38961600b0bd733b8
@@ -18,7 +18,7 @@ Gem::Specification.new do |s|
18
18
  s.add_dependency "builder"
19
19
 
20
20
  s.add_development_dependency "ri_cal"
21
- s.add_development_dependency "bundler", "~> 1.10"
21
+ s.add_development_dependency "bundler"
22
22
  s.add_development_dependency "rake", "~> 10.0"
23
23
  s.add_development_dependency "minitest-reporters"
24
24
  s.add_development_dependency "minitest-reporters-turn_reporter"
@@ -1,4 +1,4 @@
1
- class Fixnum
1
+ class Integer
2
2
 
3
3
  # todo: complete
4
4
  def human_ordinalize(map={})
@@ -7,7 +7,7 @@ module Hiccup
7
7
  def self.for(schedule)
8
8
  if schedule.monthly_pattern.empty?
9
9
  NeverEnumerator
10
- elsif schedule.monthly_pattern.all? { |occurrence| Fixnum === occurrence }
10
+ elsif schedule.monthly_pattern.all? { |occurrence| Integer === occurrence }
11
11
  MonthlyDateEnumerator
12
12
  else
13
13
  self
@@ -1,5 +1,5 @@
1
1
  require "hiccup/convenience"
2
- require "hiccup/core_ext/fixnum"
2
+ require "hiccup/core_ext/integer"
3
3
 
4
4
 
5
5
  module Hiccup
@@ -68,10 +68,10 @@ module Hiccup
68
68
  def valid_occurrence?(occurrence)
69
69
  if occurrence.is_a?(Array)
70
70
  i, wd = occurrence
71
- Date::DAYNAMES.member?(wd) && i.is_a?(Fixnum) && ((i == -1) || (1..6).include?(i))
71
+ Date::DAYNAMES.member?(wd) && i.is_a?(Integer) && ((i == -1) || (1..6).include?(i))
72
72
  else
73
73
  i = occurrence
74
- i.is_a?(Fixnum) && ([-1] + (1..31).to_a).include?(i)
74
+ i.is_a?(Integer) && ([-1] + (1..31).to_a).include?(i)
75
75
  end
76
76
  end
77
77
 
@@ -86,7 +86,7 @@ module Hiccup
86
86
  # ordinal, kind = occurrence
87
87
  #
88
88
  # errors.add(:kind, "is not a valid monthly occurrence kind") unless Date::DAYNAMES.member?(kind)
89
- # if ordinal.is_a?(Fixnum)
89
+ # if ordinal.is_a?(Integer)
90
90
  # errors.add(:ordinal, "is not a valid integer") unless (ordinal==-1) or (1..6).include?(ordinal)
91
91
  # else
92
92
  # errors.add(:ordinal, "is not an integer")
@@ -94,7 +94,7 @@ module Hiccup
94
94
  # else
95
95
  # ordinal = occurrence
96
96
  #
97
- # if ordinal.is_a?(Fixnum)
97
+ # if ordinal.is_a?(Integer)
98
98
  # errors.add(:ordinal, "is not an integer between 1 and 31") unless (1..31).include?(ordinal)
99
99
  # else
100
100
  # errors.add(:ordinal, "is not an integer")
@@ -1,3 +1,3 @@
1
1
  module Hiccup
2
- VERSION = "0.6.0"
2
+ VERSION = "0.6.1"
3
3
  end
@@ -260,8 +260,8 @@ class EnumerableTest < ActiveSupport::TestCase
260
260
  :start_date => Date.new(2011, 1, 3),
261
261
  :ends => true,
262
262
  :end_date => Date.new(2011, 1, 31)})
263
- assert_equal nil, schedule.first_occurrence_before(Date.new(2011,1,3))
264
- assert_equal nil, schedule.first_occurrence_on_or_before(Date.new(2011,1,2))
263
+ assert_nil schedule.first_occurrence_before(Date.new(2011,1,3))
264
+ assert_nil schedule.first_occurrence_on_or_before(Date.new(2011,1,2))
265
265
  assert_equal [], schedule.n_occurrences_before(10, Date.new(2011,1,3))
266
266
  assert_equal [], schedule.n_occurrences_on_or_before(10, Date.new(2011,1,2))
267
267
  end
@@ -281,8 +281,8 @@ class EnumerableTest < ActiveSupport::TestCase
281
281
  :start_date => Date.new(2011, 1, 3),
282
282
  :ends => true,
283
283
  :end_date => Date.new(2011, 1, 31)})
284
- assert_equal nil, schedule.first_occurrence_after(Date.new(2011,1,31))
285
- assert_equal nil, schedule.first_occurrence_on_or_after(Date.new(2011,2, 1))
284
+ assert_nil schedule.first_occurrence_after(Date.new(2011,1,31))
285
+ assert_nil schedule.first_occurrence_on_or_after(Date.new(2011,2, 1))
286
286
  assert_equal [], schedule.occurrences_between(Date.new(2013, 9, 23), Date.new(2013, 9, 30))
287
287
  end
288
288
 
@@ -160,7 +160,7 @@ class MonthlyEnumeratorTest < ActiveSupport::TestCase
160
160
  should "always return nil" do
161
161
  date = Date.new(2015, 2, 1)
162
162
  enumerator = @schedule.enumerator.new(@schedule, date)
163
- assert_equal nil, enumerator.next
163
+ assert_nil enumerator.next
164
164
  end
165
165
  end
166
166
 
@@ -119,12 +119,12 @@ class WeeklyEnumeratorTest < ActiveSupport::TestCase
119
119
 
120
120
  should "return nil for prev rather than raising an exception" do
121
121
  enumerator = @schedule.enumerator.new(@schedule, Date.today)
122
- assert_equal nil, enumerator.prev
122
+ assert_nil enumerator.prev
123
123
  end
124
124
 
125
125
  should "return nil for next rather than raising an exception" do
126
126
  enumerator = @schedule.enumerator.new(@schedule, Date.today)
127
- assert_equal nil, enumerator.next
127
+ assert_nil enumerator.next
128
128
  end
129
129
  end
130
130
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hiccup
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bob Lail
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-31 00:00:00.000000000 Z
11
+ date: 2019-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -70,16 +70,16 @@ dependencies:
70
70
  name: bundler
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: '1.10'
75
+ version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: '1.10'
82
+ version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rake
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -185,8 +185,8 @@ files:
185
185
  - lib/hiccup/core_ext/date.rb
186
186
  - lib/hiccup/core_ext/duration.rb
187
187
  - lib/hiccup/core_ext/enumerable.rb
188
- - lib/hiccup/core_ext/fixnum.rb
189
188
  - lib/hiccup/core_ext/hash.rb
189
+ - lib/hiccup/core_ext/integer.rb
190
190
  - lib/hiccup/enumerable.rb
191
191
  - lib/hiccup/enumerable/annually_enumerator.rb
192
192
  - lib/hiccup/enumerable/monthly_date_enumerator.rb