ensure_subdomain 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ensure_subdomain.gemspec +1 -1
- data/lib/ensure_subdomain/version.rb +1 -1
- data/lib/ensure_subdomain.rb +4 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8bfbed2cb42ec1dec6b7db959362ceea0cb69744
|
4
|
+
data.tar.gz: 108f8ddd0931f49a7b23a4b4a9a6065133f0a0ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f7433c9c8ac9f077ac8939b4e2c5ae155f829a03ede929b01789ddd03eff470566ac2dd9b1b6a3f0e4580bd10a0611396b4576854455f6bfaeba44987d4d8fbe
|
7
|
+
data.tar.gz: 408da1bae5482b9d43066c1c22f4f8c11629d1ba17f88808003796ea751b6ca3c4c3a5cebf9a724279ae92b92c21cc70a37aa84a60f3268bfe5e4595e928b01f
|
data/ensure_subdomain.gemspec
CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
|
|
13
13
|
s.homepage = 'https://github.com/shreve/ensure_subdomain'
|
14
14
|
s.license = 'MIT'
|
15
15
|
|
16
|
-
s.add_runtime_dependency 'actionpack', '>=
|
16
|
+
s.add_runtime_dependency 'actionpack', '>= 3.2.0'
|
17
17
|
|
18
18
|
s.files = `git ls-files`.split("\n")
|
19
19
|
s.require_path = 'lib'
|
data/lib/ensure_subdomain.rb
CHANGED
@@ -6,9 +6,11 @@ class EnsureSubdomain
|
|
6
6
|
end
|
7
7
|
|
8
8
|
def matches?(request)
|
9
|
+
# don't deal with addresses like http://0.0.0.0:3000
|
10
|
+
request.domain.present? and
|
9
11
|
# ''.match('www') #=> nil, which is is the opposite of what we want
|
10
|
-
|
11
|
-
|
12
|
+
((self.subdomain.empty? and request.subdomain.present?) or
|
13
|
+
request.subdomain.match(self.subdomain).nil?)
|
12
14
|
end
|
13
15
|
|
14
16
|
def to(params, request)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ensure_subdomain
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jacob Evan Shreve
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 3.2.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 3.2.0
|
27
27
|
description: Ensure requests are going to the right subdomain to avoid competing with
|
28
28
|
yourself for dem SERPs. Adds a couple methods to ActionDispatch for routes.
|
29
29
|
email:
|