rich_i18n 1.2.0 → 1.2.1
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/CHANGELOG +6 -0
- data/README.textile +10 -8
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/lib/rich/i18n/core/array/merging.rb +1 -1
- data/lib/rich/i18n/core/enriched_string.rb +7 -1
- data/lib/rich/i18n/core/string/enrichments.rb +2 -2
- data/rich_i18n.gemspec +3 -5
- metadata +5 -7
- data/lib/rich/i18n/core/erb.rb +0 -6
- data/lib/rich/i18n/core/erb/output.rb +0 -22
data/CHANGELOG
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
= Rich-i18n CHANGELOG
|
2
2
|
|
3
|
+
== Version 1.2.1 (October 2, 2010)
|
4
|
+
|
5
|
+
* Altered the default delimiter (separator) of Array.join
|
6
|
+
* Being able to concatenate (+, <<, concat) Strings with EnrichedStrings
|
7
|
+
* Not overriding ERB::Compiler::Buffer.push anymore
|
8
|
+
|
3
9
|
== Version 1.2.0 (October 1, 2010)
|
4
10
|
|
5
11
|
* Fixed bug: corrected String.to_output
|
data/README.textile
CHANGED
@@ -244,16 +244,18 @@ This Rails gem / plugin depends on:
|
|
244
244
|
i18n<br>
|
245
245
|
"http://github.com/svenfuchs/i18n":http://github.com/svenfuchs/i18n
|
246
246
|
|
247
|
+
Formtastic (optional)<br>
|
248
|
+
"http://github.com/justinfrench/formtastic":http://github.com/justinfrench/formtastic
|
249
|
+
|
247
250
|
Hpricot<br>
|
248
251
|
"http://github.com/whymirror/hpricot":http://github.com/whymirror/hpricot (thanks Why!)
|
249
252
|
|
250
253
|
Rich-CMS (optional)<br>
|
254
|
+
"http://codehero.es/rails_gems_plugins/rich_cms":http://codehero.es/rails_gems_plugins/rich_cms <br>
|
251
255
|
"http://github.com/archan937/rich_cms":http://github.com/archan937/rich_cms
|
252
256
|
|
253
|
-
Formtastic (optional)<br>
|
254
|
-
"http://github.com/justinfrench/formtastic":http://github.com/justinfrench/formtastic
|
255
|
-
|
256
257
|
SeatHolder (optional)<br>
|
258
|
+
"http://codehero.es/jquery_libraries/seat_holder":http://codehero.es/jquery_libraries/seat_holder <br>
|
257
259
|
"http://github.com/archan937/seat_holder":http://github.com/archan937/seat_holder
|
258
260
|
|
259
261
|
h2. ToDo's
|
@@ -262,15 +264,15 @@ h2. ToDo's
|
|
262
264
|
* Use a better implementation to tackle String interpolation (e.g. "foo #{"bar".t}") to preserve meta data
|
263
265
|
* Most String inflection methods are also defined in rich_pluralization (keep it DRY)
|
264
266
|
|
265
|
-
h2.
|
267
|
+
h2. Enrichments
|
266
268
|
|
267
|
-
|
269
|
+
The all-in-one gem at - "http://codehero.es/rails_gems_plugins/e9s":http://codehero.es/rails_gems_plugins/e9s - "http://github.com/archan937/e9s":http://github.com/archan937/e9s
|
268
270
|
|
269
271
|
h3. E9s modules
|
270
272
|
|
271
|
-
* Rich-CMS
|
272
|
-
* Rich-i18n
|
273
|
-
* Rich-pluralization
|
273
|
+
* Rich-CMS <br> "http://codehero.es/rails_gems_plugins/rich_cms":http://codehero.es/rails_gems_plugins/rich_cms <br> "http://github.com/archan937/rich_cms":http://github.com/archan937/rich_cms
|
274
|
+
* Rich-i18n <br> "http://codehero.es/rails_gems_plugins/rich_i18n":http://codehero.es/rails_gems_plugins/rich_i18n <br> "http://github.com/archan937/rich_i18n":http://github.com/archan937/rich_i18n
|
275
|
+
* Rich-pluralization <br> "http://codehero.es/rails_gems_plugins/rich_pluralization":http://codehero.es/rails_gems_plugins/rich_pluralization <br> "http://github.com/archan937/rich_pluralization":http://github.com/archan937/rich_pluralization
|
274
276
|
|
275
277
|
h2. License
|
276
278
|
|
data/Rakefile
CHANGED
@@ -9,7 +9,7 @@ begin
|
|
9
9
|
gemspec.summary = "Enrichments (e9s) module for internationalization (i18n)"
|
10
10
|
gemspec.description = "Rich-i18n is a module of E9s (http://github.com/archan937/e9s) which enriches I18n, Formtastic, the String and Symbol classes. This simplifies internationalization of your Rails application making a Rails developers life much easier."
|
11
11
|
gemspec.email = "paul.engel@holder.nl"
|
12
|
-
gemspec.homepage = "http://
|
12
|
+
gemspec.homepage = "http://codehero.es/rails_gems_plugins/rich_i18n"
|
13
13
|
gemspec.author = "Paul Engel"
|
14
14
|
|
15
15
|
gemspec.add_dependency "i18n" , "0.3.7"
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.2.
|
1
|
+
1.2.1
|
@@ -4,12 +4,18 @@ module Rich
|
|
4
4
|
module Core
|
5
5
|
class EnrichedString
|
6
6
|
|
7
|
-
delegate :empty?, :blank?, :to_json, :to => :@string
|
7
|
+
delegate :empty?, :blank?, :to_json, :+, :<<, :concat, :to => :@string
|
8
|
+
|
9
|
+
attr_reader :string
|
8
10
|
|
9
11
|
def initialize(string = "", meta_data = nil)
|
10
12
|
@string = string
|
11
13
|
@meta_data = meta_data || (s.meta_data.dup unless (string.meta_data.nil? rescue true)) || {}
|
12
14
|
end
|
15
|
+
|
16
|
+
def enriched_string?
|
17
|
+
true
|
18
|
+
end
|
13
19
|
|
14
20
|
def to_es
|
15
21
|
(@meta_data.filled? && Engine.can_enrich_output?) ? to_tag : @string
|
@@ -26,7 +26,7 @@ module Rich
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def add_with_rich_i18n(other)
|
29
|
-
strings, result = self.merged_strings.try(:dup) || [], add_without_rich_i18n(other)
|
29
|
+
strings, result = self.merged_strings.try(:dup) || [], add_without_rich_i18n(other.enriched_string? ? other.string : other)
|
30
30
|
|
31
31
|
if (result.merged_strings = strings).empty?
|
32
32
|
result.merged_strings << self.dup
|
@@ -50,7 +50,7 @@ module Rich
|
|
50
50
|
end
|
51
51
|
|
52
52
|
def enriched_string?
|
53
|
-
|
53
|
+
(merged_strings || []).any?(&:enriched_string?)
|
54
54
|
end
|
55
55
|
|
56
56
|
def to_output
|
data/rich_i18n.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{rich_i18n}
|
8
|
-
s.version = "1.2.
|
8
|
+
s.version = "1.2.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Paul Engel"]
|
12
|
-
s.date = %q{2010-10-
|
12
|
+
s.date = %q{2010-10-02}
|
13
13
|
s.description = %q{Rich-i18n is a module of E9s (http://github.com/archan937/e9s) which enriches I18n, Formtastic, the String and Symbol classes. This simplifies internationalization of your Rails application making a Rails developers life much easier.}
|
14
14
|
s.email = %q{paul.engel@holder.nl}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -42,8 +42,6 @@ Gem::Specification.new do |s|
|
|
42
42
|
"lib/rich/i18n/core/array/merging.rb",
|
43
43
|
"lib/rich/i18n/core/enriched_string.rb",
|
44
44
|
"lib/rich/i18n/core/enumerable/methods.rb",
|
45
|
-
"lib/rich/i18n/core/erb.rb",
|
46
|
-
"lib/rich/i18n/core/erb/output.rb",
|
47
45
|
"lib/rich/i18n/core/hash.rb",
|
48
46
|
"lib/rich/i18n/core/nil_class.rb",
|
49
47
|
"lib/rich/i18n/core/object.rb",
|
@@ -73,7 +71,7 @@ Gem::Specification.new do |s|
|
|
73
71
|
"test/test_helper.rb",
|
74
72
|
"uninstall.rb"
|
75
73
|
]
|
76
|
-
s.homepage = %q{http://
|
74
|
+
s.homepage = %q{http://codehero.es/rails_gems_plugins/rich_i18n}
|
77
75
|
s.rdoc_options = ["--charset=UTF-8"]
|
78
76
|
s.require_paths = ["lib"]
|
79
77
|
s.rubygems_version = %q{1.3.7}
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rich_i18n
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 29
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 1.2.
|
9
|
+
- 1
|
10
|
+
version: 1.2.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Paul Engel
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-10-
|
18
|
+
date: 2010-10-02 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -115,8 +115,6 @@ files:
|
|
115
115
|
- lib/rich/i18n/core/array/merging.rb
|
116
116
|
- lib/rich/i18n/core/enriched_string.rb
|
117
117
|
- lib/rich/i18n/core/enumerable/methods.rb
|
118
|
-
- lib/rich/i18n/core/erb.rb
|
119
|
-
- lib/rich/i18n/core/erb/output.rb
|
120
118
|
- lib/rich/i18n/core/hash.rb
|
121
119
|
- lib/rich/i18n/core/nil_class.rb
|
122
120
|
- lib/rich/i18n/core/object.rb
|
@@ -146,7 +144,7 @@ files:
|
|
146
144
|
- test/test_helper.rb
|
147
145
|
- uninstall.rb
|
148
146
|
has_rdoc: true
|
149
|
-
homepage: http://
|
147
|
+
homepage: http://codehero.es/rails_gems_plugins/rich_i18n
|
150
148
|
licenses: []
|
151
149
|
|
152
150
|
post_install_message:
|
data/lib/rich/i18n/core/erb.rb
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
|
2
|
-
module Rich
|
3
|
-
module I18n
|
4
|
-
module Core
|
5
|
-
module ERB
|
6
|
-
module Output
|
7
|
-
|
8
|
-
def self.included(base)
|
9
|
-
base.class_eval do
|
10
|
-
alias_method_chain :push, :rich_i18n
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
def push_with_rich_i18n(cmd)
|
15
|
-
push_without_rich_i18n cmd.match(/^#{@compiler.insert_cmd}\(\(.*\)\.to_s\)$/) ? cmd.gsub(/to_s\)$/, "to_output)") : cmd
|
16
|
-
end
|
17
|
-
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|