time_pieces 1.0.2 → 1.0.3

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: 7f7098f2d181bb8ebcfc57c72bf7048b173fdd43
4
- data.tar.gz: c93566156f61614497bd3bff156f6f96b079464d
3
+ metadata.gz: 6939c86325f83d19a213a15367cc310751dac361
4
+ data.tar.gz: b1e3f2eaa0466f938812c32947d07f373370da47
5
5
  SHA512:
6
- metadata.gz: f7b5b6780294f08ba9172072da1de6f0f0564657fb624bea4754c852920a7046538c2b5d9a90de88c91a95276fffdc195f996fa969389ca4488fb2d1b2df2173
7
- data.tar.gz: 83d42224dd9bc7eaf8d20df5529d19879d85cc360a1f5c437a683f1b16bc5065309636bd6264ecd1e8b167c9378a62b8b4bea89c3f1ad7f6793c48be27913e77
6
+ metadata.gz: 4da90ccab31712d514f8ac2d316bbc3bc244887d9e7ce5f6acde8225a31e9e7d6ee9add2918de1b1a38b538522f2932183db5891960a02271e7a203e32d2d518
7
+ data.tar.gz: 442fd4ba05979b1c7f3ddf1d95a0a7d00f8aa1bca56c9a5b1f05e1a76f83ee7c38ecc439dd9183dcd04cb72811c425bb71cb1fed634e780d2751d56f6cb78558
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- time_pieces (1.0.1)
4
+ time_pieces (1.0.3)
5
5
  bundler
6
6
 
7
7
  GEM
@@ -14,6 +14,7 @@ GEM
14
14
  thread_safe (~> 0.3, >= 0.3.4)
15
15
  tzinfo (~> 1.1)
16
16
  builder (3.2.2)
17
+ chronic (0.10.2)
17
18
  cucumber (2.3.2)
18
19
  builder (>= 2.1.2)
19
20
  cucumber-core (~> 1.4.0)
@@ -42,9 +43,7 @@ PLATFORMS
42
43
 
43
44
  DEPENDENCIES
44
45
  activesupport (~> 4.2)
46
+ chronic (~> 0.10.2)
45
47
  cucumber (~> 2.3.2)
46
48
  rake (~> 10.5)
47
49
  time_pieces!
48
-
49
- BUNDLED WITH
50
- 1.10.6
@@ -1,6 +1,16 @@
1
1
  module TimePieces
2
+ module DurationClassMethods
3
+ def parse(str)
4
+ times = str.split(" - ")
5
+ dur = self.new(Chronic.parse(times[0]).seconds_since_midnight, Chronic.parse(times[1]).seconds_since_midnight - Chronic.parse(times[0]).seconds_since_midnight)
6
+ return dur
7
+ end
8
+ end
2
9
  module Duration
3
10
  attr_accessor :start_at_seconds, :duration_seconds
11
+ def self.included(base)
12
+ base.extend(DurationClassMethods)
13
+ end
4
14
  def end_at_seconds
5
15
  return start_at_seconds + duration_seconds
6
16
  end
@@ -1,3 +1,3 @@
1
1
  module TimePieces
2
- VERSION = "1.0.2"
2
+ VERSION = "1.0.3"
3
3
  end
data/lib/time_pieces.rb CHANGED
@@ -7,3 +7,4 @@ require 'time_pieces/duration'
7
7
 
8
8
  require 'time_pieces/simple_duration'
9
9
  require 'time_pieces/time_set'
10
+ require 'chronic'
Binary file
data/time_pieces.gemspec CHANGED
@@ -38,4 +38,6 @@ Gem::Specification.new do |spec|
38
38
 
39
39
  spec.add_development_dependency 'rake', '~> 10.5'
40
40
  spec.add_development_dependency 'cucumber', '~> 2.3.2'
41
+ spec.add_development_dependency 'chronic', '~> 0.10.2'
42
+
41
43
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: time_pieces
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Grant R.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-02-26 00:00:00.000000000 Z
11
+ date: 2016-03-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: 2.3.2
69
+ - !ruby/object:Gem::Dependency
70
+ name: chronic
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: 0.10.2
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 0.10.2
69
83
  description: time_pieces is a library to make it easy to add/subtract time from a
70
84
  schedule
71
85
  email: grant@arsemporium.com
@@ -83,6 +97,7 @@ files:
83
97
  - lib/time_pieces/simple_duration.rb
84
98
  - lib/time_pieces/time_set.rb
85
99
  - lib/time_pieces/version.rb
100
+ - pkg/time_pieces-1.0.2.gem
86
101
  - time_pieces.gemspec
87
102
  homepage: http://github.com/riggleg/time_pieces
88
103
  licenses: