agilix 0.6.0 → 0.6.5

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: 81a67f3ba0539b370407f94da49a5fbdea63c2ac45c5fffb3a69c4cb9208ca0e
4
- data.tar.gz: 4d64c6cccca91106f9cbaa00bca53a1f84aefef256da03d2c14fc2f0fb3c2040
3
+ metadata.gz: 2574c48446db7d43f059d8600854fadc55481506e7fa8a1d2e67c7e5953c7245
4
+ data.tar.gz: fdde5ae592e333d8f29ee42416a6c8f16be8fbd1162044216a9b2442905d8625
5
5
  SHA512:
6
- metadata.gz: aca52f340f374f9c5a44fb8cefcc578079262046dc3c7ae9e770640a3cbec1ffd20c881bbe42d7a1c9a52f90779f3843239ccff27254e06ad699d73e6f3fc88e
7
- data.tar.gz: 10ab8c6c4b7bc330d27191f9c425bdac78af13ff52da05d4a91bc21382cb9f4ada27b537933fc3a4b8643898aff884d38296181e0e03cfc3b0902dbd2a895eed
6
+ metadata.gz: 3546e5be858cc58b1b3d6d590a0886cda9848942b8cd605427b0ce40babb3b06cb38acf9acc831ca39bd8ed615b94b7414af54805b1fe49497390975bab632e7
7
+ data.tar.gz: 82621e6b177da329f00f6379c48eec1fad9143cd6acd64b246ff216b02c676543ceb3cdd91008f5c4d7798b8843d5dc41a2fd0536417025e78abbd81fb20047b
@@ -1,8 +1,8 @@
1
1
  module Agilix
2
2
  module Buzz
3
3
  class Api
4
- URL_ENDPOINT = ENV.fetch("AGILIX_BUZZ_URL", "https://api.schooldigger.com")
5
- URL_BASE = "#{URL_ENDPOINT}/cmd"
4
+ AGILIX_URL_ENDPOINT = ENV.fetch("AGILIX_BUZZ_URL", "https://api.schooldigger.com")
5
+ AGILIX_URL_BASE = "#{AGILIX_URL_ENDPOINT}/cmd"
6
6
  include HTTParty
7
7
 
8
8
  include Agilix::Buzz::Commands::Authentication
@@ -46,33 +46,33 @@ module Agilix
46
46
  end
47
47
 
48
48
  def get(query = {})
49
- response = self.class.get(URL_BASE, query: modify_query(query), timeout: 60, headers: headers)
49
+ response = self.class.get(AGILIX_URL_BASE, query: modify_query(query), timeout: 60, headers: headers)
50
50
  end
51
51
 
52
52
  def post(query = {})
53
- response = self.class.post(URL_BASE, body: modify_body(query), timeout: 60, headers: headers)
53
+ response = self.class.post(AGILIX_URL_BASE, body: modify_body(query), timeout: 60, headers: headers)
54
54
  end
55
55
 
56
56
  # Not sure if I want to use this yet
57
57
  # api.response_parser response: response, path_to_parse: ['response', 'users', 'user'], collection_name: 'users'
58
- def response_parser(path_to_parse: nil, collection_name: nil, response: )
59
- if path_to_parse
60
- result = response.dig(*path_to_parse)
61
- ostruct = JSON::parse({collection_name => result}.to_json, object_class: OpenStruct)
62
- ostruct.result_count = result.size
63
- ostruct.collection_name = collection_name
64
- else
65
- ostruct = JSON::parse(response.body, object_class: OpenStruct)
66
- end
67
- ostruct.code = response['code']
68
- ostruct.response = response
69
- ostruct.request = request
70
- ostruct
71
- end
58
+ # def response_parser(path_to_parse: nil, collection_name: nil, response: )
59
+ # if path_to_parse
60
+ # result = response.dig(*path_to_parse)
61
+ # ostruct = JSON::parse({collection_name => result}.to_json, object_class: OpenStruct)
62
+ # ostruct.result_count = result.size
63
+ # ostruct.collection_name = collection_name
64
+ # else
65
+ # ostruct = JSON::parse(response.body, object_class: OpenStruct)
66
+ # end
67
+ # ostruct.code = response['code']
68
+ # ostruct.response = response
69
+ # ostruct.request = request
70
+ # ostruct
71
+ # end
72
72
 
73
73
  # 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
74
  def query_post(query = {})
75
- url = URL_BASE
75
+ url = AGILIX_URL_BASE
76
76
  query_params = query.delete(:query_params)
77
77
  if query_params
78
78
  url += "?&_token=#{token}" + query_params.map {|k,v| "&#{k}=#{v}" }.join("")
@@ -89,7 +89,7 @@ module Agilix
89
89
 
90
90
  def bulk_post(query = {})
91
91
  cmd = query.delete(:cmd)
92
- url = URL_BASE + "?cmd=#{cmd}&_token=#{token}"
92
+ url = AGILIX_URL_BASE + "?cmd=#{cmd}&_token=#{token}"
93
93
  query_params = query.delete(:query_params)
94
94
  if query_params
95
95
  url += query_params.map {|k,v| "&#{k}=#{v}" }.join("")
@@ -1,3 +1,3 @@
1
1
  module Agilix
2
- VERSION = "0.6.0"
2
+ VERSION = "0.6.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: agilix
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Eggett
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-04-08 00:00:00.000000000 Z
11
+ date: 2019-04-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -216,8 +216,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
216
216
  - !ruby/object:Gem::Version
217
217
  version: '0'
218
218
  requirements: []
219
- rubyforge_project:
220
- rubygems_version: 2.7.8
219
+ rubygems_version: 3.0.3
221
220
  signing_key:
222
221
  specification_version: 4
223
222
  summary: Agilix Buzz API wrapper