arii 1.5 → 1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/arii/agent.rb +42 -40
- data/lib/arii/cashier.rb +2 -3
- data/lib/arii/client.rb +3 -2
- data/lib/arii/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 194ecd1fa2cf00cdee0bd568f4fa2a281c2667c4
|
4
|
+
data.tar.gz: 0e269c4c5f515efe8dd94ad2e40efc6235c523f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
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
|
-
|
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
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
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
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.
|
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-
|
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.
|
165
|
+
rubygems_version: 2.4.6
|
166
166
|
signing_key:
|
167
167
|
specification_version: 4
|
168
168
|
summary: arii client library for distributed agents.
|