kabal 1.0.2 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/kabal.rb +8 -1
- data/lib/kabal/version.rb +1 -1
- data/test/lib/kabal_test.rb +6 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: da52bd41c147a27396349b646b3a43c65859dc0b
|
4
|
+
data.tar.gz: 52715c51e01d8794718fa82cfe49d72a91ee8064
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2722cc629a9668cc78c525d614a81c104a8c862a3e8676afdadd198f47f6656d9abe6e76bb04ea83a6e300381f167e6582f3d3c736e2c99b2daaa3804ee47fb7
|
7
|
+
data.tar.gz: d065503e13779a652896bf1f19ca909a7a3669d6efd93a1f2e519d8b8a21832c6ec57ea6102b417be317354eaf0b989de7e0d33267409d92961b9f9c0cefbae4
|
data/lib/kabal.rb
CHANGED
@@ -53,7 +53,7 @@ module Kabal
|
|
53
53
|
@language
|
54
54
|
end
|
55
55
|
|
56
|
-
def supported_languages
|
56
|
+
def self.supported_languages
|
57
57
|
languages = Kabal::Config::YamlLoader.yaml_object 'languages'
|
58
58
|
languages.keys
|
59
59
|
end
|
@@ -88,6 +88,13 @@ module Kabal
|
|
88
88
|
obj.min_value
|
89
89
|
end
|
90
90
|
|
91
|
+
#Define languages methods
|
92
|
+
supported_languages.each do |language|
|
93
|
+
define_method "to_text_in_#{language.downcase}" do |number|
|
94
|
+
to_text_in_language number, language
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
91
98
|
private
|
92
99
|
|
93
100
|
def string_convert(number)
|
data/lib/kabal/version.rb
CHANGED
data/test/lib/kabal_test.rb
CHANGED
@@ -96,4 +96,10 @@ class KabalTest < TestCase
|
|
96
96
|
assert_equal "девятьсот девять миллионов девяносто тысяч девятьсот девять целых одна тысяча двести тридцать четыре десятитысячных", Kabal.to_text("909090909.1234")
|
97
97
|
assert_equal "девятьсот девять миллионов девяносто тысяч девятьсот девять целых одна тысяча двести тридцать четыре десятитысячных", Kabal.to_text(909090909.1234)
|
98
98
|
end
|
99
|
+
|
100
|
+
def test_defined_methods
|
101
|
+
assert Kabal.to_text_in_russian 1
|
102
|
+
assert Kabal.to_text_in_english 1
|
103
|
+
assert Kabal.to_text_in_deutsch 1
|
104
|
+
end
|
99
105
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kabal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pavel Kalashnikov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-09-
|
11
|
+
date: 2014-09-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|