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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a347173be1eeb59ca8de5963a10e154945520b8602c323fdcae676e0b75b9b11
4
- data.tar.gz: a38019cb7033045ae4827198f6b06b21ba5faca8ed300de32666b7c7a9378490
3
+ metadata.gz: 0e68037c5c65e4329816ad44e6ae2ba6fcb4c1ce94b39b8b70dbf52e6b6167db
4
+ data.tar.gz: 7b523879a3d067b47c97a5c966676c4b8591d9f6f6b137c2f1ed2e68cdb17baf
5
5
  SHA512:
6
- metadata.gz: 5ea16963f22d89440ada573ed3e9c36e3955be8ad4f8dcdd4d9d4b14a8b2bbe75ec1eafc49c324e4c56184648ca7e10362d4163893f76b18f5b067552390ba08
7
- data.tar.gz: 0d7647d8a187304fca6b2ce0cb59ca31947da2bdaf1118e355a052b3bd006b28ec52056d534bf7e547faa53ba4cbff9bdcf59b3109b6a9b904a36a151cb552e8
6
+ metadata.gz: 81e9f7a1f7a2a1961ebd7181f943a9250538b50ae1fcdca70589ba9a99dc3841849a1203f4273bcbd6cefde98040a8a8d8db4e8cf46cb491f8af462cdbb7582f
7
+ data.tar.gz: 77bc067dc3f3a950ef5487003dd7fbcf544ec93678a4fb0516d2bd53d34110600414f25e3c5ac9ea2ec2246e22292d80f7156629eb4ac4562aee40807aadcf80
@@ -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(AGILIX_URL_BASE, query: modify_query(query), timeout: 60, headers: headers)
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(AGILIX_URL_BASE, body: modify_body(query), timeout: 60, headers: headers)
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 = AGILIX_URL_BASE
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 = AGILIX_URL_BASE + "?cmd=#{cmd}&_token=#{token}"
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
@@ -1,3 +1,3 @@
1
1
  module Agilix
2
- VERSION = "0.6.6"
2
+ VERSION = "0.6.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: agilix
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.6
4
+ version: 0.6.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Eggett