abaco 0.0.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/README.md +5 -1
- data/lib/abaco/converter.rb +7 -6
- data/lib/abaco/version.rb +1 -1
- data/spec/abaco/converter_spec.rb +2 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 94d8e8b072fcd1ecd6027ff34115ad814a5ddf49
|
4
|
+
data.tar.gz: f0e5d275f8210d47e1008185f8f7359e1b7740c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c54cb2bbec55b76a601a52a9e02c0e8d8443a77ba12f7e09c910e7154f61c5ed3ad5a61e3a3bb46f121352579ca7c6bd47123b4587553117ad5cb15cd749db8f
|
7
|
+
data.tar.gz: 67de3f2255c6f77fc406cbd81b9283a1d05f39d576946df501c478517d2e98775cb620d2595d67e26145862b46c423745547f4c17014a42ceebf2e17c842eae9
|
data/CHANGELOG.md
ADDED
data/README.md
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# Abaco
|
2
2
|
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/abaco.svg)](http://badge.fury.io/rb/abaco)
|
3
4
|
[![Build Status](https://travis-ci.org/interconn-isp/abaco.svg?branch=master)](https://travis-ci.org/interconn-isp/abaco)
|
4
5
|
[![Dependency Status](https://gemnasium.com/interconn-isp/abaco.svg)](https://gemnasium.com/interconn-isp/abaco)
|
5
6
|
[![Code Climate](https://codeclimate.com/github/interconn-isp/abaco/badges/gpa.svg)](https://codeclimate.com/github/interconn-isp/abaco)
|
@@ -64,10 +65,13 @@ to help you! :)
|
|
64
65
|
The [Bollettino](https://github.com/interconn-isp/bollettino) gem can be used
|
65
66
|
with Abaco to generate Italian postal payment slips.
|
66
67
|
|
67
|
-
##
|
68
|
+
## Credits
|
68
69
|
|
69
70
|
Abaco is developed and maintained by [Alessandro Desantis](https://github.com/alessandro1997).
|
70
71
|
|
72
|
+
The original implementation was written by [Giovanni Intini](https://github.com/intinig)
|
73
|
+
in an article entitled “[Dai numeri alle lettere](http://old.therubymine.com/2007/2/27/dai-numeri-alle-lettere)”.
|
74
|
+
|
71
75
|
## License
|
72
76
|
|
73
77
|
Abaco is released under the MIT license.
|
data/lib/abaco/converter.rb
CHANGED
@@ -6,14 +6,15 @@ module Abaco
|
|
6
6
|
# @author Alessandro Desantis <desa.alessandro@gmail.com>
|
7
7
|
class Converter
|
8
8
|
EXCEPTIONS = {
|
9
|
-
'unocento'
|
10
|
-
'unomila'
|
9
|
+
'unocento' => 'cento',
|
10
|
+
'unomila' => 'mille',
|
11
11
|
'uno m' => 'un m',
|
12
|
-
/t\wmille/
|
13
|
-
'ntaotto'
|
14
|
-
'ntauno'
|
12
|
+
/t\wmille/ => 'tunomila',
|
13
|
+
'ntaotto' => 'ntotto',
|
14
|
+
'ntauno' => 'ntuno',
|
15
15
|
'un miliardi' => 'un miliardo',
|
16
|
-
'un milioni' => 'un milione'
|
16
|
+
'un milioni' => 'un milione',
|
17
|
+
'ntoo' => 'nto'
|
17
18
|
}
|
18
19
|
|
19
20
|
NUMBERS = {
|
data/lib/abaco/version.rb
CHANGED
@@ -18,7 +18,8 @@ RSpec.describe Abaco::Converter do
|
|
18
18
|
17634 => 'diciassettemilaseicentotrentaquattro/00',
|
19
19
|
1973431 => 'un milione novecentosettantatremilaquattrocentotrentuno/00',
|
20
20
|
1999197431 => 'un miliardo novecentonovantanove milioni centonovantasettemilaquattrocentotrentuno/00',
|
21
|
-
999999999999 => 'novecentonovantanove miliardi novecentonovantanove milioni novecentonovantanovemilanovecentonovantanove/00'
|
21
|
+
999999999999 => 'novecentonovantanove miliardi novecentonovantanove milioni novecentonovantanovemilanovecentonovantanove/00',
|
22
|
+
288 => 'duecentottantotto/00'
|
22
23
|
}.each_pair do |number, result|
|
23
24
|
it "converts #{number} as '#{result}'" do
|
24
25
|
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: 0.0
|
4
|
+
version: 1.0.0
|
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-
|
11
|
+
date: 2014-12-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -76,6 +76,7 @@ files:
|
|
76
76
|
- ".gitignore"
|
77
77
|
- ".rspec"
|
78
78
|
- ".travis.yml"
|
79
|
+
- CHANGELOG.md
|
79
80
|
- Gemfile
|
80
81
|
- LICENSE.txt
|
81
82
|
- README.md
|