papla 0.1.0 → 0.1.1
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.
- data/CHANGELOG.md +4 -0
- data/README.md +14 -22
- data/lib/papla.rb +2 -1
- data/lib/papla/version.rb +1 -1
- data/papla.gemspec +1 -1
- metadata +11 -11
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
## Papla [](http://travis-ci.org/exviva/papla)
|
2
2
|
|
3
3
|
Papla is a Ruby gem that allows you to convert numbers into Polish
|
4
4
|
and English words (e.g. `153` into `"Sto pięćdziesiąt trzy"`
|
@@ -6,7 +6,7 @@ or `44` into `"Forty four"`), including the decimal part as cents
|
|
6
6
|
and currency symbol. Its primary use case are invoices, where
|
7
7
|
the total amount has to be displayed as words at the bottom line.
|
8
8
|
|
9
|
-
|
9
|
+
### Installation
|
10
10
|
|
11
11
|
To install Papla, run
|
12
12
|
|
@@ -20,9 +20,9 @@ gem 'papla'
|
|
20
20
|
|
21
21
|
to your `Gemfile`.
|
22
22
|
|
23
|
-
|
23
|
+
### Usage
|
24
24
|
|
25
|
-
|
25
|
+
#### Basic examples
|
26
26
|
|
27
27
|
```ruby
|
28
28
|
I18n.locale = :pl
|
@@ -34,8 +34,6 @@ I18n.locale = :en
|
|
34
34
|
Papla[1_234] # => "One thousand two hundred thirty four"
|
35
35
|
```
|
36
36
|
|
37
|
-
### Cents and currency
|
38
|
-
|
39
37
|
#### Cents
|
40
38
|
|
41
39
|
When given a `Float`, Papla will assume that the decimal part represents cents.
|
@@ -50,21 +48,7 @@ Papla[87.654321] # => "Osiemdziesiąt siedem 65/100"
|
|
50
48
|
Papla[2.999] # => "Trzy 00/100"
|
51
49
|
```
|
52
50
|
|
53
|
-
####
|
54
|
-
|
55
|
-
This feature is planned for future releases.
|
56
|
-
|
57
|
-
## Integration with I18n and Money
|
58
|
-
|
59
|
-
### I18n
|
60
|
-
|
61
|
-
Localization is provided by I18n. See `lib/papla/backend.rb`
|
62
|
-
for details of keys used. Currently `:pl` and `:en` locales are supported.
|
63
|
-
|
64
|
-
Note: English support is not fully correct, e.g. `123` becomes
|
65
|
-
`"One hundred twenty three"` and not `"One hundred and twenty three"`.
|
66
|
-
|
67
|
-
### Money
|
51
|
+
#### Money
|
68
52
|
|
69
53
|
If you're using the `money` gem, you can pass in an instance of `Money` to Papla.
|
70
54
|
The returned string will contain the dollars part as words,
|
@@ -81,6 +65,14 @@ discounted_price = Money.new(9999, 'PLN')
|
|
81
65
|
Papla[discounted_price] # => "Ninety nine 99/100 PLN"
|
82
66
|
```
|
83
67
|
|
84
|
-
|
68
|
+
### I18n
|
69
|
+
|
70
|
+
Localization is provided by I18n. See `lib/papla/backend.rb`
|
71
|
+
for details of keys used. Currently `:pl` and `:en` locales are supported.
|
72
|
+
|
73
|
+
Note: English support is not fully correct, e.g. `123` becomes
|
74
|
+
`"One hundred twenty three"` and not `"One hundred and twenty three"`.
|
75
|
+
|
76
|
+
### Documentation
|
85
77
|
|
86
78
|
Documentation is available at [RubyDoc.info](http://rubydoc.info/github/exviva/papla/master/frames).
|
data/lib/papla.rb
CHANGED
data/lib/papla/version.rb
CHANGED
data/papla.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: papla
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-04-
|
12
|
+
date: 2012-04-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: i18n
|
16
|
-
requirement: &
|
16
|
+
requirement: &8447560 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *8447560
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: money
|
27
|
-
requirement: &
|
27
|
+
requirement: &8447080 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,21 +32,21 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *8447080
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rspec
|
38
|
-
requirement: &
|
38
|
+
requirement: &8446580 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
42
42
|
- !ruby/object:Gem::Version
|
43
|
-
version:
|
43
|
+
version: '0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *8446580
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: rake
|
49
|
-
requirement: &
|
49
|
+
requirement: &8445960 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,7 +54,7 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *8445960
|
58
58
|
description: Papla is a Ruby gem that allows you to convert numbers into Polish and
|
59
59
|
English words.
|
60
60
|
email:
|