rrule 0.4.2 → 0.4.3
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 +4 -4
- data/.gitignore +2 -1
- data/.rubocop.yml +4 -1
- data/.travis.yml +25 -5
- data/Appraisals +23 -0
- data/CHANGELOG.md +10 -0
- data/Gemfile +1 -1
- data/gemfiles/activesupport_2.3_LTS.gemfile +16 -0
- data/gemfiles/activesupport_3.gemfile +16 -0
- data/gemfiles/activesupport_4.gemfile +15 -0
- data/gemfiles/activesupport_5.gemfile +15 -0
- data/gemfiles/activesupport_6.gemfile +15 -0
- data/lib/rrule/filters/by_week_day.rb +3 -3
- data/lib/rrule/generators/generator.rb +2 -0
- data/lib/rrule/rule.rb +9 -3
- data/lib/rrule/version.rb +1 -1
- data/lib/rrule/weekday.rb +1 -1
- data/rrule.gemspec +3 -2
- metadata +35 -9
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 75e4c7df763fb7f51c26dd5c904838cd711236c4f0c1b8903aaaa9fa8cb3a177
|
|
4
|
+
data.tar.gz: 8bd2ccc6326b7d839f53744091fed93000616e32af1305c8395fe129e9e5d294
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 744bc6a792d4ccaf944b6ed56c090387fe7c7dd87c79eae8f5c93fee299b47451d3834d6bfa7dd7dab062e7ae80fa12b0b333984d18e1579a9d2228ad4119543
|
|
7
|
+
data.tar.gz: 641c8c1f5c8320e4e17461a3dd040171c9a4a71cc6bb3cc1e70d3e16bb6ef8536ff54ace59447c7854a1504a86e0f140bbdc558bffe33515c79e802410c1ec0e
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
data/.travis.yml
CHANGED
|
@@ -1,8 +1,28 @@
|
|
|
1
1
|
language: ruby
|
|
2
2
|
sudo: false
|
|
3
3
|
rvm:
|
|
4
|
-
- 2.
|
|
5
|
-
- 2.
|
|
6
|
-
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
- 2.6.5
|
|
5
|
+
- 2.7.0
|
|
6
|
+
- 3.0.0
|
|
7
|
+
|
|
8
|
+
gemfile:
|
|
9
|
+
- gemfiles/activesupport_2.3_LTS.gemfile
|
|
10
|
+
- gemfiles/activesupport_3.gemfile
|
|
11
|
+
- gemfiles/activesupport_4.gemfile
|
|
12
|
+
- gemfiles/activesupport_5.gemfile
|
|
13
|
+
- gemfiles/activesupport_6.gemfile
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
exclude:
|
|
17
|
+
- rvm: 2.7.0
|
|
18
|
+
gemfile: gemfiles/activesupport_3.gemfile
|
|
19
|
+
- rvm: 2.7.0
|
|
20
|
+
gemfile: gemfiles/activesupport_4.gemfile
|
|
21
|
+
- rvm: 3.0.0
|
|
22
|
+
gemfile: gemfiles/activesupport_3.gemfile
|
|
23
|
+
- rvm: 3.0.0
|
|
24
|
+
gemfile: gemfiles/activesupport_4.gemfile
|
|
25
|
+
|
|
26
|
+
before_install:
|
|
27
|
+
- yes | gem update --system --force
|
|
28
|
+
- gem install bundler
|
data/Appraisals
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
appraise 'activesupport-2.3-LTS' do
|
|
4
|
+
gem 'rexml'
|
|
5
|
+
gem 'activesupport', '>= 2', git: 'https://github.com/makandra/rails.git', branch: '2-3-lts'
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
appraise 'activesupport-3' do
|
|
9
|
+
gem 'activesupport', '~> 3'
|
|
10
|
+
gem 'tzinfo', '~> 1.2'
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
appraise 'activesupport-4' do
|
|
14
|
+
gem 'activesupport', '~> 4'
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
appraise 'activesupport-5' do
|
|
18
|
+
gem 'activesupport', '~> 5'
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
appraise 'activesupport-6' do
|
|
22
|
+
gem 'activesupport', '~> 6'
|
|
23
|
+
end
|
data/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
Change Log
|
|
2
2
|
==========
|
|
3
3
|
|
|
4
|
+
Version 0.4.3 *(2021-08-10)*
|
|
5
|
+
----------------------------
|
|
6
|
+
Adding support for multiple versions of ActiveSupport, up until at least ActiveSupport 6
|
|
7
|
+
Handle case where DTSTART is a date
|
|
8
|
+
Several bugfixes (fix weekday ordinal matching, BYDAY calculations with and without ordinals)
|
|
9
|
+
|
|
10
|
+
Version 0.4.2 *(2019-02-05)*
|
|
11
|
+
----------------------------
|
|
12
|
+
Truncate the floor_date option if it's less than the dtstart option
|
|
13
|
+
|
|
4
14
|
Version 0.4.1 *(2018-11-28)*
|
|
5
15
|
----------------------------
|
|
6
16
|
Fix bug in SimpleWeekly when ENV['TZ'] was not equal to time zone of rrule
|
data/Gemfile
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# This file was generated by Appraisal
|
|
2
|
+
|
|
3
|
+
source "https://rubygems.org"
|
|
4
|
+
|
|
5
|
+
gem "pry", "~> 0.12.2"
|
|
6
|
+
gem "rake"
|
|
7
|
+
gem "rspec", "~> 3.8"
|
|
8
|
+
gem "rubocop", "0.63.1"
|
|
9
|
+
gem "rexml"
|
|
10
|
+
gem "activesupport", ">= 2", git: "https://github.com/makandra/rails.git", branch: "2-3-lts"
|
|
11
|
+
|
|
12
|
+
platforms :mri do
|
|
13
|
+
gem "pry-byebug"
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
gemspec path: "../"
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# This file was generated by Appraisal
|
|
2
|
+
|
|
3
|
+
source "https://rubygems.org"
|
|
4
|
+
|
|
5
|
+
gem "pry", "~> 0.12.2"
|
|
6
|
+
gem "rake"
|
|
7
|
+
gem "rspec", "~> 3.8"
|
|
8
|
+
gem "rubocop", "0.63.1"
|
|
9
|
+
gem "activesupport", "~> 3"
|
|
10
|
+
gem "tzinfo", "~> 1.2"
|
|
11
|
+
|
|
12
|
+
platforms :mri do
|
|
13
|
+
gem "pry-byebug"
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
gemspec path: "../"
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# This file was generated by Appraisal
|
|
2
|
+
|
|
3
|
+
source "https://rubygems.org"
|
|
4
|
+
|
|
5
|
+
gem "pry", "~> 0.12.2"
|
|
6
|
+
gem "rake"
|
|
7
|
+
gem "rspec", "~> 3.8"
|
|
8
|
+
gem "rubocop", "0.63.1"
|
|
9
|
+
gem "activesupport", "~> 4"
|
|
10
|
+
|
|
11
|
+
platforms :mri do
|
|
12
|
+
gem "pry-byebug"
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
gemspec path: "../"
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# This file was generated by Appraisal
|
|
2
|
+
|
|
3
|
+
source "https://rubygems.org"
|
|
4
|
+
|
|
5
|
+
gem "pry", "~> 0.12.2"
|
|
6
|
+
gem "rake"
|
|
7
|
+
gem "rspec", "~> 3.8"
|
|
8
|
+
gem "rubocop", "0.63.1"
|
|
9
|
+
gem "activesupport", "~> 5"
|
|
10
|
+
|
|
11
|
+
platforms :mri do
|
|
12
|
+
gem "pry-byebug"
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
gemspec path: "../"
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# This file was generated by Appraisal
|
|
2
|
+
|
|
3
|
+
source "https://rubygems.org"
|
|
4
|
+
|
|
5
|
+
gem "pry", "~> 0.12.2"
|
|
6
|
+
gem "rake"
|
|
7
|
+
gem "rspec", "~> 3.8"
|
|
8
|
+
gem "rubocop", "0.63.1"
|
|
9
|
+
gem "activesupport", "~> 6"
|
|
10
|
+
|
|
11
|
+
platforms :mri do
|
|
12
|
+
gem "pry-byebug"
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
gemspec path: "../"
|
|
@@ -8,17 +8,17 @@ module RRule
|
|
|
8
8
|
end
|
|
9
9
|
|
|
10
10
|
def reject?(i)
|
|
11
|
-
masked?(i)
|
|
11
|
+
masked?(i) && !matches_by_week_days?(i)
|
|
12
12
|
end
|
|
13
13
|
|
|
14
14
|
private
|
|
15
15
|
|
|
16
16
|
def masked?(i)
|
|
17
|
-
context.day_of_year_mask
|
|
17
|
+
context.day_of_year_mask.blank? || !context.day_of_year_mask[i]
|
|
18
18
|
end
|
|
19
19
|
|
|
20
20
|
def matches_by_week_days?(i)
|
|
21
|
-
by_week_days.
|
|
21
|
+
by_week_days.present? && by_week_days.include?(context.weekday_by_day_of_year[i])
|
|
22
22
|
end
|
|
23
23
|
|
|
24
24
|
attr_reader :by_week_days, :context
|
data/lib/rrule/rule.rb
CHANGED
|
@@ -8,7 +8,7 @@ module RRule
|
|
|
8
8
|
|
|
9
9
|
def initialize(rrule, dtstart: Time.now, tzid: 'UTC', exdate: [], max_year: nil)
|
|
10
10
|
@tz = tzid
|
|
11
|
-
@dtstart = floor_to_seconds_in_timezone(dtstart)
|
|
11
|
+
@dtstart = dtstart.is_a?(Date) ? dtstart : floor_to_seconds_in_timezone(dtstart)
|
|
12
12
|
@exdate = exdate
|
|
13
13
|
@options = parse_options(rrule)
|
|
14
14
|
@frequency_type = Frequency.for_options(options)
|
|
@@ -111,7 +111,9 @@ module RRule
|
|
|
111
111
|
raise InvalidRRule, 'COUNT must be a non-negative integer' if i < 0
|
|
112
112
|
options[:count] = i
|
|
113
113
|
when 'UNTIL'
|
|
114
|
-
|
|
114
|
+
# The value of the UNTIL rule part MUST have the same
|
|
115
|
+
# value type as the "DTSTART" property.
|
|
116
|
+
options[:until] = @dtstart.is_a?(Date) ? Date.parse(value) : Time.parse(value)
|
|
115
117
|
when 'INTERVAL'
|
|
116
118
|
i = Integer(value) rescue 0
|
|
117
119
|
raise InvalidRRule, 'INTERVAL must be a positive integer' unless i > 0
|
|
@@ -154,7 +156,11 @@ module RRule
|
|
|
154
156
|
|
|
155
157
|
options[:byweekday], options[:bynweekday] = options[:byweekday].partition { |wday| wday.ordinal.nil? } unless options[:byweekday].nil?
|
|
156
158
|
|
|
157
|
-
|
|
159
|
+
# The BYSECOND, BYMINUTE and BYHOUR rule parts MUST NOT be specified
|
|
160
|
+
# when the associated "DTSTART" property has a DATE value type.
|
|
161
|
+
# These rule parts MUST be ignored in RECUR value that violate the
|
|
162
|
+
# above requirement
|
|
163
|
+
options[:timeset] = [{ hour: (options[:byhour].presence || dtstart.hour), minute: (options[:byminute].presence || dtstart.min), second: (options[:bysecond].presence || dtstart.sec) }] unless dtstart.is_a?(Date)
|
|
158
164
|
|
|
159
165
|
options
|
|
160
166
|
end
|
data/lib/rrule/version.rb
CHANGED
data/lib/rrule/weekday.rb
CHANGED
data/rrule.gemspec
CHANGED
|
@@ -21,6 +21,7 @@ Gem::Specification.new do |s|
|
|
|
21
21
|
'changelog_uri' => 'https://github.com/square/ruby-rrule/blob/master/CHANGELOG.md'
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
s.required_ruby_version = '>= 2.
|
|
25
|
-
s.add_runtime_dependency 'activesupport', '>=
|
|
24
|
+
s.required_ruby_version = '>= 2.6.0'
|
|
25
|
+
s.add_runtime_dependency 'activesupport', '>= 2.3', '< 7'
|
|
26
|
+
s.add_development_dependency 'appraisal'
|
|
26
27
|
end
|
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.4.
|
|
4
|
+
version: 0.4.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ryan Mitchell
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2021-08-10 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|
|
@@ -16,14 +16,34 @@ dependencies:
|
|
|
16
16
|
requirements:
|
|
17
17
|
- - ">="
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: '
|
|
19
|
+
version: '2.3'
|
|
20
|
+
- - "<"
|
|
21
|
+
- !ruby/object:Gem::Version
|
|
22
|
+
version: '7'
|
|
20
23
|
type: :runtime
|
|
21
24
|
prerelease: false
|
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
26
|
requirements:
|
|
24
27
|
- - ">="
|
|
25
28
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: '
|
|
29
|
+
version: '2.3'
|
|
30
|
+
- - "<"
|
|
31
|
+
- !ruby/object:Gem::Version
|
|
32
|
+
version: '7'
|
|
33
|
+
- !ruby/object:Gem::Dependency
|
|
34
|
+
name: appraisal
|
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
|
36
|
+
requirements:
|
|
37
|
+
- - ">="
|
|
38
|
+
- !ruby/object:Gem::Version
|
|
39
|
+
version: '0'
|
|
40
|
+
type: :development
|
|
41
|
+
prerelease: false
|
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
43
|
+
requirements:
|
|
44
|
+
- - ">="
|
|
45
|
+
- !ruby/object:Gem::Version
|
|
46
|
+
version: '0'
|
|
27
47
|
description: A gem for expanding dates according to the RRule specification
|
|
28
48
|
email: rmitchell@squareup.com
|
|
29
49
|
executables: []
|
|
@@ -33,12 +53,18 @@ files:
|
|
|
33
53
|
- ".gitignore"
|
|
34
54
|
- ".rubocop.yml"
|
|
35
55
|
- ".travis.yml"
|
|
56
|
+
- Appraisals
|
|
36
57
|
- CHANGELOG.md
|
|
37
58
|
- CONTRIBUTING.md
|
|
38
59
|
- Gemfile
|
|
39
60
|
- LICENSE.txt
|
|
40
61
|
- README.md
|
|
41
62
|
- Rakefile
|
|
63
|
+
- gemfiles/activesupport_2.3_LTS.gemfile
|
|
64
|
+
- gemfiles/activesupport_3.gemfile
|
|
65
|
+
- gemfiles/activesupport_4.gemfile
|
|
66
|
+
- gemfiles/activesupport_5.gemfile
|
|
67
|
+
- gemfiles/activesupport_6.gemfile
|
|
42
68
|
- lib/rrule.rb
|
|
43
69
|
- lib/rrule/context.rb
|
|
44
70
|
- lib/rrule/filters/by_month.rb
|
|
@@ -68,7 +94,7 @@ metadata:
|
|
|
68
94
|
source_code_uri: https://github.com/square/ruby-rrule
|
|
69
95
|
bug_tracker_uri: https://github.com/square/ruby-rrule/issues
|
|
70
96
|
changelog_uri: https://github.com/square/ruby-rrule/blob/master/CHANGELOG.md
|
|
71
|
-
post_install_message:
|
|
97
|
+
post_install_message:
|
|
72
98
|
rdoc_options: []
|
|
73
99
|
require_paths:
|
|
74
100
|
- lib
|
|
@@ -76,15 +102,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
76
102
|
requirements:
|
|
77
103
|
- - ">="
|
|
78
104
|
- !ruby/object:Gem::Version
|
|
79
|
-
version: 2.
|
|
105
|
+
version: 2.6.0
|
|
80
106
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
81
107
|
requirements:
|
|
82
108
|
- - ">="
|
|
83
109
|
- !ruby/object:Gem::Version
|
|
84
110
|
version: '0'
|
|
85
111
|
requirements: []
|
|
86
|
-
rubygems_version: 3.
|
|
87
|
-
signing_key:
|
|
112
|
+
rubygems_version: 3.1.4
|
|
113
|
+
signing_key:
|
|
88
114
|
specification_version: 4
|
|
89
115
|
summary: RRule expansion
|
|
90
116
|
test_files: []
|