krasivotokak-russian 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. data/CHANGELOG +64 -0
  2. data/LICENSE +20 -0
  3. data/README.textile +288 -0
  4. data/Rakefile +55 -0
  5. data/TODO +10 -0
  6. data/init.rb +3 -0
  7. data/lib/russian.rb +119 -0
  8. data/lib/russian/action_view_ext/helpers/date_helper.rb +112 -0
  9. data/lib/russian/active_record_ext/custom_error_message.rb +67 -0
  10. data/lib/russian/active_support_ext/parameterize.rb +31 -0
  11. data/lib/russian/backend/advanced.rb +132 -0
  12. data/lib/russian/locale/actionview.yml +153 -0
  13. data/lib/russian/locale/activerecord.yml +90 -0
  14. data/lib/russian/locale/activesupport.yml +16 -0
  15. data/lib/russian/locale/datetime.yml +46 -0
  16. data/lib/russian/locale/pluralize.rb +36 -0
  17. data/lib/russian/transliteration.rb +60 -0
  18. data/lib/vendor/i18n/MIT-LICENSE +20 -0
  19. data/lib/vendor/i18n/README.textile +20 -0
  20. data/lib/vendor/i18n/Rakefile +5 -0
  21. data/lib/vendor/i18n/i18n.gemspec +27 -0
  22. data/lib/vendor/i18n/lib/i18n.rb +199 -0
  23. data/lib/vendor/i18n/lib/i18n/backend/simple.rb +214 -0
  24. data/lib/vendor/i18n/lib/i18n/exceptions.rb +53 -0
  25. data/lib/vendor/i18n/test/all.rb +5 -0
  26. data/lib/vendor/i18n/test/i18n_exceptions_test.rb +100 -0
  27. data/lib/vendor/i18n/test/i18n_test.rb +125 -0
  28. data/lib/vendor/i18n/test/locale/en.rb +1 -0
  29. data/lib/vendor/i18n/test/locale/en.yml +3 -0
  30. data/lib/vendor/i18n/test/simple_backend_test.rb +568 -0
  31. data/lib/vendor/i18n_label/README.textile +38 -0
  32. data/lib/vendor/i18n_label/Rakefile +11 -0
  33. data/lib/vendor/i18n_label/init.rb +1 -0
  34. data/lib/vendor/i18n_label/install.rb +1 -0
  35. data/lib/vendor/i18n_label/lib/i18n_label.rb +23 -0
  36. data/lib/vendor/i18n_label/spec/i18n_label_spec.rb +20 -0
  37. data/lib/vendor/i18n_label/spec/spec_helper.rb +10 -0
  38. data/lib/vendor/i18n_label/tasks/i18n_label_tasks.rake +4 -0
  39. data/lib/vendor/i18n_label/uninstall.rb +1 -0
  40. data/spec/fixtures/en.yml +4 -0
  41. data/spec/fixtures/ru.yml +4 -0
  42. data/spec/i18n/locale/datetime_spec.rb +93 -0
  43. data/spec/i18n/locale/pluralization_spec.rb +28 -0
  44. data/spec/locale_spec.rb +123 -0
  45. data/spec/russian_spec.rb +136 -0
  46. data/spec/spec_helper.rb +7 -0
  47. data/spec/transliteration_spec.rb +44 -0
  48. metadata +125 -0
@@ -0,0 +1,7 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ $TESTING=true
4
+ $:.push File.join(File.dirname(__FILE__), '..', 'lib')
5
+
6
+ require 'russian'
7
+
@@ -0,0 +1,44 @@
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
+ end
44
+ end
metadata ADDED
@@ -0,0 +1,125 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: krasivotokak-russian
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.1
5
+ platform: ruby
6
+ authors:
7
+ - Yaroslav Markin
8
+ - Alexander Semyonov
9
+ autorequire: russian
10
+ bindir: bin
11
+ cert_chain: []
12
+
13
+ date: 2009-03-16 00:00:00 -07:00
14
+ default_executable:
15
+ dependencies: []
16
+
17
+ description: Russian language support for Ruby and Rails
18
+ email: yaroslav@markin.net
19
+ executables: []
20
+
21
+ extensions: []
22
+
23
+ extra_rdoc_files:
24
+ - README.textile
25
+ - LICENSE
26
+ - CHANGELOG
27
+ - TODO
28
+ files:
29
+ - LICENSE
30
+ - README.textile
31
+ - Rakefile
32
+ - CHANGELOG
33
+ - TODO
34
+ - init.rb
35
+ - lib/russian
36
+ - lib/russian/active_record_ext
37
+ - lib/russian/active_record_ext/custom_error_message.rb
38
+ - lib/russian/active_support_ext
39
+ - lib/russian/active_support_ext/parameterize.rb
40
+ - lib/russian/locale
41
+ - lib/russian/locale/actionview.yml
42
+ - lib/russian/locale/pluralize.rb
43
+ - lib/russian/locale/datetime.yml
44
+ - lib/russian/locale/activerecord.yml
45
+ - lib/russian/locale/activesupport.yml
46
+ - lib/russian/action_view_ext
47
+ - lib/russian/action_view_ext/helpers
48
+ - lib/russian/action_view_ext/helpers/date_helper.rb
49
+ - lib/russian/transliteration.rb
50
+ - lib/russian/backend
51
+ - lib/russian/backend/advanced.rb
52
+ - lib/vendor
53
+ - lib/vendor/i18n
54
+ - lib/vendor/i18n/test
55
+ - lib/vendor/i18n/test/i18n_exceptions_test.rb
56
+ - lib/vendor/i18n/test/simple_backend_test.rb
57
+ - lib/vendor/i18n/test/all.rb
58
+ - lib/vendor/i18n/test/i18n_test.rb
59
+ - lib/vendor/i18n/test/locale
60
+ - lib/vendor/i18n/test/locale/en.yml
61
+ - lib/vendor/i18n/test/locale/en.rb
62
+ - lib/vendor/i18n/i18n.gemspec
63
+ - lib/vendor/i18n/lib
64
+ - lib/vendor/i18n/lib/i18n.rb
65
+ - lib/vendor/i18n/lib/i18n
66
+ - lib/vendor/i18n/lib/i18n/exceptions.rb
67
+ - lib/vendor/i18n/lib/i18n/backend
68
+ - lib/vendor/i18n/lib/i18n/backend/simple.rb
69
+ - lib/vendor/i18n/MIT-LICENSE
70
+ - lib/vendor/i18n/README.textile
71
+ - lib/vendor/i18n/Rakefile
72
+ - lib/vendor/i18n_label
73
+ - lib/vendor/i18n_label/spec
74
+ - lib/vendor/i18n_label/spec/spec_helper.rb
75
+ - lib/vendor/i18n_label/spec/i18n_label_spec.rb
76
+ - lib/vendor/i18n_label/init.rb
77
+ - lib/vendor/i18n_label/install.rb
78
+ - lib/vendor/i18n_label/uninstall.rb
79
+ - lib/vendor/i18n_label/lib
80
+ - lib/vendor/i18n_label/lib/i18n_label.rb
81
+ - lib/vendor/i18n_label/README.textile
82
+ - lib/vendor/i18n_label/tasks
83
+ - lib/vendor/i18n_label/tasks/i18n_label_tasks.rake
84
+ - lib/vendor/i18n_label/Rakefile
85
+ - lib/russian.rb
86
+ - spec/russian_spec.rb
87
+ - spec/spec_helper.rb
88
+ - spec/locale_spec.rb
89
+ - spec/i18n
90
+ - spec/i18n/locale
91
+ - spec/i18n/locale/pluralization_spec.rb
92
+ - spec/i18n/locale/datetime_spec.rb
93
+ - spec/fixtures
94
+ - spec/fixtures/ru.yml
95
+ - spec/fixtures/en.yml
96
+ - spec/transliteration_spec.rb
97
+ has_rdoc: true
98
+ homepage: http://github.com/yaroslav/russian/
99
+ licenses:
100
+ post_install_message:
101
+ rdoc_options: []
102
+
103
+ require_paths:
104
+ - lib
105
+ required_ruby_version: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - ">="
108
+ - !ruby/object:Gem::Version
109
+ version: "0"
110
+ version:
111
+ required_rubygems_version: !ruby/object:Gem::Requirement
112
+ requirements:
113
+ - - ">="
114
+ - !ruby/object:Gem::Version
115
+ version: "0"
116
+ version:
117
+ requirements: []
118
+
119
+ rubyforge_project:
120
+ rubygems_version: 1.3.5
121
+ signing_key:
122
+ specification_version: 2
123
+ summary: Russian language support for Ruby and Rails
124
+ test_files: []
125
+