workhours 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/lib/workhours.rb +1 -0
- data/lib/workhours/period.rb +3 -3
- data/lib/workhours/version.rb +1 -1
- data/lib/workhours/week.rb +2 -2
- data/workhours.gemspec +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a8c7f5dee953a61e1d670526c3088081f16f453c
|
4
|
+
data.tar.gz: 74efe9fef0d7f6499bf3041bc8965aba35da3bd0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8f138d644b682e8dc032de679f4742ac68764f0385fb24ce988b01d73b1c64a130164f37ab906eae55071e62a3bf605fc8ca052c59c44561e1ab38c058b1685f
|
7
|
+
data.tar.gz: b8fb21d8d847938d684b5e918c6876de77e11bcd91fd8f5294580028f76207cc78c4df64f959dfd59782b88fb25131167e9396e3d62bef7a9ff6e19c26363f94
|
data/Gemfile.lock
CHANGED
data/lib/workhours.rb
CHANGED
data/lib/workhours/period.rb
CHANGED
@@ -3,12 +3,12 @@ module Workhours
|
|
3
3
|
attr_accessor :wday, :shift
|
4
4
|
def initialize(wday, beginning, ending)
|
5
5
|
@wday = wday
|
6
|
-
beginning = TimeOfDay.parse(beginning) unless beginning.is_a?(TimeOfDay)
|
7
|
-
ending = TimeOfDay.parse(ending) unless ending.is_a?(TimeOfDay)
|
6
|
+
beginning = Tod::TimeOfDay.parse(beginning) unless beginning.is_a?(Tod::TimeOfDay)
|
7
|
+
ending = Tod::TimeOfDay.parse(ending) unless ending.is_a?(Tod::TimeOfDay)
|
8
8
|
if ending.second_of_day != 0 && ending < beginning
|
9
9
|
raise MultidayPeriodError.new()
|
10
10
|
end
|
11
|
-
@shift = Shift.new(beginning, ending)
|
11
|
+
@shift = Tod::Shift.new(beginning, ending)
|
12
12
|
end
|
13
13
|
|
14
14
|
def inspect
|
data/lib/workhours/version.rb
CHANGED
data/lib/workhours/week.rb
CHANGED
@@ -31,8 +31,8 @@ module Workhours
|
|
31
31
|
else
|
32
32
|
pr = h.split(' ')
|
33
33
|
times = pr[1].split('-')
|
34
|
-
beginning = TimeOfDay.parse(times[0])
|
35
|
-
ending = TimeOfDay.parse(times[1])
|
34
|
+
beginning = Tod::TimeOfDay.parse(times[0])
|
35
|
+
ending = Tod::TimeOfDay.parse(times[1])
|
36
36
|
if ending < beginning
|
37
37
|
[Workhours::Period.new(pr[0], times[0], "0:00"), Workhours::Period.new(Workhours.next_day(pr[0]), "0:00", times[1])]
|
38
38
|
else
|
data/workhours.gemspec
CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.add_dependency "tod"
|
21
|
+
spec.add_dependency "tod", '~> 2.0'
|
22
22
|
|
23
23
|
spec.add_development_dependency "bundler", "~> 1.6"
|
24
24
|
spec.add_development_dependency "rake"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: workhours
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- glebtv
|
@@ -14,16 +14,16 @@ dependencies:
|
|
14
14
|
name: tod
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
19
|
+
version: '2.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'
|
26
|
+
version: '2.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|