Skip to content

Commit

Permalink
Add second argument to #respond_to? call to fix mounting in 2.0.0. Cl…
Browse files Browse the repository at this point in the history
…oses #351
  • Loading branch information
mbleigh committed Feb 25, 2013
1 parent a51a074 commit e83f8bf
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ pkg
.yardoc/*
dist
Gemfile.lock
tmp

## Rubinius
.rbx
Expand Down
2 changes: 1 addition & 1 deletion lib/grape/api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ def http_digest(options = {}, &block)
def mount(mounts)
mounts = { mounts => '/' } unless mounts.respond_to?(:each_pair)
mounts.each_pair do |app, path|
if app.respond_to?(:inherit_settings)
if app.respond_to?(:inherit_settings, true)
app_settings = settings.clone
mount_path = Rack::Mount::Utils.normalize_path([ settings[:mount_path], path ].compact.join("/"))
app_settings.set :mount_path, mount_path
Expand Down
1 change: 1 addition & 0 deletions spec/grape/api_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1535,6 +1535,7 @@ def self.call(object, env)

mount app
end

get '/v1/cool/awesome'
last_response.body.should == 'yo'
end
Expand Down

0 comments on commit e83f8bf

Please sign in to comment.