patchbay 0.0.1.pre4 → 0.0.1.pre5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/patchbay.rb +1 -16
- metadata +5 -5
data/lib/patchbay.rb
CHANGED
@@ -1,23 +1,9 @@
|
|
1
1
|
require 'rack/mime'
|
2
2
|
require 'rack/handler'
|
3
3
|
|
4
|
-
module PatchbayHelpers
|
5
|
-
def incoming_json
|
6
|
-
unless params[:incoming_json]
|
7
|
-
inp = environment['rack.input']
|
8
|
-
inp.rewind
|
9
|
-
params[:incoming_json] = JSON.parse inp.read
|
10
|
-
end
|
11
|
-
|
12
|
-
params[:incoming_json]
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
4
|
# The main Patchbay class, from which application classes derive.
|
17
5
|
class Patchbay
|
18
6
|
|
19
|
-
include PatchbayHelpers
|
20
|
-
|
21
7
|
NoRoute_Message = <<EOT
|
22
8
|
<html><body>
|
23
9
|
<h1>404</h1><p>Patchbay: Routing Error</p>
|
@@ -334,7 +320,7 @@ private
|
|
334
320
|
@response = [200, { "Content-Type" => "text/html" }, []]
|
335
321
|
options.each do |key, value|
|
336
322
|
case key
|
337
|
-
when :error
|
323
|
+
when :error, :status
|
338
324
|
@response[0] = value
|
339
325
|
else
|
340
326
|
@response[1]["Content-Type"] = Rack::Mime.mime_type("."+key.to_s)
|
@@ -389,4 +375,3 @@ private
|
|
389
375
|
end
|
390
376
|
end
|
391
377
|
end
|
392
|
-
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: patchbay
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.1.
|
4
|
+
version: 0.0.1.pre5
|
5
5
|
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2014-10-15 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rack
|
16
|
-
requirement: &
|
16
|
+
requirement: &8445740 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,7 +21,7 @@ dependencies:
|
|
21
21
|
version: 1.3.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *8445740
|
25
25
|
description: ! "Patchbay is the web framework for non-web apps. \nIt's designed for
|
26
26
|
simplicity, minimalism, and easy integration.\n"
|
27
27
|
email: andrew@asquaredlabs.com
|
@@ -50,7 +50,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
50
50
|
version: 1.3.1
|
51
51
|
requirements: []
|
52
52
|
rubyforge_project:
|
53
|
-
rubygems_version: 1.8.
|
53
|
+
rubygems_version: 1.8.10
|
54
54
|
signing_key:
|
55
55
|
specification_version: 3
|
56
56
|
summary: Embed HTTP APIs in non-web apps easily
|