Skip to content

Commit

Permalink
fixed Patron hack in case the library is not available
Browse files Browse the repository at this point in the history
  • Loading branch information
mislav committed May 13, 2011
1 parent 9fc7d7e commit 4a9405d
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions lib/faraday/adapter/patron.rb
Expand Up @@ -22,12 +22,15 @@ def call(env)

@app.call env
end
end

# HAX: helps but doesn't work completely
# https://github.com/toland/patron/issues/34
valid_actions = ::Patron::Request::VALID_ACTIONS
valid_actions << :patch unless valid_actions.include? :patch
valid_actions << :options unless valid_actions.include? :options
if loaded? && defined?(::Patron::Request::VALID_ACTIONS)
# HAX: helps but doesn't work completely
# https://github.com/toland/patron/issues/34
::Patron::Request::VALID_ACTIONS.tap do |actions|
actions << :patch unless actions.include? :patch
actions << :options unless actions.include? :options
end
end
end
end
end

0 comments on commit 4a9405d

Please sign in to comment.