ru_propisju 2.2.1 → 2.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 8caa7abb8128fcd57cf3b2902309b67fe20f7137
4
+ data.tar.gz: e14c5a3ea4bbc12353fb33f2d246a63ae60fc4e9
5
+ SHA512:
6
+ metadata.gz: 95bfde5696ce888ebdf0d795b743026175ffb907707b4edc01a0ebbb6e1db3816b286aca32f502a7df0d4f9936314cae7e6b5a37ff265a35e933d34ec7661c90
7
+ data.tar.gz: f49d42ed3ef8009c0e649bcc707276076eaef080e08feec5a18deee6fad23b0d299fc63894e0eb9ce30463e0b58064541512b4b08ebbbf788b7cbb51b9a9e072
data/History.txt CHANGED
@@ -1,3 +1,7 @@
1
+ === 2.2.2
2
+
3
+ * Форматирование долей могло вызвать ошибку (https://github.com/julik/ru_propisju/issues/10)
4
+
1
5
  === 2.2.1
2
6
 
3
7
  * Опечатка в украинских числительных (https://github.com/julik/ru_propisju/pull/9)
data/lib/ru_propisju.rb CHANGED
@@ -6,7 +6,7 @@ $KCODE = 'u' if RUBY_VERSION < '1.9.0'
6
6
  # RuPropisju.rublej(123) # "сто двадцать три рубля"
7
7
  module RuPropisju
8
8
 
9
- VERSION = '2.2.1'
9
+ VERSION = '2.2.2'
10
10
 
11
11
  # http://www.xe.com/symbols.php
12
12
  # (лица, приближенные форексам и всяким там валютам и курсам)
@@ -432,7 +432,7 @@ module RuPropisju
432
432
  end.freeze
433
433
 
434
434
  # Укорачиваем до триллионной доли
435
- formatted = ("%0.#{words.length}f" % num).gsub(/0+$/, '')
435
+ formatted = ("%0.#{words.length}g" % num).gsub(/0+$/, '')
436
436
  wholes, decimals = formatted.split(/\./)
437
437
 
438
438
  return propisju_int(wholes.to_i, 1, [], locale) if decimals.to_i.zero?
data/ru_propisju.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "ru_propisju"
8
- s.version = "2.2.1"
8
+ s.version = "2.2.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Julik Tarkhanov"]
12
- s.date = "2013-08-05"
12
+ s.date = "2013-11-28"
13
13
  s.email = "me@julik.nl"
14
14
  s.extra_rdoc_files = [
15
15
  "README.rdoc"
@@ -26,11 +26,11 @@ Gem::Specification.new do |s|
26
26
  s.homepage = "http://github.com/julik/ru_propisju"
27
27
  s.licenses = ["MIT"]
28
28
  s.require_paths = ["lib"]
29
- s.rubygems_version = "1.8.25"
29
+ s.rubygems_version = "2.0.3"
30
30
  s.summary = "C\u{443}\u{43c}\u{43c}\u{430} \u{43f}\u{440}\u{43e}\u{43f}\u{438}\u{441}\u{44c}\u{44e}"
31
31
 
32
32
  if s.respond_to? :specification_version then
33
- s.specification_version = 3
33
+ s.specification_version = 4
34
34
 
35
35
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
36
36
  s.add_development_dependency(%q<jeweler>, [">= 0"])
@@ -84,7 +84,11 @@ class TestRuPropisju < Test::Unit::TestCase
84
84
  assert_equal "двадцать одна подстава", RuPropisju.propisju_shtuk(21, 2, ["подстава", "подставы", "подстав"])
85
85
  assert_equal "двести двенадцать сволочей", RuPropisju.propisju_shtuk(212.00, 2, ["сволочь", "сволочи", "сволочей"])
86
86
  assert_equal "двести двенадцать целых четыре десятых куска", RuPropisju.propisju_shtuk(212.40, 2, ["кусок", "куска", "кусков"])
87
-
87
+
88
+ # GH issue 10
89
+ # https://github.com/julik/ru_propisju/issues/10
90
+ assert_equal "одна тысяча сто две целых сорок одна сотая кубометра", RuPropisju.propisju_shtuk( 1102.41, 2, ["кубометр", "кубометра", "кубометров"])
91
+
88
92
  # ua locale
89
93
  assert_equal "шість цілих", RuPropisju.propisju_shtuk(6, 2, ["ціла", "цілих", "цілих"], :ua)
90
94
  assert_equal "двадцять п'ять колес", RuPropisju.propisju_shtuk(25, 3, ["колесо", "колеса", "колес"], :ua)
@@ -99,6 +103,7 @@ class TestRuPropisju < Test::Unit::TestCase
99
103
  assert_equal "триста сорок одна целая двести сорок пять тысячных", RuPropisju.propisju(341.245, 1)
100
104
  assert_equal "двести три целых сорок одна сотая", RuPropisju.propisju(203.41, 1)
101
105
  assert_equal "четыреста сорок две целых пять десятых", RuPropisju.propisju(442.50000, 1)
106
+
102
107
  # ua locale
103
108
  assert_equal "шість цілих п'ять десятих", RuPropisju.propisju(6.50, 1, :ua)
104
109
  assert_equal "триста сорок одна ціла дев'ять десятих", RuPropisju.propisju(341.9, 1, :ua)
metadata CHANGED
@@ -1,46 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ru_propisju
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.1
5
- prerelease:
4
+ version: 2.2.2
6
5
  platform: ruby
7
6
  authors:
8
7
  - Julik Tarkhanov
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-08-05 00:00:00.000000000 Z
11
+ date: 2013-11-28 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: jeweler
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - '>='
20
18
  - !ruby/object:Gem::Version
21
19
  version: '0'
22
20
  type: :development
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - '>='
28
25
  - !ruby/object:Gem::Version
29
26
  version: '0'
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: rake
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - '>='
36
32
  - !ruby/object:Gem::Version
37
33
  version: '0'
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - '>='
44
39
  - !ruby/object:Gem::Version
45
40
  version: '0'
46
41
  description:
@@ -60,29 +55,25 @@ files:
60
55
  homepage: http://github.com/julik/ru_propisju
61
56
  licenses:
62
57
  - MIT
58
+ metadata: {}
63
59
  post_install_message:
64
60
  rdoc_options: []
65
61
  require_paths:
66
62
  - lib
67
63
  required_ruby_version: !ruby/object:Gem::Requirement
68
- none: false
69
64
  requirements:
70
- - - ! '>='
65
+ - - '>='
71
66
  - !ruby/object:Gem::Version
72
67
  version: '0'
73
- segments:
74
- - 0
75
- hash: -1598717423605578407
76
68
  required_rubygems_version: !ruby/object:Gem::Requirement
77
- none: false
78
69
  requirements:
79
- - - ! '>='
70
+ - - '>='
80
71
  - !ruby/object:Gem::Version
81
72
  version: '0'
82
73
  requirements: []
83
74
  rubyforge_project:
84
- rubygems_version: 1.8.25
75
+ rubygems_version: 2.0.3
85
76
  signing_key:
86
- specification_version: 3
77
+ specification_version: 4
87
78
  summary: Cумма прописью
88
79
  test_files: []