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.
- data/lib/subdomain_locale/url_for.rb +1 -1
- data/lib/subdomain_locale.rb +1 -1
- data/test/url_for_test.rb +5 -0
- metadata +6 -6
@@ -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
|
data/lib/subdomain_locale.rb
CHANGED
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.
|
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-
|
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: &
|
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: *
|
24
|
+
version_requirements: *70237108702520
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: hoe
|
27
|
-
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: *
|
35
|
+
version_requirements: *70237108702020
|
36
36
|
description: ''
|
37
37
|
email:
|
38
38
|
- sema@sema.in
|