fast_gettext 0.5.7 → 0.5.8
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 +2 -2
- data/lib/fast_gettext/storage.rb +3 -1
- data/spec/fast_gettext/storage_spec.rb +10 -5
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.5.
|
1
|
+
0.5.8
|
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.8"
|
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-07-21}
|
13
13
|
s.email = %q{grosser.michael@gmail.com}
|
14
14
|
s.extra_rdoc_files = [
|
15
15
|
"README.markdown"
|
data/lib/fast_gettext/storage.rb
CHANGED
@@ -25,7 +25,9 @@ module FastGettext
|
|
25
25
|
|
26
26
|
|
27
27
|
def available_locales
|
28
|
-
Thread.current[:fast_gettext_available_locales] || default_available_locales
|
28
|
+
locales = Thread.current[:fast_gettext_available_locales] || default_available_locales
|
29
|
+
return unless locales
|
30
|
+
locales.map{|s|s.to_s}
|
29
31
|
end
|
30
32
|
|
31
33
|
# == cattr_accessor :default_available_locales
|
@@ -104,16 +104,21 @@ describe 'Storage' do
|
|
104
104
|
thread_save(:default_available_locales, 'xx').should == false
|
105
105
|
end
|
106
106
|
|
107
|
+
it "converts locales to s" do
|
108
|
+
self.available_locales = [:x]
|
109
|
+
available_locales.should == ['x']
|
110
|
+
end
|
111
|
+
|
107
112
|
it "uses default_available_locales when available_locales is not set" do
|
108
113
|
self.available_locales = nil
|
109
|
-
self.default_available_locales = 'x'
|
110
|
-
available_locales.should == 'x'
|
114
|
+
self.default_available_locales = ['x']
|
115
|
+
available_locales.should == ['x']
|
111
116
|
end
|
112
117
|
|
113
118
|
it "does not use default when available_locales is set" do
|
114
|
-
self.available_locales = 'x'
|
115
|
-
self.default_available_locales = 'y'
|
116
|
-
available_locales.should == 'x'
|
119
|
+
self.available_locales = ['x']
|
120
|
+
self.default_available_locales = ['y']
|
121
|
+
available_locales.should == ['x']
|
117
122
|
end
|
118
123
|
end
|
119
124
|
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 5
|
8
|
-
-
|
9
|
-
version: 0.5.
|
8
|
+
- 8
|
9
|
+
version: 0.5.8
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Michael Grosser
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-
|
17
|
+
date: 2010-07-21 00:00:00 +02:00
|
18
18
|
default_executable:
|
19
19
|
dependencies: []
|
20
20
|
|