go-duration 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/go-duration/duration.rb +3 -3
- data/lib/go-duration/version.rb +1 -1
- data/spec/go-duration/duration_spec.rb +9 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d401fe34deab2c324f95692060a62c43ee55a0b2
|
4
|
+
data.tar.gz: 3c8c82b84a4e36de1fbf757849cea6ee4fa8cbc1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 65014bf58fb1c0c0b1d457dfde244af283308dba3011462104ca136b3dd255bc2693e27323edd22d15508df834b0dcd71218d1c023439896626536bb6a471a72
|
7
|
+
data.tar.gz: 4f85900024787f42cac3c69e308e8130f5b9c1bd2143ac221998ef2cdb45fff5739bcbc8f26bf21736d0989385a2ca03bc3f3b1e720fc075c4699274a1220121
|
data/lib/go-duration/duration.rb
CHANGED
@@ -3,13 +3,13 @@ module GoDuration
|
|
3
3
|
NANOSECOND = 1.freeze
|
4
4
|
|
5
5
|
# One microsecond in nanoseconds.
|
6
|
-
MICROSECOND =
|
6
|
+
MICROSECOND = 1000 * NANOSECOND.freeze
|
7
7
|
|
8
8
|
# One millisecond in nanoseconds.
|
9
|
-
MILLISECOND =
|
9
|
+
MILLISECOND = 1000 * MICROSECOND.freeze
|
10
10
|
|
11
11
|
# One second in nanoseconds.
|
12
|
-
SECOND =
|
12
|
+
SECOND = 1000 * MILLISECOND.freeze
|
13
13
|
|
14
14
|
# One minute in nanoseconds.
|
15
15
|
MINUTE = 60 * SECOND.freeze
|
data/lib/go-duration/version.rb
CHANGED
@@ -1,8 +1,15 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
3
|
module GoDuration
|
4
|
-
all_duration = "
|
5
|
-
all_nano =
|
4
|
+
all_duration = "2h2m2s2ms2µs2ns"
|
5
|
+
all_nano = 2 * (
|
6
|
+
HOUR +
|
7
|
+
MINUTE +
|
8
|
+
SECOND +
|
9
|
+
MILLISECOND +
|
10
|
+
MICROSECOND +
|
11
|
+
NANOSECOND
|
12
|
+
)
|
6
13
|
|
7
14
|
describe Duration do
|
8
15
|
describe "#new" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: go-duration
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Uber
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-02-
|
11
|
+
date: 2017-02-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|