vauchar_api 0.3.6 → 0.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ef5344252655b2334b4981304e381132007cccf68f231f1729d8afd9ed3b7b54
4
- data.tar.gz: 7da3bfdb2979b0b8c7fb88af067b1bc878b74823a3b9b3c8df0d2061f0c22148
3
+ metadata.gz: 30da9c5066f24123eb1076ea4aabb6cf1d058349280d8048cce128b5c4616123
4
+ data.tar.gz: 1496f5669c037d7e9810b7a4f5d10600faa64f75fe7e2c75bd4911805963e0a4
5
5
  SHA512:
6
- metadata.gz: ecdc3a371237d3ec666be312e25c5b289e3a0b25a50c4e7ab206e0adbeb3ab66fd9d353939d18141803705631035be0c64d6022ec1532ec8d648fc8c71deaf99
7
- data.tar.gz: e65ff4d1703f0f91c07a31d77e36da8dbce9b8cb8ed3a57031067094781415b06029c4b02431bb36ef29962d8267e31ac2532a3a78f7b5f011cf7d193aacf264
6
+ metadata.gz: 76df041b6d0ee69f76d16fb353dde09345424c36740ec3a9cd9e89abe22c4f9d9f9724cd390814a0d614d4ab6d9961e98e5c2b45578159272b3b86eddcd6665f
7
+ data.tar.gz: 5e452c34b2f57f6693c9ff7160384bdff7a2bb896e3a73523d2989c80fe017a14e25897ce1afa32f632f2c08906c92907222eb1d6982948baed560bfc31c53b5
@@ -1,24 +1,11 @@
1
1
  require "httparty"
2
2
  require "vauchar_api/connection"
3
3
 
4
- p "module ActiveResource"
5
-
6
4
  module ActiveResource
7
5
  class Connection
8
6
  attr_reader :response
9
7
 
10
8
  prepend VaucharAPI::Connection::ResponseCapture
11
9
  prepend VaucharAPI::Connection::RequestNotification
12
-
13
- p "module ActiveResource -> Connection"
14
-
15
- def delete_with_body(path, body = "", headers = {})
16
- with_auth do
17
- HTTParty.delete("#{site.scheme}://#{site.host}:#{site.port}#{path}", {
18
- headers: build_request_headers(headers, :delete, self.site.merge(path)),
19
- body: body,
20
- })
21
- end
22
- end
23
10
  end
24
- end
11
+ end
data/lib/vauchar_api.rb CHANGED
@@ -3,7 +3,6 @@ require "active_resource/formats_ext"
3
3
 
4
4
  require "vauchar_api/configuration"
5
5
  require "vauchar_api/version"
6
- p "require vauchar_api/version"
7
6
 
8
7
  module VaucharAPI
9
8
  def self.config
@@ -14,17 +13,15 @@ end
14
13
  require "vauchar_api/resources"
15
14
  require "vauchar_api/connection"
16
15
 
17
- require "active_resource/connection_ext"
18
- p "require active_resource/connection_ext"
19
-
20
- t = VaucharAPI::Connection.new("https://api.vauchar.com", {})
21
- p t.methods
22
- p t.methods.grep(/delete/)
23
-
24
- require "active_resource/custom_methods_ext"
25
-
26
16
  p "VaucharAPI::Base.respond_to?(:connection_class)"
27
17
  p VaucharAPI::Base.respond_to?(:connection_class)
28
18
 
29
- VaucharAPI::Base.connection_class = VaucharAPI::Connection
30
- p "VaucharAPI::Base.connection_class = VaucharAPI::Connection"
19
+ if VaucharAPI::Base.respond_to?(:connection_class)
20
+ VaucharAPI::Base.connection_class = VaucharAPI::Connection
21
+ else
22
+ require 'active_resource/connection_ext'
23
+ end
24
+
25
+ t = VaucharAPI::Connection.new("https://api.vauchar.com", {})
26
+ p t.methods
27
+ p t.methods.grep(/delete/)
@@ -2,6 +2,15 @@ module VaucharAPI
2
2
  class Connection < ActiveResource::Connection
3
3
  attr_reader :response
4
4
 
5
+ def delete_with_body(path, body = "", headers = {})
6
+ with_auth do
7
+ HTTParty.delete("#{site.scheme}://#{site.host}:#{site.port}#{path}", {
8
+ headers: build_request_headers(headers, :delete, self.site.merge(path)),
9
+ body: body,
10
+ })
11
+ end
12
+ end
13
+
5
14
  module ResponseCapture
6
15
  def handle_response(response)
7
16
  @response = super
@@ -1,3 +1,3 @@
1
1
  module VaucharAPI
2
- VERSION = "0.3.6"
2
+ VERSION = "0.3.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vauchar_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.6
4
+ version: 0.3.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Max