fast_gettext 0.6.3 → 0.6.4

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.3
1
+ 0.6.4
data/fast_gettext.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{fast_gettext}
8
- s.version = "0.6.3"
8
+ s.version = "0.6.4"
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,15 +12,15 @@ module FastGettext
12
12
 
13
13
  [:available_locales, :_locale, :text_domain, :pluralisation_rule].each do |method_name|
14
14
  key = "fast_gettext_#{method_name}".to_sym
15
- define_method method_name do
16
- Thread.current[key]
17
- end
18
-
19
15
  define_method "#{method_name}=" do |value|
20
16
  Thread.current[key]=value
21
17
  update_current_cache
22
18
  end
23
19
  end
20
+
21
+ def _locale
22
+ Thread.current[:fast_gettext__locale]
23
+ end
24
24
  private :_locale, :_locale=
25
25
 
26
26
 
@@ -27,7 +27,7 @@ module FastGettext
27
27
  # n_('apple','apples',3)
28
28
  def n_(*keys)
29
29
  count = keys.pop
30
- translations = FastGettext.cached_plural_find *keys
30
+ translations = FastGettext.cached_plural_find(*keys)
31
31
 
32
32
  selected = FastGettext.pluralisation_rule.call(count)
33
33
  selected = (selected ? 1 : 0) unless selected.is_a? Numeric #convert booleans to numbers
@@ -188,7 +188,6 @@ module FastGettext
188
188
  HASHWORDBITS = 32
189
189
  def hash_string(str)
190
190
  hval = 0
191
- i = 0
192
191
  str.each_byte do |b|
193
192
  break if b == '\0'
194
193
  hval <<= 4
@@ -73,4 +73,4 @@ rescue KeyError
73
73
  end
74
74
  end
75
75
  end
76
- end
76
+ end
@@ -27,7 +27,7 @@ describe String do
27
27
 
28
28
  describe "old % style replacement" do
29
29
  it "substitudes using % + Hash" do
30
- ("x%{name}y" %{:name=>'a'}).should == 'xay'
30
+ ("x%{name}y" % {:name=>'a'}).should == 'xay'
31
31
  end
32
32
 
33
33
  it "does not substitute after %%" do
data/spec/spec_helper.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # $VERBOSE = true # ignore complaints in spec files
2
+
1
3
  # ---- requirements
2
4
  require 'rubygems'
3
5
  $LOAD_PATH.unshift File.expand_path("../lib", File.dirname(__FILE__))
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fast_gettext
3
3
  version: !ruby/object:Gem::Version
4
- hash: 1
4
+ hash: 15
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 6
9
- - 3
10
- version: 0.6.3
9
+ - 4
10
+ version: 0.6.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Michael Grosser