agilix 0.6.6 → 0.6.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/agilix/buzz/api.rb +12 -6
- data/lib/agilix/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: 0e68037c5c65e4329816ad44e6ae2ba6fcb4c1ce94b39b8b70dbf52e6b6167db
|
4
|
+
data.tar.gz: 7b523879a3d067b47c97a5c966676c4b8591d9f6f6b137c2f1ed2e68cdb17baf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 81e9f7a1f7a2a1961ebd7181f943a9250538b50ae1fcdca70589ba9a99dc3841849a1203f4273bcbd6cefde98040a8a8d8db4e8cf46cb491f8af462cdbb7582f
|
7
|
+
data.tar.gz: 77bc067dc3f3a950ef5487003dd7fbcf544ec93678a4fb0516d2bd53d34110600414f25e3c5ac9ea2ec2246e22292d80f7156629eb4ac4562aee40807aadcf80
|
data/lib/agilix/buzz/api.rb
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
module Agilix
|
2
2
|
module Buzz
|
3
3
|
class Api
|
4
|
-
AGILIX_URL_ENDPOINT = ENV.fetch("AGILIX_BUZZ_URL", "https://api.agilixbuzz.com")
|
5
|
-
AGILIX_URL_BASE = "#{AGILIX_URL_ENDPOINT}/cmd"
|
6
4
|
include HTTParty
|
7
5
|
|
8
6
|
include Agilix::Buzz::Commands::Authentication
|
@@ -46,11 +44,11 @@ module Agilix
|
|
46
44
|
end
|
47
45
|
|
48
46
|
def get(query = {})
|
49
|
-
response = self.class.get(
|
47
|
+
response = self.class.get(agilix_url_base, query: modify_query(query), timeout: 60, headers: headers)
|
50
48
|
end
|
51
49
|
|
52
50
|
def post(query = {})
|
53
|
-
response = self.class.post(
|
51
|
+
response = self.class.post(agilix_url_base, body: modify_body(query), timeout: 60, headers: headers)
|
54
52
|
end
|
55
53
|
|
56
54
|
# Not sure if I want to use this yet
|
@@ -72,7 +70,7 @@ module Agilix
|
|
72
70
|
|
73
71
|
# For when the api is super unconventional & you need to modify both query params & body params in a custom fashion, and upload a file even!
|
74
72
|
def query_post(query = {})
|
75
|
-
url =
|
73
|
+
url = agilix_url_base
|
76
74
|
query_params = query.delete(:query_params)
|
77
75
|
if query_params
|
78
76
|
url += "?&_token=#{token}" + query_params.map {|k,v| "&#{k}=#{v}" }.join("")
|
@@ -89,7 +87,7 @@ module Agilix
|
|
89
87
|
|
90
88
|
def bulk_post(query = {})
|
91
89
|
cmd = query.delete(:cmd)
|
92
|
-
url =
|
90
|
+
url = agilix_url_base + "?cmd=#{cmd}&_token=#{token}"
|
93
91
|
query_params = query.delete(:query_params)
|
94
92
|
if query_params
|
95
93
|
url += query_params.map {|k,v| "&#{k}=#{v}" }.join("")
|
@@ -162,6 +160,14 @@ module Agilix
|
|
162
160
|
ENV["AGILIX_BUZZ_DEFAULT_DOMAIN"]
|
163
161
|
end
|
164
162
|
|
163
|
+
def agilix_url_endpoint
|
164
|
+
@agilix_url_endpoint ||= ENV.fetch("AGILIX_BUZZ_URL", "https://api.agilixbuzz.com")
|
165
|
+
end
|
166
|
+
|
167
|
+
def agilix_url_base
|
168
|
+
@agilix_url_base ||= "#{agilix_url_endpoint}/cmd"
|
169
|
+
end
|
170
|
+
|
165
171
|
end
|
166
172
|
end
|
167
173
|
end
|
data/lib/agilix/version.rb
CHANGED