ice_cube_cron 0.0.4 → 0.0.5

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: aac1001063151e51a60b53a6b4eea444009fa08e
4
- data.tar.gz: 78f620c779e71033474cde381b4b501a0cf8809f
3
+ metadata.gz: c4177ac895e629d1b81080c4fadb639109705eb5
4
+ data.tar.gz: 55c6f84a783a4d5d0e5cb27fe2b729809782860c
5
5
  SHA512:
6
- metadata.gz: 28e7b695019f4a4df2a58eda6c90400e5e4d96cb29aed16a9af900dba773a651c5d8b0464cbd45f86662d77dac5046c71177bbae9630ff642db2cc99ad99a765
7
- data.tar.gz: bfdd0ef7b2ff5904799340514ab4b9b57b553afe19daa1a4eb76643341ab21129ec9c1bfd7e753fa704029ec6de56d797fe3552ca907e72bb3fc8407581875cf
6
+ metadata.gz: 6a1a73ec0d09f91490dde50e6de214c4cd53b1a22295dbd672e220da40b0af8f45c1722c274de0e24b715fa144f9fbac84ba6f47095ecb8bc83ee590e6cc6dea
7
+ data.tar.gz: 2bc4d36810f9d788217f6a82e81b4e1d22e0addfc3ced87dc5d402307c6ad7c4b300409cbf9e2b5a52972165ea7202a313ee10e56740a1232d447a7647f19ae2
data/README.md CHANGED
@@ -41,7 +41,7 @@ Cron expression can be specified using a hash or a string in the format:
41
41
  ```ruby
42
42
  require 'ice_cube_cron'
43
43
 
44
- # using cron expression string (not supported yet)
44
+ # using cron expression string
45
45
  schedule = ::IceCube::Schedule.from_cron(::Date.current, "* * * * 5")
46
46
 
47
47
  # using hash
@@ -70,4 +70,3 @@ schedule.occurrences_between(::Date.new(2015, 3, 5), ::Date.new(2015, 6, 5))
70
70
 
71
71
  ## todo
72
72
  - Add support for time options
73
- - Add support for string cron expressions
@@ -1,3 +1,3 @@
1
1
  module IceCubeCron # :nodoc: all
2
- VERSION = '0.0.4'
2
+ VERSION = '0.0.5'
3
3
  end
@@ -35,7 +35,7 @@ module IceCube
35
35
  end
36
36
 
37
37
  def build_s(builder)
38
- builder.piece(:year) << StringBuilder.nice_number(year)
38
+ builder.piece(:year) << year
39
39
  end
40
40
 
41
41
  def build_hash(builder)
@@ -47,7 +47,7 @@ module IceCube
47
47
  end
48
48
 
49
49
  StringBuilder.register_formatter(:year) do |entries|
50
- "in #{StringBuilder.sentence(entries)} "
50
+ "in #{StringBuilder.sentence(entries)}"
51
51
  end
52
52
  end
53
53
  end
@@ -243,6 +243,10 @@ describe ::IceCubeCron do
243
243
  it '#occurrences_between' do
244
244
  expect(ice_cube_model.occurrences_between(::Date.new(2013, 1, 1), ::Date.new(2017, 12, 31))).to eq([::Date.new(2015, 6, 10)])
245
245
  end
246
+
247
+ it '#to_s' do
248
+ expect(ice_cube_model.to_s).to eq('Yearly in 2015 in June on the 10th day of the month')
249
+ end
246
250
  end
247
251
 
248
252
  context 'in a month of multiple years' do
@@ -258,6 +262,10 @@ describe ::IceCubeCron do
258
262
  it '#occurrences_between' do
259
263
  expect(ice_cube_model.occurrences_between(::Date.new(2013, 1, 1), ::Date.new(2018, 12, 31))).to eq([::Date.new(2015, 6, 10), ::Date.new(2017, 6, 10)])
260
264
  end
265
+
266
+ it '#to_s' do
267
+ expect(ice_cube_model.to_s).to eq('Yearly in 2015 and 2017 in June on the 10th day of the month')
268
+ end
261
269
  end
262
270
 
263
271
  context 'multiple days in month of a year' do
@@ -273,6 +281,10 @@ describe ::IceCubeCron do
273
281
  it '#occurrences_between' do
274
282
  expect(ice_cube_model.occurrences_between(::Date.new(2013, 1, 1), ::Date.new(2017, 12, 31))).to eq([::Date.new(2015, 6, 10), ::Date.new(2015, 6, 15)])
275
283
  end
284
+
285
+ it '#to_s' do
286
+ expect(ice_cube_model.to_s).to eq('Yearly in 2015 in June on the 10th and 15th days of the month')
287
+ end
276
288
  end
277
289
  end
278
290
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ice_cube_cron
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Nichols