rack-subdomain 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5959d46b21502dbf6990dbf7e52638f717cad88c
4
- data.tar.gz: 6f1690afc1a59e46fb1180ea11c07d64e112ebdd
3
+ metadata.gz: 044ed228d9fe5a813ae8eb116c3a6211134726f7
4
+ data.tar.gz: ae15e033c03b933262a59aae8fe140a0407cc51c
5
5
  SHA512:
6
- metadata.gz: 4080b6caf3b42ba6df5e5f17471edd2341d3dae3ec5cb9863555be2f1da209b3f83dd13fdc06d25663e0550995e88d6b3ccf7b4a2e1206ae9f79f2469d72a026
7
- data.tar.gz: 2f14cf9749e2fb0665b7a3adee42cd95dfc7b88a2c6df60ad57bb49f19ff0f3fc1e63b7c960b64d078b810289ed169c07ec8fab0b3c773bc83ebae641574fffd
6
+ metadata.gz: 390701423d48e5609ec2b906d396b2b70ec2326fa9b3caa571ba477a5040c21ae70fbb4ca5caecac89b44071b597e4ee43446127463dfb09cae4f82139fd0397
7
+ data.tar.gz: 4cb403d14343fb54f9c0d07a419487cfd740c8e879cdbf3c1768a1787dab7d7434a48f2b9c1f8a6c35f1211e0c6b34920cd9f47f8e3bc2588ba9e43f5d3ca3e8
data/Gemfile.lock CHANGED
@@ -1,12 +1,14 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rack-subdomain (0.3.0)
4
+ rack-subdomain (0.3.1)
5
+ ipaddress (~> 0.8.0)
5
6
  rack (>= 1.2.0, <= 2.0.0)
6
7
 
7
8
  GEM
8
9
  remote: https://rubygems.org/
9
10
  specs:
11
+ ipaddress (0.8.0)
10
12
  minitest (2.11.4)
11
13
  rack (1.4.1)
12
14
  rack-test (0.6.1)
@@ -1 +1,2 @@
1
1
  require 'rack/subdomain'
2
+ require 'ipaddress'
@@ -1,7 +1,7 @@
1
+ require 'ipaddress'
2
+
1
3
  module Rack
2
4
  class Subdomain
3
- VERSION = '0.3.0'
4
-
5
5
  def initialize(app, domain, options = {}, &block)
6
6
  # Maintain compatibility with previous rack-subdomain gem
7
7
  options = {to: options} if options.is_a? String
@@ -61,7 +61,7 @@ module Rack
61
61
  end
62
62
 
63
63
  def subdomain
64
- @env['HTTP_HOST'].sub(/\.?#{domain}.*$/,'') unless @env['HTTP_HOST'].match(/^localhost/)
64
+ @env['HTTP_HOST'].sub(/\.?#{domain}.*$/,'') unless @env['HTTP_HOST'].match(/^localhost/) or IPAddress.valid?(@env['SERVER_NAME'])
65
65
  end
66
66
 
67
67
  def remap_with_substituted_path!(path)
@@ -1,19 +1,20 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  $:.push File.expand_path("../lib", __FILE__)
3
- require "rack-subdomain"
4
3
 
5
4
  Gem::Specification.new do |s|
6
5
  s.name = "rack-subdomain"
7
6
  s.authors = ["Mattt Thompson", "Piotr Sarnacki"]
8
7
  s.email = "m@mattt.me"
9
8
  s.homepage = "http://github.com/mattt/rack-subdomain"
10
- s.version = Rack::Subdomain::VERSION
9
+ s.version = '0.3.1'
11
10
  s.platform = Gem::Platform::RUBY
12
11
  s.summary = "rack-subdomain"
13
12
  s.description = "Rack middleware to route requests with subdomains to specified routes with substitutions"
14
13
 
15
14
  s.add_runtime_dependency "rack", ">= 1.2.0", "<= 2.0.0"
16
15
 
16
+ s.add_dependency "ipaddress", "~> 0.8.0"
17
+
17
18
  s.add_development_dependency "rspec"
18
19
  s.add_development_dependency "rake"
19
20
  s.add_development_dependency "minitest", "~> 2.11"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-subdomain
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mattt Thompson
@@ -9,13 +9,13 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-05-24 00:00:00.000000000 Z
12
+ date: 2013-10-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rack
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - ! '>='
18
+ - - '>='
19
19
  - !ruby/object:Gem::Version
20
20
  version: 1.2.0
21
21
  - - <=
@@ -25,38 +25,52 @@ dependencies:
25
25
  prerelease: false
26
26
  version_requirements: !ruby/object:Gem::Requirement
27
27
  requirements:
28
- - - ! '>='
28
+ - - '>='
29
29
  - !ruby/object:Gem::Version
30
30
  version: 1.2.0
31
31
  - - <=
32
32
  - !ruby/object:Gem::Version
33
33
  version: 2.0.0
34
+ - !ruby/object:Gem::Dependency
35
+ name: ipaddress
36
+ requirement: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: 0.8.0
41
+ type: :runtime
42
+ prerelease: false
43
+ version_requirements: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: 0.8.0
34
48
  - !ruby/object:Gem::Dependency
35
49
  name: rspec
36
50
  requirement: !ruby/object:Gem::Requirement
37
51
  requirements:
38
- - - ! '>='
52
+ - - '>='
39
53
  - !ruby/object:Gem::Version
40
54
  version: '0'
41
55
  type: :development
42
56
  prerelease: false
43
57
  version_requirements: !ruby/object:Gem::Requirement
44
58
  requirements:
45
- - - ! '>='
59
+ - - '>='
46
60
  - !ruby/object:Gem::Version
47
61
  version: '0'
48
62
  - !ruby/object:Gem::Dependency
49
63
  name: rake
50
64
  requirement: !ruby/object:Gem::Requirement
51
65
  requirements:
52
- - - ! '>='
66
+ - - '>='
53
67
  - !ruby/object:Gem::Version
54
68
  version: '0'
55
69
  type: :development
56
70
  prerelease: false
57
71
  version_requirements: !ruby/object:Gem::Requirement
58
72
  requirements:
59
- - - ! '>='
73
+ - - '>='
60
74
  - !ruby/object:Gem::Version
61
75
  version: '0'
62
76
  - !ruby/object:Gem::Dependency
@@ -99,7 +113,6 @@ files:
99
113
  - ./lib/rack/subdomain.rb
100
114
  - ./lib/rack-subdomain.rb
101
115
  - ./LICENSE
102
- - ./rack-subdomain-0.2.1.gem
103
116
  - ./rack-subdomain.gemspec
104
117
  - ./Rakefile
105
118
  - ./README.md
@@ -112,12 +125,12 @@ require_paths:
112
125
  - lib
113
126
  required_ruby_version: !ruby/object:Gem::Requirement
114
127
  requirements:
115
- - - ! '>='
128
+ - - '>='
116
129
  - !ruby/object:Gem::Version
117
130
  version: '0'
118
131
  required_rubygems_version: !ruby/object:Gem::Requirement
119
132
  requirements:
120
- - - ! '>='
133
+ - - '>='
121
134
  - !ruby/object:Gem::Version
122
135
  version: '0'
123
136
  requirements: []
Binary file