aem-deploy 0.1.9 → 0.1.11

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: 99e43a6be5116ece40f04dbc0dd05910bb161def
4
- data.tar.gz: a4a4f54be4781a4149b5d6f5d7f675a090be7001
3
+ metadata.gz: e69f766f28e7f545c57730fefad25e50b7d27e48
4
+ data.tar.gz: 3588a996f8532eaa83ed276a3e56fb7370ba36d4
5
5
  SHA512:
6
- metadata.gz: 153d7fefcf5ae10eb43ce4fa978b91e9794a26e1f70fee3199ef3ef6405f14b471d7f0680380f730e6dfb190929f9c690ba9eb271f9cb65566bb20338845053d
7
- data.tar.gz: 028835d55af6cee408d1d77d1ca9d7f464e9e50bb70a49e4bf04b1f026a71e93ffbbb6c200c89b96f9d80203803abb2f62baa8c574d560edb9b85ada7545f6fd
6
+ metadata.gz: 23417b2a3ac428555e769bf2eed83df8d184aede33fb520fc435fac121854cf233d848b023afd95beafd04ccf3b3a5e6eb3218bb9054e38ec7993e1241c5fc61
7
+ data.tar.gz: ae975479436180413de50309d7b4d295a12855ff887773c2dc0b5a01458d6024073fc72353ae5be19fbc7e2e6c080b0b65018627a8649c4aeb5530d479839684
@@ -9,6 +9,9 @@ module Aem::Deploy
9
9
  class Session
10
10
  attr_reader :host, :user, :pass, :retry, :upload_path
11
11
 
12
+ # Initialize the object
13
+ # @param [Hash] including :host, :user and :pass REQUIRED, optional :retry [Integer] which will retry failures x times.
14
+ # @raise [Error] if :host, :user and :pass are not passed on initialize
12
15
  def initialize(params)
13
16
  if [:host, :user, :pass].all? {|k| params.key?(k)}
14
17
  @host = params.fetch(:host)
@@ -20,13 +23,18 @@ module Aem::Deploy
20
23
  end
21
24
  end
22
25
 
23
- #upload and install package
26
+ # See Upload and Install methods for individual descriptions
27
+ # @param [String] path to the package for upload and installation.
28
+ # @return [Hash] installation message from crx
24
29
  def easy_install(package_path)
25
30
  upload_package(package_path)
26
31
  install_package
27
32
  end
28
33
 
29
- # upload package
34
+ # Uploads Package to CRX
35
+ # @param [String] path to the package for upload and installation.
36
+ # @return [Hash] installation message from crx.
37
+ # @raise [Error] if server returns anything but success.
30
38
  def upload_package(package_path)
31
39
  upload = RestClient.post("http://#{@user}:#{@pass}@#{@host}/crx/packmgr/service/.json", :cmd => 'upload', :package => File.new(package_path, 'rb'), :force => true, :timeout => 300)
32
40
  parse_response(upload)
@@ -39,7 +47,10 @@ module Aem::Deploy
39
47
  end
40
48
  end
41
49
 
42
- # Install package
50
+ # Installs Package to CRX
51
+ # @param [Hash] Optionally install packages already on CRX uses :path key in options hash, if you know the path to the package on crx.
52
+ # @return [Hash] installation message from crx.
53
+ # @raise [Error] if server returns anything but success.
43
54
  def install_package(options = {})
44
55
  if options[:path]
45
56
  @upload_path = options[:path]
@@ -54,7 +65,9 @@ module Aem::Deploy
54
65
  end
55
66
  end
56
67
 
57
- # Recompiles JSPs on CMS
68
+ # Recompiles JSPs
69
+ # @return [String] Recompile complete
70
+ # @raise [Error] if server returns anything but success.
58
71
  def recompile_jsps
59
72
  begin
60
73
  RestClient.post "http://#{@user}:#{@pass}@#{@host}/system/console/slingjsp", :cmd => 'recompile', :timeout => 120
@@ -69,7 +82,9 @@ module Aem::Deploy
69
82
  end
70
83
  end
71
84
 
72
- # Checks response of any request to CMS. Breaks script if unexpected response.
85
+ # Parses message output from CRX
86
+ # @return [String] Recompile complete
87
+ # @raise [Error] if server returns anything but success.
73
88
  def parse_response(message)
74
89
  if JSON.parse(message)['success'] == true
75
90
  return " #{message}"
@@ -1,5 +1,5 @@
1
1
  module Aem
2
2
  module Deploy
3
- VERSION = "0.1.9"
3
+ VERSION = "0.1.11"
4
4
  end
5
5
  end
data/lib/aem-deploy.rb CHANGED
@@ -3,7 +3,7 @@ require "aem/deploy/session"
3
3
 
4
4
  module Aem
5
5
  module Deploy
6
- # Create a new session with teh default options.
6
+ # Create a new session with the default options.
7
7
  def self.new(params = {})
8
8
  Session.new(params)
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aem-deploy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mitch Eaton