ruby_aem 1.0.6 → 1.0.7

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: bd2ed673ae15b68e95ab826d68fcbe626be9d311
4
- data.tar.gz: 05a5ce3cbb7b71bd803e0e84ea3bde75c8f5cfe9
3
+ metadata.gz: 4aeb1fe97514d136bf71c865801a2fd01ee6171d
4
+ data.tar.gz: 239284f42251a5b5bf498217be67a8ec79ce4589
5
5
  SHA512:
6
- metadata.gz: a9575353f79e67a36b1ff72c710ab178e8589459e07a415fd4597809b9e95911cd1f55f2cf54e7fd15708adab7094d5a433bb3a718617f08e169fef485d9754e
7
- data.tar.gz: d031a4e54a02d5fd02313e91ae108ba01495dd892b1b69e8b1c5d0736840ac369778846648784ead03a45af3296044568f563ee8110e6c0df18bb873277cd52e
6
+ metadata.gz: b9349cc5c4baeeaef1ee58a3e6b7af79b09d178ce0d3c2c724702d1b398424bdb32b8ffc66b2edabe105acdb3474dd434d1346ba5e744d1fa3aba770fa2f7c23
7
+ data.tar.gz: ae96390118a070803f81ff2e519d6ff45b27e8a126082055644628ef472053bd6559fb1e8bc26a83e754cb5e40d20d43fcd3e4e1e6e8186bbf97cfc4b28d6d4a
@@ -42,10 +42,24 @@ module RubyAem
42
42
  # Retrieve AEM login page with retries until it is successful.
43
43
  # This is handy for waiting for AEM to start or restart Jetty.
44
44
  #
45
+ # @param opts optional parameters:
46
+ # - _retries: retries library's options (http://www.rubydoc.info/gems/retries/0.0.5#Usage), restricted to max_trie, base_sleep_seconds, max_sleep_seconds
45
47
  # @return RubyAem::Result
46
- def get_login_page_wait_until_ready()
48
+ def get_login_page_wait_until_ready(
49
+ opts = {
50
+ _retries: {
51
+ max_tries: 30,
52
+ base_sleep_seconds: 2,
53
+ max_sleep_seconds: 2
54
+ }
55
+ })
56
+ opts[:_retries] ||= {}
57
+ opts[:_retries][:max_tries] ||= 30
58
+ opts[:_retries][:base_sleep_seconds] ||= 2
59
+ opts[:_retries][:max_sleep_seconds] ||= 2
60
+
47
61
  result = nil
48
- with_retries(:max_tries => 30, :base_sleep_seconds => 2, :max_sleep_seconds => 2) { |retries_count|
62
+ with_retries(:max_tries => opts[:_retries][:max_tries], :base_sleep_seconds => opts[:_retries][:base_sleep_seconds], :max_sleep_seconds => opts[:_retries][:max_sleep_seconds]) { |retries_count|
49
63
  begin
50
64
  result = get_login_page()
51
65
  if result.response.body !~ /QUICKSTART_HOMEPAGE/
@@ -97,7 +97,6 @@ module RubyAem
97
97
  # Upload the package without waiting until the package status states it is uploaded.
98
98
  #
99
99
  # @param file_path the directory where the package file to be uploaded is
100
- # @param force if true, then overwrite if the package already exists
101
100
  # @param opts optional parameters:
102
101
  # - force: if false then a package file will not be uploaded when the package already exists with the same group, name, and version, default is true (will overwrite existing package file)
103
102
  # @return RubyAem::Result
@@ -190,16 +189,27 @@ module RubyAem
190
189
  # Upload the package and wait until the package status states it is uploaded.
191
190
  #
192
191
  # @param file_path the directory where the package file to be uploaded is
193
- # @param force if true, then overwrite if the package already exists
194
192
  # @param opts optional parameters:
195
193
  # - force: if false then a package file will not be uploaded when the package already exists with the same group, name, and version, default is true (will overwrite existing package file)
194
+ # - _retries: retries library's options (http://www.rubydoc.info/gems/retries/0.0.5#Usage), restricted to max_trie, base_sleep_seconds, max_sleep_seconds
196
195
  # @return RubyAem::Result
197
196
  def upload_wait_until_ready(file_path,
198
197
  opts = {
199
- force: true
198
+ force: true,
199
+ _retries: {
200
+ max_tries: 30,
201
+ base_sleep_seconds: 2,
202
+ max_sleep_seconds: 2
203
+ }
200
204
  })
205
+ opts[:force] ||= true
206
+ opts[:_retries] ||= {}
207
+ opts[:_retries][:max_tries] ||= 30
208
+ opts[:_retries][:base_sleep_seconds] ||= 2
209
+ opts[:_retries][:max_sleep_seconds] ||= 2
210
+
201
211
  result = upload(file_path, opts)
202
- with_retries(:max_tries => 30, :base_sleep_seconds => 2, :max_sleep_seconds => 2) { |retries_count|
212
+ with_retries(:max_tries => opts[:_retries][:max_tries], :base_sleep_seconds => opts[:_retries][:base_sleep_seconds], :max_sleep_seconds => opts[:_retries][:max_sleep_seconds]) { |retries_count|
203
213
  check_result = is_uploaded()
204
214
  puts 'Upload check #%d: %s - %s' % [retries_count, check_result.data, check_result.message]
205
215
  if check_result.data == false
@@ -211,10 +221,24 @@ module RubyAem
211
221
 
212
222
  # Install the package and wait until the package status states it is installed.
213
223
  #
224
+ # @param opts optional parameters:
225
+ # - _retries: retries library's options (http://www.rubydoc.info/gems/retries/0.0.5#Usage), restricted to max_trie, base_sleep_seconds, max_sleep_seconds
214
226
  # @return RubyAem::Result
215
- def install_wait_until_ready()
227
+ def install_wait_until_ready(
228
+ opts = {
229
+ _retries: {
230
+ max_tries: 30,
231
+ base_sleep_seconds: 2,
232
+ max_sleep_seconds: 2
233
+ }
234
+ })
235
+ opts[:_retries] ||= {}
236
+ opts[:_retries][:max_tries] ||= 30
237
+ opts[:_retries][:base_sleep_seconds] ||= 2
238
+ opts[:_retries][:max_sleep_seconds] ||= 2
239
+
216
240
  result = install()
217
- with_retries(:max_tries => 30, :base_sleep_seconds => 2, :max_sleep_seconds => 2) { |retries_count|
241
+ with_retries(:max_tries => opts[:_retries][:max_tries], :base_sleep_seconds => opts[:_retries][:base_sleep_seconds], :max_sleep_seconds => opts[:_retries][:max_sleep_seconds]) { |retries_count|
218
242
  check_result = is_installed()
219
243
  puts 'Install check #%d: %s - %s' % [retries_count, check_result.data, check_result.message]
220
244
  if check_result.data == false
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.6
4
+ version: 1.0.7
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-01-15 00:00:00.000000000 Z
12
+ date: 2017-02-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri
@@ -18,6 +18,9 @@ dependencies:
18
18
  - - ~>
19
19
  - !ruby/object:Gem::Version
20
20
  version: '1.6'
21
+ - - <
22
+ - !ruby/object:Gem::Version
23
+ version: '1.7'
21
24
  type: :runtime
22
25
  prerelease: false
23
26
  version_requirements: !ruby/object:Gem::Requirement
@@ -25,6 +28,9 @@ dependencies:
25
28
  - - ~>
26
29
  - !ruby/object:Gem::Version
27
30
  version: '1.6'
31
+ - - <
32
+ - !ruby/object:Gem::Version
33
+ version: '1.7'
28
34
  - !ruby/object:Gem::Dependency
29
35
  name: retries
30
36
  requirement: !ruby/object:Gem::Requirement