ice_cube 0.16.2 → 0.16.4
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 +5 -5
- data/config/locales/de.yml +1 -1
- data/config/locales/fr.yml +2 -2
- data/config/locales/it.yml +179 -0
- data/config/locales/nl.yml +133 -0
- data/config/locales/sv.yml +1 -1
- data/lib/ice_cube/i18n.rb +11 -12
- data/lib/ice_cube/input_alignment.rb +89 -0
- data/lib/ice_cube/null_i18n.rb +12 -6
- data/lib/ice_cube/occurrence.rb +25 -23
- data/lib/ice_cube/parsers/ical_parser.rb +8 -5
- data/lib/ice_cube/rule.rb +4 -11
- data/lib/ice_cube/rules/daily_rule.rb +9 -0
- data/lib/ice_cube/rules/hourly_rule.rb +9 -0
- data/lib/ice_cube/rules/minutely_rule.rb +9 -0
- data/lib/ice_cube/rules/monthly_rule.rb +9 -0
- data/lib/ice_cube/rules/secondly_rule.rb +9 -0
- data/lib/ice_cube/rules/weekly_rule.rb +10 -1
- data/lib/ice_cube/rules/yearly_rule.rb +9 -0
- data/lib/ice_cube/schedule.rb +10 -9
- data/lib/ice_cube/single_occurrence_rule.rb +4 -0
- data/lib/ice_cube/time_util.rb +26 -16
- data/lib/ice_cube/validated_rule.rb +10 -19
- data/lib/ice_cube/validations/count.rb +1 -2
- data/lib/ice_cube/validations/daily_interval.rb +5 -1
- data/lib/ice_cube/validations/day.rb +6 -2
- data/lib/ice_cube/validations/day_of_month.rb +5 -0
- data/lib/ice_cube/validations/hour_of_day.rb +23 -0
- data/lib/ice_cube/validations/hourly_interval.rb +2 -0
- data/lib/ice_cube/validations/minute_of_hour.rb +16 -0
- data/lib/ice_cube/validations/minutely_interval.rb +2 -0
- data/lib/ice_cube/validations/month_of_year.rb +5 -0
- data/lib/ice_cube/validations/monthly_interval.rb +4 -1
- data/lib/ice_cube/validations/schedule_lock.rb +4 -0
- data/lib/ice_cube/validations/second_of_minute.rb +19 -3
- data/lib/ice_cube/validations/secondly_interval.rb +2 -0
- data/lib/ice_cube/validations/until.rb +1 -2
- data/lib/ice_cube/validations/weekly_interval.rb +0 -2
- data/lib/ice_cube/version.rb +1 -1
- data/lib/ice_cube.rb +1 -3
- data/spec/spec_helper.rb +32 -9
- metadata +9 -7
data/spec/spec_helper.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require "bundler/setup"
|
2
2
|
require 'ice_cube'
|
3
|
+
require 'timeout'
|
3
4
|
|
4
5
|
begin
|
5
6
|
require 'simplecov'
|
@@ -19,6 +20,17 @@ WORLD_TIME_ZONES = [
|
|
19
20
|
'Pacific/Auckland', # +1200 / +1300
|
20
21
|
]
|
21
22
|
|
23
|
+
# TODO: enable warnings here and update specs to call IceCube objects correctly
|
24
|
+
def Object.const_missing(sym)
|
25
|
+
case sym
|
26
|
+
when :Schedule, :Rule, :Occurrence, :TimeUtil, :ONE_DAY, :ONE_HOUR, :ONE_MINUTE
|
27
|
+
# warn "Use IceCube::#{sym}", caller[0]
|
28
|
+
IceCube.const_get(sym)
|
29
|
+
else
|
30
|
+
super
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
22
34
|
RSpec.configure do |config|
|
23
35
|
# Enable flags like --only-failures and --next-failure
|
24
36
|
config.example_status_persistence_file_path = ".rspec_status"
|
@@ -29,6 +41,8 @@ RSpec.configure do |config|
|
|
29
41
|
|
30
42
|
Dir[File.dirname(__FILE__) + '/support/**/*'].each { |f| require f }
|
31
43
|
|
44
|
+
config.warnings = true
|
45
|
+
|
32
46
|
config.include WarningHelpers
|
33
47
|
|
34
48
|
config.before :each do |example|
|
@@ -37,15 +51,18 @@ RSpec.configure do |config|
|
|
37
51
|
end
|
38
52
|
end
|
39
53
|
|
40
|
-
config.around :each do |example|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
54
|
+
config.around :each, system_time_zone: true do |example|
|
55
|
+
orig_zone = ENV['TZ']
|
56
|
+
ENV['TZ'] = example.metadata[:system_time_zone]
|
57
|
+
example.run
|
58
|
+
ENV['TZ'] = orig_zone
|
59
|
+
end
|
60
|
+
|
61
|
+
config.around :each, locale: true do |example|
|
62
|
+
orig_locale = I18n.locale
|
63
|
+
I18n.locale = example.metadata[:locale]
|
64
|
+
example.run
|
65
|
+
I18n.locale = orig_locale
|
49
66
|
end
|
50
67
|
|
51
68
|
config.around :each, expect_warnings: true do |example|
|
@@ -53,4 +70,10 @@ RSpec.configure do |config|
|
|
53
70
|
example.run
|
54
71
|
end
|
55
72
|
end
|
73
|
+
|
74
|
+
config.around :each do |example|
|
75
|
+
Timeout.timeout(example.metadata.fetch(:timeout, 1)) do
|
76
|
+
example.run
|
77
|
+
end
|
78
|
+
end
|
56
79
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ice_cube
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.16.
|
4
|
+
version: 0.16.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Crepezzi
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-10-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -49,7 +49,9 @@ files:
|
|
49
49
|
- config/locales/en.yml
|
50
50
|
- config/locales/es.yml
|
51
51
|
- config/locales/fr.yml
|
52
|
+
- config/locales/it.yml
|
52
53
|
- config/locales/ja.yml
|
54
|
+
- config/locales/nl.yml
|
53
55
|
- config/locales/pt-BR.yml
|
54
56
|
- config/locales/ru.yml
|
55
57
|
- config/locales/sv.yml
|
@@ -62,6 +64,7 @@ files:
|
|
62
64
|
- lib/ice_cube/errors/until_exceeded.rb
|
63
65
|
- lib/ice_cube/flexible_hash.rb
|
64
66
|
- lib/ice_cube/i18n.rb
|
67
|
+
- lib/ice_cube/input_alignment.rb
|
65
68
|
- lib/ice_cube/null_i18n.rb
|
66
69
|
- lib/ice_cube/occurrence.rb
|
67
70
|
- lib/ice_cube/parsers/hash_parser.rb
|
@@ -105,7 +108,7 @@ homepage: http://seejohnrun.github.com/ice_cube/
|
|
105
108
|
licenses:
|
106
109
|
- MIT
|
107
110
|
metadata: {}
|
108
|
-
post_install_message:
|
111
|
+
post_install_message:
|
109
112
|
rdoc_options: []
|
110
113
|
require_paths:
|
111
114
|
- lib
|
@@ -120,9 +123,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
120
123
|
- !ruby/object:Gem::Version
|
121
124
|
version: '0'
|
122
125
|
requirements: []
|
123
|
-
|
124
|
-
|
125
|
-
signing_key:
|
126
|
+
rubygems_version: 3.1.4
|
127
|
+
signing_key:
|
126
128
|
specification_version: 4
|
127
129
|
summary: Ruby Date Recurrence Library
|
128
130
|
test_files:
|