abaco 1.0.0 → 1.0.1

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: 94d8e8b072fcd1ecd6027ff34115ad814a5ddf49
4
- data.tar.gz: f0e5d275f8210d47e1008185f8f7359e1b7740c5
3
+ metadata.gz: f8a81add9bd6a7fa2b74e154443a6f6ee32832ab
4
+ data.tar.gz: a28d4780e22db5dcb1c81742dcabbb6d32a64be1
5
5
  SHA512:
6
- metadata.gz: c54cb2bbec55b76a601a52a9e02c0e8d8443a77ba12f7e09c910e7154f61c5ed3ad5a61e3a3bb46f121352579ca7c6bd47123b4587553117ad5cb15cd749db8f
7
- data.tar.gz: 67de3f2255c6f77fc406cbd81b9283a1d05f39d576946df501c478517d2e98775cb620d2595d67e26145862b46c423745547f4c17014a42ceebf2e17c842eae9
6
+ metadata.gz: 2c2933ac91cb87a559cba16fed0d7540641c81107818ea115c8dc52f2872c08d4159dc44f48e2a630737463e553fcb4627cd2a56e840c1df546947bb0d111e69
7
+ data.tar.gz: 158491ea757b26bcf34f9c56f0a0cc9984644e0379f57a6d4c42f15e244b2600790b15988f50fb86a33bfc7e260c0aa738678bc740ebb9701507a7379a085743
@@ -1,3 +1,7 @@
1
+ 1.0.0 (December 5th, 2014)
2
+ ==========================
3
+ - Add 'ntoo' -> 'nto' exception
4
+
1
5
  0.0.1 (November 25th, 2014)
2
6
  ===========================
3
7
  - First working version
@@ -48,19 +48,24 @@ module Abaco
48
48
  number = number.to_f
49
49
 
50
50
  tmp = number.to_i
51
- result = ''
52
51
 
53
- 9.step(3, -3) do |n|
54
- # Is the number in the 10^n form?
55
- if Math.log10(tmp).to_i >= n
56
- result += describe_part(tmp / 10 ** n)
52
+ if tmp == 0
53
+ result = 'zero'
54
+ else
55
+ result = ''
57
56
 
58
- result += ' ' if n >= 6
59
- result += SUFFIXES[n]
60
- result += ' ' if n >= 6
61
- end
57
+ 9.step(3, -3) do |n|
58
+ # Is the number in the 10^n form?
59
+ if Math.log10(tmp).to_i >= n
60
+ result += describe_part(tmp / 10 ** n)
62
61
 
63
- tmp %= 10 ** n
62
+ result += ' ' if n >= 6
63
+ result += SUFFIXES[n]
64
+ result += ' ' if n >= 6
65
+ end
66
+
67
+ tmp %= 10 ** n
68
+ end
64
69
  end
65
70
 
66
71
  decimal_part = '/'
@@ -1,3 +1,3 @@
1
1
  module Abaco
2
- VERSION = '1.0.0'
2
+ VERSION = '1.0.1'
3
3
  end
@@ -19,7 +19,8 @@ RSpec.describe Abaco::Converter do
19
19
  1973431 => 'un milione novecentosettantatremilaquattrocentotrentuno/00',
20
20
  1999197431 => 'un miliardo novecentonovantanove milioni centonovantasettemilaquattrocentotrentuno/00',
21
21
  999999999999 => 'novecentonovantanove miliardi novecentonovantanove milioni novecentonovantanovemilanovecentonovantanove/00',
22
- 288 => 'duecentottantotto/00'
22
+ 288 => 'duecentottantotto/00',
23
+ 0.6 => 'zero/60'
23
24
  }.each_pair do |number, result|
24
25
  it "converts #{number} as '#{result}'" do
25
26
  expect(subject.convert(number)).to eq(result)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: abaco
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alessandro Desantis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-05 00:00:00.000000000 Z
11
+ date: 2015-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -109,7 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
109
109
  version: '0'
110
110
  requirements: []
111
111
  rubyforge_project:
112
- rubygems_version: 2.4.3
112
+ rubygems_version: 2.4.5
113
113
  signing_key:
114
114
  specification_version: 4
115
115
  summary: Convert numbers into Italian words.