silverball 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8e1dec3505120fcc2c7f2b12a3d4a89f6f2d6b8d
4
- data.tar.gz: 3e03c5a75bd62cb4973c7832eb96581484f0423e
3
+ metadata.gz: b9e6a4721e936e9764964f09257c59f5da628509
4
+ data.tar.gz: 394dd4af29993e7abb68da6964598809422679f3
5
5
  SHA512:
6
- metadata.gz: e1a98a3fe2b8b2e7fb69498520076118eba1c920fb802753ba74f8d8925fdf7c029085d1c3393fe1c2e58d4dce9b1e73a2b5108ba4fad70d9dd467e28e0a25ac
7
- data.tar.gz: 96ac7911a4a220af58cbecc19cc0cdcff2d396466cc08c4be99442121cb2d8bd6b8ab5f91e9f270e7ef6bfc9b711e06fd684e23959466656d5dae1787645f03b
6
+ metadata.gz: 7d902cb6c6caf729acf920ae9200df488bb4e28558b6bd8d6cc0bd9e39cd3ce2804524ce1d493c8f47764b2d7ad0bcc2d81b6a1ca39e36a7ffcc4211458f0cd6
7
+ data.tar.gz: 59b75702917c38b1c4f3405646083c6884279e6c63554b9f8dfa8000a32785533633b408225df55cbdc9c1a1815ab6e564a7231ea41ea965d2b5e1053188b9c9
data/CHANGELOG.md CHANGED
@@ -19,6 +19,14 @@ glance - what to expact from upgrading to a new version.
19
19
  ### Removed
20
20
 
21
21
 
22
+ ## [0.1.2] - 2017-01-06
23
+
24
+ ### Fixed
25
+
26
+ - Removes seconds part of output of `timespan_in_words` in single-unit mode due
27
+ to floating point inaccuracies.
28
+
29
+
22
30
  ## [0.1.1] - 2017-01-03
23
31
 
24
32
  ### Fixed
@@ -62,13 +62,21 @@ module Silverball
62
62
  end
63
63
  end
64
64
 
65
- out = []
66
- out << "#{ days }d" if days > 0
67
- out << "#{ hours }h" if hours > 0
68
- out << "#{ minutes }m" if minutes > 0
69
- out << "#{ seconds }s" if seconds > 0 || (seconds == 0 && minutes == 0 && hours == 0 && days == 0)
65
+ if unit == :days
66
+ "#{ days }d"
67
+ elsif unit == :hours
68
+ "#{ hours }h"
69
+ elsif unit == :minutes
70
+ "#{ minutes }m"
71
+ else
72
+ out = []
73
+ out << "#{ days }d" if days > 0
74
+ out << "#{ hours }h" if hours > 0
75
+ out << "#{ minutes }m" if minutes > 0
76
+ out << "#{ seconds }s" if seconds > 0 || (seconds == 0 && minutes == 0 && hours == 0 && days == 0)
70
77
 
71
- out.join(' ')
78
+ out.join(' ')
79
+ end
72
80
  end
73
81
  end
74
82
  end
data/silverball.gemspec CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "silverball"
7
- spec.version = '0.1.1'
7
+ spec.version = '0.1.2'
8
8
  spec.authors = ["Michael Senn"]
9
9
  spec.email = ["michael@morrolan.ch"]
10
10
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: silverball
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Senn
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-01-03 00:00:00.000000000 Z
11
+ date: 2017-01-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler