arii 1.1 → 1.2.1

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
  SHA1:
3
- metadata.gz: 057ae00a6822650e3c7e280caf80938d00b7a46d
4
- data.tar.gz: cb60035b6c4258fb7586bda1f45061e2c75b94ee
3
+ metadata.gz: 46bd94c23d38c60e86cb59d895a3a055f5156542
4
+ data.tar.gz: f0ee9fc3475dc2a63bbcd6f2389302650936c2d0
5
5
  SHA512:
6
- metadata.gz: b55598ffe786b89c419f8801bd141905608c61132c5df60c0a655eba7e708fe7b221d0dc563b8c8cefea16ea5bb48d5be88b41860203e109d3389e58ad0af7e7
7
- data.tar.gz: 30e7edca8cd4c3712bcaf24ef77fe82e78ebbba72bff2c721fb2354a2602edbac29a50845d770b1a21347634bbda1e30c476758150c07ec1c10effb4aa744318
6
+ metadata.gz: 7ad68f3de32c472f75c6e69404e738c1c90a83891bb5d5665dfdb08fa5b3153a41e8e586eda1a15088733f573f3ef9b26b1b9e437fbe5421d0a52fae29f08c6a
7
+ data.tar.gz: b50c8411dc3f10c15833a846a7cbb0aae3ec1f4a568ab61c2fcbe33b92a1afc9ab099e19978d78279e6027b8c75d10977843a6fd63419fbfb12b0b86d9d650e3
data/arii.gemspec CHANGED
@@ -22,5 +22,7 @@ Gem::Specification.new do |spec|
22
22
 
23
23
  spec.add_runtime_dependency 'rest-client', '~> 0'
24
24
  spec.add_runtime_dependency 'nokogiri'
25
+ spec.add_runtime_dependency 'rubyXL'
26
+ spec.add_runtime_dependency 'spreadsheet'
25
27
  spec.add_runtime_dependency 'jsonpath', '~> 0'
26
28
  end
data/lib/arii/agent.rb CHANGED
@@ -41,6 +41,13 @@ module ARII
41
41
  @response = {:status => 400, :error => e}
42
42
  ARII::Config.log.error(self.class.name) {"#{e}"}
43
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
44
51
  when 'xml'
45
52
  begin
46
53
  @d = ARII::XMLDetector.new(self)
@@ -58,62 +65,62 @@ module ARII
58
65
  end
59
66
 
60
67
 
61
- # Start checkup
62
- begin
63
- unless content.nil? then
64
- @d.content = content
65
- end
66
- @checkup = @d.checkup
67
- rescue Exception => e
68
- ARII::Config.log.error(self.class.name) {"Checkup error: #{e}"}
68
+ # Start checkup
69
+ begin
70
+ unless content.nil? then
71
+ @d.content = content
69
72
  end
73
+ @checkup = @d.checkup
74
+ rescue Exception => e
75
+ ARII::Config.log.error(self.class.name) {"Checkup error: #{e}"}
76
+ end
70
77
 
71
- # Start detection
72
- begin
73
- @d.objects.each do |object|
74
- @d.detect object
75
- end
76
-
77
- @checkup[:templates] = @d.templates.uniq
78
- rescue Exception => e
79
- ARII::Config.log.error(self.class.name) {"Detection error: #{e}"}
78
+ # Start detection
79
+ begin
80
+ @d.objects.each do |object|
81
+ @d.detect object
80
82
  end
81
83
 
82
- begin
83
- if @checkup[:status] == 100 then
84
- process @checkup
85
- end
86
- rescue Exception => e
87
- ARII::Config.log.error(self.class.name) {"Process error: #{e}"}
84
+ @checkup[:templates] = @d.templates.uniq
85
+ rescue Exception => e
86
+ ARII::Config.log.error(self.class.name) {"Detection error: #{e}"}
87
+ end
88
+
89
+ begin
90
+ if @checkup[:status] == 100 then
91
+ process @checkup
88
92
  end
89
- response = {:status => @checkup[:status], :message => "[ARII][Checkup][execute] All OK."}
93
+ rescue Exception => e
94
+ ARII::Config.log.error(self.class.name) {"Process error: #{e}"}
90
95
  end
96
+ response = {:status => @checkup[:status], :message => "[ARII][Checkup][execute] All OK."}
97
+ end
91
98
 
92
99
 
93
100
 
94
- ##
95
- # => Process agent checks.
96
- #
97
- def process checkup
98
- begin
99
- checkup[:templates].each do |template|
100
- ARII::Config.log.info(self.class.name) {"Delivering to #{template} template."}
101
- checkup[:payload].each do |payload|
102
- ARII::Config.log.debug(self.class.name) {"Processing #{payload}."}
103
- response = RestClient.post "#{ARII::Config.host}postman/deliver/#{template}.js", payload
104
- case response.code
105
- when 200
106
- ARII::Config.log.debug(self.class.name) {"Delivered to #{template}."}
107
- else
108
- ARII::Config.log.warn(self.class.name) {"unable to deliver \"#{payload}\" to \"#{template}\""}
109
- end
101
+ ##
102
+ # => Process agent checks.
103
+ #
104
+ def process checkup
105
+ begin
106
+ checkup[:templates].each do |template|
107
+ ARII::Config.log.info(self.class.name) {"Delivering to #{template} template."}
108
+ checkup[:payload].each do |payload|
109
+ ARII::Config.log.debug(self.class.name) {"Processing #{payload}."}
110
+ response = RestClient.post "#{ARII::Config.host}postman/deliver/#{template}.js", payload
111
+ case response.code
112
+ when 200
113
+ ARII::Config.log.debug(self.class.name) {"Delivered to #{template}."}
114
+ else
115
+ ARII::Config.log.warn(self.class.name) {"unable to deliver \"#{payload}\" to \"#{template}\""}
110
116
  end
111
117
  end
112
- rescue Exception => e
113
- ARII::Config.log.error(self.class.name) {"Processing error: #{e}"}
114
118
  end
115
-
119
+ rescue Exception => e
120
+ ARII::Config.log.error(self.class.name) {"Processing error: #{e}"}
116
121
  end
122
+
117
123
  end
124
+ end
118
125
 
119
- end
126
+ end
@@ -60,4 +60,4 @@ module ARII
60
60
  end
61
61
  end
62
62
  end
63
- end
63
+ end
data/lib/arii/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module ARII
2
- VERSION = "1.1"
2
+ VERSION = "1.2.1"
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.1'
4
+ version: 1.2.1
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-02-12 00:00:00.000000000 Z
11
+ date: 2015-04-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -66,6 +66,34 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rubyXL
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: spreadsheet
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
69
97
  - !ruby/object:Gem::Dependency
70
98
  name: jsonpath
71
99
  requirement: !ruby/object:Gem::Requirement