Class: Tomcat::Manager

Inherits:
Object
  • Object
show all
Defined in:
lib/manager.rb

Instance Method Summary collapse

Constructor Details

#initialize(url, username, password, timeout = nil) ⇒ Manager

Returns a new instance of Manager.



4
5
6
7
8
9
# File 'lib/manager.rb', line 4

def initialize(url, username, password, timeout = nil)
  @url = url
  @username = username
  @password = password
  @timeout = timeout
end

Instance Method Details

#deploy(appname, file) ⇒ Object



15
16
17
# File 'lib/manager.rb', line 15

def deploy(appname, file)
  check_response(resource('deploy', appname).put(file))
end

#redeploy(appname, file) ⇒ Object



19
20
21
22
23
24
25
26
# File 'lib/manager.rb', line 19

def redeploy(appname, file)
  begin
    undeploy(appname)
  rescue
  end

  deploy(appname, file)
end

#undeploy(appname) ⇒ Object



11
12
13
# File 'lib/manager.rb', line 11

def undeploy(appname)
  check_response(resource('undeploy', appname).get)
end