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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4afcc2a48122262799dcb7e26fdc3eb35b14bb9f
4
- data.tar.gz: cacbd1f4c452697d860d3bdb39e48707eb3f0910
3
+ metadata.gz: a8c7f5dee953a61e1d670526c3088081f16f453c
4
+ data.tar.gz: 74efe9fef0d7f6499bf3041bc8965aba35da3bd0
5
5
  SHA512:
6
- metadata.gz: d08055ca91f5ebd065f653fa153fe9cdcc9779591e496af743a257e21fae6b8eef038fee6426206599143f399c9f36936ba25ab569a32bd7d828ca3f7d9e1280
7
- data.tar.gz: 25e9d25e4e0406f3a70c5eb34d1d2f063b3da5b3cbc6c819158901ba3fe2d5331d34ae375d515be1888c2b44cdd5bad7678ee6abf3d89075c3e2b2d30a0b51ce
6
+ metadata.gz: 8f138d644b682e8dc032de679f4742ac68764f0385fb24ce988b01d73b1c64a130164f37ab906eae55071e62a3bf605fc8ca052c59c44561e1ab38c058b1685f
7
+ data.tar.gz: b8fb21d8d847938d684b5e918c6876de77e11bcd91fd8f5294580028f76207cc78c4df64f959dfd59782b88fb25131167e9396e3d62bef7a9ff6e19c26363f94
data/Gemfile.lock CHANGED
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- workhours (0.1.0)
5
- tod
4
+ workhours (0.2.0)
5
+ tod (~> 2.0)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
data/lib/workhours.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  require "workhours/version"
2
2
 
3
3
  require 'tod'
4
+ require 'tod/core_extensions'
4
5
  require "workhours/week"
5
6
  require "workhours/period"
6
7
  require "workhours/util"
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Workhours
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -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.1.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