montrose 0.9.0 → 0.10.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aea4b303d8edcae6f8273a01596ad8cef6bc44a910b14ccb386b7c31e75e9770
4
- data.tar.gz: 542674604e253fbc5a33ecd37ad4776291d30a45263a10440d898690cb7554ca
3
+ metadata.gz: 0db24b32e84647b7cbcc6ef866ae5e4b281586988c204db9121aa7e34b3bc00b
4
+ data.tar.gz: de8cd6aff8fed30f62691433931fb20dab2f7d759f985969753f2615687f073d
5
5
  SHA512:
6
- metadata.gz: 9a807b48aef8b5143f7cfe45d5ccbb8192e529dbb802aed82c21c375e48889cfd447d0f29e7238004458e56806164db387ae966a5c492433808bc90a5698ec8e
7
- data.tar.gz: 2653cfceb13a13e4941ead84dbacc1ed5ef05cad74465bd39ab738cbcd48a3cebc9e70b59d521c8c38be1aacdd120dfdb75ae6ba81e991e644039adfa2f65697
6
+ metadata.gz: a17683c42b4660c9c4b10c22566d33043b1fbf2e38ada33966520b69ff5ce64f7f420e992379b3db2f0d301d467afa69ff965bec42c184a09b466b686db5749e
7
+ data.tar.gz: 4d5c02063938b9573efccfabf454ac733f6fbbcd916722ef6b923d8a9c70bb466d85c2dc2a9d3216fdc3a1e6c7463ada8cdf2b8740e82a5f967c1bae64039fcc
@@ -118,7 +118,7 @@ Style/RegexpLiteral:
118
118
  EnforcedStyle: percent_r
119
119
 
120
120
  Layout/DotPosition:
121
- EnforcedStyle: trailing
121
+ EnforcedStyle: leading
122
122
 
123
123
  Naming/VariableNumber:
124
124
  Enabled: false
@@ -1,15 +1,31 @@
1
+ ### 0.10.0 - (2019-07-17)
2
+
3
+ * enhancements
4
+ * Overrides `Recurrence#as_json` (by @mmagn) to correlate with behavior of
5
+ `Recurrence#to_json`
6
+
7
+ * bug fixes
8
+ * In overriding `Recurrence#as_json` as described above, fixes potential
9
+ infinite loop of calling the method with an infinite recurrence
10
+
11
+ * breaking changes
12
+ * Start time for a daily Recurrence defined with :at options will no longer
13
+ reset to the beginning of the day; addresses confusion with original
14
+ behavior in which such occurrences could emit events in the past relative
15
+ to the given or explicit start time, i.e., earlier in the day
16
+
1
17
  ### 0.9.0 - (2019-03-11)
2
18
 
3
19
  * enhancements
4
- * enables support for ActiveRecord 6
20
+ * Enables support for ActiveRecord 6
5
21
 
6
22
  * bug fixes
7
23
  * Fixes bug for nth day of month when used with yearly interval
8
24
 
9
25
  * breaking changes
10
- * using selected with :month with :day as a Hash will now enforce the
26
+ * Using selected with :month with :day as a Hash will now enforce the
11
27
  `NthDayOfMonth` recurrence rule
12
- * drops official support for Ruby 2.1 and 2.2
28
+ * Drops official support for Ruby 2.1 and 2.2
13
29
 
14
30
  ### 0.8.2 - (2018-08-02)
15
31
 
@@ -229,7 +229,9 @@ module Montrose
229
229
  time = starts || default_starts
230
230
 
231
231
  if at
232
- at.map { |(hour, min)| time.change(hour: hour, min: min) }.min || time
232
+ at.map { |hour, min, sec = 0| time.change(hour: hour, min: min, sec: sec) }
233
+ .select { |t| t >= time }
234
+ .min || time
233
235
  else
234
236
  time
235
237
  end
@@ -318,6 +318,14 @@ module Montrose
318
318
  JSON.dump(to_hash, *args)
319
319
  end
320
320
 
321
+ # Returns json of options used to create the recurrence
322
+ #
323
+ # @return [Hash] json of recurrence options
324
+ #
325
+ def as_json(*args)
326
+ to_hash.as_json(*args)
327
+ end
328
+
321
329
  # Returns options used to create the recurrence in YAML format
322
330
  #
323
331
  # @return [String] YAML-formatted recurrence options
@@ -6,7 +6,7 @@ module Montrose
6
6
  include Montrose::Rule
7
7
 
8
8
  def self.apply_options(opts)
9
- opts[:starts] && opts.start_time
9
+ opts.start_time
10
10
  end
11
11
 
12
12
  # Initializes rule
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Montrose
4
- VERSION = "0.9.0"
4
+ VERSION = "0.10.0"
5
5
  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.9.0
4
+ version: 0.10.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: 2019-03-14 00:00:00.000000000 Z
11
+ date: 2019-07-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport