subdomain_locale 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  module SubdomainLocale
2
2
  module UrlFor
3
3
  def url_for(options=nil)
4
- if options and locale = options.delete(:locale)
4
+ if options.is_a?(Hash) and locale = options.delete(:locale)
5
5
  options[:subdomain] = Locale.new(locale).subdomain
6
6
  options[:only_path] = false
7
7
  end
@@ -1,5 +1,5 @@
1
1
  module SubdomainLocale
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  autoload :UrlFor, "subdomain_locale/url_for"
4
4
  autoload :Controller, "subdomain_locale/controller"
5
5
  autoload :Locale, "subdomain_locale/locale"
data/test/url_for_test.rb CHANGED
@@ -15,6 +15,11 @@ class UrlForTest < MiniTest::Unit::TestCase
15
15
  assert_equal [{foo: 'bar'}], @actual
16
16
  end
17
17
 
18
+ def test_does_not_affect_string_argument
19
+ url_for('/bar')
20
+ assert_equal ['/bar'], @actual
21
+ end
22
+
18
23
  def test_replaces_locale_with_subdomain_and_forces_not_only_path
19
24
  url_for(foo: 'bar', locale: :ru)
20
25
  assert_equal [{foo: 'bar', subdomain: 'ru', only_path: false}], @actual
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: subdomain_locale
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-01-08 00:00:00.000000000 Z
12
+ date: 2012-01-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rdoc
16
- requirement: &70239990318660 !ruby/object:Gem::Requirement
16
+ requirement: &70237108702520 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '3.10'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70239990318660
24
+ version_requirements: *70237108702520
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: hoe
27
- requirement: &70239990318180 !ruby/object:Gem::Requirement
27
+ requirement: &70237108702020 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '2.12'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70239990318180
35
+ version_requirements: *70237108702020
36
36
  description: ''
37
37
  email:
38
38
  - sema@sema.in