rrule 0.4.1 → 0.4.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +3 -0
- data/.rubocop.yml +28 -0
- data/.travis.yml +27 -1
- data/Appraisals +27 -0
- data/CHANGELOG.md +14 -0
- data/Gemfile +9 -0
- data/Rakefile +9 -3
- 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/gemfiles/activesupport_7.gemfile +15 -0
- data/lib/rrule/context.rb +5 -3
- data/lib/rrule/filters/by_month.rb +2 -0
- data/lib/rrule/filters/by_month_day.rb +2 -0
- data/lib/rrule/filters/by_week_day.rb +5 -3
- data/lib/rrule/filters/by_week_number.rb +2 -0
- data/lib/rrule/filters/by_year_day.rb +3 -1
- data/lib/rrule/frequencies/daily.rb +2 -0
- data/lib/rrule/frequencies/frequency.rb +4 -12
- data/lib/rrule/frequencies/monthly.rb +2 -0
- data/lib/rrule/frequencies/simple_weekly.rb +6 -6
- data/lib/rrule/frequencies/weekly.rb +2 -0
- data/lib/rrule/frequencies/yearly.rb +2 -0
- data/lib/rrule/generators/all_occurrences.rb +2 -0
- data/lib/rrule/generators/by_set_position.rb +2 -0
- data/lib/rrule/generators/generator.rb +5 -1
- data/lib/rrule/rule.rb +29 -37
- data/lib/rrule/version.rb +5 -0
- data/lib/rrule/weekday.rb +4 -2
- data/lib/rrule.rb +4 -0
- data/rrule.gemspec +18 -11
- data/scripts/benchmark.rb +3 -1
- metadata +30 -52
- data/spec/context_spec.rb +0 -261
- data/spec/filters/by_month_day_spec.rb +0 -35
- data/spec/filters/by_month_spec.rb +0 -35
- data/spec/filters/by_week_day_spec.rb +0 -35
- data/spec/filters/by_week_number_spec.rb +0 -41
- data/spec/filters/by_year_day_spec.rb +0 -35
- data/spec/frequencies/daily_spec.rb +0 -62
- data/spec/frequencies/monthly_spec.rb +0 -63
- data/spec/frequencies/simple_weekly_spec.rb +0 -32
- data/spec/frequencies/weekly_spec.rb +0 -92
- data/spec/frequencies/yearly_spec.rb +0 -54
- data/spec/generators/all_occurrences_spec.rb +0 -44
- data/spec/generators/by_set_position_spec.rb +0 -39
- data/spec/generators/generator_spec.rb +0 -110
- data/spec/rule_spec.rb +0 -2338
- data/spec/spec_helper.rb +0 -23
- data/spec/weekday_spec.rb +0 -34
data/spec/spec_helper.rb
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
require 'rrule'
|
2
|
-
|
3
|
-
RSpec.configure do |config|
|
4
|
-
config.expect_with :rspec do |expectations|
|
5
|
-
# This option will default to `true` in RSpec 4. It makes the `description`
|
6
|
-
# and `failure_message` of custom matchers include text for helper methods
|
7
|
-
# defined using `chain`, e.g.:
|
8
|
-
# be_bigger_than(2).and_smaller_than(4).description
|
9
|
-
# # => "be bigger than 2 and smaller than 4"
|
10
|
-
# ...rather than:
|
11
|
-
# # => "be bigger than 2"
|
12
|
-
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
13
|
-
end
|
14
|
-
|
15
|
-
config.mock_with :rspec do |mocks|
|
16
|
-
# Prevents you from mocking or stubbing a method that does not exist on
|
17
|
-
# a real object. This is generally recommended, and will default to
|
18
|
-
# `true` in RSpec 4.
|
19
|
-
mocks.verify_partial_doubles = true
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
Time.zone = 'America/Los_Angeles'
|
data/spec/weekday_spec.rb
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe RRule::Weekday do
|
4
|
-
describe '.parse' do
|
5
|
-
subject(:weekday) { described_class.parse(weekday_string) }
|
6
|
-
|
7
|
-
context 'with an explicit + for the ordinal' do
|
8
|
-
let(:weekday_string) { '+2SU' }
|
9
|
-
|
10
|
-
it 'parses correctly' do
|
11
|
-
expect(weekday.ordinal).to eql 2
|
12
|
-
expect(weekday.index).to eql 0
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
context 'with an implied + for the ordinal' do
|
17
|
-
let(:weekday_string) { '2SU' }
|
18
|
-
|
19
|
-
it 'parses correctly' do
|
20
|
-
expect(weekday.ordinal).to eql 2
|
21
|
-
expect(weekday.index).to eql 0
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
context 'with a negative ordinal' do
|
26
|
-
let(:weekday_string) { '-3TU' }
|
27
|
-
|
28
|
-
it 'parses correctly' do
|
29
|
-
expect(weekday.ordinal).to eql -3
|
30
|
-
expect(weekday.index).to eql 2
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|