montrose 0.7.0 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +16 -10
- data/.travis.yml +14 -7
- data/Appraisals +6 -0
- data/CHANGELOG.md +8 -0
- data/Gemfile +5 -4
- data/Guardfile +1 -0
- data/Rakefile +2 -1
- data/gemfiles/activesupport_5.2.gemfile +16 -0
- data/lib/montrose.rb +1 -0
- data/lib/montrose/chainable.rb +1 -0
- data/lib/montrose/clock.rb +2 -1
- data/lib/montrose/errors.rb +1 -0
- data/lib/montrose/frequency.rb +1 -0
- data/lib/montrose/frequency/daily.rb +1 -0
- data/lib/montrose/frequency/hourly.rb +1 -0
- data/lib/montrose/frequency/minutely.rb +1 -0
- data/lib/montrose/frequency/monthly.rb +1 -0
- data/lib/montrose/frequency/secondly.rb +1 -0
- data/lib/montrose/frequency/weekly.rb +1 -0
- data/lib/montrose/frequency/yearly.rb +1 -0
- data/lib/montrose/options.rb +4 -2
- data/lib/montrose/recurrence.rb +2 -1
- data/lib/montrose/refinements/array_concat.rb +1 -0
- data/lib/montrose/rule.rb +1 -0
- data/lib/montrose/rule/after.rb +1 -0
- data/lib/montrose/rule/between.rb +1 -0
- data/lib/montrose/rule/day_of_month.rb +1 -0
- data/lib/montrose/rule/day_of_week.rb +1 -0
- data/lib/montrose/rule/day_of_year.rb +1 -0
- data/lib/montrose/rule/except.rb +1 -0
- data/lib/montrose/rule/hour_of_day.rb +1 -0
- data/lib/montrose/rule/month_of_year.rb +1 -0
- data/lib/montrose/rule/nth_day_matcher.rb +1 -0
- data/lib/montrose/rule/nth_day_of_month.rb +1 -0
- data/lib/montrose/rule/nth_day_of_year.rb +1 -0
- data/lib/montrose/rule/time_of_day.rb +3 -2
- data/lib/montrose/rule/total.rb +1 -0
- data/lib/montrose/rule/until.rb +1 -0
- data/lib/montrose/rule/week_of_year.rb +1 -0
- data/lib/montrose/schedule.rb +1 -0
- data/lib/montrose/stack.rb +1 -0
- data/lib/montrose/utils.rb +1 -0
- data/lib/montrose/version.rb +2 -1
- data/montrose.gemspec +6 -6
- metadata +22 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 84030dd2ad699d4db2bb62011fa41867964f9e56
|
4
|
+
data.tar.gz: 00a3b299b80f0cdfc0659bee39ff7266d6275d24
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9d1e5813fba6d74ecdd137e32e911ccfb5642d939c5732e2e302489a66e964ea239175d74c43a3c1d8ffad235c5131a09f773c9bf072d27b4a9569597f5a695d
|
7
|
+
data.tar.gz: 7bd9adae17eff3af8f6cc2d17de785f1ec851856fb5196c54bd9799f99bd70e4c863b23af7f31abe783c920a30c39aedfeb252743e320f925303fc853803476f
|
data/.rubocop.yml
CHANGED
@@ -2,6 +2,7 @@ AllCops:
|
|
2
2
|
Exclude:
|
3
3
|
- 'bin/**/*'
|
4
4
|
- 'gemfiles/**/*'
|
5
|
+
TargetRubyVersion: '2.1.0'
|
5
6
|
|
6
7
|
Lint/HandleExceptions:
|
7
8
|
Exclude:
|
@@ -31,6 +32,9 @@ Metrics/CyclomaticComplexity:
|
|
31
32
|
Metrics/PerceivedComplexity:
|
32
33
|
Enabled: false
|
33
34
|
|
35
|
+
Metrics/BlockLength:
|
36
|
+
Enabled: false
|
37
|
+
|
34
38
|
Documentation:
|
35
39
|
Enabled: false # TODO: Enable again once we have more docs
|
36
40
|
|
@@ -56,13 +60,13 @@ Style/TrivialAccessors:
|
|
56
60
|
Style/HashSyntax:
|
57
61
|
Enabled: true
|
58
62
|
|
59
|
-
|
63
|
+
Naming/MethodName:
|
60
64
|
Enabled: false
|
61
65
|
|
62
|
-
|
66
|
+
Layout/AlignParameters:
|
63
67
|
EnforcedStyle: with_fixed_indentation
|
64
68
|
|
65
|
-
|
69
|
+
Layout/AccessModifierIndentation:
|
66
70
|
Enabled: true
|
67
71
|
|
68
72
|
Style/StringLiterals:
|
@@ -71,7 +75,7 @@ Style/StringLiterals:
|
|
71
75
|
Style/StringLiteralsInInterpolation:
|
72
76
|
EnforcedStyle: double_quotes
|
73
77
|
|
74
|
-
|
78
|
+
Layout/ClosingParenthesisIndentation:
|
75
79
|
Enabled: false
|
76
80
|
|
77
81
|
Style/OneLineConditional:
|
@@ -83,8 +87,7 @@ Style/AndOr:
|
|
83
87
|
Style/Not:
|
84
88
|
Enabled: false
|
85
89
|
|
86
|
-
|
87
|
-
IndentWhenRelativeTo: case
|
90
|
+
Layout/CaseIndentation:
|
88
91
|
SupportedStyles:
|
89
92
|
- case
|
90
93
|
- end
|
@@ -95,13 +98,13 @@ Style/PercentLiteralDelimiters:
|
|
95
98
|
'%w': "[]"
|
96
99
|
'%W': "[]"
|
97
100
|
|
98
|
-
|
101
|
+
Layout/AccessModifierIndentation:
|
99
102
|
EnforcedStyle: indent
|
100
103
|
|
101
104
|
Style/SignalException:
|
102
105
|
Enabled: false
|
103
106
|
|
104
|
-
|
107
|
+
Layout/IndentationWidth:
|
105
108
|
Enabled: false
|
106
109
|
|
107
110
|
Style/TrivialAccessors:
|
@@ -110,10 +113,10 @@ Style/TrivialAccessors:
|
|
110
113
|
Style/RegexpLiteral:
|
111
114
|
EnforcedStyle: percent_r
|
112
115
|
|
113
|
-
|
116
|
+
Layout/DotPosition:
|
114
117
|
EnforcedStyle: trailing
|
115
118
|
|
116
|
-
|
119
|
+
Naming/VariableNumber:
|
117
120
|
Enabled: false
|
118
121
|
|
119
122
|
Style/FormatString:
|
@@ -124,3 +127,6 @@ Style/MutableConstant:
|
|
124
127
|
|
125
128
|
Style/NumericPredicate:
|
126
129
|
Enabled: false
|
130
|
+
|
131
|
+
Style/SymbolArray:
|
132
|
+
Enabled: false
|
data/.travis.yml
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
bundler_args: "--jobs 4 --retry 3"
|
2
2
|
cache: bundler
|
3
3
|
gemfile:
|
4
|
+
- gemfiles/activesupport_5.2.gemfile
|
4
5
|
- gemfiles/activesupport_5.1.gemfile
|
5
6
|
- gemfiles/activesupport_5.0.gemfile
|
6
7
|
- gemfiles/activesupport_4.2.gemfile
|
@@ -8,19 +9,25 @@ gemfile:
|
|
8
9
|
language: ruby
|
9
10
|
matrix:
|
10
11
|
exclude:
|
11
|
-
- rvm: 2.1
|
12
|
+
- rvm: 2.1
|
12
13
|
gemfile: gemfiles/activesupport_5.0.gemfile # Requires Ruby 2.2+
|
13
|
-
- rvm: 2.1
|
14
|
+
- rvm: 2.1
|
14
15
|
gemfile: gemfiles/activesupport_5.1.gemfile # Requires Ruby 2.2+
|
15
|
-
- rvm: 2.
|
16
|
+
- rvm: 2.1
|
17
|
+
gemfile: gemfiles/activesupport_5.2.gemfile # Requires Ruby 2.2+
|
18
|
+
- rvm: 2.4
|
19
|
+
gemfile: gemfiles/activesupport_4.1.gemfile # Requires json 1.8.5+
|
20
|
+
- rvm: 2.5
|
16
21
|
gemfile: gemfiles/activesupport_4.1.gemfile # Requires json 1.8.5+
|
17
22
|
fast_finish: true
|
18
23
|
rvm:
|
19
|
-
- 2.1
|
20
|
-
- 2.2
|
21
|
-
- 2.3
|
22
|
-
- 2.4
|
24
|
+
- 2.1
|
25
|
+
- 2.2
|
26
|
+
- 2.3
|
27
|
+
- 2.4
|
28
|
+
- 2.5
|
23
29
|
sudo: false
|
24
30
|
before_install:
|
25
31
|
- gem update --system
|
26
32
|
- gem --version
|
33
|
+
- gem install bundler
|
data/Appraisals
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
### 0.8.0 - (2018-05-29)
|
2
|
+
|
3
|
+
* enhancements
|
4
|
+
* Parsing the `:at` option now initializes recurrence by the hour-minute-second
|
5
|
+
* Support activesupport-5.2 (by @zokioki)
|
6
|
+
* Support ruby-2.5
|
7
|
+
* Support YAML.safe_load for Recurrence#to_yaml
|
8
|
+
|
1
9
|
### 0.7.0 - (2017-09-18)
|
2
10
|
|
3
11
|
* enhancements
|
data/Gemfile
CHANGED
@@ -1,13 +1,14 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
source "https://rubygems.org"
|
3
4
|
|
4
5
|
gemspec
|
5
6
|
|
6
7
|
group :development do
|
7
8
|
gem "coveralls"
|
8
|
-
gem "guard", platforms: [
|
9
|
-
gem "guard-minitest", platforms: [
|
10
|
-
gem "guard-rubocop", platforms: [
|
11
|
-
gem "pry-byebug", platforms: [
|
9
|
+
gem "guard", platforms: %i[ruby_22 ruby_23] # Guard no longer supports ruby 2.1
|
10
|
+
gem "guard-minitest", platforms: %i[ruby_22 ruby_23]
|
11
|
+
gem "guard-rubocop", platforms: %i[ruby_22 ruby_23]
|
12
|
+
gem "pry-byebug", platforms: %i[ruby_21 ruby_22 ruby_23 ruby_24]
|
12
13
|
gem "yard"
|
13
14
|
end
|
data/Guardfile
CHANGED
data/Rakefile
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
require "bundler/setup"
|
3
4
|
require "bundler/gem_tasks"
|
4
5
|
require "rake/testtask"
|
@@ -16,7 +17,7 @@ task test: :spec
|
|
16
17
|
|
17
18
|
RuboCop::RakeTask.new
|
18
19
|
|
19
|
-
task default: [
|
20
|
+
task default: %i[spec rubocop]
|
20
21
|
|
21
22
|
namespace :doc do
|
22
23
|
desc "Generate docs and publish to gh-pages"
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# This file was generated by Appraisal
|
2
|
+
|
3
|
+
source "https://rubygems.org"
|
4
|
+
|
5
|
+
gem "activesupport", "~> 5.2.0"
|
6
|
+
|
7
|
+
group :development do
|
8
|
+
gem "coveralls"
|
9
|
+
gem "guard", platforms: [:ruby_22, :ruby_23]
|
10
|
+
gem "guard-minitest", platforms: [:ruby_22, :ruby_23]
|
11
|
+
gem "guard-rubocop", platforms: [:ruby_22, :ruby_23]
|
12
|
+
gem "pry-byebug", platforms: [:ruby_21, :ruby_22, :ruby_23]
|
13
|
+
gem "yard"
|
14
|
+
end
|
15
|
+
|
16
|
+
gemspec path: "../"
|
data/lib/montrose.rb
CHANGED
data/lib/montrose/chainable.rb
CHANGED
data/lib/montrose/clock.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
require "montrose/errors"
|
3
4
|
|
4
5
|
module Montrose
|
@@ -23,7 +24,7 @@ module Montrose
|
|
23
24
|
return @start_time if @time.nil?
|
24
25
|
|
25
26
|
if @at
|
26
|
-
times = @at.map { |
|
27
|
+
times = @at.map { |hour, min, sec = 0| @time.change(hour: hour, min: min, sec: sec) }
|
27
28
|
|
28
29
|
min_next = times.select { |t| t > @time }.min and return min_next
|
29
30
|
|
data/lib/montrose/errors.rb
CHANGED
data/lib/montrose/frequency.rb
CHANGED
data/lib/montrose/options.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
module Montrose
|
3
4
|
class Options
|
4
5
|
include Montrose::Utils
|
@@ -23,7 +24,8 @@ module Montrose
|
|
23
24
|
protected :"#{name}="
|
24
25
|
end
|
25
26
|
|
26
|
-
attr_accessor :
|
27
|
+
attr_accessor :default_every
|
28
|
+
attr_writer :default_starts, :default_until
|
27
29
|
|
28
30
|
# Return the default ending time.
|
29
31
|
#
|
@@ -305,7 +307,7 @@ module Montrose
|
|
305
307
|
return arg if arg.is_a?(Array)
|
306
308
|
|
307
309
|
time = as_time(arg)
|
308
|
-
[time.hour, time.min]
|
310
|
+
[time.hour, time.min, time.sec]
|
309
311
|
end
|
310
312
|
|
311
313
|
def parse_frequency(input)
|
data/lib/montrose/recurrence.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
require "json"
|
3
4
|
require "yaml"
|
4
5
|
require "montrose/chainable"
|
@@ -321,7 +322,7 @@ module Montrose
|
|
321
322
|
# @return [String] YAML-formatted recurrence options
|
322
323
|
#
|
323
324
|
def to_yaml(*args)
|
324
|
-
YAML.dump(
|
325
|
+
YAML.dump(JSON.parse(to_json(*args)))
|
325
326
|
end
|
326
327
|
|
327
328
|
def inspect
|
data/lib/montrose/rule.rb
CHANGED
data/lib/montrose/rule/after.rb
CHANGED
data/lib/montrose/rule/except.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
module Montrose
|
3
4
|
module Rule
|
4
5
|
class TimeOfDay
|
@@ -10,7 +11,7 @@ module Montrose
|
|
10
11
|
|
11
12
|
# Initializes rule
|
12
13
|
#
|
13
|
-
# @param [Array<Time>] times - valid
|
14
|
+
# @param [Array<Time>] times - valid times
|
14
15
|
#
|
15
16
|
def initialize(times)
|
16
17
|
@times = times
|
@@ -23,7 +24,7 @@ module Montrose
|
|
23
24
|
private
|
24
25
|
|
25
26
|
def parts(time)
|
26
|
-
[time.hour, time.min]
|
27
|
+
[time.hour, time.min, time.sec]
|
27
28
|
end
|
28
29
|
end
|
29
30
|
end
|
data/lib/montrose/rule/total.rb
CHANGED
data/lib/montrose/rule/until.rb
CHANGED
data/lib/montrose/schedule.rb
CHANGED
data/lib/montrose/stack.rb
CHANGED
data/lib/montrose/utils.rb
CHANGED
data/lib/montrose/version.rb
CHANGED
data/montrose.gemspec
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
# coding: utf-8
|
2
1
|
# frozen_string_literal: true
|
2
|
+
|
3
3
|
lib = File.expand_path("../lib", __FILE__)
|
4
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
5
|
require "montrose/version"
|
@@ -22,13 +22,13 @@ Gem::Specification.new do |spec|
|
|
22
22
|
|
23
23
|
spec.required_ruby_version = ">= 2.1.0"
|
24
24
|
|
25
|
-
spec.add_dependency "activesupport", ">= 4.1", "< 5.
|
25
|
+
spec.add_dependency "activesupport", ">= 4.1", "< 5.3"
|
26
26
|
|
27
|
-
spec.add_development_dependency "bundler", "~> 1.13"
|
28
27
|
spec.add_development_dependency "appraisal", "~> 2.2.0"
|
29
|
-
spec.add_development_dependency "
|
30
|
-
spec.add_development_dependency "minitest", "~> 5.10"
|
28
|
+
spec.add_development_dependency "bundler", "~> 1.13"
|
31
29
|
spec.add_development_dependency "m", "~> 1.5"
|
32
|
-
spec.add_development_dependency "
|
30
|
+
spec.add_development_dependency "minitest", "~> 5.10"
|
31
|
+
spec.add_development_dependency "rake", "~> 11.0"
|
32
|
+
spec.add_development_dependency "rubocop", "~> 0.52.1"
|
33
33
|
spec.add_development_dependency "timecop"
|
34
34
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: montrose
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ross Kaffenberger
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-05-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
version: '4.1'
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: '5.
|
22
|
+
version: '5.3'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,49 +29,49 @@ dependencies:
|
|
29
29
|
version: '4.1'
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '5.
|
32
|
+
version: '5.3'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
|
-
name:
|
34
|
+
name: appraisal
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
37
|
- - "~>"
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version:
|
39
|
+
version: 2.2.0
|
40
40
|
type: :development
|
41
41
|
prerelease: false
|
42
42
|
version_requirements: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
44
44
|
- - "~>"
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version:
|
46
|
+
version: 2.2.0
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
|
-
name:
|
48
|
+
name: bundler
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
51
|
- - "~>"
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version:
|
53
|
+
version: '1.13'
|
54
54
|
type: :development
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
58
|
- - "~>"
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version:
|
60
|
+
version: '1.13'
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
|
-
name:
|
62
|
+
name: m
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|
64
64
|
requirements:
|
65
65
|
- - "~>"
|
66
66
|
- !ruby/object:Gem::Version
|
67
|
-
version: '
|
67
|
+
version: '1.5'
|
68
68
|
type: :development
|
69
69
|
prerelease: false
|
70
70
|
version_requirements: !ruby/object:Gem::Requirement
|
71
71
|
requirements:
|
72
72
|
- - "~>"
|
73
73
|
- !ruby/object:Gem::Version
|
74
|
-
version: '
|
74
|
+
version: '1.5'
|
75
75
|
- !ruby/object:Gem::Dependency
|
76
76
|
name: minitest
|
77
77
|
requirement: !ruby/object:Gem::Requirement
|
@@ -87,33 +87,33 @@ dependencies:
|
|
87
87
|
- !ruby/object:Gem::Version
|
88
88
|
version: '5.10'
|
89
89
|
- !ruby/object:Gem::Dependency
|
90
|
-
name:
|
90
|
+
name: rake
|
91
91
|
requirement: !ruby/object:Gem::Requirement
|
92
92
|
requirements:
|
93
93
|
- - "~>"
|
94
94
|
- !ruby/object:Gem::Version
|
95
|
-
version: '
|
95
|
+
version: '11.0'
|
96
96
|
type: :development
|
97
97
|
prerelease: false
|
98
98
|
version_requirements: !ruby/object:Gem::Requirement
|
99
99
|
requirements:
|
100
100
|
- - "~>"
|
101
101
|
- !ruby/object:Gem::Version
|
102
|
-
version: '
|
102
|
+
version: '11.0'
|
103
103
|
- !ruby/object:Gem::Dependency
|
104
104
|
name: rubocop
|
105
105
|
requirement: !ruby/object:Gem::Requirement
|
106
106
|
requirements:
|
107
|
-
- -
|
107
|
+
- - "~>"
|
108
108
|
- !ruby/object:Gem::Version
|
109
|
-
version: 0.
|
109
|
+
version: 0.52.1
|
110
110
|
type: :development
|
111
111
|
prerelease: false
|
112
112
|
version_requirements: !ruby/object:Gem::Requirement
|
113
113
|
requirements:
|
114
|
-
- -
|
114
|
+
- - "~>"
|
115
115
|
- !ruby/object:Gem::Version
|
116
|
-
version: 0.
|
116
|
+
version: 0.52.1
|
117
117
|
- !ruby/object:Gem::Dependency
|
118
118
|
name: timecop
|
119
119
|
requirement: !ruby/object:Gem::Requirement
|
@@ -160,6 +160,7 @@ files:
|
|
160
160
|
- gemfiles/activesupport_4.2.gemfile
|
161
161
|
- gemfiles/activesupport_5.0.gemfile
|
162
162
|
- gemfiles/activesupport_5.1.gemfile
|
163
|
+
- gemfiles/activesupport_5.2.gemfile
|
163
164
|
- lib/montrose.rb
|
164
165
|
- lib/montrose/chainable.rb
|
165
166
|
- lib/montrose/clock.rb
|
@@ -216,7 +217,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
216
217
|
version: '0'
|
217
218
|
requirements: []
|
218
219
|
rubyforge_project:
|
219
|
-
rubygems_version: 2.
|
220
|
+
rubygems_version: 2.6.11
|
220
221
|
signing_key:
|
221
222
|
specification_version: 4
|
222
223
|
summary: Recurring events in Ruby
|