Skip to content

Commit 02d7329

Browse files
committed
Merge branch 'hotfix-0.9.1'
2 parents 4ca41d0 + 92965dc commit 02d7329

File tree

6 files changed

+24
-6
lines changed

6 files changed

+24
-6
lines changed

CHANGELOG.rdoc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
== 0.9.1 / 2012-09-18
2+
3+
* Bug fixes
4+
5+
* Allow opts to be passed to Server.with_routes
6+
17
== 0.9.0 / 2012-08-22
28

39
* Minor enhancements

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
jimson (0.8.0)
4+
jimson (0.9.0)
55
blankslate (>= 2.1.2.3)
66
multi_json (~> 1.1.0)
77
rack (>= 1.3)

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.9.0
1+
0.9.1

jimson.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
spec = Gem::Specification.new do |s|
22
s.name = "jimson"
3-
s.version = "0.9.0"
3+
s.version = "0.9.1"
44
s.author = "Chris Kite"
55
s.homepage = "http://www.github.com/chriskite/jimson"
66
s.platform = Gem::Platform::RUBY

lib/jimson/server.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ def isAlive
2727

2828
JSON_RPC_VERSION = '2.0'
2929

30-
attr_accessor :router, :host, :port, :opts
30+
attr_accessor :router, :host, :port, :show_errors, :opts
3131

3232
#
3333
# Create a Server with routes defined
3434
#
35-
def self.with_routes(&block)
35+
def self.with_routes(opts = {}, &block)
3636
router = Router.new
3737
router.send(:draw, &block)
38-
self.new(router)
38+
self.new(router, opts)
3939
end
4040

4141
#
@@ -45,6 +45,7 @@ def self.with_routes(&block)
4545
# * :host - the hostname or ip to bind to
4646
# * :port - the port to listen on
4747
# * :server - the rack handler to use, e.g. 'webrick' or 'thin'
48+
# * :show_errors - true or false, send backtraces in error responses?
4849
#
4950
# Remaining options are forwarded to the underlying Rack server.
5051
#

spec/server_spec.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,17 @@ def post_json(hash)
450450
'id' => 1
451451
}
452452
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
453464
end
454465
end
455466
end

0 commit comments

Comments
 (0)