rrule 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rrule.rb +0 -3
- data/lib/rrule/rule.rb +6 -4
- data/rrule.gemspec +2 -2
- 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: cef0ad524f55bb65033204ddb1b134d6e9fb0c6f
|
4
|
+
data.tar.gz: 881e0c1e363a355b8908fb036568525e8b77dacf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e3a41b83fbd8b90734f1b9c97d493f8e4fa2e6314e300603b6cb0d9949151d60a3bcc34073a03c37e2aeece752ec99e9633f5c5f48b9f9eadb445407f3e5abb3
|
7
|
+
data.tar.gz: d4a47101d49896dcc2ac9ab2108ae64c1873fc52f1bea394623508f8887d3c23748c728ffaede12a079b662f0da33256f5dd30970845e41348a12444b8b5d394
|
data/lib/rrule.rb
CHANGED
data/lib/rrule/rule.rb
CHANGED
@@ -4,11 +4,13 @@ module RRule
|
|
4
4
|
|
5
5
|
attr_reader :dtstart, :tz, :exdate
|
6
6
|
|
7
|
-
def initialize(rrule, dtstart: Time.now, tzid: 'UTC', exdate: [])
|
7
|
+
def initialize(rrule, dtstart: Time.now, tzid: 'UTC', exdate: [], max_year: nil)
|
8
8
|
@dtstart = floor_to_seconds(dtstart).in_time_zone(tzid)
|
9
9
|
@tz = tzid
|
10
10
|
@exdate = exdate
|
11
11
|
@options = parse_options(rrule)
|
12
|
+
@max_year = max_year || 9999
|
13
|
+
@max_date = DateTime.new(@max_year)
|
12
14
|
end
|
13
15
|
|
14
16
|
def all(limit: nil)
|
@@ -60,7 +62,7 @@ module RRule
|
|
60
62
|
frequency = Frequency.for_options(options).new(context, filters, generator, timeset)
|
61
63
|
|
62
64
|
loop do
|
63
|
-
return if frequency.current_date.year >
|
65
|
+
return if frequency.current_date.year > max_year
|
64
66
|
|
65
67
|
frequency.next_occurrences.each do |this_result|
|
66
68
|
next if this_result < dtstart
|
@@ -77,7 +79,7 @@ module RRule
|
|
77
79
|
|
78
80
|
private
|
79
81
|
|
80
|
-
attr_reader :options
|
82
|
+
attr_reader :options, :max_year, :max_date
|
81
83
|
|
82
84
|
def floor_to_seconds(date)
|
83
85
|
# This removes all sub-second and floors it to the second level.
|
@@ -90,7 +92,7 @@ module RRule
|
|
90
92
|
@enumerator ||= to_enum
|
91
93
|
end
|
92
94
|
|
93
|
-
def all_until(end_date:
|
95
|
+
def all_until(end_date: max_date, limit: nil)
|
94
96
|
limit ? take(limit) : take_while { |date| date <= end_date }
|
95
97
|
end
|
96
98
|
|
data/rrule.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'rrule'
|
3
|
-
s.version = '0.3.
|
4
|
-
s.date = '2018-04-
|
3
|
+
s.version = '0.3.1'
|
4
|
+
s.date = '2018-04-24'
|
5
5
|
s.summary = 'RRule expansion'
|
6
6
|
s.description = 'A gem for expanding dates according to the RRule specification'
|
7
7
|
s.authors = ['Ryan Mitchell']
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rrule
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Mitchell
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-04-
|
11
|
+
date: 2018-04-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -107,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
107
107
|
version: '0'
|
108
108
|
requirements: []
|
109
109
|
rubyforge_project:
|
110
|
-
rubygems_version: 2.
|
110
|
+
rubygems_version: 2.5.2
|
111
111
|
signing_key:
|
112
112
|
specification_version: 4
|
113
113
|
summary: RRule expansion
|