rs_russian 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +5 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/.travis.yml +9 -0
- data/CHANGELOG +132 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +48 -0
- data/LICENSE +20 -0
- data/README.textile +268 -0
- data/Rakefile +12 -0
- data/TODO +4 -0
- data/lib/rs_russian.rb +1 -0
- data/lib/russian/action_view_ext/helpers/date_helper.rb +118 -0
- data/lib/russian/active_model_ext/custom_error_message.rb +70 -0
- data/lib/russian/locale/actionview.yml +212 -0
- data/lib/russian/locale/activemodel.yml +50 -0
- data/lib/russian/locale/activerecord.yml +95 -0
- data/lib/russian/locale/activesupport.yml +16 -0
- data/lib/russian/locale/datetime.rb +39 -0
- data/lib/russian/locale/datetime.yml +50 -0
- data/lib/russian/locale/pluralization.rb +28 -0
- data/lib/russian/locale/transliterator.rb +17 -0
- data/lib/russian/russian_rails.rb +8 -0
- data/lib/russian/transliteration.rb +64 -0
- data/lib/russian/version.rb +9 -0
- data/lib/russian.rb +121 -0
- data/russian.gemspec +33 -0
- data/spec/fixtures/en.yml +4 -0
- data/spec/fixtures/ru.yml +4 -0
- data/spec/i18n/locale/datetime_spec.rb +120 -0
- data/spec/i18n/locale/pluralization_spec.rb +28 -0
- data/spec/locale_spec.rb +47 -0
- data/spec/russian_spec.rb +133 -0
- data/spec/spec_helper.rb +7 -0
- data/spec/transliteration_spec.rb +51 -0
- metadata +173 -0
@@ -0,0 +1,51 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
require File.dirname(__FILE__) + '/spec_helper'
|
4
|
+
|
5
|
+
describe Russian do
|
6
|
+
describe "transliteration" do
|
7
|
+
def t(str)
|
8
|
+
Russian::transliterate(str)
|
9
|
+
end
|
10
|
+
|
11
|
+
%w(transliterate translit).each do |method|
|
12
|
+
it "'#{method}' method should perform transliteration" do
|
13
|
+
str = mock(:str)
|
14
|
+
Russian::Transliteration.should_receive(:transliterate).with(str)
|
15
|
+
Russian.send(method, str)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
# These tests are from rutils, <http://rutils.rubyforge.org>.
|
20
|
+
|
21
|
+
it "should transliterate properly" do
|
22
|
+
t("Это просто некий текст").should == "Eto prosto nekiy tekst"
|
23
|
+
t("щ").should == "sch"
|
24
|
+
t("стансы").should == "stansy"
|
25
|
+
t("упущение").should == "upuschenie"
|
26
|
+
t("ш").should == "sh"
|
27
|
+
t("Ш").should == "SH"
|
28
|
+
t("ц").should == "ts"
|
29
|
+
end
|
30
|
+
|
31
|
+
it "should properly transliterate mixed russian-english strings" do
|
32
|
+
t("Это кусок строки русских букв v peremeshku s latinizey i амперсандом (pozor!) & something").should ==
|
33
|
+
"Eto kusok stroki russkih bukv v peremeshku s latinizey i ampersandom (pozor!) & something"
|
34
|
+
end
|
35
|
+
|
36
|
+
it "should properly transliterate mixed case chars in a string" do
|
37
|
+
t("НЕВЕРОЯТНОЕ УПУЩЕНИЕ").should == "NEVEROYATNOE UPUSCHENIE"
|
38
|
+
t("Невероятное Упущение").should == "Neveroyatnoe Upuschenie"
|
39
|
+
t("Шерстяной Заяц").should == "Sherstyanoy Zayats"
|
40
|
+
t("Н.П. Шерстяков").should == "N.P. Sherstyakov"
|
41
|
+
t("ШАРОВАРЫ").should == "SHAROVARY"
|
42
|
+
end
|
43
|
+
|
44
|
+
it "should work for multi-char substrings" do
|
45
|
+
t("38 воробьёв").should == "38 vorobiev"
|
46
|
+
t("Вася Воробьёв").should == "Vasya Vorobiev"
|
47
|
+
t("Алябьев").should == "Alyabiev"
|
48
|
+
t("АЛЯБЬЕВ").should == "ALYABIEV"
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
metadata
ADDED
@@ -0,0 +1,173 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rs_russian
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.7.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- glebtv
|
8
|
+
- Yaroslav Markin
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-10-23 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: i18n
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - ~>
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: 0.6.0
|
21
|
+
type: :runtime
|
22
|
+
prerelease: false
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - ~>
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: 0.6.0
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: unicode
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - ~>
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: 0.4.4
|
35
|
+
type: :runtime
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - ~>
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: 0.4.4
|
42
|
+
- !ruby/object:Gem::Dependency
|
43
|
+
name: bundler
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - ~>
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: '1.3'
|
49
|
+
type: :development
|
50
|
+
prerelease: false
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - ~>
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '1.3'
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
name: rake
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - '>='
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0'
|
63
|
+
type: :development
|
64
|
+
prerelease: false
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: rspec
|
72
|
+
requirement: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - '>='
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
77
|
+
type: :development
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - '>='
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '0'
|
84
|
+
- !ruby/object:Gem::Dependency
|
85
|
+
name: activesupport
|
86
|
+
requirement: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - '>='
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: 3.0.0
|
91
|
+
type: :development
|
92
|
+
prerelease: false
|
93
|
+
version_requirements: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
95
|
+
- - '>='
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: 3.0.0
|
98
|
+
description: Russian language support for Ruby and Rails
|
99
|
+
email:
|
100
|
+
- glebtv@gmail.com
|
101
|
+
- yaroslav@markin.net
|
102
|
+
executables: []
|
103
|
+
extensions: []
|
104
|
+
extra_rdoc_files: []
|
105
|
+
files:
|
106
|
+
- .gitignore
|
107
|
+
- .ruby-gemset
|
108
|
+
- .ruby-version
|
109
|
+
- .travis.yml
|
110
|
+
- CHANGELOG
|
111
|
+
- Gemfile
|
112
|
+
- Gemfile.lock
|
113
|
+
- LICENSE
|
114
|
+
- README.textile
|
115
|
+
- Rakefile
|
116
|
+
- TODO
|
117
|
+
- lib/rs_russian.rb
|
118
|
+
- lib/russian.rb
|
119
|
+
- lib/russian/action_view_ext/helpers/date_helper.rb
|
120
|
+
- lib/russian/active_model_ext/custom_error_message.rb
|
121
|
+
- lib/russian/locale/actionview.yml
|
122
|
+
- lib/russian/locale/activemodel.yml
|
123
|
+
- lib/russian/locale/activerecord.yml
|
124
|
+
- lib/russian/locale/activesupport.yml
|
125
|
+
- lib/russian/locale/datetime.rb
|
126
|
+
- lib/russian/locale/datetime.yml
|
127
|
+
- lib/russian/locale/pluralization.rb
|
128
|
+
- lib/russian/locale/transliterator.rb
|
129
|
+
- lib/russian/russian_rails.rb
|
130
|
+
- lib/russian/transliteration.rb
|
131
|
+
- lib/russian/version.rb
|
132
|
+
- russian.gemspec
|
133
|
+
- spec/fixtures/en.yml
|
134
|
+
- spec/fixtures/ru.yml
|
135
|
+
- spec/i18n/locale/datetime_spec.rb
|
136
|
+
- spec/i18n/locale/pluralization_spec.rb
|
137
|
+
- spec/locale_spec.rb
|
138
|
+
- spec/russian_spec.rb
|
139
|
+
- spec/spec_helper.rb
|
140
|
+
- spec/transliteration_spec.rb
|
141
|
+
homepage: https://github.com/rs-pro/russian
|
142
|
+
licenses:
|
143
|
+
- MIT
|
144
|
+
metadata: {}
|
145
|
+
post_install_message:
|
146
|
+
rdoc_options: []
|
147
|
+
require_paths:
|
148
|
+
- lib
|
149
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
150
|
+
requirements:
|
151
|
+
- - '>='
|
152
|
+
- !ruby/object:Gem::Version
|
153
|
+
version: '0'
|
154
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
155
|
+
requirements:
|
156
|
+
- - '>='
|
157
|
+
- !ruby/object:Gem::Version
|
158
|
+
version: '0'
|
159
|
+
requirements: []
|
160
|
+
rubyforge_project:
|
161
|
+
rubygems_version: 2.0.6
|
162
|
+
signing_key:
|
163
|
+
specification_version: 4
|
164
|
+
summary: Russian language support for Ruby and Rails
|
165
|
+
test_files:
|
166
|
+
- spec/fixtures/en.yml
|
167
|
+
- spec/fixtures/ru.yml
|
168
|
+
- spec/i18n/locale/datetime_spec.rb
|
169
|
+
- spec/i18n/locale/pluralization_spec.rb
|
170
|
+
- spec/locale_spec.rb
|
171
|
+
- spec/russian_spec.rb
|
172
|
+
- spec/spec_helper.rb
|
173
|
+
- spec/transliteration_spec.rb
|