working_calendar 0.1.0
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 +7 -0
- data/.coveralls.yml +2 -0
- data/.gitignore +9 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/.travis.yml +23 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +50 -0
- data/Rakefile +25 -0
- data/lib/working_calendar.rb +42 -0
- data/lib/working_calendar/cast_helper.rb +34 -0
- data/lib/working_calendar/single_date.rb +24 -0
- data/lib/working_calendar/version.rb +3 -0
- data/lib/working_calendar/week_day.rb +24 -0
- data/spec/coverage_helper.rb +5 -0
- data/spec/minitest_helper.rb +5 -0
- data/spec/single_date_spec.rb +79 -0
- data/spec/week_day_spec.rb +66 -0
- data/spec/working_calendar_spec.rb +43 -0
- data/working_calendar.gemspec +32 -0
- metadata +215 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 9432c70fcd651666dd70a9c46ae6d78b376bc39e16b04703dec525f34e83409f
|
4
|
+
data.tar.gz: 1f2a697ccac7dcaae72085da4d76b04ed55857c5654efd40b405d013d356068b
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: d7f929e23897c08f2a9aa03f6eb2d67b5ec183c9c1652dc8ed5f5a02a398a8f547f260fb6c8974f942170baa588f913ff50429ab475af49f725ea3c1eeb80249
|
7
|
+
data.tar.gz: 24652b62203f26765c12f34d5813561e7bc723f647979689d6b5a168b7da7058d9607f8a26f6c4372cf4f75aba77fb1fc3b7d47c3026cb478640f55e6a413764
|
data/.coveralls.yml
ADDED
data/.gitignore
ADDED
data/.ruby-gemset
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
working_calendar
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby-2.5.0
|
data/.travis.yml
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
language: ruby
|
2
|
+
|
3
|
+
rvm:
|
4
|
+
- 1.9.3
|
5
|
+
- 2.0
|
6
|
+
- 2.1
|
7
|
+
- 2.2
|
8
|
+
- 2.3.0
|
9
|
+
- 2.4.0
|
10
|
+
- 2.5.0
|
11
|
+
- jruby-1.7.25
|
12
|
+
- jruby-9.1.7.0
|
13
|
+
- ruby-head
|
14
|
+
- jruby-head
|
15
|
+
|
16
|
+
matrix:
|
17
|
+
fast_finish: true
|
18
|
+
allow_failures:
|
19
|
+
- rvm: ruby-head
|
20
|
+
- rvm: jruby-head
|
21
|
+
|
22
|
+
before_install:
|
23
|
+
- gem install bundler
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2018 Gabriel Naiman
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
# WorkingCalendar
|
2
|
+
|
3
|
+
[](https://rubygems.org/gems/working_calendar)
|
4
|
+
[](https://travis-ci.org/gabynaiman/working_calendar)
|
5
|
+
[](https://coveralls.io/github/gabynaiman/working_calendar?branch=master)
|
6
|
+
[](https://codeclimate.com/github/gabynaiman/working_calendar)
|
7
|
+
|
8
|
+
Working calendar specification
|
9
|
+
|
10
|
+
## Installation
|
11
|
+
|
12
|
+
Add this line to your application's Gemfile:
|
13
|
+
|
14
|
+
```ruby
|
15
|
+
gem 'working_calendar'
|
16
|
+
```
|
17
|
+
|
18
|
+
And then execute:
|
19
|
+
|
20
|
+
$ bundle
|
21
|
+
|
22
|
+
Or install it yourself as:
|
23
|
+
|
24
|
+
$ gem install working_calendar
|
25
|
+
|
26
|
+
## Usage
|
27
|
+
|
28
|
+
```ruby
|
29
|
+
calendar = WorkingCalendar.new '-0600'
|
30
|
+
|
31
|
+
# Working
|
32
|
+
calendar.add_working_week_day :monday, '09:00' => '18:00'
|
33
|
+
calendar.add_working_date '2018-12-29', '10:00' => '14:00'
|
34
|
+
|
35
|
+
# Not working
|
36
|
+
calendar.add_not_working_week_day :monday, '13:00' => '14:00'
|
37
|
+
calendar.add_not_working_date '2018-12-31', '10:00' => '14:00'
|
38
|
+
|
39
|
+
|
40
|
+
calendar.working_at? Time.parse('2018-12-17T12:35:00-0600') # => true
|
41
|
+
calendar.working_at? Time.parse('2018-12-31T13:35:00-0600') # => false
|
42
|
+
```
|
43
|
+
|
44
|
+
## Contributing
|
45
|
+
|
46
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/gabynaiman/working_calendar.
|
47
|
+
|
48
|
+
## License
|
49
|
+
|
50
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'bundler/gem_tasks'
|
2
|
+
require 'rake/testtask'
|
3
|
+
|
4
|
+
Rake::TestTask.new(:spec) do |t|
|
5
|
+
t.libs << 'spec'
|
6
|
+
t.libs << 'lib'
|
7
|
+
t.pattern = ENV['DIR'] ? File.join(ENV['DIR'], '**', '*_spec.rb') : 'spec/**/*_spec.rb'
|
8
|
+
t.verbose = false
|
9
|
+
t.warning = false
|
10
|
+
t.loader = nil if ENV['TEST']
|
11
|
+
ENV['TEST'], ENV['LINE'] = ENV['TEST'].split(':') if ENV['TEST'] && !ENV['LINE']
|
12
|
+
t.options = ''
|
13
|
+
t.options << "--name=/#{ENV['NAME']}/ " if ENV['NAME']
|
14
|
+
t.options << "-l #{ENV['LINE']} " if ENV['LINE'] && ENV['TEST']
|
15
|
+
end
|
16
|
+
|
17
|
+
task default: :spec
|
18
|
+
|
19
|
+
desc 'Pry console'
|
20
|
+
task :console do
|
21
|
+
require 'working_calendar'
|
22
|
+
require 'pry'
|
23
|
+
ARGV.clear
|
24
|
+
Pry.start
|
25
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
require 'date'
|
2
|
+
require 'timing'
|
3
|
+
require 'multi_require'
|
4
|
+
|
5
|
+
MultiRequire.require_relative_pattern 'working_calendar/*'
|
6
|
+
|
7
|
+
class WorkingCalendar
|
8
|
+
|
9
|
+
attr_reader :zone_offset, :working_week_days, :working_dates, :not_working_week_days, :not_working_dates
|
10
|
+
|
11
|
+
def initialize(zone_offset)
|
12
|
+
@zone_offset = Timing::ZoneOffset.parse zone_offset
|
13
|
+
@working_week_days = []
|
14
|
+
@working_dates = []
|
15
|
+
@not_working_week_days = []
|
16
|
+
@not_working_dates = []
|
17
|
+
end
|
18
|
+
|
19
|
+
def add_working_week_day(day_name, hours_ranges)
|
20
|
+
working_week_days << WeekDay.new(day_name, hours_ranges)
|
21
|
+
end
|
22
|
+
|
23
|
+
def add_working_date(date, hours_ranges)
|
24
|
+
working_dates << SingleDate.new(date, hours_ranges)
|
25
|
+
end
|
26
|
+
|
27
|
+
def add_not_working_week_day(day_name, hours_ranges)
|
28
|
+
not_working_week_days << WeekDay.new(day_name, hours_ranges)
|
29
|
+
end
|
30
|
+
|
31
|
+
def add_not_working_date(date, hours_ranges)
|
32
|
+
not_working_dates << SingleDate.new(date, hours_ranges)
|
33
|
+
end
|
34
|
+
|
35
|
+
def working_at?(time)
|
36
|
+
time_in_zone = Timing::TimeInZone.new(time).to_zone(zone_offset)
|
37
|
+
|
38
|
+
(working_week_days | working_dates).any? { |e| e.include? time_in_zone } &&
|
39
|
+
!(not_working_week_days | not_working_dates).any? { |e| e.include? time_in_zone }
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
class WorkingCalendar
|
2
|
+
module CastHelper
|
3
|
+
|
4
|
+
DAY_NAMES = [:sunday, :monday, :tuesday, :wednesday, :thursday, :friday, :saturday]
|
5
|
+
|
6
|
+
def cast_date(date)
|
7
|
+
case
|
8
|
+
when date.is_a?(Date) then date
|
9
|
+
when date.respond_to?(:to_date) then date.to_date
|
10
|
+
when date.is_a?(String) then Date.parse(date)
|
11
|
+
else raise(ArgumentError, "Invalid date #{date}")
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
def cast_day_name(day_name)
|
16
|
+
normalized_day_name = day_name.downcase.to_sym
|
17
|
+
if DAY_NAMES.include? normalized_day_name
|
18
|
+
normalized_day_name
|
19
|
+
else
|
20
|
+
raise ArgumentError, "Invalid day name #{day_name}"
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def cast_hours_ranges(hours_ranges)
|
25
|
+
hours_ranges.each_with_object({}) do |(from_expression, to_expression), hash|
|
26
|
+
from = Timing::HourMinutesSeconds.parse from_expression
|
27
|
+
to = Timing::HourMinutesSeconds.parse to_expression
|
28
|
+
raise ArgumentError, "Invalid range #{from - to}" if from >= to
|
29
|
+
hash[from] = to
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
class WorkingCalendar
|
2
|
+
class SingleDate
|
3
|
+
|
4
|
+
include CastHelper
|
5
|
+
|
6
|
+
attr_reader :date, :hours_ranges
|
7
|
+
|
8
|
+
def initialize(date, hours_ranges)
|
9
|
+
@date = cast_date date
|
10
|
+
@hours_ranges = cast_hours_ranges hours_ranges
|
11
|
+
end
|
12
|
+
|
13
|
+
def include?(time)
|
14
|
+
hms = Timing::HourMinutesSeconds.new time.hour, time.min, time.sec
|
15
|
+
date == time.to_date && hours_ranges.any? { |from, to| hms.between? from, to }
|
16
|
+
end
|
17
|
+
|
18
|
+
def to_s
|
19
|
+
"#{date.iso8601} #{hours_ranges}"
|
20
|
+
end
|
21
|
+
alias_method :inspect, :to_s
|
22
|
+
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
class WorkingCalendar
|
2
|
+
class WeekDay
|
3
|
+
|
4
|
+
include CastHelper
|
5
|
+
|
6
|
+
attr_reader :day_name, :hours_ranges
|
7
|
+
|
8
|
+
def initialize(day_name, hours_ranges)
|
9
|
+
@day_name = cast_day_name day_name
|
10
|
+
@hours_ranges = cast_hours_ranges hours_ranges
|
11
|
+
end
|
12
|
+
|
13
|
+
def include?(time)
|
14
|
+
hms = Timing::HourMinutesSeconds.new time.hour, time.min, time.sec
|
15
|
+
time.public_send("#{day_name}?") && hours_ranges.any? { |from, to| hms.between? from, to }
|
16
|
+
end
|
17
|
+
|
18
|
+
def to_s
|
19
|
+
"#{day_name.capitalize} #{hours_ranges}"
|
20
|
+
end
|
21
|
+
alias_method :inspect, :to_s
|
22
|
+
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,79 @@
|
|
1
|
+
require 'minitest_helper'
|
2
|
+
|
3
|
+
describe WorkingCalendar::SingleDate do
|
4
|
+
|
5
|
+
let(:moment) { Timing::NaturalTimeLanguage.parse '2018-11-04T14:27:00-06:00' }
|
6
|
+
|
7
|
+
describe 'Included moments' do
|
8
|
+
|
9
|
+
it 'Single hours range' do
|
10
|
+
date = WorkingCalendar::SingleDate.new '2018-11-04', '09:00' => '18:00'
|
11
|
+
assert date.include?(moment)
|
12
|
+
end
|
13
|
+
|
14
|
+
it 'Multiple hours ranges' do
|
15
|
+
date = WorkingCalendar::SingleDate.new '2018-11-04', '09:00' => '13:00',
|
16
|
+
'14:00' => '18:00'
|
17
|
+
assert date.include?(moment)
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
|
22
|
+
describe 'Not included moments' do
|
23
|
+
|
24
|
+
describe 'Single hours range' do
|
25
|
+
|
26
|
+
it 'Same date and different time' do
|
27
|
+
date = WorkingCalendar::SingleDate.new '2018-11-04', '17:00' => '20:00'
|
28
|
+
refute date.include?(moment)
|
29
|
+
end
|
30
|
+
|
31
|
+
it 'Valid time and different date' do
|
32
|
+
date = WorkingCalendar::SingleDate.new '2018-11-02', '09:00' => '20:00'
|
33
|
+
refute date.include?(moment)
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
37
|
+
|
38
|
+
describe 'Multiple hours ranges' do
|
39
|
+
|
40
|
+
it 'Same date and different time' do
|
41
|
+
date = WorkingCalendar::SingleDate.new '2018-11-04', '09:00' => '14:00',
|
42
|
+
'15:00' => '18:00'
|
43
|
+
refute date.include?(moment)
|
44
|
+
end
|
45
|
+
|
46
|
+
it 'Valid time and different date' do
|
47
|
+
date = WorkingCalendar::SingleDate.new '2018-11-02', '09:00' => '13:00',
|
48
|
+
'14:00' => '18:00'
|
49
|
+
refute date.include?(moment)
|
50
|
+
end
|
51
|
+
|
52
|
+
end
|
53
|
+
|
54
|
+
end
|
55
|
+
|
56
|
+
it 'To string' do
|
57
|
+
assert_equal '2018-11-04 {09:00:00=>18:00:00}', WorkingCalendar::SingleDate.new('2018-11-04', '09:00' => '18:00').to_s
|
58
|
+
end
|
59
|
+
|
60
|
+
describe 'Cast date' do
|
61
|
+
|
62
|
+
it 'Date' do
|
63
|
+
working_date = WorkingCalendar::SingleDate.new(Date.parse('2018-11-04'), '09:00' => '18:00')
|
64
|
+
assert_equal Date.parse('2018-11-04'), working_date.date
|
65
|
+
end
|
66
|
+
|
67
|
+
it 'Time' do
|
68
|
+
working_date = WorkingCalendar::SingleDate.new(Time.parse('2018-11-04'), '09:00' => '18:00')
|
69
|
+
assert_equal Date.parse('2018-11-04'), working_date.date
|
70
|
+
end
|
71
|
+
|
72
|
+
it 'Invalid' do
|
73
|
+
error = proc { WorkingCalendar::SingleDate.new 123, '09:00' => '18:00' }.must_raise ArgumentError
|
74
|
+
assert_equal 'Invalid date 123', error.message
|
75
|
+
end
|
76
|
+
|
77
|
+
end
|
78
|
+
|
79
|
+
end
|
@@ -0,0 +1,66 @@
|
|
1
|
+
require 'minitest_helper'
|
2
|
+
|
3
|
+
describe WorkingCalendar::WeekDay do
|
4
|
+
|
5
|
+
let(:moment) { Timing::NaturalTimeLanguage.parse '2018-11-04T14:27:00-06:00' }
|
6
|
+
|
7
|
+
describe 'Included moments' do
|
8
|
+
|
9
|
+
it 'Single hours range' do
|
10
|
+
week_day = WorkingCalendar::WeekDay.new :sunday, '09:00' => '18:00'
|
11
|
+
assert week_day.include?(moment)
|
12
|
+
end
|
13
|
+
|
14
|
+
it 'Multiple hours ranges' do
|
15
|
+
week_day = WorkingCalendar::WeekDay.new :sunday, '09:00' => '13:00',
|
16
|
+
'14:00' => '18:00'
|
17
|
+
assert week_day.include?(moment)
|
18
|
+
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
|
23
|
+
describe 'Not included moments' do
|
24
|
+
|
25
|
+
describe 'Single hours range' do
|
26
|
+
|
27
|
+
it 'Same week day and different time' do
|
28
|
+
week_day = WorkingCalendar::WeekDay.new :sunday, '17:00' => '20:00'
|
29
|
+
refute week_day.include?(moment)
|
30
|
+
end
|
31
|
+
|
32
|
+
it 'Valid time and different week day' do
|
33
|
+
week_day = WorkingCalendar::WeekDay.new :monday, '09:00' => '20:00'
|
34
|
+
refute week_day.include?(moment)
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
38
|
+
|
39
|
+
describe 'Multiple hours ranges' do
|
40
|
+
|
41
|
+
it 'Same week day and different time' do
|
42
|
+
week_day = WorkingCalendar::WeekDay.new :sunday, '09:00' => '14:00',
|
43
|
+
'15:00' => '18:00'
|
44
|
+
refute week_day.include?(moment)
|
45
|
+
end
|
46
|
+
|
47
|
+
it 'Valid time and different week day' do
|
48
|
+
week_day = WorkingCalendar::WeekDay.new :monday, '09:00' => '13:00',
|
49
|
+
'14:00' => '18:00'
|
50
|
+
refute week_day.include?(moment)
|
51
|
+
end
|
52
|
+
|
53
|
+
end
|
54
|
+
|
55
|
+
end
|
56
|
+
|
57
|
+
it 'To string' do
|
58
|
+
assert_equal 'Tuesday {09:00:00=>18:00:00}', WorkingCalendar::WeekDay.new(:tuesday, '09:00' => '18:00').to_s
|
59
|
+
end
|
60
|
+
|
61
|
+
it 'Invalid day name' do
|
62
|
+
error = proc { WorkingCalendar::WeekDay.new :xyz, '09:00' => '18:00' }.must_raise ArgumentError
|
63
|
+
assert_equal 'Invalid day name xyz', error.message
|
64
|
+
end
|
65
|
+
|
66
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
require 'minitest_helper'
|
2
|
+
|
3
|
+
describe WorkingCalendar do
|
4
|
+
|
5
|
+
let :calendar do
|
6
|
+
WorkingCalendar.new('-0600').tap do |calendar|
|
7
|
+
calendar.add_working_week_day :monday, '09:00' => '18:00'
|
8
|
+
calendar.add_not_working_week_day :monday, '13:00' => '14:00'
|
9
|
+
|
10
|
+
calendar.add_working_date '2018-12-29', '10:00' => '14:00'
|
11
|
+
calendar.add_not_working_date '2018-12-31', '10:00' => '14:00'
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
describe 'Working' do
|
16
|
+
|
17
|
+
it 'Week day' do
|
18
|
+
assert calendar.working_at? Time.parse('2018-12-17T12:35:00-0600')
|
19
|
+
assert calendar.working_at? Time.parse('2018-12-17T13:35:00-0500') # 12:35:00 -0600
|
20
|
+
end
|
21
|
+
|
22
|
+
it 'Date' do
|
23
|
+
assert calendar.working_at? Time.parse('2018-12-29T12:35:00-0600')
|
24
|
+
assert calendar.working_at? Time.parse('2018-12-29T16:35:00-0100') # 11:35:00 -0600
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
28
|
+
|
29
|
+
describe 'Not working' do
|
30
|
+
|
31
|
+
it 'Week day' do
|
32
|
+
refute calendar.working_at? Time.parse('2018-12-17T13:35:00-0600')
|
33
|
+
refute calendar.working_at? Time.parse('2018-12-17T12:35:00-0700') # 13:35:00 -0600
|
34
|
+
end
|
35
|
+
|
36
|
+
it 'Date' do
|
37
|
+
refute calendar.working_at? Time.parse('2018-12-31T13:35:00-0600')
|
38
|
+
refute calendar.working_at? Time.parse('2018-12-31T11:35:00-0700') # 12:35:00 -0600
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
42
|
+
|
43
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'working_calendar/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'working_calendar'
|
8
|
+
spec.version = WorkingCalendar::VERSION
|
9
|
+
spec.authors = ['Gabriel Naiman']
|
10
|
+
spec.email = ['gabynaiman@gmail.com']
|
11
|
+
spec.summary = 'Working calendar specification'
|
12
|
+
spec.description = 'Working calendar specification'
|
13
|
+
spec.homepage = 'https://github.com/gabynaiman/working_calendar'
|
14
|
+
spec.license = 'MIT'
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ['lib']
|
20
|
+
|
21
|
+
spec.add_runtime_dependency 'multi_require', '~> 1.0'
|
22
|
+
spec.add_runtime_dependency 'timing', '~> 0.2'
|
23
|
+
|
24
|
+
spec.add_development_dependency 'bundler', '~> 1.12'
|
25
|
+
spec.add_development_dependency 'rake', '~> 11.0'
|
26
|
+
spec.add_development_dependency 'minitest', '~> 5.0', '< 5.11'
|
27
|
+
spec.add_development_dependency 'minitest-colorin', '~> 0.1'
|
28
|
+
spec.add_development_dependency 'minitest-line', '~> 0.6'
|
29
|
+
spec.add_development_dependency 'simplecov', '~> 0.12'
|
30
|
+
spec.add_development_dependency 'coveralls', '~> 0.8'
|
31
|
+
spec.add_development_dependency 'pry-nav', '~> 0.2'
|
32
|
+
end
|
metadata
ADDED
@@ -0,0 +1,215 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: working_calendar
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Gabriel Naiman
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-12-20 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: multi_require
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: timing
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0.2'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0.2'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bundler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.12'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.12'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '11.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '11.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: minitest
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '5.0'
|
76
|
+
- - "<"
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: '5.11'
|
79
|
+
type: :development
|
80
|
+
prerelease: false
|
81
|
+
version_requirements: !ruby/object:Gem::Requirement
|
82
|
+
requirements:
|
83
|
+
- - "~>"
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '5.0'
|
86
|
+
- - "<"
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '5.11'
|
89
|
+
- !ruby/object:Gem::Dependency
|
90
|
+
name: minitest-colorin
|
91
|
+
requirement: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - "~>"
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '0.1'
|
96
|
+
type: :development
|
97
|
+
prerelease: false
|
98
|
+
version_requirements: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - "~>"
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: '0.1'
|
103
|
+
- !ruby/object:Gem::Dependency
|
104
|
+
name: minitest-line
|
105
|
+
requirement: !ruby/object:Gem::Requirement
|
106
|
+
requirements:
|
107
|
+
- - "~>"
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0.6'
|
110
|
+
type: :development
|
111
|
+
prerelease: false
|
112
|
+
version_requirements: !ruby/object:Gem::Requirement
|
113
|
+
requirements:
|
114
|
+
- - "~>"
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: '0.6'
|
117
|
+
- !ruby/object:Gem::Dependency
|
118
|
+
name: simplecov
|
119
|
+
requirement: !ruby/object:Gem::Requirement
|
120
|
+
requirements:
|
121
|
+
- - "~>"
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
version: '0.12'
|
124
|
+
type: :development
|
125
|
+
prerelease: false
|
126
|
+
version_requirements: !ruby/object:Gem::Requirement
|
127
|
+
requirements:
|
128
|
+
- - "~>"
|
129
|
+
- !ruby/object:Gem::Version
|
130
|
+
version: '0.12'
|
131
|
+
- !ruby/object:Gem::Dependency
|
132
|
+
name: coveralls
|
133
|
+
requirement: !ruby/object:Gem::Requirement
|
134
|
+
requirements:
|
135
|
+
- - "~>"
|
136
|
+
- !ruby/object:Gem::Version
|
137
|
+
version: '0.8'
|
138
|
+
type: :development
|
139
|
+
prerelease: false
|
140
|
+
version_requirements: !ruby/object:Gem::Requirement
|
141
|
+
requirements:
|
142
|
+
- - "~>"
|
143
|
+
- !ruby/object:Gem::Version
|
144
|
+
version: '0.8'
|
145
|
+
- !ruby/object:Gem::Dependency
|
146
|
+
name: pry-nav
|
147
|
+
requirement: !ruby/object:Gem::Requirement
|
148
|
+
requirements:
|
149
|
+
- - "~>"
|
150
|
+
- !ruby/object:Gem::Version
|
151
|
+
version: '0.2'
|
152
|
+
type: :development
|
153
|
+
prerelease: false
|
154
|
+
version_requirements: !ruby/object:Gem::Requirement
|
155
|
+
requirements:
|
156
|
+
- - "~>"
|
157
|
+
- !ruby/object:Gem::Version
|
158
|
+
version: '0.2'
|
159
|
+
description: Working calendar specification
|
160
|
+
email:
|
161
|
+
- gabynaiman@gmail.com
|
162
|
+
executables: []
|
163
|
+
extensions: []
|
164
|
+
extra_rdoc_files: []
|
165
|
+
files:
|
166
|
+
- ".coveralls.yml"
|
167
|
+
- ".gitignore"
|
168
|
+
- ".ruby-gemset"
|
169
|
+
- ".ruby-version"
|
170
|
+
- ".travis.yml"
|
171
|
+
- Gemfile
|
172
|
+
- LICENSE.txt
|
173
|
+
- README.md
|
174
|
+
- Rakefile
|
175
|
+
- lib/working_calendar.rb
|
176
|
+
- lib/working_calendar/cast_helper.rb
|
177
|
+
- lib/working_calendar/single_date.rb
|
178
|
+
- lib/working_calendar/version.rb
|
179
|
+
- lib/working_calendar/week_day.rb
|
180
|
+
- spec/coverage_helper.rb
|
181
|
+
- spec/minitest_helper.rb
|
182
|
+
- spec/single_date_spec.rb
|
183
|
+
- spec/week_day_spec.rb
|
184
|
+
- spec/working_calendar_spec.rb
|
185
|
+
- working_calendar.gemspec
|
186
|
+
homepage: https://github.com/gabynaiman/working_calendar
|
187
|
+
licenses:
|
188
|
+
- MIT
|
189
|
+
metadata: {}
|
190
|
+
post_install_message:
|
191
|
+
rdoc_options: []
|
192
|
+
require_paths:
|
193
|
+
- lib
|
194
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
195
|
+
requirements:
|
196
|
+
- - ">="
|
197
|
+
- !ruby/object:Gem::Version
|
198
|
+
version: '0'
|
199
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
200
|
+
requirements:
|
201
|
+
- - ">="
|
202
|
+
- !ruby/object:Gem::Version
|
203
|
+
version: '0'
|
204
|
+
requirements: []
|
205
|
+
rubyforge_project:
|
206
|
+
rubygems_version: 2.7.3
|
207
|
+
signing_key:
|
208
|
+
specification_version: 4
|
209
|
+
summary: Working calendar specification
|
210
|
+
test_files:
|
211
|
+
- spec/coverage_helper.rb
|
212
|
+
- spec/minitest_helper.rb
|
213
|
+
- spec/single_date_spec.rb
|
214
|
+
- spec/week_day_spec.rb
|
215
|
+
- spec/working_calendar_spec.rb
|