fast_gettext 0.5.1 → 0.5.2

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/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.1
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.1"
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-01-30}
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.5}
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",
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__),'spec_helper')
1
+ require 'spec/spec_helper'
2
2
 
3
3
  describe 'unconfigured' do
4
4
  it "gives a useful error message when trying to just translate" do
@@ -1,7 +1,6 @@
1
- current_folder = File.dirname(__FILE__)
2
- require File.join(current_folder,'..','spec_helper')
1
+ require 'spec/spec_helper'
3
2
 
4
- de_file = File.join(current_folder,'..','locale','de','LC_MESSAGES','test.mo')
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,5 +1,4 @@
1
- current_folder = File.dirname(__FILE__)
2
- require File.join(current_folder,'..','spec_helper')
1
+ require 'spec/spec_helper'
3
2
 
4
3
  describe 'Storage' do
5
4
  include FastGettext::Storage
@@ -1,5 +1,4 @@
1
- current_folder = File.dirname(__FILE__)
2
- require File.join(current_folder,'..','..','spec_helper')
1
+ require 'spec/spec_helper'
3
2
  require 'fast_gettext/translation_repository/base'
4
3
 
5
4
  describe 'FastGettext::TranslationRepository::Base' do
@@ -1,5 +1,4 @@
1
- current_folder = File.dirname(__FILE__)
2
- require File.join(current_folder,'..','..','spec_helper')
1
+ require 'spec/spec_helper'
3
2
 
4
3
  class MockRepo
5
4
  def [](key)#should_receive :[] does not work so well...
@@ -1,5 +1,4 @@
1
- current_folder = File.dirname(__FILE__)
2
- require File.join(current_folder,'..','..','spec_helper')
1
+ require 'spec/spec_helper'
3
2
 
4
3
  require 'active_record'
5
4
  require 'fast_gettext/translation_repository/db'
@@ -1,5 +1,4 @@
1
- current_folder = File.dirname(__FILE__)
2
- require File.join(current_folder,'..','..','spec_helper')
1
+ require 'spec/spec_helper'
3
2
 
4
3
  describe 'FastGettext::TranslationRepository::Logger' do
5
4
  before do
@@ -1,10 +1,8 @@
1
- current_folder = File.dirname(__FILE__)
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(current_folder,'..','..','locale'))
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(current_folder,'..','..','locale'))
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
- current_folder = File.dirname(__FILE__)
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(current_folder,'..','..','locale'),:type=>:po)
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(current_folder,'..','..','locale'),:type=>:po)
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
- current_folder = File.dirname(__FILE__)
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(current_folder,'..', '..', 'locale', 'yaml'), :type => :yaml)
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
@@ -1,5 +1,4 @@
1
- current_folder = File.dirname(__FILE__)
2
- require File.join(current_folder,'..','spec_helper')
1
+ require 'spec/spec_helper'
3
2
 
4
3
  module FastGettext
5
4
  module TranslationRepository
@@ -1,5 +1,4 @@
1
- current_folder = File.dirname(__FILE__)
2
- require File.join(current_folder,'..','spec_helper')
1
+ require 'spec/spec_helper'
3
2
 
4
3
  describe FastGettext::Translation do
5
4
  include FastGettext::Translation
@@ -1,4 +1,4 @@
1
- require File.expand_path("spec_helper", File.dirname(__FILE__))
1
+ require 'spec/spec_helper'
2
2
 
3
3
  default_setup
4
4
  class IncludeTest
@@ -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 File.join(current_folder,'fake_load_path')
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(File.dirname(__FILE__),'..','locale'))
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'
@@ -1,8 +1,17 @@
1
- current_folder = File.dirname(__FILE__)
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 unless ("a %{x}" % {:x=>'b'}) == 'a b'
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
- version: 0.5.1
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-01-30 00:00:00 +01:00
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.5
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