async-rest 0.8.0 → 0.8.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a3ccf5222149954ba21b9e57ec80f14752fdaa126e7c53ba152666557812dcbc
4
- data.tar.gz: a26d1cf50daa97e4ebc05b606b83273879dfd92e39d50190f3868153192e87ff
3
+ metadata.gz: '016926580e59e99301f924fae62c8f6261d17529bbf86958a40f738e7ed4981a'
4
+ data.tar.gz: bbaf2ae2a2419be45addbbfffd35a4c2798073268eff97ba8e2fab83da0f20aa
5
5
  SHA512:
6
- metadata.gz: dd34a5f9ca74d4992f272b788322785af7bb2dd7ebc33bf20cd80a1d1b39179325a121b5e658cea74cab8e90f03cc7e428d5f34e5e9be65cf7c7b2fe7300306b
7
- data.tar.gz: 4ae3d9d692e6e8136aacd801a0356e8181322ac66a6fe7110089eca61578c19ee74cae2ae60544ff0f3223795fc2307d0937839afe1487cd8b6720df7a9a4d5c
6
+ metadata.gz: 6fd749effe692063ebab519cd42fbd4df7bc8cb6b168e66d5e938ba0396337afc5fccf5fc206892e086976edaa5620c95114038aa124c65de6b5afcf59f485d9
7
+ data.tar.gz: fbce09f4608610d801853acf810c2e6452d8c49d0785b1876480bae46293b61119222bf32e89f590e37429541c150b71d06695763ad14c2a839cb339f82da9c3
@@ -4,7 +4,6 @@ cache: bundler
4
4
 
5
5
  matrix:
6
6
  include:
7
- - rvm: 2.3
8
7
  - rvm: 2.4
9
8
  - rvm: 2.5
10
9
  - rvm: 2.6
data/README.md CHANGED
@@ -41,7 +41,7 @@ This simple example shows how to use a custom representation to access DNS over
41
41
 
42
42
  ```ruby
43
43
  require 'async/http/server'
44
- require 'async/http/url_endpoint'
44
+ require 'async/http/endpoint'
45
45
 
46
46
  require 'async/rest/resource'
47
47
  require 'async/rest/representation'
@@ -16,7 +16,7 @@ Gem::Specification.new do |spec|
16
16
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
17
17
  spec.require_paths = ["lib"]
18
18
 
19
- spec.add_dependency "async-http", "~> 0.39"
19
+ spec.add_dependency "async-http", "~> 0.41"
20
20
 
21
21
  spec.add_development_dependency "async-rspec", "~> 1.1"
22
22
 
@@ -65,7 +65,7 @@ module Async
65
65
  @wrapper.process_response(request, response)
66
66
  end
67
67
 
68
- HTTP::VERBS.each do |verb|
68
+ ::Protocol::HTTP::Methods.each do |name, verb|
69
69
  # TODO when Ruby 3.0 lands, convert this to |payload = nil, **parameters|
70
70
  # Blocked by https://bugs.ruby-lang.org/issues/14183
71
71
  define_method(verb.downcase) do |payload = nil|
@@ -20,18 +20,19 @@
20
20
 
21
21
  require 'async'
22
22
  require 'async/http/client'
23
- require 'async/http/accept_encoding'
24
- require 'async/http/reference'
25
- require 'async/http/url_endpoint'
23
+ require 'async/http/endpoint'
24
+
25
+ require 'protocol/http/accept_encoding'
26
+ require 'protocol/http/reference'
26
27
 
27
28
  module Async
28
29
  module REST
29
30
  # The key abstraction of information in REST is a resource. Any information that can be named can be a resource: a document or image, a temporal service (e.g. "today's weather in Los Angeles"), a collection of other resources, a non-virtual object (e.g. a person), and so on. In other words, any concept that might be the target of an author's hypertext reference must fit within the definition of a resource. A resource is a conceptual mapping to a set of entities, not the entity that corresponds to the mapping at any particular point in time.
30
- class Resource < HTTP::Middleware
31
+ class Resource < ::Protocol::HTTP::Middleware
31
32
  # @param delegate [Async::HTTP::Middleware] the delegate that will handle requests.
32
33
  # @param reference [Async::HTTP::Reference] the resource identifier (base request path/parameters).
33
- # @param headers [Async::HTTP::Headers] the default headers that will be supplied with the request.
34
- def initialize(delegate, reference = HTTP::Reference.parse, headers = HTTP::Headers.new)
34
+ # @param headers [::Protocol::HTTP::Headers] the default headers that will be supplied with the request.
35
+ def initialize(delegate, reference = ::Protocol::HTTP::Reference.parse, headers = ::Protocol::HTTP::Headers.new)
35
36
  super(delegate)
36
37
 
37
38
  @reference = reference
@@ -39,12 +40,12 @@ module Async
39
40
  end
40
41
 
41
42
  def self.connect(url)
42
- endpoint = HTTP::URLEndpoint.parse(url)
43
+ endpoint = HTTP::Endpoint.parse(url)
43
44
 
44
- reference = HTTP::Reference.parse(endpoint.path)
45
+ reference = ::Protocol::HTTP::Reference.parse(endpoint.path)
45
46
 
46
47
  # return HTTP::Client.new(endpoint), reference
47
- return HTTP::AcceptEncoding.new(HTTP::Client.new(endpoint)), reference
48
+ return ::Protocol::HTTP::AcceptEncoding.new(HTTP::Client.new(endpoint)), reference
48
49
  end
49
50
 
50
51
  def self.for(url, *args)
@@ -91,7 +92,7 @@ module Async
91
92
  body = nil
92
93
  end
93
94
 
94
- return HTTP::Request[verb, @reference, headers, body]
95
+ return ::Protocol::HTTP::Request[verb, @reference, headers, body]
95
96
  end
96
97
 
97
98
  def inspect
@@ -20,6 +20,6 @@
20
20
 
21
21
  module Async
22
22
  module REST
23
- VERSION = "0.8.0"
23
+ VERSION = "0.8.1"
24
24
  end
25
25
  end
@@ -20,8 +20,8 @@
20
20
 
21
21
  require 'json'
22
22
 
23
- require 'async/http/body/wrapper'
24
- require 'async/http/body/buffered'
23
+ require 'protocol/http/body/wrapper'
24
+ require 'protocol/http/body/buffered'
25
25
 
26
26
  module Async
27
27
  module REST
@@ -20,8 +20,8 @@
20
20
 
21
21
  require 'json'
22
22
 
23
- require 'async/http/body/wrapper'
24
- require 'async/http/body/buffered'
23
+ require 'protocol/http/body/wrapper'
24
+ require 'protocol/http/body/buffered'
25
25
 
26
26
  module Async
27
27
  module REST
@@ -45,7 +45,7 @@ module Async
45
45
  if payload
46
46
  headers['content-type'] = @content_type
47
47
 
48
- HTTP::Body::Buffered.new([
48
+ ::Protocol::HTTP::Body::Buffered.new([
49
49
  ::Protocol::HTTP::URL.encode(payload)
50
50
  ])
51
51
  end
@@ -65,7 +65,7 @@ module Async
65
65
  return response
66
66
  end
67
67
 
68
- class Parser < HTTP::Body::Wrapper
68
+ class Parser < ::Protocol::HTTP::Body::Wrapper
69
69
  def join
70
70
  ::Protocol::HTTP::URL.decode(super, symbolize_keys: true)
71
71
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: async-rest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-08 00:00:00.000000000 Z
11
+ date: 2019-05-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: async-http
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.39'
19
+ version: '0.41'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0.39'
26
+ version: '0.41'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: async-rspec
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -134,7 +134,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
134
134
  - !ruby/object:Gem::Version
135
135
  version: '0'
136
136
  requirements: []
137
- rubygems_version: 3.0.3
137
+ rubygems_version: 3.0.2
138
138
  signing_key:
139
139
  specification_version: 4
140
140
  summary: A library for RESTful clients (and hopefully servers).