restpack-web 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +17 -0
- data/Gemfile +7 -0
- data/LICENSE +22 -0
- data/Rakefile +32 -0
- data/lib/restpack-web/version.rb +5 -0
- data/lib/restpack-web.rb +18 -0
- data/restpack-web.gemspec +23 -0
- metadata +9 -2
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
MIT License
|
2
|
+
-----------
|
3
|
+
|
4
|
+
Copyright (c) 2013 Gavin Joyce and RestPack contributors
|
5
|
+
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
7
|
+
this software and associated documentation files (the "Software"), to deal in
|
8
|
+
the Software without restriction, including without limitation the rights to
|
9
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
10
|
+
of the Software, and to permit persons to whom the Software is furnished to do
|
11
|
+
so, subject to the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
14
|
+
copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
22
|
+
SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
require_relative 'lib/restpack-web/version'
|
2
|
+
|
3
|
+
task :default => :test
|
4
|
+
task :test => :spec
|
5
|
+
|
6
|
+
begin
|
7
|
+
require "rspec/core/rake_task"
|
8
|
+
|
9
|
+
desc "Run all specs"
|
10
|
+
RSpec::Core::RakeTask.new(:spec) do |t|
|
11
|
+
t.rspec_opts = ['-cfs']
|
12
|
+
end
|
13
|
+
rescue LoadError
|
14
|
+
end
|
15
|
+
|
16
|
+
|
17
|
+
task :gem do
|
18
|
+
["gem:build", "gem:push"].each do |task|
|
19
|
+
Rake::Task[task].reenable
|
20
|
+
Rake::Task[task].invoke
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
namespace :gem do
|
25
|
+
task :build do
|
26
|
+
sh "gem build restpack-web.gemspec"
|
27
|
+
end
|
28
|
+
|
29
|
+
task :push do
|
30
|
+
sh "gem push restpack-web-#{RestPack::Web::VERSION}.gem"
|
31
|
+
end
|
32
|
+
end
|
data/lib/restpack-web.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'restpack-web/version'
|
2
|
+
|
3
|
+
module RestPack
|
4
|
+
class Web
|
5
|
+
def initialize(app)
|
6
|
+
@app = app
|
7
|
+
end
|
8
|
+
|
9
|
+
def call(env)
|
10
|
+
env["restpack"] ||= {}
|
11
|
+
host = env["SERVER_NAME"]
|
12
|
+
|
13
|
+
env["restpack"][:host] = host #TODO: GJ: add some magic
|
14
|
+
|
15
|
+
@app.call(env)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'restpack-web/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |gem|
|
7
|
+
gem.name = "restpack-web"
|
8
|
+
gem.version = RestPack::Web::VERSION
|
9
|
+
gem.authors = ["Gavin Joyce"]
|
10
|
+
gem.email = ["gavinjoyce@gmail.com"]
|
11
|
+
gem.description = %q{...}
|
12
|
+
gem.summary = %q{...}
|
13
|
+
gem.homepage = ""
|
14
|
+
|
15
|
+
gem.files = `git ls-files`.split($/)
|
16
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
17
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
18
|
+
gem.require_paths = ["lib"]
|
19
|
+
|
20
|
+
gem.add_dependency 'rack-auto-session-domain'
|
21
|
+
gem.add_development_dependency 'rack'
|
22
|
+
gem.add_development_dependency 'rspec', '~> 2.12'
|
23
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: restpack-web
|
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:
|
@@ -65,7 +65,14 @@ email:
|
|
65
65
|
executables: []
|
66
66
|
extensions: []
|
67
67
|
extra_rdoc_files: []
|
68
|
-
files:
|
68
|
+
files:
|
69
|
+
- .gitignore
|
70
|
+
- Gemfile
|
71
|
+
- LICENSE
|
72
|
+
- Rakefile
|
73
|
+
- lib/restpack-web.rb
|
74
|
+
- lib/restpack-web/version.rb
|
75
|
+
- restpack-web.gemspec
|
69
76
|
homepage: ''
|
70
77
|
licenses: []
|
71
78
|
post_install_message:
|