montrose 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/README.md +1 -1
- data/lib/montrose/options.rb +3 -1
- data/lib/montrose/recurrence.rb +16 -5
- data/lib/montrose/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c6586fb7cc1e8bfb5bf4a60b01dc27687703b613
|
4
|
+
data.tar.gz: 2de01900143bb357b8250d7213b02f18d63f7f6e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 97c05ddc454035a90a397d3aa0b498baedee44288a0e1488c57629e62ff5516542e023deac99ec2ac26b2ac3e612836e8f15d18da08403f77ef848564ea23b37
|
7
|
+
data.tar.gz: e8e8d506f11e6dade4915e3af9c4a518102a1eb5199a499485975020334744ba67a2943db5ccaa094cff05827c2172ec912c42d23dd69bd09107cf16c23e7843
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -335,7 +335,7 @@ Montrose.every(:month, day: :friday, interval: 2)
|
|
335
335
|
Montrose.r(every: :month, day: :friday, interval: 2)
|
336
336
|
|
337
337
|
Montrose.monthly(day: { friday: [1] }) # 1st Friday of the month
|
338
|
-
Montrose.monthly(day: {
|
338
|
+
Montrose.monthly(day: { sunday: [1, -1] }) # first and last Sunday of the month
|
339
339
|
|
340
340
|
Montrose.monthly(mday: 7..13, day: :saturday) # first Saturday that follow the first Sunday of the month
|
341
341
|
|
data/lib/montrose/options.rb
CHANGED
@@ -79,7 +79,6 @@ module Montrose
|
|
79
79
|
def_option :month
|
80
80
|
def_option :interval
|
81
81
|
def_option :total
|
82
|
-
def_option :between
|
83
82
|
def_option :at
|
84
83
|
def_option :on
|
85
84
|
def_option :except
|
@@ -147,6 +146,9 @@ module Montrose
|
|
147
146
|
@every = parsed.fetch(:every)
|
148
147
|
end
|
149
148
|
|
149
|
+
alias frequency every
|
150
|
+
alias frequency= every=
|
151
|
+
|
150
152
|
def starts=(time)
|
151
153
|
@starts = as_time(time) || self.class.default_starts
|
152
154
|
end
|
data/lib/montrose/recurrence.rb
CHANGED
@@ -224,16 +224,27 @@ module Montrose
|
|
224
224
|
|
225
225
|
def dump(obj)
|
226
226
|
return nil if obj.nil?
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
227
|
+
return dump(load(obj)) if obj.is_a?(String)
|
228
|
+
|
229
|
+
hash = case obj
|
230
|
+
when Hash
|
231
|
+
obj
|
232
|
+
when self
|
233
|
+
obj.to_hash
|
234
|
+
else
|
235
|
+
fail SerializationError,
|
236
|
+
"Object was supposed to be a #{self}, but was a #{obj.class}. -- #{obj.inspect}"
|
237
|
+
end
|
231
238
|
|
232
|
-
JSON.dump(
|
239
|
+
JSON.dump(hash)
|
233
240
|
end
|
234
241
|
|
235
242
|
def load(json)
|
243
|
+
return nil if json.blank?
|
244
|
+
|
236
245
|
new JSON.parse(json)
|
246
|
+
rescue JSON::ParserError => e
|
247
|
+
fail SerializationError, "Could not parse JSON: #{e}"
|
237
248
|
end
|
238
249
|
end
|
239
250
|
|
data/lib/montrose/version.rb
CHANGED
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.6.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: 2017-01-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -212,7 +212,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
212
212
|
version: '0'
|
213
213
|
requirements: []
|
214
214
|
rubyforge_project:
|
215
|
-
rubygems_version: 2.5.1
|
215
|
+
rubygems_version: 2.4.5.1
|
216
216
|
signing_key:
|
217
217
|
specification_version: 4
|
218
218
|
summary: Recurring events in Ruby
|