arii 1.5 → 1.6

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
  SHA1:
3
- metadata.gz: 0aeddaad7f72f8ae830b47255985541799513c79
4
- data.tar.gz: 622c5fc983028b63dea20b020b66dbe903bb12eb
3
+ metadata.gz: 194ecd1fa2cf00cdee0bd568f4fa2a281c2667c4
4
+ data.tar.gz: 0e269c4c5f515efe8dd94ad2e40efc6235c523f5
5
5
  SHA512:
6
- metadata.gz: 482d917d1166424bc35e9093b6cb881da7de9e9050e27ae44791238a7c9820053ff1984d24cc17cd80ed07ae89c3bd93b31b6f9c609b52498bef4c23fcb744a5
7
- data.tar.gz: 7b88b6b0626c160f7f7eb50ba335a4523ff8109b096e0f263d23f8d7dc3724ece018a17803503620443813aa2b017eee85079fe9b7c99608782f3f93e7747a4c
6
+ metadata.gz: 2995959f9093ae662454a8be963b698f990abebeb4eac2af4d390c1c18e6e7af05a70a01114457e5a603bde198ca9f2a9673e66920be87685e771ea7c8145d59
7
+ data.tar.gz: ebe95cc058aace1a96cfcc67a3f6b95093a1d3c74cf46d41219ce4b7431edae90119045e90e88e860dd2f1358ec2dfe3d1e2a3d2a96668bb008d1e764c9c270e
data/lib/arii/agent.rb CHANGED
@@ -27,41 +27,41 @@ module ARII
27
27
  @checkup = {}
28
28
 
29
29
  case @publisher
30
- when 'sql'
31
- begin
32
- @d = ARII::SQLDetector.new(self)
33
- rescue Exception => e
34
- @response = {:status => 400, :error => e}
35
- ARII::Config.log.error(self.class.name) { "#{e}" }
36
- end
37
- when 'csv'
38
- begin
39
- @d = ARII::CSVDetector.new(self)
40
- rescue Exception => e
41
- @response = {:status => 400, :error => e}
42
- ARII::Config.log.error(self.class.name) { "#{e}" }
43
- end
44
- when 'excel'
45
- begin
46
- @d = ARII::ExcelDetector.new(self)
47
- rescue Exception => e
48
- @response = {:status => 400, :error => e}
49
- ARII::Config.log.error(self.class.name) { "#{e}" }
50
- end
51
- when 'xml'
52
- begin
53
- @d = ARII::XMLDetector.new(self)
54
- rescue Exception => e
55
- @response = {:status => 400, :error => e}
56
- ARII::Config.log.error(self.class.name) { "#{e}" }
57
- end
58
- when 'json'
59
- begin
60
- @d = ARII::JSONDetector.new(self)
61
- rescue Exception => e
62
- @response = {:status => 400, :error => e}
63
- ARII::Config.log.error(self.class.name) { "#{e}" }
64
- end
30
+ when 'sql'
31
+ begin
32
+ @d = ARII::SQLDetector.new(self)
33
+ rescue Exception => e
34
+ @response = {:status => 400, :error => e}
35
+ ARII::Config.log.error(self.class.name) { "#{e}" }
36
+ end
37
+ when 'csv'
38
+ begin
39
+ @d = ARII::CSVDetector.new(self)
40
+ rescue Exception => e
41
+ @response = {:status => 400, :error => e}
42
+ ARII::Config.log.error(self.class.name) { "#{e}" }
43
+ end
44
+ when 'excel'
45
+ begin
46
+ @d = ARII::ExcelDetector.new(self)
47
+ rescue Exception => e
48
+ @response = {:status => 400, :error => e}
49
+ ARII::Config.log.error(self.class.name) { "#{e}" }
50
+ end
51
+ when 'xml'
52
+ begin
53
+ @d = ARII::XMLDetector.new(self)
54
+ rescue Exception => e
55
+ @response = {:status => 400, :error => e}
56
+ ARII::Config.log.error(self.class.name) { "#{e}" }
57
+ end
58
+ when 'json'
59
+ begin
60
+ @d = ARII::JSONDetector.new(self)
61
+ rescue Exception => e
62
+ @response = {:status => 400, :error => e}
63
+ ARII::Config.log.error(self.class.name) { "#{e}" }
64
+ end
65
65
  end
66
66
 
67
67
 
@@ -106,12 +106,14 @@ module ARII
106
106
  ARII::Config.log.info(self.class.name) { "Delivering to #{template} template." }
107
107
  checkup[:payload].each do |payload|
108
108
  ARII::Config.log.debug(self.class.name) { "Processing #{payload}." }
109
- response = RestClient.post "#{ARII::Config.host}postman/deliver/#{template}.js", payload
109
+
110
+ response = RestClient::Request.execute(:method => 'post', :url => "#{ARII::Config.host}postman/deliver/#{template}.js", :payload => payload ,:verify_ssl => OpenSSL::SSL::VERIFY_NONE )
111
+
110
112
  case response.code
111
- when 200
112
- ARII::Config.log.debug(self.class.name) { "Delivered to #{template}." }
113
- else
114
- ARII::Config.log.warn(self.class.name) { "unable to deliver \"#{payload}\" to \"#{template}\"" }
113
+ when 200
114
+ ARII::Config.log.debug(self.class.name) { "Delivered to #{template}." }
115
+ else
116
+ ARII::Config.log.warn(self.class.name) { "unable to deliver \"#{payload}\" to \"#{template}\"" }
115
117
  end
116
118
  end
117
119
  end
data/lib/arii/cashier.rb CHANGED
@@ -17,8 +17,7 @@ module ARII
17
17
  def self.verify cache, agent, payload, seed
18
18
  #ARII::Config.log.info(self.class.name) {"Verifying\n\taccess token: #{ARII::Config.access_token}\n\thost: #{ARII::Config.host}\n\tcache: #{cache}\n\tagent: #{agent}\n\tpayload: #{payload}\n\tseed: #{seed}"}
19
19
  begin
20
- response = RestClient.post "#{ARII::Config.host}fluxcapacitor/verify.json", {:access_token => ARII::Config.access_token, :agent => agent[:identifier], :cache => cache, :payload => payload, :seed => seed}
21
-
20
+ response = RestClient::Request.execute(:method => 'post', :url => "#{ARII::Config.host}fluxcapacitor/verify.json", :payload => {:access_token => ARII::Config.access_token, :agent => agent[:identifier], :cache => cache, :payload => payload, :seed => seed} ,:verify_ssl => OpenSSL::SSL::VERIFY_NONE )
22
21
  rescue Exception => e
23
22
  ARII::Config.log.error(self.class.name) { "Cache verification error: #{e}\n#{e.backtrace}" }
24
23
  response = {:status => 400, :error => e}
@@ -26,4 +25,4 @@ module ARII
26
25
  response
27
26
  end
28
27
  end
29
- end
28
+ end
data/lib/arii/client.rb CHANGED
@@ -27,7 +27,8 @@ module ARII
27
27
  begin
28
28
  ARII::Config.log.info(self.class.name) { 'Launching validation.' }
29
29
 
30
- out = RestClient.post "#{ARII::Config.host}fluxcapacitor/validate_key.json", {:access_token => ARII::Config.access_token}
30
+ out = RestClient::Request.execute(:method => 'post', :url => "#{ARII::Config.host}fluxcapacitor/validate_key.json", :payload => {:access_token => ARII::Config.access_token} ,:verify_ssl => OpenSSL::SSL::VERIFY_NONE )
31
+
31
32
  response = {:status => 100, :response => out.to_str}
32
33
  rescue Exception => e
33
34
  ARII::Config.log.error(self.class.name) { "Failed validation: #{e}" }
@@ -50,4 +51,4 @@ module ARII
50
51
  end
51
52
  end
52
53
  end
53
- end
54
+ end
data/lib/arii/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module ARII
2
- VERSION = "1.5"
2
+ VERSION = "1.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arii
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.5'
4
+ version: '1.6'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pedro Lopes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-10 00:00:00.000000000 Z
11
+ date: 2015-04-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -162,7 +162,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
162
162
  version: '0'
163
163
  requirements: []
164
164
  rubyforge_project:
165
- rubygems_version: 2.4.5
165
+ rubygems_version: 2.4.6
166
166
  signing_key:
167
167
  specification_version: 4
168
168
  summary: arii client library for distributed agents.