jimson 0.9.0 → 0.9.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/CHANGELOG.rdoc +6 -0
- data/VERSION +1 -1
- data/lib/jimson/server.rb +4 -3
- data/spec/server_spec.rb +11 -0
- metadata +2 -2
data/CHANGELOG.rdoc
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.9.
|
1
|
+
0.9.1
|
data/lib/jimson/server.rb
CHANGED
@@ -27,15 +27,15 @@ module Jimson
|
|
27
27
|
|
28
28
|
JSON_RPC_VERSION = '2.0'
|
29
29
|
|
30
|
-
attr_accessor :router, :host, :port, :opts
|
30
|
+
attr_accessor :router, :host, :port, :show_errors, :opts
|
31
31
|
|
32
32
|
#
|
33
33
|
# Create a Server with routes defined
|
34
34
|
#
|
35
|
-
def self.with_routes(&block)
|
35
|
+
def self.with_routes(opts = {}, &block)
|
36
36
|
router = Router.new
|
37
37
|
router.send(:draw, &block)
|
38
|
-
self.new(router)
|
38
|
+
self.new(router, opts)
|
39
39
|
end
|
40
40
|
|
41
41
|
#
|
@@ -45,6 +45,7 @@ module Jimson
|
|
45
45
|
# * :host - the hostname or ip to bind to
|
46
46
|
# * :port - the port to listen on
|
47
47
|
# * :server - the rack handler to use, e.g. 'webrick' or 'thin'
|
48
|
+
# * :show_errors - true or false, send backtraces in error responses?
|
48
49
|
#
|
49
50
|
# Remaining options are forwarded to the underlying Rack server.
|
50
51
|
#
|
data/spec/server_spec.rb
CHANGED
@@ -450,6 +450,17 @@ module Jimson
|
|
450
450
|
'id' => 1
|
451
451
|
}
|
452
452
|
end
|
453
|
+
|
454
|
+
context "when opts are given" do
|
455
|
+
it "passes the opts to the new server" do
|
456
|
+
app = Server.with_routes(:show_errors => true) do
|
457
|
+
root TestHandler.new
|
458
|
+
namespace 'foo', OtherHandler.new
|
459
|
+
end
|
460
|
+
|
461
|
+
app.show_errors.should be_true
|
462
|
+
end
|
463
|
+
end
|
453
464
|
end
|
454
465
|
end
|
455
466
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jimson
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-09-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: blankslate
|