localized 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- localized (0.0.6)
4
+ localized (0.0.7)
5
5
  bitfields (>= 0.4.0)
6
6
  rails (>= 3.0)
7
7
 
@@ -22,6 +22,10 @@ module Localized::Helper
22
22
  super options
23
23
  end
24
24
 
25
+ def localized_site
26
+ Localized::Config.locale_to_site_map[I18n.locale]
27
+ end
28
+
25
29
  protected
26
30
 
27
31
  def ip?(hostname)
@@ -2,7 +2,7 @@ Gem::Specification.new do |s|
2
2
  s.name = 'localized'
3
3
  s.author = 'Paul Hepworth'
4
4
  s.email = 'paul<dot>hepworth<at>peppyheppy<dot>com'
5
- s.version = '0.0.7'
5
+ s.version = '0.0.8'
6
6
  s.homepage = 'https://github.com/peppyheppy/localized'
7
7
  s.date = '2011-07-09'
8
8
  s.summary = "A ruby on rails gem that provides locale setting support through the subdomain (in a box)"
@@ -51,6 +51,13 @@ describe FoobarController , "locale specific routes", :type => :controller do
51
51
  end
52
52
  end
53
53
 
54
+ describe "additional helpers" do
55
+ it "should have localized_site helper" do
56
+ get :test
57
+ controller.localized_site.should == :us
58
+ end
59
+ end
60
+
54
61
  describe "subdomain locale" do
55
62
 
56
63
  it "should set the current locale to that of the subdomain" do
@@ -0,0 +1 @@
1
+ <%= localized_site %>
@@ -10,6 +10,14 @@ describe "widget_default.erb" do
10
10
  end
11
11
  end
12
12
 
13
+ describe "widget_helpers_test.erb" do
14
+ it "renders the widget partial for localized_site helper" do
15
+ I18n.locale = :'it-IT'
16
+ render
17
+ rendered.should =~ /it/
18
+ end
19
+ end
20
+
13
21
  describe "widget.erb" do
14
22
  it "renders the widget partial for it" do
15
23
  I18n.locale = :'it-IT'
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: localized
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.7
5
+ version: 0.0.8
6
6
  platform: ruby
7
7
  authors:
8
8
  - Paul Hepworth
@@ -115,6 +115,7 @@ files:
115
115
  - spec/spec_helper.rb
116
116
  - spec/views/widget.erb
117
117
  - spec/views/widget_default.erb
118
+ - spec/views/widget_helpers_test.erb
118
119
  - spec/views/widget_invalid.erb
119
120
  - spec/views/widget_views_spec.rb
120
121
  has_rdoc: true