CodeOfficer-rack-options-request 0.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +20 -0
- data/README.rdoc +19 -0
- data/VERSION.yml +4 -0
- data/lib/rack/options/request.rb +21 -0
- data/lib/rack_options_request.rb +12 -0
- data/spec/rack_options_request_spec.rb +7 -0
- data/spec/spec_helper.rb +9 -0
- metadata +63 -0
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2009 Russell Jones
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
= rack-options-request
|
2
|
+
|
3
|
+
Description goes here.
|
4
|
+
|
5
|
+
Until I learn TDD, you can test your local app with ...
|
6
|
+
|
7
|
+
curl -X GET http://localhost:3000/
|
8
|
+
|
9
|
+
Should return your normal content.
|
10
|
+
|
11
|
+
While ...
|
12
|
+
|
13
|
+
curl -X OPTIONS http://localhost:3000/
|
14
|
+
|
15
|
+
Should return a 200 status and "Microsoft Office Protocol Discovery".
|
16
|
+
|
17
|
+
== Copyright
|
18
|
+
|
19
|
+
Copyright (c) 2009 Russell Jones. See LICENSE for details.
|
data/VERSION.yml
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
module Rack
|
2
|
+
module Options
|
3
|
+
|
4
|
+
class Request
|
5
|
+
|
6
|
+
def initialize(app)
|
7
|
+
@app = app
|
8
|
+
end
|
9
|
+
|
10
|
+
def call(env)
|
11
|
+
if env["REQUEST_METHOD"] =~ /OPTIONS/
|
12
|
+
[200, {"Content-Type" => "text/html"}, ["Microsoft Office Protocol Discovery"]]
|
13
|
+
else
|
14
|
+
@app.call(env)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# $:.unshift File.dirname(__FILE__)
|
2
|
+
|
3
|
+
# require File.join(File.dirname(__FILE__), *%w[rack options request])
|
4
|
+
|
5
|
+
begin
|
6
|
+
require 'rack'
|
7
|
+
rescue LoadError
|
8
|
+
raise "rack is required for rack-options-request, try: gem install rack"
|
9
|
+
end
|
10
|
+
|
11
|
+
# require 'rack/options/request'
|
12
|
+
# ActionController::Dispatcher.middleware.use Rack::Options::Request
|
data/spec/spec_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: CodeOfficer-rack-options-request
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Russell Jones
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2009-03-11 00:00:00 -07:00
|
13
|
+
default_executable:
|
14
|
+
dependencies: []
|
15
|
+
|
16
|
+
description:
|
17
|
+
email: spam@codeofficer.com
|
18
|
+
executables: []
|
19
|
+
|
20
|
+
extensions: []
|
21
|
+
|
22
|
+
extra_rdoc_files:
|
23
|
+
- README.rdoc
|
24
|
+
- LICENSE
|
25
|
+
files:
|
26
|
+
- README.rdoc
|
27
|
+
- VERSION.yml
|
28
|
+
- lib/rack
|
29
|
+
- lib/rack/options
|
30
|
+
- lib/rack/options/request.rb
|
31
|
+
- lib/rack_options_request.rb
|
32
|
+
- spec/rack_options_request_spec.rb
|
33
|
+
- spec/spec_helper.rb
|
34
|
+
- LICENSE
|
35
|
+
has_rdoc: true
|
36
|
+
homepage: http://github.com/CodeOfficer/rack-options-request
|
37
|
+
post_install_message:
|
38
|
+
rdoc_options:
|
39
|
+
- --inline-source
|
40
|
+
- --charset=UTF-8
|
41
|
+
require_paths:
|
42
|
+
- lib
|
43
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: "0"
|
48
|
+
version:
|
49
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: "0"
|
54
|
+
version:
|
55
|
+
requirements: []
|
56
|
+
|
57
|
+
rubyforge_project:
|
58
|
+
rubygems_version: 1.2.0
|
59
|
+
signing_key:
|
60
|
+
specification_version: 2
|
61
|
+
summary: TODO
|
62
|
+
test_files: []
|
63
|
+
|