rutils 0.2.5 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.txt +9 -0
- data/Manifest.txt +22 -15
- data/README.txt +54 -41
- data/Rakefile.rb +9 -26
- data/TODO.txt +2 -3
- data/WHAT_HAS_CHANGED.txt +44 -0
- data/init.rb +20 -2
- data/lib/countries/countries.rb +1 -0
- data/lib/datetime/datetime.rb +1 -0
- data/lib/gilenson/bluecloth_extra.rb +7 -0
- data/lib/gilenson/gilenson.rb +39 -30
- data/lib/gilenson/helper.rb +34 -0
- data/lib/gilenson/maruku_extra.rb +19 -0
- data/lib/gilenson/rdiscount_extra.rb +7 -0
- data/lib/gilenson/redcloth_extra.rb +42 -0
- data/lib/integration/integration.rb +1 -11
- data/lib/integration/rails_date_helper_override.rb +103 -105
- data/lib/integration/rails_pre_filter.rb +1 -0
- data/lib/pluralizer/pluralizer.rb +14 -13
- data/lib/rutils.rb +15 -25
- data/lib/transliteration/bidi.rb +15 -72
- data/lib/transliteration/simple.rb +1 -0
- data/lib/transliteration/transliteration.rb +11 -9
- data/lib/version.rb +5 -0
- data/test/extras/integration_bluecloth.rb +13 -0
- data/test/extras/integration_maruku.rb +15 -0
- data/test/{test_rails_filter.rb → extras/integration_rails_filter.rb} +3 -1
- data/test/extras/integration_rails_gilenson_helpers.rb +80 -0
- data/test/{test_rails_helpers.rb → extras/integration_rails_helpers.rb} +15 -3
- data/test/extras/integration_rdiscount.rb +15 -0
- data/test/extras/integration_redcloth3.rb +18 -0
- data/test/extras/integration_redcloth4.rb +19 -0
- data/test/run_tests.rb +2 -2
- data/test/{t_datetime.rb → test_datetime.rb} +1 -2
- data/test/{t_gilenson.rb → test_gilenson.rb} +15 -6
- data/test/test_integration.rb +22 -0
- data/test/test_integration_flag.rb +18 -0
- data/test/{t_pluralize.rb → test_pluralize.rb} +3 -2
- data/test/{t_rutils_base.rb → test_rutils_base.rb} +1 -0
- data/test/test_transliteration.rb +53 -0
- metadata +35 -26
- data/lib/integration/blue_cloth_override.rb +0 -12
- data/lib/integration/red_cloth_four.rb +0 -24
- data/lib/integration/red_cloth_override.rb +0 -7
- data/lib/integration/red_cloth_three.rb +0 -25
- data/test/t_integration.rb +0 -46
- data/test/t_transliteration.rb +0 -109
- data/test/test_integration_bluecloth.rb +0 -17
- data/test/test_integration_redcloth3.rb +0 -31
- data/test/test_integration_redcloth4.rb +0 -31
@@ -0,0 +1,18 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$KCODE = 'u'
|
3
|
+
require 'test/unit'
|
4
|
+
|
5
|
+
require File.dirname(__FILE__) + '/../lib/rutils'
|
6
|
+
|
7
|
+
class IntegrationFlagTest < Test::Unit::TestCase
|
8
|
+
def setup
|
9
|
+
RuTils::overrides = true
|
10
|
+
end
|
11
|
+
|
12
|
+
def test_integration_flag
|
13
|
+
RuTils::overrides = false
|
14
|
+
assert !RuTils::overrides_enabled?
|
15
|
+
RuTils::overrides = true
|
16
|
+
assert RuTils::overrides_enabled?
|
17
|
+
end
|
18
|
+
end
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
1
2
|
$KCODE = 'u'
|
2
3
|
require 'test/unit'
|
3
4
|
require File.dirname(__FILE__) + '/../lib/rutils'
|
@@ -16,7 +17,7 @@ class PropisjuTestCase < Test::Unit::TestCase
|
|
16
17
|
assert_equal "двадцать пять колес", 25.propisju_items(3, "колесо", "колеса", "колес")
|
17
18
|
assert_equal "двадцать одна подстава", 21.propisju_items(2, "подстава", "подставы", "подстав")
|
18
19
|
end
|
19
|
-
|
20
|
+
|
20
21
|
def test_floats
|
21
22
|
assert_equal "шесть целых пять десятых", (6.50).propisju
|
22
23
|
assert_equal "триста сорок одна целая девять десятых", (341.9).propisju
|
@@ -26,7 +27,7 @@ class PropisjuTestCase < Test::Unit::TestCase
|
|
26
27
|
assert_equal "двести двенадцать целых четыре десятых сволочи", (212.40).propisju_items(2, "сволочь", "сволочи", "сволочей")
|
27
28
|
assert_equal "двести двенадцать сволочей", (212.00).propisju_items(2, "сволочь", "сволочи", "сволочей")
|
28
29
|
end
|
29
|
-
|
30
|
+
|
30
31
|
def test_items
|
31
32
|
assert_equal "чемодана", 523.items("чемодан", "чемодана", "чемоданов")
|
32
33
|
assert_equal "партий", 6727.items("партия", "партии", "партий")
|
@@ -0,0 +1,53 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$KCODE = 'u'
|
3
|
+
require 'test/unit'
|
4
|
+
require File.dirname(__FILE__) + '/../lib/rutils'
|
5
|
+
|
6
|
+
|
7
|
+
class TranslitTest < Test::Unit::TestCase
|
8
|
+
|
9
|
+
def setup
|
10
|
+
@string = "Это кусок строки русских букв v peremeshku s latinizey i амперсандом (pozor!) & something"
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_translify
|
14
|
+
assert_equal "sch", 'щ'.translify
|
15
|
+
assert_equal "stansyi", "стансы".translify
|
16
|
+
assert_equal "upuschenie", 'упущение'.translify
|
17
|
+
assert_equal "sh", 'ш'.translify
|
18
|
+
assert_equal "SH", 'Ш'.translify
|
19
|
+
assert_equal "ts", 'ц'.translify
|
20
|
+
assert_equal "Eto kusok stroki russkih bukv v peremeshku s latinizey i ampersandom (pozor!) & something", @string.translify
|
21
|
+
assert_equal "Это просто некий текст".translify, "Eto prosto nekiy tekst"
|
22
|
+
|
23
|
+
assert_equal "NEVEROYATNOE UPUSCHENIE", 'НЕВЕРОЯТНОЕ УПУЩЕНИЕ'.translify
|
24
|
+
assert_equal "Neveroyatnoe Upuschenie", 'Невероятное Упущение'.translify
|
25
|
+
assert_equal "Sherstyanoy Zayats", 'Шерстяной Заяц'.translify
|
26
|
+
assert_equal "N.P. Sherstyakov", 'Н.П. Шерстяков'.translify
|
27
|
+
assert_equal "SHAROVARYI", 'ШАРОВАРЫ'.translify
|
28
|
+
end
|
29
|
+
|
30
|
+
# def test_detranslify
|
31
|
+
# puts "Шерстяной негодяй"
|
32
|
+
# assert_equal "щ", "sch".detranslify
|
33
|
+
# assert_equal "Щ", "SCH".detranslify
|
34
|
+
# assert_equal "Щ", "Sch".detranslify
|
35
|
+
# assert_equal "Щукин", "Schukin".detranslify
|
36
|
+
# assert_equal "Шерстяной негодяй", "Scherstyanoy negodyay".detranslify
|
37
|
+
# end
|
38
|
+
|
39
|
+
def test_dirify
|
40
|
+
assert_equal "eto-kusok-stroki-russkih-bukv-v-peremeshku-s-latinizey-i-ampersandom-pozor-and-something", @string.dirify
|
41
|
+
assert_equal "esche-russkiy-tekst", "Еще РусСКий теКст".dirify
|
42
|
+
assert_equal "kooperator-poobedal-offlayn", "кооператор пообедал оффлайн".dirify, "dirify не должен съедать парные буквы"
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
|
47
|
+
class BiDiTranslitTest < Test::Unit::TestCase
|
48
|
+
|
49
|
+
def test_bidi_translify_raises_unsupported
|
50
|
+
assert_raise(RuTils::RemovedFeature) { "xxx".bidi_translify }
|
51
|
+
assert_raise(RuTils::RemovedFeature) { "xxx".bidi_detranslify }
|
52
|
+
end
|
53
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rutils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Julian 'Julik' Tarkhanov
|
@@ -11,7 +11,7 @@ autorequire:
|
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
13
|
|
14
|
-
date:
|
14
|
+
date: 2009-02-08 00:00:00 +01:00
|
15
15
|
default_executable:
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
@@ -22,7 +22,7 @@ dependencies:
|
|
22
22
|
requirements:
|
23
23
|
- - ">="
|
24
24
|
- !ruby/object:Gem::Version
|
25
|
-
version: 1.
|
25
|
+
version: 1.8.3
|
26
26
|
version:
|
27
27
|
description: Simple processing of russian strings
|
28
28
|
email:
|
@@ -38,44 +38,52 @@ extra_rdoc_files:
|
|
38
38
|
- Manifest.txt
|
39
39
|
- README.txt
|
40
40
|
- TODO.txt
|
41
|
+
- WHAT_HAS_CHANGED.txt
|
41
42
|
files:
|
42
43
|
- History.txt
|
43
44
|
- Manifest.txt
|
44
45
|
- README.txt
|
45
46
|
- Rakefile.rb
|
46
47
|
- TODO.txt
|
48
|
+
- WHAT_HAS_CHANGED.txt
|
47
49
|
- bin/gilensize
|
48
50
|
- bin/rutilize
|
49
51
|
- init.rb
|
50
52
|
- lib/countries/countries.rb
|
51
53
|
- lib/datetime/datetime.rb
|
54
|
+
- lib/gilenson/bluecloth_extra.rb
|
52
55
|
- lib/gilenson/gilenson.rb
|
53
|
-
- lib/
|
56
|
+
- lib/gilenson/helper.rb
|
57
|
+
- lib/gilenson/maruku_extra.rb
|
58
|
+
- lib/gilenson/rdiscount_extra.rb
|
59
|
+
- lib/gilenson/redcloth_extra.rb
|
54
60
|
- lib/integration/integration.rb
|
55
61
|
- lib/integration/rails_date_helper_override.rb
|
56
62
|
- lib/integration/rails_pre_filter.rb
|
57
|
-
- lib/integration/red_cloth_four.rb
|
58
|
-
- lib/integration/red_cloth_override.rb
|
59
|
-
- lib/integration/red_cloth_three.rb
|
60
63
|
- lib/pluralizer/pluralizer.rb
|
61
64
|
- lib/rutils.rb
|
62
65
|
- lib/transliteration/bidi.rb
|
63
66
|
- lib/transliteration/simple.rb
|
64
67
|
- lib/transliteration/transliteration.rb
|
68
|
+
- lib/version.rb
|
69
|
+
- test/extras/integration_bluecloth.rb
|
70
|
+
- test/extras/integration_maruku.rb
|
71
|
+
- test/extras/integration_rails_filter.rb
|
72
|
+
- test/extras/integration_rails_gilenson_helpers.rb
|
73
|
+
- test/extras/integration_rails_helpers.rb
|
74
|
+
- test/extras/integration_rdiscount.rb
|
75
|
+
- test/extras/integration_redcloth3.rb
|
76
|
+
- test/extras/integration_redcloth4.rb
|
65
77
|
- test/run_tests.rb
|
66
|
-
- test/
|
67
|
-
- test/
|
68
|
-
- test/
|
69
|
-
- test/
|
70
|
-
- test/
|
71
|
-
- test/
|
72
|
-
- test/
|
73
|
-
- test/test_integration_redcloth3.rb
|
74
|
-
- test/test_integration_redcloth4.rb
|
75
|
-
- test/test_rails_filter.rb
|
76
|
-
- test/test_rails_helpers.rb
|
78
|
+
- test/test_datetime.rb
|
79
|
+
- test/test_gilenson.rb
|
80
|
+
- test/test_integration.rb
|
81
|
+
- test/test_integration_flag.rb
|
82
|
+
- test/test_pluralize.rb
|
83
|
+
- test/test_rutils_base.rb
|
84
|
+
- test/test_transliteration.rb
|
77
85
|
has_rdoc: true
|
78
|
-
homepage:
|
86
|
+
homepage: "RuTils - \xD0\xBF\xD1\x80\xD0\xBE\xD1\x81\xD1\x82\xD0\xBE\xD0\xB9 \xD0\xBE\xD0\xB1\xD1\x80\xD0\xB0\xD0\xB1\xD0\xBE\xD1\x82\xD1\x87\xD0\xB8\xD0\xBA \xD1\x80\xD1\x83\xD1\x81\xD1\x81\xD0\xBA\xD0\xBE\xD0\xB3\xD0\xBE \xD1\x82\xD0\xB5\xD0\xBA\xD1\x81\xD1\x82\xD0\xB0 \xD0\xBD\xD0\xB0 Ruby. \xD0\x9E\xD1\x81\xD0\xBD\xD0\xBE\xD0\xB2\xD0\xBD\xD0\xB0\xD1\x8F \xD1\x86\xD0\xB5\xD0\xBB\xD1\x8C RuTils -"
|
79
87
|
post_install_message:
|
80
88
|
rdoc_options:
|
81
89
|
- --main
|
@@ -97,14 +105,15 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
97
105
|
requirements: []
|
98
106
|
|
99
107
|
rubyforge_project: rutils
|
100
|
-
rubygems_version: 1.
|
108
|
+
rubygems_version: 1.3.1
|
101
109
|
signing_key:
|
102
110
|
specification_version: 2
|
103
111
|
summary: Simple processing of russian strings
|
104
112
|
test_files:
|
105
|
-
- test/
|
106
|
-
- test/
|
107
|
-
- test/
|
108
|
-
- test/
|
109
|
-
- test/
|
110
|
-
- test/
|
113
|
+
- test/test_datetime.rb
|
114
|
+
- test/test_gilenson.rb
|
115
|
+
- test/test_integration.rb
|
116
|
+
- test/test_integration_flag.rb
|
117
|
+
- test/test_pluralize.rb
|
118
|
+
- test/test_rutils_base.rb
|
119
|
+
- test/test_transliteration.rb
|
@@ -1,12 +0,0 @@
|
|
1
|
-
if defined?(BlueCloth) && !BlueCloth.instance_methods.include?("to_html_without_rutils")
|
2
|
-
class Object::BlueCloth < String #:nodoc:
|
3
|
-
alias_method :to_html_without_rutils, :to_html
|
4
|
-
def to_html(*opts)
|
5
|
-
if RuTils::overrides_enabled?
|
6
|
-
RuTils::Gilenson::Formatter.new(to_html_without_rutils(*opts)).to_html
|
7
|
-
else
|
8
|
-
to_html_without_rutils(*opts)
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
@@ -1,24 +0,0 @@
|
|
1
|
-
# RedCloth 4
|
2
|
-
class RedCloth::TextileDoc < String
|
3
|
-
alias_method :to_html_without_rutils, :to_html
|
4
|
-
|
5
|
-
def to_html
|
6
|
-
if RuTils::overrides_enabled?
|
7
|
-
suspended = to_html_without_rutils
|
8
|
-
|
9
|
-
# Return quotes to original state
|
10
|
-
[187, 171, 8220, 8221].map do |e|
|
11
|
-
suspended.gsub! /&\##{e};/, '"'
|
12
|
-
end
|
13
|
-
|
14
|
-
# Return spaces to original state
|
15
|
-
[160].map do |e|
|
16
|
-
suspended.gsub! /&\##{e};/, ' '
|
17
|
-
end
|
18
|
-
|
19
|
-
suspended.gilensize
|
20
|
-
else
|
21
|
-
to_html_without_rutils
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
@@ -1,25 +0,0 @@
|
|
1
|
-
# RuTils выполняет перегрузку Textile Glyphs в RedCloth, перенося форматирование спецсимволов на Gilenson.
|
2
|
-
class RedCloth < String #:nodoc:
|
3
|
-
# Этот метод в RedCloth при наличии Гиленсона надо отключать
|
4
|
-
alias_method :htmlesc_without_rutils, :htmlesc
|
5
|
-
def htmlesc(text, mode=0) #:nodoc:
|
6
|
-
RuTils::overrides_enabled? ? text : htmlesc_without_rutils(text, mode)
|
7
|
-
end
|
8
|
-
|
9
|
-
# А этот метод обрабатывает Textile Glyphs - ту самую типографицу.
|
10
|
-
# Вместо того чтобы влезать в чужие таблицы мы просто заменим Textile Glyphs на Gilenson - и все будут рады.
|
11
|
-
alias_method :pgl_without_rutils, :pgl
|
12
|
-
def pgl(text) #:nodoc:
|
13
|
-
if RuTils::overrides_enabled?
|
14
|
-
# Suspend the spaces in the start and end of the block because Gilenson chews them off,
|
15
|
-
# and RedCloth feeds them to us in packs
|
16
|
-
# that appear between tag starts/stops. We mess up the formatting but preserve the spacing.
|
17
|
-
spaces = Array.new(2,'')
|
18
|
-
text.gsub!(/\A([\s]+)/) { spaces[0] = $1; '' }
|
19
|
-
text.gsub!(/(\s+)\Z/) { spaces[1] = $1; '' }
|
20
|
-
text.replace(spaces[0].to_s + RuTils::Gilenson::Formatter.new(text).to_html + spaces[1].to_s)
|
21
|
-
else
|
22
|
-
pgl_without_rutils(text)
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
data/test/t_integration.rb
DELETED
@@ -1,46 +0,0 @@
|
|
1
|
-
$KCODE = 'u'
|
2
|
-
require 'rubygems'
|
3
|
-
require 'test/unit'
|
4
|
-
|
5
|
-
def requiring_with_dependencies(*tests)
|
6
|
-
begin
|
7
|
-
yield
|
8
|
-
tests.map {|t| require File.join(File.dirname(__FILE__), t) }
|
9
|
-
rescue LoadError => e
|
10
|
-
$stderr.puts "Skipping integration test - #{e}"
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
requiring_with_dependencies { require 'multi_rails_init' }
|
15
|
-
|
16
|
-
requiring_with_dependencies('test_rails_helpers', 'test_rails_filter') do
|
17
|
-
require 'action_controller' unless defined?(ActionController)
|
18
|
-
require 'action_view' unless defined?(ActionView)
|
19
|
-
end
|
20
|
-
|
21
|
-
|
22
|
-
requiring_with_dependencies('test_integration_bluecloth') { require 'bluecloth' }
|
23
|
-
requiring_with_dependencies do
|
24
|
-
require 'RedCloth' unless defined? RedCloth
|
25
|
-
if RedCloth::VERSION =~ /^3/
|
26
|
-
require File.dirname(__FILE__) + '/test_integration_redcloth3'
|
27
|
-
else
|
28
|
-
require File.dirname(__FILE__) + '/test_integration_redcloth4'
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
require File.dirname(__FILE__) + '/../lib/rutils'
|
33
|
-
load File.dirname(__FILE__) + '/../lib/integration/integration.rb'
|
34
|
-
|
35
|
-
class IntegrationFlagTest < Test::Unit::TestCase
|
36
|
-
def setup
|
37
|
-
RuTils::overrides = true
|
38
|
-
end
|
39
|
-
|
40
|
-
def test_integration_flag
|
41
|
-
RuTils::overrides = false
|
42
|
-
assert !RuTils::overrides_enabled?
|
43
|
-
RuTils::overrides = true
|
44
|
-
assert RuTils::overrides_enabled?
|
45
|
-
end
|
46
|
-
end
|
data/test/t_transliteration.rb
DELETED
@@ -1,109 +0,0 @@
|
|
1
|
-
$KCODE = 'u'
|
2
|
-
require 'test/unit'
|
3
|
-
require File.dirname(__FILE__) + '/../lib/rutils'
|
4
|
-
|
5
|
-
|
6
|
-
class TranslitTest < Test::Unit::TestCase
|
7
|
-
|
8
|
-
def setup
|
9
|
-
@string = "Это кусок строки русских букв v peremeshku s latinizey i амперсандом (pozor!) & something"
|
10
|
-
end
|
11
|
-
|
12
|
-
def test_translify
|
13
|
-
assert_equal "sch", 'щ'.translify
|
14
|
-
assert_equal "stansyi", "стансы".translify
|
15
|
-
assert_equal "upuschenie", 'упущение'.translify
|
16
|
-
assert_equal "sh", 'ш'.translify
|
17
|
-
assert_equal "SH", 'Ш'.translify
|
18
|
-
assert_equal "ts", 'ц'.translify
|
19
|
-
assert_equal "Eto kusok stroki russkih bukv v peremeshku s latinizey i ampersandom (pozor!) & something", @string.translify
|
20
|
-
assert_equal "Это просто некий текст".translify, "Eto prosto nekiy tekst"
|
21
|
-
|
22
|
-
assert_equal "NEVEROYATNOE UPUSCHENIE", 'НЕВЕРОЯТНОЕ УПУЩЕНИЕ'.translify
|
23
|
-
assert_equal "Neveroyatnoe Upuschenie", 'Невероятное Упущение'.translify
|
24
|
-
assert_equal "Sherstyanoy Zayats", 'Шерстяной Заяц'.translify
|
25
|
-
assert_equal "N.P. Sherstyakov", 'Н.П. Шерстяков'.translify
|
26
|
-
assert_equal "SHAROVARYI", 'ШАРОВАРЫ'.translify
|
27
|
-
end
|
28
|
-
|
29
|
-
# def test_detranslify
|
30
|
-
# puts "Шерстяной негодяй"
|
31
|
-
# assert_equal "щ", "sch".detranslify
|
32
|
-
# assert_equal "Щ", "SCH".detranslify
|
33
|
-
# assert_equal "Щ", "Sch".detranslify
|
34
|
-
# assert_equal "Щукин", "Schukin".detranslify
|
35
|
-
# assert_equal "Шерстяной негодяй", "Scherstyanoy negodyay".detranslify
|
36
|
-
# end
|
37
|
-
|
38
|
-
def test_dirify
|
39
|
-
assert_equal "eto-kusok-stroki-russkih-bukv-v-peremeshku-s-latinizey-i-ampersandom-pozor-and-something", @string.dirify
|
40
|
-
assert_equal "esche-russkiy-tekst", "Еще РусСКий теКст".dirify
|
41
|
-
# dirify не должен съедать парные буквы
|
42
|
-
assert_equal "kooperator-poobedal-offlayn", "кооператор пообедал оффлайн".dirify
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
|
47
|
-
class BiDiTranslitTest < Test::Unit::TestCase
|
48
|
-
|
49
|
-
def setup
|
50
|
-
@strings_all_with_slash = {
|
51
|
-
"ThisIsРусскийName/ДляВас/ДемонстрацияOfSwitching" => "ThisIs+Russkijj+Name/+DljaVas+/+Demonstracija+OfSwitching",
|
52
|
-
"Андрэ Нортон Зачумлённый корабльzip" => "+Andreh__Norton__Zachumljonnyjj__korabl'+zip",
|
53
|
-
"Эй Эгегей" => "+EHjj__EHgegejj",
|
54
|
-
"эй-эй" => "+ehjj+-+ehjj",
|
55
|
-
"WebРазработка/Скрипты" => "Web+Razrabotka+/+Skripty",
|
56
|
-
"Смотрите зайцы -- нас много" => "+Smotrite__zajjcy__+--+__nas__mnogo",
|
57
|
-
"Привет Родина" => "+Privet__Rodina",
|
58
|
-
"ЙухХа" => "+JJukhKHa",
|
59
|
-
"Ыхыхых Its English text" => "+Ykhykhykh__+Its+__+English+__+text",
|
60
|
-
"Пьянь" => "+P'jan'",
|
61
|
-
"----____" => "----____",
|
62
|
-
"Madonna - Свежия Песенки" => "Madonna+__+-+__Svezhija__Pesenki",
|
63
|
-
"58-49" => "58-49",
|
64
|
-
"Въезд ГЛЯНЬ ВЪЕЗД" => "+V~ezd__GLJAN_'__V_~EZD",
|
65
|
-
"----____" => "----____",
|
66
|
-
"Въезд ГЛЯНь ВЪЕЗД" => "+V~ezd__GLJAN'__V_~EZD",
|
67
|
-
"Установка mod_perl" => "+Ustanovka__+mod_perl",
|
68
|
-
"Проверка__двери неразумной" => "+Proverka+__+dveri__nerazumnojj",
|
69
|
-
"Проверка_ дверцы" => "+Proverka+_+__dvercy",
|
70
|
-
"Кровать устала _ь" => "+Krovat'__ustala__+_+'",
|
71
|
-
"test__bed" => "test__bed",
|
72
|
-
"test_ bed" => "test_+__+bed",
|
73
|
-
"test__ __bed" => "test__+__+__bed",
|
74
|
-
"a_-_b-_-c" => "a_-_b-_-c",
|
75
|
-
"a - b _ c" => "a+__+-+__+b+__+_+__+c",
|
76
|
-
}
|
77
|
-
|
78
|
-
@strings_tran_without_slash = {
|
79
|
-
"Андрэ/ Н/о/ртон /Зачум//лённый корабль/z/ip" => "+Andreh__Norton__Zachumljonnyjj__korabl'+zip",
|
80
|
-
"WebРазработка/Мимо" => "Web+RazrabotkaMimo",
|
81
|
-
"test_/_bed" => "test__bed",
|
82
|
-
}
|
83
|
-
|
84
|
-
@strings_detran_without_slash = {
|
85
|
-
"Webds" => "/We/bds/",
|
86
|
-
"WebРазработкаМимо" => "Web/+Razrabotka+/+Mimo",
|
87
|
-
"WebСкрипты" => "Web/+Skripty",
|
88
|
-
"ПХПScripts" => "+PKHP+/Scripts",
|
89
|
-
}
|
90
|
-
end
|
91
|
-
|
92
|
-
def test_bidi_translify
|
93
|
-
@strings_all_with_slash.each do |str_from, str_to|
|
94
|
-
assert_equal str_to, str_from.bidi_translify
|
95
|
-
end
|
96
|
-
@strings_tran_without_slash.each do |str_from, str_to|
|
97
|
-
assert_equal str_to, str_from.bidi_translify(false)
|
98
|
-
end
|
99
|
-
end
|
100
|
-
|
101
|
-
def test_bidi_detranslify
|
102
|
-
@strings_all_with_slash.each do |str_to, str_from|
|
103
|
-
assert_equal str_to, str_from.bidi_detranslify
|
104
|
-
end
|
105
|
-
@strings_detran_without_slash.each do |str_to, str_from|
|
106
|
-
assert_equal str_to, str_from.bidi_detranslify(false)
|
107
|
-
end
|
108
|
-
end
|
109
|
-
end
|