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 +4 -4
- data/lib/active_resource/connection_ext.rb +1 -14
- data/lib/vauchar_api.rb +9 -12
- data/lib/vauchar_api/connection.rb +9 -0
- data/lib/vauchar_api/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 30da9c5066f24123eb1076ea4aabb6cf1d058349280d8048cce128b5c4616123
|
4
|
+
data.tar.gz: 1496f5669c037d7e9810b7a4f5d10600faa64f75fe7e2c75bd4911805963e0a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
30
|
-
|
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
|
data/lib/vauchar_api/version.rb
CHANGED