montrose 0.13.0 → 0.15.0

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
  SHA256:
3
- metadata.gz: c4b7914b70270912f8acf6757a8f130112d9137c50c34b933714f0edf97ac3c1
4
- data.tar.gz: d70713d758bf62b45a7a74196f3d2c5bcc0a4bcf48b899164d7b5d4e2afe6b4a
3
+ metadata.gz: d987c6a9b58b5a73d95b6cf86a42f7887d8778760f08bb02e0fcffe24a06320e
4
+ data.tar.gz: 844da8c5fda1cb93bc0633fe69f8461c9e07a11292478c355a8c6ccfed6a1a6a
5
5
  SHA512:
6
- metadata.gz: 5ea9a0877d09b1d360c3de7dc9b68a4fd9b6f64047728991d0398333777c18afa06f12fba1b2e178f53bd412f054314b125a174099a896c554cc53a337672fb5
7
- data.tar.gz: f0b7431307846f0fa969352cfb98101ae2542ad37dd443e8324dd1480b01edfa81f8c06f92b6dc96f4278410f7cb221b7a1c1a487241a0faf8f5ee07fd763db3
6
+ metadata.gz: 9852954548cc4fb698dc492d7573e7bedf20d470b0729a1bcd63b26c76828d01eb2d13cc793b3e8a8019135f8de104fbc3e3ea2ac2514c48462e0c4d2236f258
7
+ data.tar.gz: 67a3b6ba8d0ebd629658dbe023682954fa51dbd5bc1105a462be0b619237ed29dd29c0c13ec0cfcab1c9fb7eca29b8af00cbcb6417a1a31e96e07664cdb49c50
data/.circleci/config.yml CHANGED
@@ -1,66 +1,141 @@
1
1
  version: 2.1
2
2
  orbs:
3
- ruby: circleci/ruby@1.3.0
3
+ ruby: circleci/ruby@2.1.0
4
+
5
+ executors:
6
+ app-ruby:
7
+ parameters:
8
+ ruby-version:
9
+ type: string
10
+ default: '2.7'
11
+ docker:
12
+ - image: cimg/ruby:<<parameters.ruby-version>>
13
+
4
14
  commands:
5
15
  run-tests:
6
16
  description: Run tests
7
17
  steps:
8
18
  - run: bundle exec rake test
9
- restore:
10
- description: Restore cache
19
+
20
+ run-lint:
21
+ description: Run standardrb lint check
11
22
  steps:
12
- - restore_cache:
13
- keys:
14
- - v1_bundler_deps-
15
- save:
16
- description: Save cache
23
+ - run: bundle exec rake standard
24
+
25
+ run-docs-build:
26
+ description: Generate docs
17
27
  steps:
18
- - save_cache:
19
- paths:
20
- - ./vendor/bundle
21
- key: v1-bundler-deps-{{ .Environment.CIRCLE_JOB }}
22
- bundle:
23
- description: Install dependencies
28
+ - run: bundle exec rake doc:build
29
+
30
+ run-docs-publish:
31
+ description: Update gh-pages
24
32
  steps:
25
- - run:
26
- echo "export BUNDLE_JOBS=4" >> $BASH_ENV
27
- echo "export BUNDLE_RETRY=3" >> $BASH_ENV
28
- echo "export BUNDLE_PATH=$(pwd)/vendor/bundle" >> $BASH_ENV
29
- echo "export BUNDLE_GEMFILE=$(pwd)/${GEMFILE_NAME}" >> $BASH_ENV
30
- - run: bundle install
33
+ - run: |
34
+ git checkout gh-pages
35
+ cp -R doc/* .
36
+ git commit -vam 'Update documentation'
37
+ git push origin gh-pages
31
38
 
32
39
  jobs:
33
40
  test:
34
41
  parameters:
35
- ruby_version:
42
+ ruby-version:
36
43
  type: string
37
44
  gemfile:
38
45
  type: string
39
- docker:
40
- - image: 'cimg/ruby:<< parameters.ruby_version >>'
41
- environment:
42
- GEMFILE_NAME: <<parameters.gemfile>>
46
+ executor:
47
+ name: app-ruby
48
+ ruby-version: <<parameters.ruby-version>>
43
49
  steps:
44
50
  - checkout
45
- - restore
46
- - bundle
47
- - save
51
+ - ruby/install-deps:
52
+ gemfile: <<parameters.gemfile>>
48
53
  - run-tests
49
54
 
55
+ # Convenience job for setting github branch protection rules
56
+ test-matrix:
57
+ executor: app-ruby
58
+ steps:
59
+ - checkout
60
+ - run: echo "Done"
61
+
62
+ lint:
63
+ executor: app-ruby
64
+ steps:
65
+ - checkout
66
+ - ruby/install-deps
67
+ - run-lint
68
+
69
+ build-docs:
70
+ executor: app-ruby
71
+ steps:
72
+ - checkout
73
+ - ruby/install-deps
74
+ - run-docs-build
75
+ - persist_to_workspace:
76
+ root: .
77
+ paths: doc
78
+
79
+ publish-docs:
80
+ executor: app-ruby
81
+ steps:
82
+ - checkout
83
+ - ruby/install-deps
84
+ - attach_workspace:
85
+ at: .
86
+ - add_ssh_keys:
87
+ fingerprints: # ssh key generated solely for montrose docs
88
+ - "97:43:0c:36:36:1d:83:30:f0:76:d4:9f:d3:71:a8:a5"
89
+ - run:
90
+ name: Configure git
91
+ command: |
92
+ git config user.email "ci-build@rossta.net"
93
+ git config user.name "ci-build"
94
+ - run-docs-publish
95
+
96
+ release:
97
+ executor: app-ruby
98
+ steps:
99
+ - checkout
100
+ - ruby/install-deps
101
+ - run:
102
+ name: Publish gem to Rubygems
103
+ command: bundle exec rake release
104
+
50
105
  workflows:
51
- all-tests:
106
+ build:
52
107
  jobs:
108
+ - lint
109
+ - build-docs
110
+ - test-matrix:
111
+ requires:
112
+ - test
53
113
  - test:
54
114
  matrix:
55
115
  parameters:
56
- ruby_version: ['2.6', '2.7', '3.0', '3.1']
116
+ ruby-version:
117
+ - '2.7'
118
+ - '3.0'
119
+ - '3.1'
57
120
  gemfile:
58
- [
59
- 'gemfiles/activesupport_5.2.gemfile',
60
- 'gemfiles/activesupport_6.0.gemfile',
61
- 'gemfiles/activesupport_6.1.gemfile',
62
- 'gemfiles/activesupport_7.0.gemfile',
63
- ]
64
- exclude:
65
- - ruby_version: '2.6'
66
- gemfile: gemfiles/activesupport_7.0.gemfile
121
+ - 'gemfiles/activesupport_5.2.gemfile'
122
+ - 'gemfiles/activesupport_6.0.gemfile'
123
+ - 'gemfiles/activesupport_6.1.gemfile'
124
+ - 'gemfiles/activesupport_7.0.gemfile'
125
+ - publish-docs:
126
+ requires:
127
+ - lint
128
+ - build-docs
129
+ - test-matrix
130
+ filters:
131
+ branches:
132
+ only: main
133
+ - release:
134
+ requires:
135
+ - test
136
+ - lint
137
+ filters:
138
+ tags:
139
+ only: /^v.*/
140
+ branches:
141
+ ignore: /.*/
data/.gitignore CHANGED
@@ -1,6 +1,5 @@
1
1
  /.bundle/
2
2
  /.yardoc
3
- /Gemfile.lock
4
3
  /_yardoc/
5
4
  /coverage/
6
5
  /doc/
@@ -9,6 +8,5 @@
9
8
  /tmp/
10
9
  /profile.log
11
10
  /trace.txt
12
- gemfiles/*.lock
13
11
  /.ruby-gemset
14
- /.ruby-version
12
+ /vendor/
data/.rubocop.yml ADDED
@@ -0,0 +1,5 @@
1
+ require:
2
+ - standard
3
+
4
+ inherit_gem:
5
+ standard: config/base.yml
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.7
data/CHANGELOG.md CHANGED
@@ -1,187 +1,220 @@
1
+ ### 0.15.0 - (2023-08-27)
2
+
3
+ - breaking changes
4
+ - Drop support for Ruby 2.6
5
+
6
+ ### 0.14.0 - (2023-08-23)
7
+
8
+ - enhancements
9
+ - Performance optimization for recurrences with :at option (by @artinboghosian)
10
+
11
+ ### 0.13.0 - (2022-01-04)
12
+
13
+ - enhancements
14
+
15
+ - Add support for Ruby 3.x
16
+ - Add support for Rails 7.0
17
+ - Add basic support for ical parsing
18
+
19
+ - bug fixes
20
+ - Make :during option work for time range spanning midnight
21
+
1
22
  ### 0.12.0 - (2021-02-02)
2
23
 
3
- * enhancements
4
- * Adds `Montrose.covering` to disambiguate `Montrose.between` behavior
5
- `#covering` provides recurrence masking behavior, i.e., only recurrences
6
- within the given range will be emitted
7
- * Added support for ActiveSupport 6 and Ruby 2.7
8
- * Adds `Montrose#infinite?` and ensures `Montrose.finite?` returns a boolean
9
-
10
- * bug fixes
11
- * Fixes `Recurrence#include?` behavior for infinite recurrences with
12
- intervals > 1
13
-
14
- * breaking changes
15
- * `Montrose.between` no longer provides masking behavior, which is now
16
- provided by `Montrose.covering`. A global option can be used
17
- `Montrose.enable_deprecated_between_masking = true` to retain the legacy
18
- behavior for `Montrose.between`. This option will be removed in v1.0.
19
- * Dropped official support for EOL'd rubies and ActiveSupport < 5.2
20
-
21
- * miscellaneous
22
- * switched from Travis to CircleCi for builds
23
- * switched default branch to `main`
24
+ - enhancements
25
+
26
+ - Adds `Montrose.covering` to disambiguate `Montrose.between` behavior
27
+ `#covering` provides recurrence masking behavior, i.e., only recurrences
28
+ within the given range will be emitted
29
+ - Added support for ActiveSupport 6 and Ruby 2.7
30
+ - Adds `Montrose#infinite?` and ensures `Montrose.finite?` returns a boolean
31
+
32
+ - bug fixes
33
+
34
+ - Fixes `Recurrence#include?` behavior for infinite recurrences with
35
+ intervals > 1
36
+
37
+ - breaking changes
38
+
39
+ - `Montrose.between` no longer provides masking behavior, which is now
40
+ provided by `Montrose.covering`. A global option can be used
41
+ `Montrose.enable_deprecated_between_masking = true` to retain the legacy
42
+ behavior for `Montrose.between`. This option will be removed in v1.0.
43
+ - Dropped official support for EOL'd rubies and ActiveSupport < 5.2
44
+
45
+ - miscellaneous
46
+ - switched from Travis to CircleCi for builds
47
+ - switched default branch to `main`
48
+
24
49
  #
50
+
25
51
  ### 0.11.0 - (2019-08-16)
26
52
 
27
- * enhancements
28
- * Adds `Recurrence#during` to support recurrences within time-of-day ranges,
53
+ - enhancements
54
+ - Adds `Recurrence#during` to support recurrences within time-of-day ranges,
29
55
  e.g. `Montrose.every(20.minutes).during("9am-5pm")`
30
56
 
31
57
  ### 0.10.1 - (2019-07-22)
32
58
 
33
- * enhancements
34
- * Adds `Schedule.dump` and `Schedule.load` to support ActiveRecord column
59
+ - enhancements
60
+ - Adds `Schedule.dump` and `Schedule.load` to support ActiveRecord column
35
61
  serialization
36
62
 
37
63
  ### 0.10.0 - (2019-07-17)
38
64
 
39
- * enhancements
40
- * Overrides `Recurrence#as_json` (by @mmagn) to correlate with behavior of
65
+ - enhancements
66
+
67
+ - Overrides `Recurrence#as_json` (by @mmagn) to correlate with behavior of
41
68
  `Recurrence#to_json`
42
69
 
43
- * bug fixes
44
- * In overriding `Recurrence#as_json` as described above, fixes potential
70
+ - bug fixes
71
+
72
+ - In overriding `Recurrence#as_json` as described above, fixes potential
45
73
  infinite loop of calling the method with an infinite recurrence
46
74
 
47
- * breaking changes
48
- * Start time for a daily Recurrence defined with :at options will no longer
75
+ - breaking changes
76
+ - Start time for a daily Recurrence defined with :at options will no longer
49
77
  reset to the beginning of the day; addresses confusion with original
50
78
  behavior in which such occurrences could emit events in the past relative
51
79
  to the given or explicit start time, i.e., earlier in the day
52
80
 
53
81
  ### 0.9.0 - (2019-03-11)
54
82
 
55
- * enhancements
56
- * Enables support for ActiveRecord 6
83
+ - enhancements
57
84
 
58
- * bug fixes
59
- * Fixes bug for nth day of month when used with yearly interval
85
+ - Enables support for ActiveRecord 6
60
86
 
61
- * breaking changes
62
- * Using selected with :month with :day as a Hash will now enforce the
87
+ - bug fixes
88
+
89
+ - Fixes bug for nth day of month when used with yearly interval
90
+
91
+ - breaking changes
92
+ - Using selected with :month with :day as a Hash will now enforce the
63
93
  `NthDayOfMonth` recurrence rule
64
- * Drops official support for Ruby 2.1 and 2.2
94
+ - Drops official support for Ruby 2.1 and 2.2
65
95
 
66
96
  ### 0.8.2 - (2018-08-02)
67
97
 
68
- * bug fixes
69
- * Fixes use of :at when time of day earlier than :starts
98
+ - bug fixes
99
+ - Fixes use of :at when time of day earlier than :starts
70
100
 
71
101
  ### 0.8.1 - (2018-07-27)
72
102
 
73
- * bug fixes
74
- * Fixes interval comparisons for secondly, hourly, minutely by zeroing usec
103
+ - bug fixes
104
+ - Fixes interval comparisons for secondly, hourly, minutely by zeroing usec
75
105
  for recurrence start and end times
76
106
 
77
107
  ### 0.8.0 - (2018-05-29)
78
108
 
79
- * enhancements
80
- * Parsing the `:at` option now initializes recurrence by the hour-minute-second
81
- * Support activesupport-5.2 (by @zokioki)
82
- * Support ruby-2.5
83
- * Support YAML.safe_load for Recurrence#to_yaml
109
+ - enhancements
110
+ - Parsing the `:at` option now initializes recurrence by the hour-minute-second
111
+ - Support activesupport-5.2 (by @zokioki)
112
+ - Support ruby-2.5
113
+ - Support YAML.safe_load for Recurrence#to_yaml
84
114
 
85
115
  ### 0.7.0 - (2017-09-18)
86
116
 
87
- * enhancements
88
- * Adds the :exclude_end option can be used to determine whether :until value
117
+ - enhancements
118
+
119
+ - Adds the :exclude_end option can be used to determine whether :until value
89
120
  is included in the recurrence. Mimics the API to Ruby's Range.
90
- * Support activesupport-5.1 (by @fauxparse)
91
- * Support ruby-2.4
121
+ - Support activesupport-5.1 (by @fauxparse)
122
+ - Support ruby-2.4
92
123
 
93
- * bug fixes
94
- * Recurrence#to_json accepts arguments for JSON.dump
124
+ - bug fixes
95
125
 
96
- * breaking changes
97
- * Previously, the :between option served as a shorthand for :starts to :until.
126
+ - Recurrence#to_json accepts arguments for JSON.dump
127
+
128
+ - breaking changes
129
+ - Previously, the :between option served as a shorthand for :starts to :until.
98
130
  Now, when both :starts and :between are provided, the recurrence will behave
99
- as if anchored by the given :starts option, but filtered through the given
100
- :between option.
101
- * The :exclude_end option changes the default behavior of :until--when the
131
+ as if anchored by the given :starts option, but filtered through the given
132
+ :between option.
133
+ - The :exclude_end option changes the default behavior of :until--when the
102
134
  timestamp of the interval matches the :until timestamp, it will be included
103
- by default unless the :exclude_end option is set to true.
135
+ by default unless the :exclude_end option is set to true.
104
136
 
105
137
  ### 0.6.0 - (2017-01-05)
106
138
 
107
- * enhancements
108
- * Alias `every` to `frequency`
109
- * Handle JSON and hashes in Recurrence serialization
110
- * Handle blank and nil objects in Recurrence deserialization
139
+ - enhancements
140
+ - Alias `every` to `frequency`
141
+ - Handle JSON and hashes in Recurrence serialization
142
+ - Handle blank and nil objects in Recurrence deserialization
111
143
 
112
144
  ### 0.5.0 - (2016-11-23)
113
145
 
114
- * enhancements
115
- * Adds `Recurrence#include?`
116
- * Improved documentation
146
+ - enhancements
147
+ - Adds `Recurrence#include?`
148
+ - Improved documentation
117
149
 
118
150
  ### 0.4.3 - (2016-11-20)
119
151
 
120
- * enhancements
121
- * Add CI support for ActiveSupport 4.1, 4.2, 5.0 (by @phlipper)
152
+ - enhancements
153
+ - Add CI support for ActiveSupport 4.1, 4.2, 5.0 (by @phlipper)
122
154
 
123
155
  ### 0.4.2 - (2016-07-27)
124
156
 
125
- * bug fixes
126
- * Respect `ActiveSupport::TimeWithZone` objects for casting time objects (by
157
+ - bug fixes
158
+ - Respect `ActiveSupport::TimeWithZone` objects for casting time objects (by
127
159
  @tconst)
128
160
 
129
161
  ### 0.4.1 - (2016-07-04)
130
162
 
131
- * enhancements
132
- * Support `Montrose.every(:second)`
163
+ - enhancements
164
+
165
+ - Support `Montrose.every(:second)`
133
166
 
134
- * bug fixes
135
- * Ensure `ActiveSupport::Duration` parts are used; fixes 'every 30 days' bug
167
+ - bug fixes
168
+ - Ensure `ActiveSupport::Duration` parts are used; fixes 'every 30 days' bug
136
169
 
137
170
  ### 0.4.0 - (2016-04-20)
138
171
 
139
- * enhancements
140
- * Respect configured time zone by using `Time.current` from `ActiveSupport`
141
- * Adds `Montrose::Recurrence#to_json` method
142
- * Additional tests for utils methods (by @AlexWheeler)
172
+ - enhancements
173
+ - Respect configured time zone by using `Time.current` from `ActiveSupport`
174
+ - Adds `Montrose::Recurrence#to_json` method
175
+ - Additional tests for utils methods (by @AlexWheeler)
143
176
 
144
177
  ### 0.3.0 - (2016-02-19)
145
178
 
146
- * enhancements
147
- * Adds `:except` option and chainable method to filter timestamps by date (by
179
+ - enhancements
180
+ - Adds `:except` option and chainable method to filter timestamps by date (by
148
181
  @thewatts)
149
- * bug fixes
150
- * Fix recurrences when specifying both `:starts` and `:at` by treating
182
+ - bug fixes
183
+ - Fix recurrences when specifying both `:starts` and `:at` by treating
151
184
  `:starts` value like a date
152
- * Respect recurrence rules using multiple `:at` values
153
- * Using `Montrose.r` without any arguments no longer throws `ArgumentError`
185
+ - Respect recurrence rules using multiple `:at` values
186
+ - Using `Montrose.r` without any arguments no longer throws `ArgumentError`
154
187
 
155
- ### 0.2.2 - 2016-02-08
188
+ ### 0.2.2 - (2016-02-08)
156
189
 
157
- * bug fixes
158
- * Handle `Hash` in `Montrose::Chainable` methods that support varargs
159
- * enhancements
160
- * Adds `Montrose.r` method for starting a new recurrence
161
- * Adds `Chainable` alias methods including `#starts`, `#until`, `#repeat`
162
- * README updates (by @thegcat)
190
+ - bug fixes
191
+ - Handle `Hash` in `Montrose::Chainable` methods that support varargs
192
+ - enhancements
193
+ - Adds `Montrose.r` method for starting a new recurrence
194
+ - Adds `Chainable` alias methods including `#starts`, `#until`, `#repeat`
195
+ - README updates (by @thegcat)
163
196
 
164
- ### 0.2.1 - 2016-02-03
197
+ ### 0.2.1 - (2016-02-03)
165
198
 
166
- * bug fixes
167
- * Handle `nil` in `Montrose::Options` constructor
199
+ - bug fixes
200
+ - Handle `nil` in `Montrose::Options` constructor
168
201
 
169
- ### 0.2.0 - 2016-02-03
202
+ ### 0.2.0 - (2016-02-03)
170
203
 
171
- * enhancements
172
- * extend `Montrose::Schedule` api for building and adding recurrences
173
- * add more details to chainable docs
174
- * merge default options at enumeration time for more consistent serialization
204
+ - enhancements
205
+ - extend `Montrose::Schedule` api for building and adding recurrences
206
+ - add more details to chainable docs
207
+ - merge default options at enumeration time for more consistent serialization
175
208
 
176
- ### 0.1.1 - 2016-25-01
209
+ ### 0.1.1 - (2016-01-25)
177
210
 
178
- * bug fixes
179
- * add missing `require "forwardable"`
180
- * enhancements
181
- * add better `#inspect` methods in `Recurrence` and `Options`
182
- * use refinement to refactor Options internal arg merging
183
- * support ruby 2.3.0 in travis builds
211
+ - bug fixes
212
+ - add missing `require "forwardable"`
213
+ - enhancements
214
+ - add better `#inspect` methods in `Recurrence` and `Options`
215
+ - use refinement to refactor Options internal arg merging
216
+ - support ruby 2.3.0 in travis builds
184
217
 
185
- ### 0.1.0 - 2016-18-01
218
+ ### 0.1.0 - (2016-01-18)
186
219
 
187
- * initial release
220
+ - initial release
data/Gemfile CHANGED
@@ -5,13 +5,8 @@ source "https://rubygems.org"
5
5
  gemspec
6
6
 
7
7
  group :development do
8
- gem "coveralls"
9
- gem "yard"
10
-
11
- unless ENV["CI"]
12
- gem "guard"
13
- gem "guard-minitest"
14
- gem "guard-rubocop"
15
- gem "pry-byebug"
16
- end
8
+ gem "guard"
9
+ gem "guard-minitest"
10
+ gem "guard-rubocop"
11
+ gem "pry-byebug"
17
12
  end