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 +4 -4
- data/Gemfile.lock +3 -4
- data/lib/time_pieces/duration.rb +10 -0
- data/lib/time_pieces/version.rb +1 -1
- data/lib/time_pieces.rb +1 -0
- data/pkg/time_pieces-1.0.2.gem +0 -0
- data/time_pieces.gemspec +2 -0
- metadata +17 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6939c86325f83d19a213a15367cc310751dac361
|
4
|
+
data.tar.gz: b1e3f2eaa0466f938812c32947d07f373370da47
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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
|
data/lib/time_pieces/duration.rb
CHANGED
@@ -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
|
data/lib/time_pieces/version.rb
CHANGED
data/lib/time_pieces.rb
CHANGED
Binary file
|
data/time_pieces.gemspec
CHANGED
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.
|
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-
|
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:
|