stringex 2.0.5 → 2.0.6

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.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YzJhYzkxYjk0MzM2YzY0NjA3YTJlNTQwMzJiZTY0MTk4MWZiNzI1YQ==
4
+ MjIwZmFlNWNlZTY1ZjU0ZTlhYzc4NjhjNzE5ZGQ2ZTJkMzQ4MzZiZg==
5
5
  data.tar.gz: !binary |-
6
- M2JjNzFjZWJhN2NhZmZmNzhlMTM0ZThmNmUwMDNiZDQ2MGY1YTllZg==
6
+ NTEzYmIxZGU2MDQzMWQ5Njg3ZTQ3YTY3MGMwMzBiYmVmOWJmMDY1Nw==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- MDE4NDUxZjY1ZTdlMzc4M2E5NWVmNGFjN2MyY2M1ZDI4ZjQ0YzFlMzJiY2Y2
10
- YjIzZGJlM2U2MDQ4NjgzNjA1NGRjYjdkNDQxYzdjMDBhZDMwYWVlNWRiMWVm
11
- OTNkNjc0ZGM1YjlmODhjMDBhNzZhNGY4Mzc0M2U4NzE5M2NiMGY=
9
+ MmRmOTYwMDM1MzY1YWQ5YzlhZjYwZjcxNjg2NDZkYjJkMzM0YTE1ZDZkYzhl
10
+ YWVlMzc1MTE1NDhjYjhkZGExOWE5MDE1NmJiYjM1Nzk3OGY2ZjRjMjAxZTY5
11
+ MDA1NzZmZmNjNmNkMDc5MjlkYWIxMTc2NWJjNzM0ZDM5NjgwZWY=
12
12
  data.tar.gz: !binary |-
13
- Zjc2YTJkOTM0YmM1NzlhMTEzZGY0NGQwNTExOGNlOTJkNWM2MTNiYTg0MWU4
14
- ZDM5ZTcyZGVkN2NmOTMxMjkzOTg0MjgwMmM5ZGU4ZGE1N2E3YThiYWNiOGJh
15
- MTAxOGM0Mjk3MWI5NTg0ODc5YzFlMmUwMTJhNWVmYWE4Zjk0Y2U=
13
+ ZjA3OWZkYmJkYmFmNDMzM2JiMWIwMjdmZTI4YTk5NjY0YTAwMGZmNjJhYTk4
14
+ NjBkZDcwMjBlNWNjMjk4MTkyMmFmNzY0MmI5NmIxMDhlMDlmZmI4MzM3YWM2
15
+ MjM3ZWU4NGUyMDY0ZGRhNmNhMTFiNTQxOGM4YjY0MDEzMmM3MWE=
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.0.5
1
+ 2.0.6
@@ -0,0 +1,76 @@
1
+ # NOTE: Some translation keys make use of matches from regular expressions
2
+ # to manipulate whitespace and order. Please consult the source code for
3
+ # Stringex::Localization::ConversionExpressions to see what those
4
+ # regular expressions look like if you need to manipulate the order
5
+ # differently than the usage below.
6
+ de:
7
+ stringex:
8
+ characters:
9
+ and: und
10
+ at: um
11
+ divide: geteilt durch
12
+ degrees: Grad
13
+ dot: \1 Punkt \2
14
+ ellipsis: Punkt Punkt Punkt
15
+ equals: gleich
16
+ number: Nummer
17
+ percent: Prozent
18
+ plus: plus
19
+ slash: Strich
20
+ star: Stern
21
+ currencies:
22
+ dollars: \1 Dollar
23
+ dollars_cents: \1 Dollar \2 Cent
24
+ pounds: \1 Pfund
25
+ pounds_pence: \1 Pfund \2 Pence
26
+ euros: \1 Euro
27
+ euros_cents: \1 Euro \2 Cent
28
+ yen: \1 Yen
29
+ reais: \1 Reais
30
+ reais_cents: \1 Reais \2 Cent
31
+ html_entities:
32
+ amp: und
33
+ cent: " Cent"
34
+ copy: (C)
35
+ deg: " Grad "
36
+ divide: " geteilt durch "
37
+ double_quote: '"'
38
+ ellipsis: "..."
39
+ en_dash: "-"
40
+ em_dash: "--"
41
+ frac14: ein Viertel
42
+ frac12: halbe(r)
43
+ frac34: drei Viertel
44
+ gt: ">"
45
+ lt: <
46
+ nbsp: " "
47
+ pound: " Pfund "
48
+ reg: (R)
49
+ single_quote: "'"
50
+ times: x
51
+ trade: (TM)
52
+ yen: " Yen "
53
+ vulgar_fractions:
54
+ half: halbe(r)
55
+ one_third: ein Drittel
56
+ two_thirds: zwei Drittel
57
+ one_fourth: ein Viertel
58
+ three_fourths: drei Viertel
59
+ one_fifth: ein Fünftel
60
+ two_fifths: zwei Fünftel
61
+ three_fifths: drei Fünftel
62
+ four_fifths: vier Fünftel
63
+ one_sixth: ein Sechstel
64
+ five_sixths: fünf Sechstel
65
+ one_eighth: ein Achtel
66
+ three_eighths: drei Achtel
67
+ five_eighths: fünf Achtel
68
+ seven_eighths: sieben Achtel
69
+ transliterations:
70
+ Ä: AE
71
+ Ö: OE
72
+ Ü: UE
73
+ ß: ss
74
+ ä: ae
75
+ ö: oe
76
+ ü: ue
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "stringex"
8
- s.version = "2.0.5"
8
+ s.version = "2.0.6"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Russell Norris"]
12
- s.date = "2013-07-16"
12
+ s.date = "2013-07-24"
13
13
  s.description = "Some [hopefully] useful extensions to Ruby's String class. Stringex is made up of three libraries: ActsAsUrl [permalink solution with better character translation], Unidecoder [Unicode to ASCII transliteration], and StringExtensions [miscellaneous helper methods for the String class]."
14
14
  s.email = "rsl@luckysneaks.com"
15
15
  s.extra_rdoc_files = [
@@ -228,6 +228,7 @@ Gem::Specification.new do |s|
228
228
  "lib/stringex/unidecoder_data/xff.yml",
229
229
  "lib/stringex/version.rb",
230
230
  "locales/da.yml",
231
+ "locales/de.yml",
231
232
  "locales/en.yml",
232
233
  "locales/pt-BR.yml",
233
234
  "stringex.gemspec",
@@ -239,6 +240,7 @@ Gem::Specification.new do |s|
239
240
  "test/unit/acts_as_url_configuration_test.rb",
240
241
  "test/unit/acts_as_url_integration_test.rb",
241
242
  "test/unit/localization/da_test.rb",
243
+ "test/unit/localization/de_test.rb",
242
244
  "test/unit/localization/default_test.rb",
243
245
  "test/unit/localization/en_test.rb",
244
246
  "test/unit/localization_test.rb",
@@ -0,0 +1,117 @@
1
+ # encoding: UTF-8
2
+
3
+ require 'test_helper'
4
+ require 'i18n'
5
+ require 'stringex'
6
+
7
+ class GermanYAMLLocalizationTest < Test::Unit::TestCase
8
+ def setup
9
+ Stringex::Localization.reset!
10
+ Stringex::Localization.backend = :i18n
11
+ Stringex::Localization.backend.load_translations :de
12
+ Stringex::Localization.locale = :de
13
+ end
14
+
15
+ {
16
+ "foo & bar" => "foo und bar",
17
+ "AT&T" => "AT und T",
18
+ "99° sind normal" => "99 Grad sind normal",
19
+ "4 ÷ 2 ist 2" => "4 geteilt durch 2 ist 2",
20
+ "webcrawler.com" => "webcrawler Punkt com",
21
+ "Nun..." => "Nun Punkt Punkt Punkt",
22
+ "x=1" => "x gleich 1",
23
+ "Ein #2 Stift" => "Ein Nummer 2 Stift",
24
+ "100%" => "100 Prozent",
25
+ "Kosten+Steuern" => "Kosten plus Steuern",
26
+ "Batman/Robin Fan Fiction" => "Batman Strich Robin Fan Fiction",
27
+ "Wähle *69" => "Wähle Stern 69",
28
+ " i leave whitespace on ends unchanged " => " i leave whitespace on ends unchanged "
29
+ }.each do |original, converted|
30
+ define_method "test_character_conversion: '#{original}'" do
31
+ assert_equal converted, original.convert_miscellaneous_characters
32
+ end
33
+ end
34
+
35
+ {
36
+ "$100" => "100 Dollar",
37
+ "$19.99" => "19 Dollar 99 Cent",
38
+ "£100" => "100 Pfund",
39
+ "£19.99" => "19 Pfund 99 Pence",
40
+ "€100" => "100 Euro",
41
+ "€19.99" => "19 Euro 99 Cent",
42
+ "¥1000" => "1000 Yen"
43
+ }.each do |original, converted|
44
+ define_method "test_currency_conversion: '#{original}'" do
45
+ assert_equal converted, original.convert_miscellaneous_characters
46
+ end
47
+ end
48
+
49
+ {
50
+ "Hennes &amp; Mauritz" => "Hennes und Mauritz",
51
+ "10&cent;" => "10 Cent",
52
+ "&copy;2000" => "(C)2000",
53
+ "98&deg; sind ok" => "98 Grad sind ok",
54
+ "10&divide;5" => "10 geteilt durch 5",
55
+ "&quot;zitiert&quot;" => '"zitiert"',
56
+ "Fortsetzung folgt&hellip;" => "Fortsetzung folgt...",
57
+ "2000&ndash;2004" => "2000-2004",
58
+ "Ich wünschte&mdash;oh, ach nichts" => "Ich wünschte--oh, ach nichts",
59
+ "&frac12; Unze Gold" => "halbe(r) Unze Gold",
60
+ "1 und &frac14; Unzen Silber" => "1 und ein Viertel Unzen Silber",
61
+ "9 und &frac34; Unzen Platin" => "9 und drei Viertel Unzen Platin",
62
+ "3&gt;2" => "3>2",
63
+ "2&lt;3" => "2<3",
64
+ "zwei&nbsp;Worte" => "zwei Worte",
65
+ "100&pound;" => "100 Pfund",
66
+ "Walmart&reg;" => "Walmart(R)",
67
+ "&apos;einfach zitiert&apos;" => "'einfach zitiert'",
68
+ "2&times;4" => "2x4",
69
+ "Programming&trade;" => "Programming(TM)",
70
+ "20000&yen;" => "20000 Yen",
71
+ " i leave whitespace on ends unchanged " => " i leave whitespace on ends unchanged "
72
+ }.each do |original, converted|
73
+ define_method "test_html_entity_conversion: '#{original}'" do
74
+ assert_equal converted, original.convert_miscellaneous_html_entities
75
+ end
76
+ end
77
+
78
+ {
79
+ "&frac12;" => "halbe(r)",
80
+ "½" => "halbe(r)",
81
+ "&#189;" => "halbe(r)",
82
+ "⅓" => "ein Drittel",
83
+ "&#8531;" => "ein Drittel",
84
+ "⅔" => "zwei Drittel",
85
+ "&#8532;" => "zwei Drittel",
86
+ "&frac14;" => "ein Viertel",
87
+ "¼" => "ein Viertel",
88
+ "&#188;" => "ein Viertel",
89
+ "&frac34;" => "drei Viertel",
90
+ "¾" => "drei Viertel",
91
+ "&#190;" => "drei Viertel",
92
+ "⅕" => "ein Fünftel",
93
+ "&#8533;" => "ein Fünftel",
94
+ "⅖" => "zwei Fünftel",
95
+ "&#8534;" => "zwei Fünftel",
96
+ "⅗" => "drei Fünftel",
97
+ "&#8535;" => "drei Fünftel",
98
+ "⅘" => "vier Fünftel",
99
+ "&#8536;" => "vier Fünftel",
100
+ "⅙" => "ein Sechstel",
101
+ "&#8537;" => "ein Sechstel",
102
+ "⅚" => "fünf Sechstel",
103
+ "&#8538;" => "fünf Sechstel",
104
+ "⅛" => "ein Achtel",
105
+ "&#8539;" => "ein Achtel",
106
+ "⅜" => "drei Achtel",
107
+ "&#8540;" => "drei Achtel",
108
+ "⅝" => "fünf Achtel",
109
+ "&#8541;" => "fünf Achtel",
110
+ "⅞" => "sieben Achtel",
111
+ "&#8542;" => "sieben Achtel"
112
+ }.each do |original, converted|
113
+ define_method "test_vulgar_fractions_conversion: #{original}" do
114
+ assert_equal converted, original.convert_vulgar_fractions
115
+ end
116
+ end
117
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stringex
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.5
4
+ version: 2.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Russell Norris
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-07-16 00:00:00.000000000 Z
11
+ date: 2013-07-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -386,6 +386,7 @@ files:
386
386
  - lib/stringex/unidecoder_data/xff.yml
387
387
  - lib/stringex/version.rb
388
388
  - locales/da.yml
389
+ - locales/de.yml
389
390
  - locales/en.yml
390
391
  - locales/pt-BR.yml
391
392
  - stringex.gemspec
@@ -397,6 +398,7 @@ files:
397
398
  - test/unit/acts_as_url_configuration_test.rb
398
399
  - test/unit/acts_as_url_integration_test.rb
399
400
  - test/unit/localization/da_test.rb
401
+ - test/unit/localization/de_test.rb
400
402
  - test/unit/localization/default_test.rb
401
403
  - test/unit/localization/en_test.rb
402
404
  - test/unit/localization_test.rb