apis 0.5.0.pre1 → 0.5.1.pre1

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,21 +4,21 @@ module Apis
4
4
  module Adapter
5
5
  class NetHTTP
6
6
  def call(env)
7
- env[:url].path = '/' if env[:url].path.empty?
8
- http = Net::HTTP.new(env[:url].host, env[:url].port)
7
+ env[:uri].path = '/' if env[:uri].path.empty?
8
+ http = Net::HTTP.new(env[:uri].host, env[:uri].port)
9
9
  query = Addressable::URI.new
10
10
  query.query_values = env[:params]
11
11
  response = case env[:method]
12
12
  when :GET
13
- http.get([env[:url].path, query.query].compact.join('?'), env[:headers])
13
+ http.get([env[:uri].path, query.query].compact.join('?'), env[:headers])
14
14
  when :HEAD
15
- http.head([env[:url].path, query.query].compact.join('?'), env[:headers])
15
+ http.head([env[:uri].path, query.query].compact.join('?'), env[:headers])
16
16
  when :POST
17
- http.post(env[:url].path, query.query, env[:headers])
17
+ http.post(env[:uri].path, query.query, env[:headers])
18
18
  when :PUT
19
- http.put(env[:url].path, query.query, env[:headers])
19
+ http.put(env[:uri].path, query.query, env[:headers])
20
20
  when :DELETE
21
- http.delete([env[:url].path, query.query].compact.join('?'), env[:headers])
21
+ http.delete([env[:uri].path, query.query].compact.join('?'), env[:headers])
22
22
  end
23
23
 
24
24
  [response.code.to_i, response, response.body]
data/lib/apis/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Apis
2
- VERSION = "0.5.0.pre1"
2
+ VERSION = "0.5.1.pre1"
3
3
  end
data/lib/apis.rb CHANGED
@@ -3,7 +3,7 @@ $: << lib_dir unless $:.include?(lib_dir = File.expand_path('..', __FILE__))
3
3
  require 'addressable/uri'
4
4
 
5
5
  module Apis
6
- class DuplicateMiddleware < StandardError; end
6
+
7
7
  autoload :Connection, 'apis/connection'
8
8
  autoload :Builder, 'apis/builder'
9
9
 
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: apis
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease: 6
5
- version: 0.5.0.pre1
5
+ version: 0.5.1.pre1
6
6
  platform: ruby
7
7
  authors:
8
8
  - "Marjan Krekoten' (\xD0\x9C\xD0\xB0\xD1\x80'\xD1\x8F\xD0\xBD \xD0\x9A\xD1\x80\xD0\xB5\xD0\xBA\xD0\xBE\xD1\x82\xD0\xB5\xD0\xBD\xD1\x8C)"
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-04-11 00:00:00 Z
13
+ date: 2011-04-12 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rspec