lib/pocket/connection.rb in pocket-ruby-andyw8-0.0.7 vs lib/pocket/connection.rb in pocket-ruby-andyw8-0.0.8
- old
+ new
@@ -1,27 +1,27 @@
-require 'faraday_middleware'
-Dir[File.expand_path('../../faraday/*.rb', __FILE__)].each{|f| require f}
+require "faraday_middleware"
+Dir[File.expand_path("../../faraday/*.rb", __FILE__)].sort.each { |f| require f }
module Pocket
# @private
module Connection
private
- def connection(raw=false)
+ def connection(raw = false)
options = {
- :headers => {'User-Agent' => user_agent},
- :proxy => proxy,
- :ssl => {:verify => false},
- :url => endpoint,
+ headers: {"User-Agent" => user_agent},
+ proxy: proxy,
+ ssl: {verify: false},
+ url: endpoint
}
Faraday::Connection.new(options) do |conn|
conn.use FaradayMiddleware::PocketOAuth, consumer_key, access_token
conn.use Faraday::Response::RaisePocketError
conn.request :json
- conn.response :json, :content_type => /\bjson$/
+ conn.response :json, content_type: /\bjson$/
conn.adapter Faraday.default_adapter
end
end
end