fast_gettext 0.6.6 → 0.6.7

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fast_gettext (0.6.6)
4
+ fast_gettext (0.6.7)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
data/Readme.md CHANGED
@@ -224,5 +224,5 @@ Mo/Po-file parsing from Masao Mutoh, see vendor/README
224
224
 
225
225
  [Michael Grosser](http://grosser.it)<br/>
226
226
  michael@grosser.it<br/>
227
- Hereby placed under public domain, do what you want, just do not hold me accountable...<br/>
227
+ License: MIT<br/>
228
228
  [![Build Status](https://secure.travis-ci.org/grosser/fast_gettext.png)](http://travis-ci.org/grosser/fast_gettext)
@@ -185,7 +185,7 @@ module FastGettext
185
185
 
186
186
  #de-de -> de_DE
187
187
  def format_locale(locale)
188
- locale.sub(/^([a-zA-Z]{2})[-_]([a-zA-Z]{2})$/){$1.downcase+'_'+$2.upcase}
188
+ locale.sub(/^([a-zA-Z]{2,3})[-_]([a-zA-Z]{2,3})$/){$1.downcase+'_'+$2.upcase}
189
189
  end
190
190
 
191
191
  def update_current_cache
@@ -1,3 +1,3 @@
1
1
  module FastGettext
2
- VERSION = Version = '0.6.6'
2
+ VERSION = Version = '0.6.7'
3
3
  end
@@ -1,4 +1,4 @@
1
- require File.expand_path('spec/spec_helper')
1
+ require "spec_helper"
2
2
 
3
3
  describe 'unconfigured' do
4
4
  it "gives a useful error message when trying to just translate" do
@@ -18,4 +18,4 @@ describe 'unconfigured' do
18
18
  rescue FastGettext::Storage::NoTextDomainConfigured
19
19
  end
20
20
  end
21
- end
21
+ end
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- require File.expand_path('spec/spec_helper')
2
+ require "spec_helper"
3
3
 
4
4
  de_file = File.join('spec','locale','de','LC_MESSAGES','test.mo')
5
5
  de = FastGettext::MoFile.new(de_file)
@@ -1,4 +1,4 @@
1
- require File.expand_path('spec/spec_helper')
1
+ require "spec_helper"
2
2
  require 'fast_gettext/po_file'
3
3
 
4
4
  de_file = File.join('spec','locale','de','test.po')
@@ -1,4 +1,5 @@
1
- require File.expand_path('spec/spec_helper')
1
+ require "spec_helper"
2
+ require 'fast_gettext/translation_repository/base'
2
3
 
3
4
  describe 'Storage' do
4
5
  include FastGettext::Storage
@@ -316,6 +317,16 @@ describe 'Storage' do
316
317
  end
317
318
  end
318
319
 
320
+ describe :format_locale do
321
+ it "allows 2-letter locales to be formatted" do
322
+ format_locale("de-ch").should == "de_CH"
323
+ end
324
+
325
+ it "allows 3-letter locales to be formatted" do
326
+ format_locale("gsw-ch").should == "gsw_CH"
327
+ end
328
+ end
329
+
319
330
  describe FastGettext::Storage::NoTextDomainConfigured do
320
331
  it "shows what to do" do
321
332
  FastGettext::Storage::NoTextDomainConfigured.new.to_s.should =~ /FastGettext\.add_text_domain/
@@ -1,4 +1,4 @@
1
- require File.expand_path('spec/spec_helper')
1
+ require "spec_helper"
2
2
  require 'fast_gettext/translation_repository/base'
3
3
 
4
4
  describe 'FastGettext::TranslationRepository::Base' do
@@ -1,4 +1,4 @@
1
- require File.expand_path('spec/spec_helper')
1
+ require "spec_helper"
2
2
 
3
3
  class MockRepo
4
4
  def [](key)#should_receive :[] does not work so well...
@@ -1,4 +1,4 @@
1
- require File.expand_path('spec/spec_helper')
1
+ require "spec_helper"
2
2
 
3
3
  require 'active_record'
4
4
  require 'fast_gettext/translation_repository/db'
@@ -67,4 +67,4 @@ describe FastGettext::TranslationRepository::Db do
67
67
  create_translation 'Axis||||Axis', 'Achse||||Achsen'
68
68
  @rep.plural('Axis','Axis').should == ['Achse','Achsen']
69
69
  end
70
- end
70
+ end
@@ -1,4 +1,4 @@
1
- require File.expand_path('spec/spec_helper')
1
+ require "spec_helper"
2
2
 
3
3
  describe 'FastGettext::TranslationRepository::Logger' do
4
4
  before do
@@ -37,4 +37,4 @@ describe 'FastGettext::TranslationRepository::Logger' do
37
37
  @rep.plural('a','b').should == []
38
38
  end
39
39
  end
40
- end
40
+ end
@@ -1,4 +1,4 @@
1
- require File.expand_path('spec/spec_helper')
1
+ require "spec_helper"
2
2
 
3
3
  describe 'FastGettext::TranslationRepository::Mo' do
4
4
  before do
@@ -1,4 +1,4 @@
1
- require File.expand_path('spec/spec_helper')
1
+ require "spec_helper"
2
2
 
3
3
  describe 'FastGettext::TranslationRepository::Po' do
4
4
  before do
@@ -1,4 +1,4 @@
1
- require File.expand_path('spec/spec_helper')
1
+ require "spec_helper"
2
2
 
3
3
  describe 'FastGettext::TranslationRepository::Yaml' do
4
4
  before do
@@ -58,4 +58,4 @@ describe 'FastGettext::TranslationRepository::Yaml' do
58
58
  @rep.pluralisation_rule.call(input).should == expected
59
59
  end
60
60
  end
61
- end
61
+ end
@@ -1,4 +1,4 @@
1
- require File.expand_path('spec/spec_helper')
1
+ require "spec_helper"
2
2
 
3
3
  module FastGettext
4
4
  module TranslationRepository
@@ -30,4 +30,4 @@ describe FastGettext::TranslationRepository do
30
30
  repo.options.should == options
31
31
  end
32
32
  end
33
- end
33
+ end
@@ -1,4 +1,4 @@
1
- require File.expand_path('spec/spec_helper')
1
+ require "spec_helper"
2
2
 
3
3
  describe FastGettext::Translation do
4
4
  include FastGettext::Translation
@@ -1,4 +1,4 @@
1
- require File.expand_path('spec/spec_helper')
1
+ require "spec_helper"
2
2
 
3
3
  describe 'Iconv' do
4
4
  it "also works when Iconv was not found locally" do
@@ -1,4 +1,4 @@
1
- require File.expand_path('spec/spec_helper')
1
+ require "spec_helper"
2
2
 
3
3
  describe String do
4
4
  def pending_18
@@ -1,4 +1,4 @@
1
- require File.expand_path('spec/spec_helper')
1
+ require "spec_helper"
2
2
 
3
3
  default_setup
4
4
  class IncludeTest
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fast_gettext
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.6
4
+ version: 0.6.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-02 00:00:00.000000000 Z
12
+ date: 2012-05-09 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description:
15
15
  email: michael@grosser.it
@@ -110,7 +110,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
110
110
  version: '0'
111
111
  segments:
112
112
  - 0
113
- hash: -4206231816777043257
113
+ hash: 2481622648606723903
114
114
  required_rubygems_version: !ruby/object:Gem::Requirement
115
115
  none: false
116
116
  requirements:
@@ -119,10 +119,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
119
119
  version: '0'
120
120
  segments:
121
121
  - 0
122
- hash: -4206231816777043257
122
+ hash: 2481622648606723903
123
123
  requirements: []
124
124
  rubyforge_project:
125
- rubygems_version: 1.8.15
125
+ rubygems_version: 1.8.24
126
126
  signing_key:
127
127
  specification_version: 3
128
128
  summary: A simple, fast, memory-efficient and threadsafe implementation of GetText