working_calendar 0.1.0 → 0.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9432c70fcd651666dd70a9c46ae6d78b376bc39e16b04703dec525f34e83409f
4
- data.tar.gz: 1f2a697ccac7dcaae72085da4d76b04ed55857c5654efd40b405d013d356068b
3
+ metadata.gz: 43caa359428afcc90255c07b614e696ed1dc5f7e8ef15b3097e9e1c8dc4f4f59
4
+ data.tar.gz: f05e901e3d24b44f66fd6aab268d934437c74cbbafdc74a2989fda152a4cf4be
5
5
  SHA512:
6
- metadata.gz: d7f929e23897c08f2a9aa03f6eb2d67b5ec183c9c1652dc8ed5f5a02a398a8f547f260fb6c8974f942170baa588f913ff50429ab475af49f725ea3c1eeb80249
7
- data.tar.gz: 24652b62203f26765c12f34d5813561e7bc723f647979689d6b5a168b7da7058d9607f8a26f6c4372cf4f75aba77fb1fc3b7d47c3026cb478640f55e6a413764
6
+ metadata.gz: 8d002255b485acfca0b4b83bb95f2a0dab8ede1b2b8bca43694d1fb3fda1962acfaabbd9d0f33bd1732bcf7b635632b8f2c800d53304a0ea8e14895ea7fe278d
7
+ data.tar.gz: e96f3734e8f4ef93e9c451c24a97bdefd1a523b860fba25e68dfcd39890d82d3f2baa835c8c9e6231b5944735465a684c4e0d4278341f83322fc866e75cf8290
@@ -0,0 +1,26 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [ '**' ]
6
+ pull_request:
7
+ branches: [ '**' ]
8
+
9
+ jobs:
10
+ test:
11
+
12
+ name: Tests
13
+ runs-on: ubuntu-latest
14
+ strategy:
15
+ matrix:
16
+ ruby-version: ['2.0', '2.1', '2.2', '2.3', '2.4', '2.5', '2.6', '2.7', '3.0', 'jruby-9.2.9.0']
17
+
18
+ steps:
19
+ - uses: actions/checkout@v3
20
+ - name: Set up Ruby
21
+ uses: ruby/setup-ruby@v1
22
+ with:
23
+ ruby-version: ${{ matrix.ruby-version }}
24
+ bundler-cache: true
25
+ - name: Run tests
26
+ run: bundle exec rake
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # WorkingCalendar
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/working_calendar.svg)](https://rubygems.org/gems/working_calendar)
4
- [![Build Status](https://travis-ci.org/gabynaiman/working_calendar.svg?branch=master)](https://travis-ci.org/gabynaiman/working_calendar)
4
+ [![CI](https://github.com/gabynaiman/working_calendar/actions/workflows/ci.yml/badge.svg)](https://github.com/gabynaiman/working_calendar/actions/workflows/ci.yml)
5
5
  [![Coverage Status](https://coveralls.io/repos/github/gabynaiman/working_calendar/badge.svg?branch=master)](https://coveralls.io/github/gabynaiman/working_calendar?branch=master)
6
6
  [![Code Climate](https://codeclimate.com/github/gabynaiman/working_calendar.svg)](https://codeclimate.com/github/gabynaiman/working_calendar)
7
7
 
@@ -25,7 +25,7 @@ class WorkingCalendar
25
25
  hours_ranges.each_with_object({}) do |(from_expression, to_expression), hash|
26
26
  from = Timing::HourMinutesSeconds.parse from_expression
27
27
  to = Timing::HourMinutesSeconds.parse to_expression
28
- raise ArgumentError, "Invalid range #{from - to}" if from >= to
28
+ raise ArgumentError, "Invalid range #{from} - #{to}" if from >= to
29
29
  hash[from] = to
30
30
  end
31
31
  end
@@ -1,3 +1,3 @@
1
1
  class WorkingCalendar
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
  end
@@ -42,7 +42,7 @@ describe WorkingCalendar::SingleDate do
42
42
  '15:00' => '18:00'
43
43
  refute date.include?(moment)
44
44
  end
45
-
45
+
46
46
  it 'Valid time and different date' do
47
47
  date = WorkingCalendar::SingleDate.new '2018-11-02', '09:00' => '13:00',
48
48
  '14:00' => '18:00'
@@ -69,11 +69,16 @@ describe WorkingCalendar::SingleDate do
69
69
  assert_equal Date.parse('2018-11-04'), working_date.date
70
70
  end
71
71
 
72
- it 'Invalid' do
72
+ it 'Invalid date' do
73
73
  error = proc { WorkingCalendar::SingleDate.new 123, '09:00' => '18:00' }.must_raise ArgumentError
74
74
  assert_equal 'Invalid date 123', error.message
75
75
  end
76
76
 
77
+ it 'Invalid range' do
78
+ error = proc { WorkingCalendar::SingleDate.new(Time.parse('2018-11-04'), '10:00' => '09:00') }.must_raise ArgumentError
79
+ assert_equal 'Invalid range 10:00:00 - 09:00:00', error.message
80
+ end
81
+
77
82
  end
78
83
 
79
84
  end
@@ -63,4 +63,9 @@ describe WorkingCalendar::WeekDay do
63
63
  assert_equal 'Invalid day name xyz', error.message
64
64
  end
65
65
 
66
+ it 'Invalid range' do
67
+ error = proc { WorkingCalendar::WeekDay.new :sunday, '18:00' => '09:00' }.must_raise ArgumentError
68
+ assert_equal 'Invalid range 18:00:00 - 09:00:00', error.message
69
+ end
70
+
66
71
  end
@@ -21,7 +21,6 @@ Gem::Specification.new do |spec|
21
21
  spec.add_runtime_dependency 'multi_require', '~> 1.0'
22
22
  spec.add_runtime_dependency 'timing', '~> 0.2'
23
23
 
24
- spec.add_development_dependency 'bundler', '~> 1.12'
25
24
  spec.add_development_dependency 'rake', '~> 11.0'
26
25
  spec.add_development_dependency 'minitest', '~> 5.0', '< 5.11'
27
26
  spec.add_development_dependency 'minitest-colorin', '~> 0.1'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: working_calendar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriel Naiman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-12-20 00:00:00.000000000 Z
11
+ date: 2022-07-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_require
@@ -38,20 +38,6 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
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
41
  - !ruby/object:Gem::Dependency
56
42
  name: rake
57
43
  requirement: !ruby/object:Gem::Requirement
@@ -164,10 +150,10 @@ extensions: []
164
150
  extra_rdoc_files: []
165
151
  files:
166
152
  - ".coveralls.yml"
153
+ - ".github/workflows/ci.yml"
167
154
  - ".gitignore"
168
155
  - ".ruby-gemset"
169
156
  - ".ruby-version"
170
- - ".travis.yml"
171
157
  - Gemfile
172
158
  - LICENSE.txt
173
159
  - README.md
@@ -202,8 +188,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
202
188
  - !ruby/object:Gem::Version
203
189
  version: '0'
204
190
  requirements: []
205
- rubyforge_project:
206
- rubygems_version: 2.7.3
191
+ rubygems_version: 3.0.8
207
192
  signing_key:
208
193
  specification_version: 4
209
194
  summary: Working calendar specification
data/.travis.yml DELETED
@@ -1,23 +0,0 @@
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