ruby_aem 1.0.11 → 1.0.12
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 +4 -4
- data/conf/spec.yaml +3 -0
- data/lib/ruby_aem/handlers/html.rb +25 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 290ff31830254e166c6b6b56b1fd2dca8d21566b
|
|
4
|
+
data.tar.gz: 08a8dad0d8b8fbf0e05a798eb154577f328699a7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6b227de99a55131fcc303889ae4722d89bdac55f5f6a7eb2a060eb62872c6f1302560d7264ac817d3b278a61a2dbd8061d8b2e857f7d4e156a4bc24c8d170a45
|
|
7
|
+
data.tar.gz: e6c6ebf2ed5115a180249b0dfd28615fc979b03c315a4b94ab883f388c2d2aeb83103e3b81944c165ec160e9b234ade3a7aa47aad862abbe9be104359cb848cf
|
data/conf/spec.yaml
CHANGED
|
@@ -296,6 +296,9 @@ package:
|
|
|
296
296
|
responses:
|
|
297
297
|
200:
|
|
298
298
|
handler: json_package_service
|
|
299
|
+
500:
|
|
300
|
+
handler: html_package_service_allow_error
|
|
301
|
+
message: 'Allowed package installation error - %{title}: %{desc} %{reason}'
|
|
299
302
|
replicate:
|
|
300
303
|
api: crx
|
|
301
304
|
operation: postPackageServiceJson
|
|
@@ -39,5 +39,30 @@ module RubyAem
|
|
|
39
39
|
RubyAem::Result.new(message, response)
|
|
40
40
|
end
|
|
41
41
|
|
|
42
|
+
# Parse error message from response body data.
|
|
43
|
+
# This is to handle AEM hotfix, service pack, and feature pack package
|
|
44
|
+
# installation which might cause AEM to respond with error 500 but it's
|
|
45
|
+
# still processing behind the scene.
|
|
46
|
+
#
|
|
47
|
+
# @param response HTTP response containing status_code, body, and headers
|
|
48
|
+
# @param response_spec response specification as configured in conf/spec.yaml
|
|
49
|
+
# @param call_params API call parameters
|
|
50
|
+
# @return RubyAem::Result
|
|
51
|
+
def Handlers.html_package_service_allow_error(response, response_spec, call_params)
|
|
52
|
+
|
|
53
|
+
html = Nokogiri::HTML(response.body)
|
|
54
|
+
title = html.xpath('//title/text()').to_s
|
|
55
|
+
desc = html.xpath('//p/text()').to_s
|
|
56
|
+
reason = html.xpath('//pre/text()').to_s
|
|
57
|
+
|
|
58
|
+
call_params[:title] = title
|
|
59
|
+
call_params[:desc] = desc
|
|
60
|
+
call_params[:reason] = reason
|
|
61
|
+
|
|
62
|
+
message = response_spec['message'] % call_params
|
|
63
|
+
|
|
64
|
+
RubyAem::Result.new(message, response)
|
|
65
|
+
end
|
|
66
|
+
|
|
42
67
|
end
|
|
43
68
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ruby_aem
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.12
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Shine Solutions
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2017-03-
|
|
12
|
+
date: 2017-03-15 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: nokogiri
|