cronex 0.8.0 → 0.11.0

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.
@@ -5,7 +5,8 @@ module Cronex
5
5
  describe ExpressionDescriptor do
6
6
 
7
7
  def desc(expression, opts = {})
8
- Cronex::ExpressionDescriptor.new(expression, opts, 'pt_BR').description
8
+ opts[:locale] = 'pt_BR'
9
+ Cronex::ExpressionDescriptor.new(expression, opts).description
9
10
  end
10
11
 
11
12
  let(:opts) { { zero_based_dow: false } }
@@ -238,8 +239,14 @@ module Cronex
238
239
  end
239
240
  end
240
241
 
241
- it 'last day of the month' do
242
- expect(desc('*/5 * L JAN *')).to eq('A cada 5 minutos, no último dia do mês, em janeiro')
242
+ context 'last day of the month:' do
243
+ it 'on the last day of the month' do
244
+ expect(desc('*/5 * L JAN *')).to eq('A cada 5 minutos, no último dia do mês, em janeiro')
245
+ end
246
+
247
+ it 'between a day and last day of the month' do
248
+ expect(desc('*/5 * 23-L JAN *')).to eq('A cada 5 minutos, entre os dias 23 e último dia do mês, em janeiro')
249
+ end
243
250
  end
244
251
 
245
252
  it 'time of day with seconds' do
@@ -5,7 +5,8 @@ module Cronex
5
5
  describe ExpressionDescriptor do
6
6
 
7
7
  def desc(expression, opts = {})
8
- Cronex::ExpressionDescriptor.new(expression, opts, 'ro').description
8
+ opts[:locale] = 'ro'
9
+ Cronex::ExpressionDescriptor.new(expression, opts).description
9
10
  end
10
11
 
11
12
  let(:opts) { { zero_based_dow: false } }
@@ -238,8 +239,14 @@ module Cronex
238
239
  end
239
240
  end
240
241
 
241
- it 'last day of the month' do
242
- expect(desc('*/5 * L JAN *')).to eq('La fiecare 5 minute, în ultima zi a lunii, numai în ianuarie')
242
+ context 'last day of the month:' do
243
+ it 'on the last day of the month' do
244
+ expect(desc('*/5 * L JAN *')).to eq('La fiecare 5 minute, în ultima zi a lunii, numai în ianuarie')
245
+ end
246
+
247
+ it 'between a day and last day of the month' do
248
+ expect(desc('*/5 * 23-L JAN *')).to eq('La fiecare 5 minute, între zilele 23 și ultima zi a lunii, numai în ianuarie')
249
+ end
243
250
  end
244
251
 
245
252
  it 'time of day with seconds' do
@@ -270,7 +277,7 @@ module Cronex
270
277
 
271
278
  it 'between with interval' do
272
279
  expect(desc('2-59/3 1,9,22 11-26 1-6 ?')).to eq(
273
- 'La fiecare 3 minute, între minutele 02 și 59, la 1:00 AM, 9:00 AM și 10:00 PM, între a 11-a și a 26-a zi a lunii, din ianuarie până în iunie')
280
+ 'La fiecare 3 minute, între minutele 02 și 59, la 1:00 AM, 9:00 AM și 10:00 PM, între zilele 11 și 26 a lunii, din ianuarie până în iunie')
274
281
  end
275
282
 
276
283
  it 'recurring first of month' do
@@ -5,7 +5,8 @@ module Cronex
5
5
  describe ExpressionDescriptor do
6
6
 
7
7
  def desc(expression, opts = {})
8
- Cronex::ExpressionDescriptor.new(expression, opts, 'ru').description
8
+ opts[:locale] = 'ru'
9
+ Cronex::ExpressionDescriptor.new(expression, opts).description
9
10
  end
10
11
 
11
12
  let(:opts) { { zero_based_dow: false } }
@@ -177,11 +178,11 @@ module Cronex
177
178
  end
178
179
 
179
180
  it 'day of month' do
180
- expect(desc('23 12 15 * *')).to eq('В 12:23 PM, 15 число месяца')
181
+ expect(desc('23 12 15 * *')).to eq('В 12:23 PM, 15 день месяца')
181
182
  end
182
183
 
183
184
  it 'day of month with day of week' do
184
- expect(desc('23 12 15 * SUN')).to eq('В 12:23 PM, 15 число месяца, только воскресенье')
185
+ expect(desc('23 12 15 * SUN')).to eq('В 12:23 PM, 15 день месяца, только воскресенье')
185
186
  end
186
187
 
187
188
  it 'month name' do
@@ -238,8 +239,14 @@ module Cronex
238
239
  end
239
240
  end
240
241
 
241
- it 'last day of the month' do
242
- expect(desc('*/5 * L JAN *')).to eq('Каждые 5 минут, в последний день месяца, только январь')
242
+ context 'last day of the month:' do
243
+ it 'on the last day of the month' do
244
+ expect(desc('*/5 * L JAN *')).to eq('Каждые 5 минут, в последний день месяца, только январь')
245
+ end
246
+
247
+ it 'between a day and last day of the month' do
248
+ expect(desc('*/5 * 23-L JAN *')).to eq('Каждые 5 минут, между 23 днем и последним днем месяца, только январь')
249
+ end
243
250
  end
244
251
 
245
252
  it 'time of day with seconds' do
@@ -252,7 +259,7 @@ module Cronex
252
259
 
253
260
  it 'second minutes hours intervals' do
254
261
  expect(desc('5-10 30-35 10-12 * * *')).to eq(
255
- 'Секунды с 5 по 10, минуты с 30 по 35, с 10:00 AM по 12:59 PM')
262
+ 'Секунды с 5 по 10, минуты с 30 по 35, между 10:00 AM и 12:59 PM')
256
263
  end
257
264
 
258
265
  it 'every 5 minutes at 30 seconds' do
@@ -261,7 +268,7 @@ module Cronex
261
268
 
262
269
  it 'minutes past the hour range' do
263
270
  expect(desc('0 30 10-13 ? * WED,FRI')).to eq(
264
- 'В 30 минут часа, с 10:00 AM по 1:59 PM, только среда и пятница')
271
+ 'В 30 минут часа, между 10:00 AM и 1:59 PM, только среда и пятница')
265
272
  end
266
273
 
267
274
  it 'seconds past the minute interval' do
@@ -270,7 +277,7 @@ module Cronex
270
277
 
271
278
  it 'between with interval' do
272
279
  expect(desc('2-59/3 1,9,22 11-26 1-6 ?')).to eq(
273
- 'Каждые 3 минут, минуты с 02 по 59, в 1:00 AM, 9:00 AM и 10:00 PM, с 11 по 26 число месяца, январь - июнь')
280
+ 'Каждые 3 минут, минуты с 02 по 59, в 1:00 AM, 9:00 AM и 10:00 PM, между 11 днем и 26 днем месяца, январь - июнь')
274
281
  end
275
282
 
276
283
  it 'recurring first of month' do
@@ -327,11 +334,11 @@ module Cronex
327
334
  end
328
335
 
329
336
  it 'minutes past the hour 5,10 day 2' do
330
- expect(desc('5,10 0 2 * *')).to eq('В 05 и 10 минут часа, 2 число месяца')
337
+ expect(desc('5,10 0 2 * *')).to eq('В 05 и 10 минут часа, 2 день месяца')
331
338
  end
332
339
 
333
340
  it 'minutes past the hour 5/10 day 2' do
334
- expect(desc('5/10 0 2 * *')).to eq('Каждые 10 минут, начало в 05 минут часа, 2 число месяца')
341
+ expect(desc('5/10 0 2 * *')).to eq('Каждые 10 минут, начало в 05 минут часа, 2 день месяца')
335
342
  end
336
343
  end
337
344
 
@@ -345,7 +352,7 @@ module Cronex
345
352
  end
346
353
 
347
354
  it 'seconds past the minute 5,6 day 2' do
348
- expect(desc('5,6 0 0 2 * *')).to eq('В 5 и 6 секунд, 2 число месяца')
355
+ expect(desc('5,6 0 0 2 * *')).to eq('В 5 и 6 секунд, 2 день месяца')
349
356
  end
350
357
  end
351
358
 
@@ -363,7 +370,7 @@ module Cronex
363
370
  end
364
371
 
365
372
  it 'day of month increments' do
366
- expect(desc('0 30 8 2/7 * *')).to eq('В 8:30 AM, каждые 7 дня(ей), начало 2 число месяца')
373
+ expect(desc('0 30 8 2/7 * *')).to eq('В 8:30 AM, каждые 7 дня(ей), начало 2 день месяца')
367
374
  end
368
375
 
369
376
  it 'day of week increments' do
@@ -375,7 +382,7 @@ module Cronex
375
382
  end
376
383
 
377
384
  it 'year increments' do
378
- expect(desc('0 0 0 1 MAR * 2010/5')).to eq('В 12:00 AM, 1 число месяца, только март, каждые 5 лет, начало в 2010')
385
+ expect(desc('0 0 0 1 MAR * 2010/5')).to eq('В 12:00 AM, 1 день месяца, только март, каждые 5 лет, начало в 2010')
379
386
  end
380
387
  end
381
388
  end
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cronex
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adrian Kazaku
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-04-18 00:00:00.000000000 Z
11
+ date: 2020-10-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tzinfo
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 1.2.5
19
+ version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 1.2.5
26
+ version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: unicode
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -56,16 +56,16 @@ dependencies:
56
56
  name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: '10.1'
61
+ version: 12.3.3
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: '10.1'
68
+ version: 12.3.3
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rspec
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -113,14 +113,18 @@ files:
113
113
  - lib/cronex/resource.rb
114
114
  - lib/cronex/utils.rb
115
115
  - lib/cronex/version.rb
116
+ - resources/resources_de.yml
116
117
  - resources/resources_en.yml
117
118
  - resources/resources_fr.yml
119
+ - resources/resources_it.yml
118
120
  - resources/resources_pt_BR.yml
119
121
  - resources/resources_ro.yml
120
122
  - resources/resources_ru.yml
121
123
  - spec/casing_spec.rb
124
+ - spec/exp_descriptor_de_spec.rb
122
125
  - spec/exp_descriptor_en_spec.rb
123
126
  - spec/exp_descriptor_fr_spec.rb
127
+ - spec/exp_descriptor_it_spec.rb
124
128
  - spec/exp_descriptor_pt_BR_spec.rb
125
129
  - spec/exp_descriptor_ro_spec.rb
126
130
  - spec/exp_descriptor_ru_spec.rb
@@ -129,7 +133,7 @@ homepage: https://github.com/alpinweis/cronex
129
133
  licenses:
130
134
  - Apache-2.0
131
135
  metadata: {}
132
- post_install_message:
136
+ post_install_message:
133
137
  rdoc_options: []
134
138
  require_paths:
135
139
  - lib
@@ -144,15 +148,16 @@ required_rubygems_version: !ruby/object:Gem::Requirement
144
148
  - !ruby/object:Gem::Version
145
149
  version: '0'
146
150
  requirements: []
147
- rubyforge_project:
148
- rubygems_version: 2.6.14
149
- signing_key:
151
+ rubygems_version: 3.0.8
152
+ signing_key:
150
153
  specification_version: 4
151
154
  summary: Ruby library that converts cron expressions into human readable strings
152
155
  test_files:
153
156
  - spec/casing_spec.rb
157
+ - spec/exp_descriptor_de_spec.rb
154
158
  - spec/exp_descriptor_en_spec.rb
155
159
  - spec/exp_descriptor_fr_spec.rb
160
+ - spec/exp_descriptor_it_spec.rb
156
161
  - spec/exp_descriptor_pt_BR_spec.rb
157
162
  - spec/exp_descriptor_ro_spec.rb
158
163
  - spec/exp_descriptor_ru_spec.rb