satoshi-unit 0.1.7 → 0.1.8
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 +4 -4
- data/VERSION +1 -1
- data/lib/satoshi.rb +5 -1
- data/satoshi-unit.gemspec +4 -4
- data/spec/satoshi_spec.rb +5 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 38dbd65122c71478ebbc17940b8f166634e0f48e
|
4
|
+
data.tar.gz: 1e765d7109e2c8e262fa97cb34bdd7b9b9847f4e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8eb63f988141717ed76c768560c82d7611f2f26bfc4e7dce89e7cc37a9a5f4214bb3d9af58d261d964b7626cdc2bf17eb656533c5fb026c2b787ac5f902251e9
|
7
|
+
data.tar.gz: 9ee2ddf57460fae6b6fce6546027956f4115c01bc772d2a851f5f16ae5c72ab6fca11d8b526fa847e1519c83e7762f82d225be7e08acda2139719df592cfb17d
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.8
|
data/lib/satoshi.rb
CHANGED
@@ -103,7 +103,11 @@ class Satoshi
|
|
103
103
|
if as == :number
|
104
104
|
result.to_f*sign
|
105
105
|
else
|
106
|
-
|
106
|
+
if result == '.'
|
107
|
+
result = '0.0'
|
108
|
+
elsif result =~ /\A\./
|
109
|
+
result = "0#{result}"
|
110
|
+
end
|
107
111
|
sign == -1 ? "-#{result}" : result
|
108
112
|
end
|
109
113
|
end
|
data/satoshi-unit.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: satoshi-unit 0.1.
|
5
|
+
# stub: satoshi-unit 0.1.8 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "satoshi-unit"
|
9
|
-
s.version = "0.1.
|
9
|
+
s.version = "0.1.8"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
13
13
|
s.authors = ["Roman Snitko"]
|
14
|
-
s.date = "2015-
|
14
|
+
s.date = "2015-07-21"
|
15
15
|
s.description = "Converts various bitcoin denominations in Satoshis and back"
|
16
16
|
s.email = "roman.snitko@gmail.com"
|
17
17
|
s.extra_rdoc_files = [
|
@@ -34,7 +34,7 @@ Gem::Specification.new do |s|
|
|
34
34
|
]
|
35
35
|
s.homepage = "http://github.com/snitko/satoshi-unit"
|
36
36
|
s.licenses = ["MIT"]
|
37
|
-
s.rubygems_version = "2.
|
37
|
+
s.rubygems_version = "2.4.5"
|
38
38
|
s.summary = "Converts various bitcoin denominations in Satoshis and back"
|
39
39
|
|
40
40
|
if s.respond_to? :specification_version then
|
data/spec/satoshi_spec.rb
CHANGED
@@ -56,4 +56,9 @@ describe Satoshi do
|
|
56
56
|
expect(one_satoshi.to_unit(as: :string)).to eq('0.00000001')
|
57
57
|
end
|
58
58
|
|
59
|
+
it "displays zero Satoshi in human form, not math form" do
|
60
|
+
zero_satoshi = Satoshi.new(0, from_unit: :satoshi, to_unit: :btc)
|
61
|
+
expect(zero_satoshi.to_unit(as: :string)).to eq('0.0')
|
62
|
+
end
|
63
|
+
|
59
64
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: satoshi-unit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roman Snitko
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-07-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -92,7 +92,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
92
92
|
version: '0'
|
93
93
|
requirements: []
|
94
94
|
rubyforge_project:
|
95
|
-
rubygems_version: 2.
|
95
|
+
rubygems_version: 2.4.5
|
96
96
|
signing_key:
|
97
97
|
specification_version: 4
|
98
98
|
summary: Converts various bitcoin denominations in Satoshis and back
|