rack-vhost 0.1.0 → 0.1.1
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.
- data/README.md +1 -1
- data/examples/config.ru +6 -6
- data/rack-vhost.gemspec +12 -13
- metadata +1 -1
data/README.md
CHANGED
data/examples/config.ru
CHANGED
|
@@ -2,22 +2,22 @@ require 'rack/vhost'
|
|
|
2
2
|
|
|
3
3
|
class Router
|
|
4
4
|
def call(env)
|
|
5
|
-
'Router app'
|
|
5
|
+
[200, { 'Content-Type' => 'text/plain' }, 'Router app']
|
|
6
6
|
end
|
|
7
7
|
end
|
|
8
8
|
|
|
9
9
|
class APIApp
|
|
10
10
|
def call(env)
|
|
11
|
-
'API app'
|
|
11
|
+
[200, { 'Content-Type' => 'text/plain' }, 'API app']
|
|
12
12
|
end
|
|
13
13
|
end
|
|
14
14
|
|
|
15
15
|
class MainApp
|
|
16
16
|
def call(env)
|
|
17
|
-
'Main app'
|
|
17
|
+
[200, { 'Content-Type' => 'text/plain' }, 'Main app']
|
|
18
18
|
end
|
|
19
19
|
end
|
|
20
20
|
|
|
21
|
-
use Rack::Vhost, :vhost =>
|
|
22
|
-
use Rack::Vhost, :vhost =>
|
|
23
|
-
run Router
|
|
21
|
+
use Rack::Vhost, :vhost => /^api/, :app => APIApp.new
|
|
22
|
+
use Rack::Vhost, :vhost => /www.philcolabs.com/, :app => MainApp.new
|
|
23
|
+
run Router.new
|
data/rack-vhost.gemspec
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
Gem::Specification.new do |gem|
|
|
2
|
-
gem.name
|
|
3
|
-
gem.version
|
|
4
|
-
gem.summary
|
|
5
|
-
gem.description
|
|
6
|
-
gem.author
|
|
7
|
-
gem.email
|
|
8
|
-
gem.homepage
|
|
9
|
-
gem.has_rdoc
|
|
10
|
-
gem.require_path
|
|
11
|
-
|
|
12
|
-
gem.
|
|
13
|
-
gem.
|
|
14
|
-
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
|
2
|
+
gem.name = 'rack-vhost'
|
|
3
|
+
gem.version = '0.1.1'
|
|
4
|
+
gem.summary = 'Rack middleware to dispatch to an application via host header'
|
|
5
|
+
gem.description = 'Rack middleware to dispatch to an application via host header.'
|
|
6
|
+
gem.author = 'Philip Reichenberger'
|
|
7
|
+
gem.email = 'preichenberger@philcolabs.com'
|
|
8
|
+
gem.homepage = 'http://github.com/preichen/rack-vhost'
|
|
9
|
+
gem.has_rdoc = false
|
|
10
|
+
gem.require_path = 'lib'
|
|
11
|
+
gem.files = `git ls-files`.split($/)
|
|
12
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
|
13
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
|
15
14
|
|
|
16
15
|
gem.add_development_dependency 'rack'
|
|
17
16
|
end
|