fast_gettext 0.5.1 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/fast_gettext.gemspec +3 -3
- data/spec/aa_unconfigued_spec.rb +1 -1
- data/spec/fast_gettext/mo_file_spec.rb +2 -3
- data/spec/fast_gettext/storage_spec.rb +1 -2
- data/spec/fast_gettext/translation_repository/base_spec.rb +1 -2
- data/spec/fast_gettext/translation_repository/chain_spec.rb +1 -2
- data/spec/fast_gettext/translation_repository/db_spec.rb +1 -2
- data/spec/fast_gettext/translation_repository/logger_spec.rb +1 -2
- data/spec/fast_gettext/translation_repository/mo_spec.rb +3 -5
- data/spec/fast_gettext/translation_repository/po_spec.rb +3 -5
- data/spec/fast_gettext/translation_repository/yaml_spec.rb +2 -3
- data/spec/fast_gettext/translation_repository_spec.rb +1 -2
- data/spec/fast_gettext/translation_spec.rb +1 -2
- data/spec/fast_gettext_spec.rb +1 -1
- data/spec/vendor/iconv_spec.rb +10 -4
- data/spec/vendor/string_spec.rb +11 -2
- data/vendor/string.rb +3 -1
- metadata +12 -5
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.5.
|
1
|
+
0.5.2
|
data/fast_gettext.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{fast_gettext}
|
8
|
-
s.version = "0.5.
|
8
|
+
s.version = "0.5.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Michael Grosser"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-04-07}
|
13
13
|
s.email = %q{grosser.michael@gmail.com}
|
14
14
|
s.extra_rdoc_files = [
|
15
15
|
"README.markdown"
|
@@ -85,7 +85,7 @@ Gem::Specification.new do |s|
|
|
85
85
|
s.homepage = %q{http://github.com/grosser/fast_gettext}
|
86
86
|
s.rdoc_options = ["--charset=UTF-8"]
|
87
87
|
s.require_paths = ["lib"]
|
88
|
-
s.rubygems_version = %q{1.3.
|
88
|
+
s.rubygems_version = %q{1.3.6}
|
89
89
|
s.summary = %q{A simple, fast and threadsafe implementation of GetText}
|
90
90
|
s.test_files = [
|
91
91
|
"spec/spec_helper.rb",
|
data/spec/aa_unconfigued_spec.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
|
-
|
2
|
-
require File.join(current_folder,'..','spec_helper')
|
1
|
+
require 'spec/spec_helper'
|
3
2
|
|
4
|
-
de_file = File.join(
|
3
|
+
de_file = File.join('spec','locale','de','LC_MESSAGES','test.mo')
|
5
4
|
de = FastGettext::MoFile.new(de_file)
|
6
5
|
|
7
6
|
describe FastGettext::MoFile do
|
@@ -1,10 +1,8 @@
|
|
1
|
-
|
2
|
-
require File.join(current_folder,'..','..','spec_helper')
|
3
|
-
|
1
|
+
require 'spec/spec_helper'
|
4
2
|
|
5
3
|
describe 'FastGettext::TranslationRepository::Mo' do
|
6
4
|
before do
|
7
|
-
@rep = FastGettext::TranslationRepository.build('test',:path=>File.join(
|
5
|
+
@rep = FastGettext::TranslationRepository.build('test',:path=>File.join('spec', 'locale'))
|
8
6
|
@rep.is_a?(FastGettext::TranslationRepository::Mo).should be_true
|
9
7
|
end
|
10
8
|
|
@@ -24,7 +22,7 @@ describe 'FastGettext::TranslationRepository::Mo' do
|
|
24
22
|
|
25
23
|
it "has access to the mo repositories pluralisation rule" do
|
26
24
|
FastGettext.locale = 'en'
|
27
|
-
rep = FastGettext::TranslationRepository.build('plural_test',:path=>File.join(
|
25
|
+
rep = FastGettext::TranslationRepository.build('plural_test',:path=>File.join('spec','locale'))
|
28
26
|
rep['car'].should == 'Test'#just check it is loaded correctly
|
29
27
|
rep.pluralisation_rule.call(2).should == 3
|
30
28
|
end
|
@@ -1,10 +1,8 @@
|
|
1
|
-
|
2
|
-
require File.join(current_folder,'..','..','spec_helper')
|
3
|
-
|
1
|
+
require 'spec/spec_helper'
|
4
2
|
|
5
3
|
describe 'FastGettext::TranslationRepository::Po' do
|
6
4
|
before do
|
7
|
-
@rep = FastGettext::TranslationRepository.build('test',:path=>File.join(
|
5
|
+
@rep = FastGettext::TranslationRepository.build('test',:path=>File.join('spec','locale'),:type=>:po)
|
8
6
|
@rep.is_a?(FastGettext::TranslationRepository::Po).should be_true
|
9
7
|
end
|
10
8
|
|
@@ -24,7 +22,7 @@ describe 'FastGettext::TranslationRepository::Po' do
|
|
24
22
|
|
25
23
|
it "has access to the mo repositories pluralisation rule" do
|
26
24
|
FastGettext.locale = 'en'
|
27
|
-
rep = FastGettext::TranslationRepository.build('plural_test',:path=>File.join(
|
25
|
+
rep = FastGettext::TranslationRepository.build('plural_test',:path=>File.join('spec','locale'),:type=>:po)
|
28
26
|
rep['car'].should == 'Test'#just check it is loaded correctly
|
29
27
|
rep.pluralisation_rule.call(2).should == 3
|
30
28
|
end
|
@@ -1,9 +1,8 @@
|
|
1
|
-
|
2
|
-
require File.join(current_folder,'..','..','spec_helper')
|
1
|
+
require 'spec/spec_helper'
|
3
2
|
|
4
3
|
describe 'FastGettext::TranslationRepository::Yaml' do
|
5
4
|
before do
|
6
|
-
@rep = FastGettext::TranslationRepository.build('test', :path => File.join(
|
5
|
+
@rep = FastGettext::TranslationRepository.build('test', :path => File.join('spec', 'locale', 'yaml'), :type => :yaml)
|
7
6
|
@rep.is_a?(FastGettext::TranslationRepository::Yaml).should be_true
|
8
7
|
FastGettext.locale = 'de'
|
9
8
|
end
|
data/spec/fast_gettext_spec.rb
CHANGED
data/spec/vendor/iconv_spec.rb
CHANGED
@@ -1,10 +1,16 @@
|
|
1
|
-
current_folder = File.dirname(__FILE__)
|
2
|
-
$LOAD_PATH.unshift File.expand_path("../../lib", current_folder)
|
3
1
|
|
4
2
|
describe 'Iconv' do
|
3
|
+
before do
|
4
|
+
@fake_load_path = File.join('spec','vendor','fake_load_path')
|
5
|
+
end
|
6
|
+
|
7
|
+
after do
|
8
|
+
$LOAD_PATH.delete @fake_load_path
|
9
|
+
end
|
10
|
+
|
5
11
|
it "also works when Iconv was not found locally" do
|
6
12
|
#prepare load path
|
7
|
-
$LOAD_PATH.unshift
|
13
|
+
$LOAD_PATH.unshift @fake_load_path
|
8
14
|
test = 1
|
9
15
|
begin
|
10
16
|
require 'iconv'
|
@@ -16,7 +22,7 @@ describe 'Iconv' do
|
|
16
22
|
#load fast_gettext
|
17
23
|
require 'fast_gettext'
|
18
24
|
|
19
|
-
FastGettext.add_text_domain('test',:path=>File.join(
|
25
|
+
FastGettext.add_text_domain('test',:path=>File.join('spec','locale'))
|
20
26
|
FastGettext.text_domain = 'test'
|
21
27
|
FastGettext.available_locales = ['en','de']
|
22
28
|
FastGettext.locale = 'de'
|
data/spec/vendor/string_spec.rb
CHANGED
@@ -1,8 +1,17 @@
|
|
1
|
-
|
2
|
-
require File.join(current_folder,'..','spec_helper')
|
1
|
+
require 'spec/spec_helper'
|
3
2
|
|
4
3
|
#just to make sure we did not mess up while copying...
|
5
4
|
describe String do
|
5
|
+
before :all do
|
6
|
+
if "i18n gem overwrites % method".respond_to?(:interpolate_without_ruby_19_syntax)
|
7
|
+
class String
|
8
|
+
def %(*args)
|
9
|
+
interpolate_without_ruby_19_syntax(*args)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
6
15
|
it "does not translate twice" do
|
7
16
|
("%{a} %{b}" % {:a=>'%{b}',:b=>'c'}).should == '%{b} c'
|
8
17
|
end
|
data/vendor/string.rb
CHANGED
@@ -10,8 +10,10 @@
|
|
10
10
|
|
11
11
|
# Extension for String class. This feature is included in Ruby 1.9 or later.
|
12
12
|
begin
|
13
|
-
raise
|
13
|
+
raise ArgumentError if ("a %{x}" % {:x=>'b'}) != 'a b'
|
14
14
|
rescue ArgumentError
|
15
|
+
# either we are on vanilla 1.8(call with hash raises ArgumentError)
|
16
|
+
# or someone else already patched % but did it wrong
|
15
17
|
class String
|
16
18
|
alias :_fast_gettext_old_format_m :% # :nodoc:
|
17
19
|
|
metadata
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fast_gettext
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 5
|
8
|
+
- 2
|
9
|
+
version: 0.5.2
|
5
10
|
platform: ruby
|
6
11
|
authors:
|
7
12
|
- Michael Grosser
|
@@ -9,7 +14,7 @@ autorequire:
|
|
9
14
|
bindir: bin
|
10
15
|
cert_chain: []
|
11
16
|
|
12
|
-
date: 2010-
|
17
|
+
date: 2010-04-07 00:00:00 +02:00
|
13
18
|
default_executable:
|
14
19
|
dependencies: []
|
15
20
|
|
@@ -101,18 +106,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
101
106
|
requirements:
|
102
107
|
- - ">="
|
103
108
|
- !ruby/object:Gem::Version
|
109
|
+
segments:
|
110
|
+
- 0
|
104
111
|
version: "0"
|
105
|
-
version:
|
106
112
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
107
113
|
requirements:
|
108
114
|
- - ">="
|
109
115
|
- !ruby/object:Gem::Version
|
116
|
+
segments:
|
117
|
+
- 0
|
110
118
|
version: "0"
|
111
|
-
version:
|
112
119
|
requirements: []
|
113
120
|
|
114
121
|
rubyforge_project:
|
115
|
-
rubygems_version: 1.3.
|
122
|
+
rubygems_version: 1.3.6
|
116
123
|
signing_key:
|
117
124
|
specification_version: 3
|
118
125
|
summary: A simple, fast and threadsafe implementation of GetText
|