ukrainian 2.4.2 → 2.5.2
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION.yml +1 -1
- data/lib/ukrainian.rb +8 -0
- data/test/test_helper.rb +1 -0
- data/test/ukrainian_test.rb +9 -2
- data/ukrainian.gemspec +4 -4
- metadata +13 -4
data/VERSION.yml
CHANGED
data/lib/ukrainian.rb
CHANGED
@@ -1,9 +1,17 @@
|
|
1
|
+
$KCODE = 'u' if RUBY_VERSION < "1.9"
|
2
|
+
|
1
3
|
require File.join(File.dirname(__FILE__), 'ukrainian/backend/simple')
|
2
4
|
require 'i18n'
|
3
5
|
|
4
6
|
module Ukrainian
|
5
7
|
extend self
|
6
8
|
|
9
|
+
def pluralize(n, *variants)
|
10
|
+
raise ArgumentError, "Must have a Numeric as a first parameter" unless n.is_a?(Numeric)
|
11
|
+
I18n.backend.send(:pluralize, :uk, {:one => variants[0], :few => variants[1],
|
12
|
+
:many => variants[2], :other => variants[3] || variants[2]}, n)
|
13
|
+
end
|
14
|
+
|
7
15
|
def init_i18n
|
8
16
|
I18n.load_path.unshift(*locale_files)
|
9
17
|
end
|
data/test/test_helper.rb
CHANGED
data/test/ukrainian_test.rb
CHANGED
@@ -1,7 +1,14 @@
|
|
1
1
|
require 'test_helper'
|
2
2
|
|
3
3
|
class UkrainianTest < Test::Unit::TestCase
|
4
|
-
should "
|
5
|
-
|
4
|
+
should "have pluralize method" do
|
5
|
+
assert Ukrainian.respond_to?(:pluralize)
|
6
|
+
end
|
7
|
+
|
8
|
+
should "pluralize correctrly" do
|
9
|
+
variants = %w(озеро озера озер)
|
10
|
+
[['озеро', 1], ['озера', 2], ['озер', 5], ['озеро', 631]].each do |w, n|
|
11
|
+
assert_equal Ukrainian.pluralize(n, *variants), w
|
12
|
+
end
|
6
13
|
end
|
7
14
|
end
|
data/ukrainian.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{ukrainian}
|
8
|
-
s.version = "2.
|
8
|
+
s.version = "2.5.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["romanvbabenko"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-06-29}
|
13
13
|
s.description = %q{Ukrainian language support for Ruby and Rails}
|
14
14
|
s.email = %q{romanvbabenko@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -41,7 +41,7 @@ Gem::Specification.new do |s|
|
|
41
41
|
s.homepage = %q{http://github.com/romanvbabenko/ukrainian}
|
42
42
|
s.rdoc_options = ["--charset=UTF-8"]
|
43
43
|
s.require_paths = ["lib"]
|
44
|
-
s.rubygems_version = %q{1.3.
|
44
|
+
s.rubygems_version = %q{1.3.7}
|
45
45
|
s.summary = %q{Ukrainian language support for Ruby and Rails}
|
46
46
|
s.test_files = [
|
47
47
|
"test/ukrainian_test.rb",
|
@@ -52,7 +52,7 @@ Gem::Specification.new do |s|
|
|
52
52
|
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
53
53
|
s.specification_version = 3
|
54
54
|
|
55
|
-
if Gem::Version.new(Gem::
|
55
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
56
56
|
s.add_development_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
57
57
|
s.add_runtime_dependency(%q<i18n>, [">= 0"])
|
58
58
|
else
|
metadata
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ukrainian
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
hash: 31
|
4
5
|
prerelease: false
|
5
6
|
segments:
|
6
7
|
- 2
|
7
|
-
-
|
8
|
+
- 5
|
8
9
|
- 2
|
9
|
-
version: 2.
|
10
|
+
version: 2.5.2
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- romanvbabenko
|
@@ -14,16 +15,18 @@ autorequire:
|
|
14
15
|
bindir: bin
|
15
16
|
cert_chain: []
|
16
17
|
|
17
|
-
date: 2010-
|
18
|
+
date: 2010-06-29 00:00:00 +03:00
|
18
19
|
default_executable:
|
19
20
|
dependencies:
|
20
21
|
- !ruby/object:Gem::Dependency
|
21
22
|
name: thoughtbot-shoulda
|
22
23
|
prerelease: false
|
23
24
|
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
24
26
|
requirements:
|
25
27
|
- - ">="
|
26
28
|
- !ruby/object:Gem::Version
|
29
|
+
hash: 3
|
27
30
|
segments:
|
28
31
|
- 0
|
29
32
|
version: "0"
|
@@ -33,9 +36,11 @@ dependencies:
|
|
33
36
|
name: i18n
|
34
37
|
prerelease: false
|
35
38
|
requirement: &id002 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
36
40
|
requirements:
|
37
41
|
- - ">="
|
38
42
|
- !ruby/object:Gem::Version
|
43
|
+
hash: 3
|
39
44
|
segments:
|
40
45
|
- 0
|
41
46
|
version: "0"
|
@@ -81,23 +86,27 @@ rdoc_options:
|
|
81
86
|
require_paths:
|
82
87
|
- lib
|
83
88
|
required_ruby_version: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
84
90
|
requirements:
|
85
91
|
- - ">="
|
86
92
|
- !ruby/object:Gem::Version
|
93
|
+
hash: 3
|
87
94
|
segments:
|
88
95
|
- 0
|
89
96
|
version: "0"
|
90
97
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
98
|
+
none: false
|
91
99
|
requirements:
|
92
100
|
- - ">="
|
93
101
|
- !ruby/object:Gem::Version
|
102
|
+
hash: 3
|
94
103
|
segments:
|
95
104
|
- 0
|
96
105
|
version: "0"
|
97
106
|
requirements: []
|
98
107
|
|
99
108
|
rubyforge_project:
|
100
|
-
rubygems_version: 1.3.
|
109
|
+
rubygems_version: 1.3.7
|
101
110
|
signing_key:
|
102
111
|
specification_version: 3
|
103
112
|
summary: Ukrainian language support for Ruby and Rails
|