Skip to content

Commit 63c29cf

Browse files
authored
Merge branch 'master' into master
2 parents e4a920c + 685775f commit 63c29cf

88 files changed

Lines changed: 1735 additions & 2065 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/tests.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
11+
jobs:
12+
lint:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v2
16+
- uses: ruby/setup-ruby@v1
17+
with:
18+
ruby-version: '2.6'
19+
bundler-cache: true
20+
- run: bundle exec standardrb
21+
test:
22+
needs: lint
23+
strategy:
24+
matrix:
25+
rails: ['5.2', '6.0.4', '6.1']
26+
ruby: ['2.6', '2.7', '3.0']
27+
exclude:
28+
- rails: '5.2'
29+
ruby: '3.0'
30+
runs-on: ubuntu-latest
31+
env:
32+
RAILS_VERSION: ${{ matrix.rails }}
33+
steps:
34+
- uses: actions/checkout@v2
35+
- uses: ruby/setup-ruby@v1
36+
with:
37+
ruby-version: ${{ matrix.ruby }}
38+
bundler-cache: true
39+
- run: bundle exec rake

.standard_todo.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Auto generated files with errors to ignore.
2+
# Remove from this list as you refactor files.
3+
---
4+
ignore:
5+
- lib/ice_cube/parsers/yaml_parser.rb:
6+
- Security/YAMLLoad
7+
- lib/ice_cube/rule.rb:
8+
- Security/YAMLLoad
9+
- spec/examples/serialization_spec.rb:
10+
- Security/YAMLLoad
11+
- spec/examples/to_yaml_spec.rb:
12+
- Security/YAMLLoad

.travis.yml

Lines changed: 0 additions & 41 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Changelog
22

3-
## Next version
3+
## 0.16.4 / 2021-10-21
44

55
* [FEATURE] Italian translations
66

Gemfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
source 'https://rubygems.org'
1+
source "https://rubygems.org"
22
gemspec
33

44
compatible_rails_versions = [
5-
'>= 3.0.0',
6-
('<5' if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.2.2'))
5+
">= 3.0.0",
6+
("<5" if Gem::Version.new(RUBY_VERSION) < Gem::Version.new("2.2.2"))
77
].compact
88

9-
gem 'activesupport', (ENV['RAILS_VERSION'] || compatible_rails_versions), require: false
10-
gem 'i18n', require: false
11-
gem 'tzinfo', require: false # only needed explicitly for RAILS_VERSION=3
9+
gem "activesupport", (ENV["RAILS_VERSION"] || compatible_rails_versions), require: false
10+
gem "i18n", require: false
11+
gem "tzinfo", require: false # only needed explicitly for RAILS_VERSION=3

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# ice_cube - Easy schedule expansion
22

3-
[![Build Status][travis-ice_cube-badge_image]][travis-ice_cube]
3+
[![Tests](https://github.com/seejohnrun/ice_cube/actions/workflows/tests.yaml/badge.svg)](https://github.com/seejohnrun/ice_cube/actions/workflows/tests.yaml)
44
[![Gem Version](https://badge.fury.io/rb/ice_cube.svg)](http://badge.fury.io/rb/ice_cube)
5+
[![Ruby Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://github.com/testdouble/standard)
56

67
```bash
78
gem install ice_cube
@@ -323,5 +324,5 @@ Use the GitHub [issue tracker][ice_cube-issues]
323324
[travis-ice_cube-badge_image]: https://secure.travis-ci.org/seejohnrun/ice_cube.svg
324325
[ice_cube-lone_star_pdf]: http://seejohnrun.github.com/ice_cube/static/lsrc_ice_cube.pdf
325326
[ice_cube-ruby_nyc_pdf]: http://seejohnrun.github.com/ice_cube/static/ice_cube_ruby_nyc.pdf
326-
[ice_cube-docs]: http://seejohnrun.github.com/ice_cube/
327+
[ice_cube-docs]: http://seejohnrun.github.io/ice_cube/
327328
[ice_cube-issues]: https://github.com/seejohnrun/ice_cube/issues

Rakefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
require "rspec/core/rake_task"
22
require "bundler/gem_tasks"
3+
require "standard/rake"
34

45
RSpec::Core::RakeTask.new(:spec)
5-
task :build => :spec
6-
task :default => :spec
6+
task build: :spec
7+
task default: :spec

ice_cube.gemspec

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
# encoding: utf-8
2-
lib = File.expand_path('../lib', __FILE__)
1+
lib = File.expand_path("../lib", __FILE__)
32
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4-
require 'ice_cube/version'
3+
require "ice_cube/version"
54

65
Gem::Specification.new do |s|
7-
s.name = 'ice_cube'
8-
s.summary = 'Ruby Date Recurrence Library'
9-
s.description = 'ice_cube is a recurring date library for Ruby. It allows for quick, programatic expansion of recurring date rules.'
10-
s.author = 'John Crepezzi'
11-
s.email = 'john@crepezzi.com'
12-
s.homepage = 'http://seejohnrun.github.com/ice_cube/'
13-
s.license = 'MIT'
6+
s.name = "ice_cube"
7+
s.summary = "Ruby Date Recurrence Library"
8+
s.description = "ice_cube is a recurring date library for Ruby. It allows for quick, programatic expansion of recurring date rules."
9+
s.author = "John Crepezzi"
10+
s.email = "john@crepezzi.com"
11+
s.homepage = "http://seejohnrun.github.com/ice_cube/"
12+
s.license = "MIT"
1413

15-
s.version = IceCube::VERSION
16-
s.platform = Gem::Platform::RUBY
17-
s.files = Dir['lib/**/*.rb', 'config/**/*.yml']
18-
s.test_files = Dir.glob('spec/*.rb')
19-
s.require_paths = ['lib']
14+
s.version = IceCube::VERSION
15+
s.platform = Gem::Platform::RUBY
16+
s.files = Dir["lib/**/*.rb", "config/**/*.yml"]
17+
s.test_files = Dir.glob("spec/*.rb")
18+
s.require_paths = ["lib"]
2019

21-
s.add_development_dependency('rake')
22-
s.add_development_dependency('rspec', '> 3')
20+
s.add_development_dependency("rake")
21+
s.add_development_dependency("rspec", "> 3")
22+
s.add_development_dependency("standard")
2323
end

lib/ice_cube.rb

Lines changed: 51 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,70 @@
1-
require 'date'
2-
require 'ice_cube/deprecated'
1+
require "date"
2+
require "ice_cube/deprecated"
33

44
module IceCube
5+
autoload :VERSION, "ice_cube/version"
56

6-
autoload :VERSION, 'ice_cube/version'
7+
autoload :TimeUtil, "ice_cube/time_util"
8+
autoload :FlexibleHash, "ice_cube/flexible_hash"
9+
autoload :I18n, "ice_cube/i18n"
710

8-
autoload :TimeUtil, 'ice_cube/time_util'
9-
autoload :FlexibleHash, 'ice_cube/flexible_hash'
10-
autoload :I18n, 'ice_cube/i18n'
11+
autoload :Rule, "ice_cube/rule"
12+
autoload :Schedule, "ice_cube/schedule"
13+
autoload :Occurrence, "ice_cube/occurrence"
1114

12-
autoload :Rule, 'ice_cube/rule'
13-
autoload :Schedule, 'ice_cube/schedule'
14-
autoload :Occurrence, 'ice_cube/occurrence'
15+
autoload :IcalBuilder, "ice_cube/builders/ical_builder"
16+
autoload :HashBuilder, "ice_cube/builders/hash_builder"
17+
autoload :StringBuilder, "ice_cube/builders/string_builder"
1518

16-
autoload :IcalBuilder, 'ice_cube/builders/ical_builder'
17-
autoload :HashBuilder, 'ice_cube/builders/hash_builder'
18-
autoload :StringBuilder, 'ice_cube/builders/string_builder'
19+
autoload :HashParser, "ice_cube/parsers/hash_parser"
20+
autoload :YamlParser, "ice_cube/parsers/yaml_parser"
21+
autoload :IcalParser, "ice_cube/parsers/ical_parser"
1922

20-
autoload :HashParser, 'ice_cube/parsers/hash_parser'
21-
autoload :YamlParser, 'ice_cube/parsers/yaml_parser'
22-
autoload :IcalParser, 'ice_cube/parsers/ical_parser'
23+
autoload :CountExceeded, "ice_cube/errors/count_exceeded"
24+
autoload :UntilExceeded, "ice_cube/errors/until_exceeded"
2325

24-
autoload :CountExceeded, 'ice_cube/errors/count_exceeded'
25-
autoload :UntilExceeded, 'ice_cube/errors/until_exceeded'
26+
autoload :ValidatedRule, "ice_cube/validated_rule"
27+
autoload :SingleOccurrenceRule, "ice_cube/single_occurrence_rule"
2628

27-
autoload :ValidatedRule, 'ice_cube/validated_rule'
28-
autoload :SingleOccurrenceRule, 'ice_cube/single_occurrence_rule'
29-
30-
autoload :SecondlyRule, 'ice_cube/rules/secondly_rule'
31-
autoload :MinutelyRule, 'ice_cube/rules/minutely_rule'
32-
autoload :HourlyRule, 'ice_cube/rules/hourly_rule'
33-
autoload :DailyRule, 'ice_cube/rules/daily_rule'
34-
autoload :WeeklyRule, 'ice_cube/rules/weekly_rule'
35-
autoload :MonthlyRule, 'ice_cube/rules/monthly_rule'
36-
autoload :YearlyRule, 'ice_cube/rules/yearly_rule'
29+
autoload :SecondlyRule, "ice_cube/rules/secondly_rule"
30+
autoload :MinutelyRule, "ice_cube/rules/minutely_rule"
31+
autoload :HourlyRule, "ice_cube/rules/hourly_rule"
32+
autoload :DailyRule, "ice_cube/rules/daily_rule"
33+
autoload :WeeklyRule, "ice_cube/rules/weekly_rule"
34+
autoload :MonthlyRule, "ice_cube/rules/monthly_rule"
35+
autoload :YearlyRule, "ice_cube/rules/yearly_rule"
3736

3837
module Validations
39-
autoload :FixedValue, 'ice_cube/validations/fixed_value'
40-
autoload :ScheduleLock, 'ice_cube/validations/schedule_lock'
41-
42-
autoload :Count, 'ice_cube/validations/count'
43-
autoload :Until, 'ice_cube/validations/until'
44-
45-
autoload :SecondlyInterval, 'ice_cube/validations/secondly_interval'
46-
autoload :MinutelyInterval, 'ice_cube/validations/minutely_interval'
47-
autoload :DailyInterval, 'ice_cube/validations/daily_interval'
48-
autoload :WeeklyInterval, 'ice_cube/validations/weekly_interval'
49-
autoload :MonthlyInterval, 'ice_cube/validations/monthly_interval'
50-
autoload :YearlyInterval, 'ice_cube/validations/yearly_interval'
51-
autoload :HourlyInterval, 'ice_cube/validations/hourly_interval'
52-
53-
autoload :HourOfDay, 'ice_cube/validations/hour_of_day'
54-
autoload :MonthOfYear, 'ice_cube/validations/month_of_year'
55-
autoload :MinuteOfHour, 'ice_cube/validations/minute_of_hour'
56-
autoload :SecondOfMinute, 'ice_cube/validations/second_of_minute'
57-
autoload :DayOfMonth, 'ice_cube/validations/day_of_month'
58-
autoload :DayOfWeek, 'ice_cube/validations/day_of_week'
59-
autoload :Day, 'ice_cube/validations/day'
60-
autoload :DayOfYear, 'ice_cube/validations/day_of_year'
38+
autoload :FixedValue, "ice_cube/validations/fixed_value"
39+
autoload :ScheduleLock, "ice_cube/validations/schedule_lock"
40+
41+
autoload :Count, "ice_cube/validations/count"
42+
autoload :Until, "ice_cube/validations/until"
43+
44+
autoload :SecondlyInterval, "ice_cube/validations/secondly_interval"
45+
autoload :MinutelyInterval, "ice_cube/validations/minutely_interval"
46+
autoload :DailyInterval, "ice_cube/validations/daily_interval"
47+
autoload :WeeklyInterval, "ice_cube/validations/weekly_interval"
48+
autoload :MonthlyInterval, "ice_cube/validations/monthly_interval"
49+
autoload :YearlyInterval, "ice_cube/validations/yearly_interval"
50+
autoload :HourlyInterval, "ice_cube/validations/hourly_interval"
51+
52+
autoload :HourOfDay, "ice_cube/validations/hour_of_day"
53+
autoload :MonthOfYear, "ice_cube/validations/month_of_year"
54+
autoload :MinuteOfHour, "ice_cube/validations/minute_of_hour"
55+
autoload :SecondOfMinute, "ice_cube/validations/second_of_minute"
56+
autoload :DayOfMonth, "ice_cube/validations/day_of_month"
57+
autoload :DayOfWeek, "ice_cube/validations/day_of_week"
58+
autoload :Day, "ice_cube/validations/day"
59+
autoload :DayOfYear, "ice_cube/validations/day_of_year"
6160
end
6261

6362
# Define some useful constants
6463
ONE_SECOND = 1
6564
ONE_MINUTE = ONE_SECOND * 60
66-
ONE_HOUR = ONE_MINUTE * 60
67-
ONE_DAY = ONE_HOUR * 24
68-
ONE_WEEK = ONE_DAY * 7
65+
ONE_HOUR = ONE_MINUTE * 60
66+
ONE_DAY = ONE_HOUR * 24
67+
ONE_WEEK = ONE_DAY * 7
6968

7069
# Defines the format used by IceCube when printing out Schedule#to_s.
7170
# Defaults to '%B %e, %Y'

lib/ice_cube/builders/hash_builder.rb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
module IceCube
2-
32
class HashBuilder
4-
53
def initialize(rule = nil)
6-
@hash = { :validations => {}, :rule_type => rule.class.name }
4+
@hash = {validations: {}, rule_type: rule.class.name}
75
end
86

97
def validations
@@ -21,7 +19,5 @@ def validations_array(type)
2119
def to_hash
2220
@hash
2321
end
24-
2522
end
26-
2723
end

0 commit comments

Comments
 (0)