ice_cube_cron 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1b14af35504a36135e5f349fa1daa0436c608848
4
- data.tar.gz: a5344d84ce8b858875732e5c594c93444a8afc22
3
+ metadata.gz: b8587cad1d7f913b7bb81a58e4e3eac37db6d1dc
4
+ data.tar.gz: 02fc4ecba72f46539c6d2ef155b8b9f64e6d0e88
5
5
  SHA512:
6
- metadata.gz: bb37fb552f54bfacf7cd4c05ad2ad24682732dc0804b9e7d43abc67187c86f811ab289bab932109c49d85252f7fa571e7c8cb5d37e114ba623fa7645d3419940
7
- data.tar.gz: 8d1e857a18f5510ec8f88a23bbaf11a2371414b8f6d96950325f06413999e3a6ba186c253f4a9492a4e7ce869da0467575cee2c40b08cc5b1def62d4e9c6386a
6
+ metadata.gz: 9d0e3698b6657bb35da47fba62350d2ad33db1ace17ec6ba617f9b6eab58a7f7cb28f4f6d83e3f46bf1086600fba1711b5b9f02fc40b49a83cc7abab551aa24e
7
+ data.tar.gz: 34c79837a63121f7b7f892305cf749c13323e9d515b5328d1daff80ac9d982a9f94a2d21b907c8fb2354e739e0d5718cadb029491e91e763b6c3abf9af57cdf6
data/.gitignore CHANGED
@@ -33,5 +33,4 @@ build/
33
33
 
34
34
  # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
35
35
  .rvmrc
36
- vendor/cache
37
36
  Gemfile.lock
data/.travis.yml ADDED
@@ -0,0 +1,10 @@
1
+ language: ruby
2
+ rvm:
3
+ - ruby-1.9.3
4
+ - ruby-2.2.1
5
+ - jruby-9.0.1.0
6
+ - jruby-1.7.20.1
7
+ before_install: gem install bundler -v 1.10.6
8
+ addons:
9
+ code_climate:
10
+ repo_token: 9b221490f5aae9396a55901f71207d9534d7882b8bae9b553d8e86ca44d8549e
@@ -0,0 +1,13 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
4
+
5
+ We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
6
+
7
+ Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
8
+
9
+ Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
10
+
11
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
12
+
13
+ This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- [![Gem Version](https://badge.fury.io/rb/ice_cube_cron.svg)](https://badge.fury.io/rb/ice_cube_cron)
1
+ [![Gem Version](https://badge.fury.io/rb/ice_cube_cron.svg)](https://badge.fury.io/rb/ice_cube_cron) [![Build Status](https://travis-ci.org/mattnichols/ice_cube_cron.svg?branch=master)](https://travis-ci.org/mattnichols/ice_cube_cron) [![Code Climate](https://codeclimate.com/github/mattnichols/ice_cube_cron/badges/gpa.svg)](https://codeclimate.com/github/mattnichols/ice_cube_cron) [![Test Coverage](https://codeclimate.com/github/mattnichols/ice_cube_cron/badges/coverage.svg)](https://codeclimate.com/github/mattnichols/ice_cube_cron/coverage)
2
2
 
3
3
  # ice_cube_cron
4
4
 
@@ -8,9 +8,6 @@ Adds new methods to ice_cube to create schedules using standard cron expressions
8
8
 
9
9
  **[ice_cube](https://github.com/seejohnrun/ice_cube)** is a sold library for projecting and querying recurrence rules. **[Cron](https://en.wikipedia.org/wiki/Cron)** is _the_ standard for expressing recurrence rules. This gem will allow you to generate ice_cube schedules using standard cron expressions [explained here](https://en.wikipedia.org/wiki/Cron). This includes range expressions, series expressions, "last" day of month, Nth weekday of month, etc.
10
10
 
11
- PLEASE NOTE:
12
- This gem is a work-in-progress. Many features have yet to be implemented.
13
-
14
11
  ## installation
15
12
 
16
13
  gem install ice_cube_cron
@@ -42,16 +39,18 @@ Cron expression can be specified using a hash or a string in the format:
42
39
  require 'ice_cube_cron'
43
40
 
44
41
  # using cron expression string
45
- schedule = ::IceCube::Schedule.from_cron(::Date.current, "* * * * 5")
42
+ schedule = ::IceCube::Schedule.from_cron(::Date.current, "0 0 * * 5")
46
43
 
47
44
  # using hash
48
- schedule = ::IceCube::Schedule.from_cron(::Date.new(2015, 1, 5), :day_of_month => 5)
45
+ schedule = ::IceCube::Schedule.from_cron(::Date.new(2015, 1, 5), :hour => 0, :minute => 0, :day_of_month => 5)
49
46
 
50
47
  schedule.occurrences_between(::Date.new(2015, 3, 5), ::Date.new(2015, 6, 5))
51
48
  # => [2015-03-05 00:00:00 UTC, 2015-04-05 00:00:00 UTC, 2015-05-05 00:00:00 UTC, 2015-06-05 00:00:00 UTC]
52
49
  ```
53
50
 
54
- ## recurrence rule examples (date)
51
+ ## recurrence rule examples
52
+
53
+ * *These are __Date Only__ - hour and minute are set to zero*
55
54
 
56
55
  |desc|interval|year|month|day_of_month|day_of_week|
57
56
  |----|-------:|---:|----:|--:|------:|
@@ -65,8 +64,7 @@ schedule.occurrences_between(::Date.new(2015, 3, 5), ::Date.new(2015, 6, 5))
65
64
  |last day every month||||L||
66
65
 
67
66
  ## notes
68
- - This gem is a work-in-progress.
69
- - Does not yet support all recurrence options. More coming.
67
+ - Does not validate cron expressions
70
68
 
71
69
  ## todo
72
70
  - Add support for W special character
data/Rakefile ADDED
@@ -0,0 +1,8 @@
1
+ require 'bundler/gem_tasks'
2
+ require 'rspec/core/rake_task'
3
+ require 'rubocop/rake_task'
4
+
5
+ RuboCop::RakeTask.new
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ task :default => [:spec, :rubocop]
@@ -18,7 +18,7 @@ Gem::Specification.new do |s|
18
18
  ##
19
19
  # Dependencies
20
20
  #
21
- s.add_dependency 'ice_cube', '~> 0.13'
21
+ s.add_dependency 'ice_cube', '<= 0.13.0'
22
22
  s.add_dependency 'activesupport', '~> 4'
23
23
 
24
24
  ##
@@ -28,4 +28,5 @@ Gem::Specification.new do |s|
28
28
  s.add_development_dependency 'pry', '~> 0'
29
29
  s.add_development_dependency 'rspec', '~> 3.3'
30
30
  s.add_development_dependency 'rubocop', '~> 0.34'
31
+ s.add_development_dependency 'codeclimate-test-reporter', '~> 0.4'
31
32
  end
@@ -1,3 +1,3 @@
1
1
  module IceCubeCron # :nodoc: all
2
- VERSION = '1.0.0'
2
+ VERSION = '1.0.1'
3
3
  end
@@ -24,7 +24,7 @@ describe ::IceCubeCron::ExpressionParser do
24
24
  expect(expression.interval).to eq(1)
25
25
  expect(expression.year).to eq(nil)
26
26
  expect(expression.month).to eq(nil)
27
- expect(expression.day).to eq([2])
27
+ expect(expression.day_of_month).to eq([2])
28
28
  expect(expression.day_of_week).to eq(nil)
29
29
  expect(expression.hour).to eq(nil)
30
30
  expect(expression.minute).to eq([1])
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe ::IceCubeCron do
3
+ describe ::IceCubeCron::Extension do
4
4
  context 'repeat options' do
5
5
  describe 'monthly' do
6
6
  let(:schedule) { ::IceCube::Schedule.from_cron(::Date.new(2015, 7, 1), :day_of_month => '1', :hour => 0, :minute => 0) }
data/spec/spec_helper.rb CHANGED
@@ -17,6 +17,9 @@
17
17
  #
18
18
  # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
19
19
 
20
+ require 'codeclimate-test-reporter'
21
+ CodeClimate::TestReporter.start
22
+
20
23
  require 'ice_cube_cron'
21
24
  require 'pry'
22
25
 
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ice_cube_cron
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Nichols
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-29 00:00:00.000000000 Z
11
+ date: 2015-12-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ice_cube
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - "<="
18
18
  - !ruby/object:Gem::Version
19
- version: '0.13'
19
+ version: 0.13.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - "<="
25
25
  - !ruby/object:Gem::Version
26
- version: '0.13'
26
+ version: 0.13.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: activesupport
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -94,6 +94,20 @@ dependencies:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0.34'
97
+ - !ruby/object:Gem::Dependency
98
+ name: codeclimate-test-reporter
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '0.4'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '0.4'
97
111
  description: Adds methods to ice_cube that creation of schedules using standard cron
98
112
  expressions.
99
113
  email:
@@ -106,10 +120,13 @@ files:
106
120
  - ".rdoc_options"
107
121
  - ".rspec"
108
122
  - ".rubocop.yml"
123
+ - ".travis.yml"
124
+ - CODE_OF_CONDUCT.md
109
125
  - Gemfile
110
126
  - Guardfile
111
127
  - LICENSE
112
128
  - README.md
129
+ - Rakefile
113
130
  - ice_cube_cron.gemspec
114
131
  - lib/ice_cube_cron.rb
115
132
  - lib/ice_cube_cron/base.rb
@@ -121,8 +138,8 @@ files:
121
138
  - lib/ice_cube_cron/version.rb
122
139
  - lib/ice_cube_ext/validated_rule.rb
123
140
  - lib/ice_cube_ext/validations/year.rb
124
- - spec/lib/ice_cube_cron/base_spec.rb
125
141
  - spec/lib/ice_cube_cron/expression_parser_spec.rb
142
+ - spec/lib/ice_cube_cron/extension_spec.rb
126
143
  - spec/lib/ice_cube_cron/rule_builder_spec.rb
127
144
  - spec/lib/ice_cube_cron/util_spec.rb
128
145
  - spec/spec_helper.rb
@@ -151,8 +168,8 @@ signing_key:
151
168
  specification_version: 4
152
169
  summary: Adds ability to create ice_cube schedules from cron expressions.
153
170
  test_files:
154
- - spec/lib/ice_cube_cron/base_spec.rb
155
171
  - spec/lib/ice_cube_cron/expression_parser_spec.rb
172
+ - spec/lib/ice_cube_cron/extension_spec.rb
156
173
  - spec/lib/ice_cube_cron/rule_builder_spec.rb
157
174
  - spec/lib/ice_cube_cron/util_spec.rb
158
175
  - spec/spec_helper.rb