kabal 0.2.14 → 0.2.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/lib/kabal/languages/english.rb +7 -0
- data/lib/kabal/languages/language.rb +4 -0
- data/lib/kabal/languages/russian.rb +0 -4
- data/lib/kabal/version.rb +1 -1
- data/test/lib/kabal/languages/english_test.rb +6 -0
- data/yaml/support.yml +1 -1
- 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: 1ac2ea874e174e6bc64bfbacfc1969a2a569c490
|
4
|
+
data.tar.gz: bf93eea3f84e8a1f3b3439fef48fcad2ec48ef4c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 22523b591f6ab9cd3717e3da54c4ba601d1f8b30c2d01ee0b352c80a7b3112b60c2796689ff7c71e7ef380be4dc128315cde0ac3947f8736fdbdf6e43fcfc932
|
7
|
+
data.tar.gz: 08e397d34caef6675084259ff71b90a2bf5e8e7089bcb1199691c203d1477afa5868bc3a3d232d676dfa1e8de9eb98d34edd80478cd37b1b76dc59969e98843c
|
data/README.md
CHANGED
@@ -2,6 +2,13 @@ require 'kabal/languages/language'
|
|
2
2
|
|
3
3
|
class Kabal::English < Kabal::Language
|
4
4
|
def convert_number(number)
|
5
|
+
if need_minus? number
|
6
|
+
minus + " " + number_words(-number)
|
7
|
+
else
|
8
|
+
number_words number
|
9
|
+
end
|
10
|
+
end
|
11
|
+
def number_words(number)
|
5
12
|
return single number if number >= 0 and number <= 19
|
6
13
|
return two_words number if number >= 0 and number <= 99
|
7
14
|
return three_words number if number >= 100 and number <= 999
|
data/lib/kabal/version.rb
CHANGED
@@ -47,4 +47,10 @@ class EnglishTest < TestCase
|
|
47
47
|
assert @eng.convert(number), number
|
48
48
|
end
|
49
49
|
end
|
50
|
+
def test_minus_one
|
51
|
+
assert_equal "minus one", @eng.convert(-1)
|
52
|
+
end
|
53
|
+
def test_minus_one_million_and_one_and_one_and_one
|
54
|
+
assert_equal "minus one hundred eleven million one hundred fifty thousand and twenty one", @eng.convert(-111150021)
|
55
|
+
end
|
50
56
|
end
|
data/yaml/support.yml
CHANGED
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: 0.2.
|
4
|
+
version: 0.2.15
|
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-07-
|
11
|
+
date: 2014-07-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|