rrule 0.4.1 → 0.4.2

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.
Files changed (45) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +2 -0
  3. data/.rubocop.yml +25 -0
  4. data/.travis.yml +6 -1
  5. data/Gemfile +9 -0
  6. data/Rakefile +9 -3
  7. data/lib/rrule.rb +4 -0
  8. data/lib/rrule/context.rb +5 -3
  9. data/lib/rrule/filters/by_month.rb +2 -0
  10. data/lib/rrule/filters/by_month_day.rb +2 -0
  11. data/lib/rrule/filters/by_week_day.rb +2 -0
  12. data/lib/rrule/filters/by_week_number.rb +2 -0
  13. data/lib/rrule/filters/by_year_day.rb +3 -1
  14. data/lib/rrule/frequencies/daily.rb +2 -0
  15. data/lib/rrule/frequencies/frequency.rb +4 -12
  16. data/lib/rrule/frequencies/monthly.rb +2 -0
  17. data/lib/rrule/frequencies/simple_weekly.rb +6 -6
  18. data/lib/rrule/frequencies/weekly.rb +2 -0
  19. data/lib/rrule/frequencies/yearly.rb +2 -0
  20. data/lib/rrule/generators/all_occurrences.rb +2 -0
  21. data/lib/rrule/generators/by_set_position.rb +2 -0
  22. data/lib/rrule/generators/generator.rb +3 -1
  23. data/lib/rrule/rule.rb +18 -33
  24. data/lib/rrule/version.rb +5 -0
  25. data/lib/rrule/weekday.rb +3 -1
  26. data/rrule.gemspec +16 -10
  27. data/scripts/benchmark.rb +3 -1
  28. metadata +13 -56
  29. data/spec/context_spec.rb +0 -261
  30. data/spec/filters/by_month_day_spec.rb +0 -35
  31. data/spec/filters/by_month_spec.rb +0 -35
  32. data/spec/filters/by_week_day_spec.rb +0 -35
  33. data/spec/filters/by_week_number_spec.rb +0 -41
  34. data/spec/filters/by_year_day_spec.rb +0 -35
  35. data/spec/frequencies/daily_spec.rb +0 -62
  36. data/spec/frequencies/monthly_spec.rb +0 -63
  37. data/spec/frequencies/simple_weekly_spec.rb +0 -32
  38. data/spec/frequencies/weekly_spec.rb +0 -92
  39. data/spec/frequencies/yearly_spec.rb +0 -54
  40. data/spec/generators/all_occurrences_spec.rb +0 -44
  41. data/spec/generators/by_set_position_spec.rb +0 -39
  42. data/spec/generators/generator_spec.rb +0 -110
  43. data/spec/rule_spec.rb +0 -2338
  44. data/spec/spec_helper.rb +0 -23
  45. data/spec/weekday_spec.rb +0 -34
@@ -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'
@@ -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