domain_routing 0.1.2 → 0.1.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.
@@ -10,11 +10,11 @@ module DomainRouting
10
10
  end
11
11
 
12
12
  def main_domains=(*values)
13
- @main_domains = values.flatten
13
+ @main_domains = values.flatten.map(&:downcase)
14
14
  end
15
15
 
16
16
  def invalid_subdomains=(*values)
17
- @invalid_subdomains = values.flatten
17
+ @invalid_subdomains = values.flatten.map(&:downcase)
18
18
  end
19
19
  end
20
20
  end
@@ -2,13 +2,14 @@ module DomainRouting
2
2
  class Util
3
3
  class << self
4
4
  def domain_for(request)
5
- return "" if DomainRouting::Config.main_domains.include?(request.domain)
6
- request.domain
5
+ domain = request.domain.downcase
6
+ return "" if DomainRouting::Config.main_domains.include?(domain)
7
+ domain
7
8
  end
8
9
 
9
10
  def subdomain_for(request)
10
11
  return "" unless request.subdomains.present?
11
- subdomain = request.subdomains.last
12
+ subdomain = request.subdomains.last.downcase
12
13
  return "" if DomainRouting::Config.invalid_subdomains.include?(subdomain)
13
14
  subdomain
14
15
  end
metadata CHANGED
@@ -1,65 +1,48 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: domain_routing
3
- version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 0
7
- - 1
8
- - 2
9
- version: 0.1.2
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.3
5
+ prerelease:
10
6
  platform: ruby
11
- authors:
7
+ authors:
12
8
  - Mike Stone
13
9
  autorequire:
14
10
  bindir: bin
15
11
  cert_chain: []
16
-
17
- date: 2011-07-26 00:00:00 -07:00
18
- default_executable:
12
+ date: 2011-08-22 00:00:00.000000000Z
19
13
  dependencies: []
20
-
21
14
  description: A Rails 3 gem that allows easy routing using different domains and subdomains
22
15
  email: stonemj@gmail.com
23
16
  executables: []
24
-
25
17
  extensions: []
26
-
27
18
  extra_rdoc_files: []
28
-
29
- files:
19
+ files:
30
20
  - lib/domain_routing.rb
31
21
  - lib/domain_routing/config.rb
32
22
  - lib/domain_routing/routing_additions.rb
33
23
  - lib/domain_routing/util.rb
34
- has_rdoc: true
35
24
  homepage: https://github.com/mikestone/Domain-Routing
36
25
  licenses: []
37
-
38
26
  post_install_message:
39
27
  rdoc_options: []
40
-
41
- require_paths:
28
+ require_paths:
42
29
  - lib
43
- required_ruby_version: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- segments:
48
- - 0
49
- version: "0"
50
- required_rubygems_version: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- segments:
55
- - 0
56
- version: "0"
30
+ required_ruby_version: !ruby/object:Gem::Requirement
31
+ none: false
32
+ requirements:
33
+ - - ! '>='
34
+ - !ruby/object:Gem::Version
35
+ version: '0'
36
+ required_rubygems_version: !ruby/object:Gem::Requirement
37
+ none: false
38
+ requirements:
39
+ - - ! '>='
40
+ - !ruby/object:Gem::Version
41
+ version: '0'
57
42
  requirements: []
58
-
59
43
  rubyforge_project:
60
- rubygems_version: 1.3.6
44
+ rubygems_version: 1.8.6
61
45
  signing_key:
62
46
  specification_version: 3
63
47
  summary: Domain Routing
64
48
  test_files: []
65
-