tomcat-manager 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/tomcat_manager/core.rb +24 -7
- data/tomcat-manager.gemspec +2 -2
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.6
|
data/lib/tomcat_manager/core.rb
CHANGED
@@ -15,7 +15,7 @@ class TomcatManager
|
|
15
15
|
params = {"type" => type}
|
16
16
|
opts[:headers] = {:params => params}
|
17
17
|
end
|
18
|
-
results =
|
18
|
+
results = do_get("resources", opts)
|
19
19
|
lines = results.split "\n"
|
20
20
|
if !/^OK.*/.match lines[0]
|
21
21
|
puts "Unknown error: \n" + results
|
@@ -35,7 +35,7 @@ class TomcatManager
|
|
35
35
|
end
|
36
36
|
|
37
37
|
def serverinfo()
|
38
|
-
results =
|
38
|
+
results = do_get("serverinfo")
|
39
39
|
lines = results.split "\n"
|
40
40
|
if !/^OK.*/.match lines[0]
|
41
41
|
puts "Unknown error: \n" + results
|
@@ -56,7 +56,7 @@ class TomcatManager
|
|
56
56
|
|
57
57
|
def redeploy(ctx_path)
|
58
58
|
params = {"path" => ctx_path}
|
59
|
-
results =
|
59
|
+
results = do_get("redeploy", {:headers => {:params => params}})
|
60
60
|
if !/^OK.*/.match results
|
61
61
|
puts "Unknown error: \n" + results
|
62
62
|
exit 1
|
@@ -66,7 +66,7 @@ class TomcatManager
|
|
66
66
|
|
67
67
|
def undeploy(ctx_path)
|
68
68
|
params = {"path" => ctx_path}
|
69
|
-
results =
|
69
|
+
results = do_get("undeploy", {:headers => {:params => params}})
|
70
70
|
if !/^OK.*/.match results
|
71
71
|
puts "Unknown error: \n" + results
|
72
72
|
exit 1
|
@@ -77,7 +77,17 @@ class TomcatManager
|
|
77
77
|
def deploy(ctx_path, war_path)
|
78
78
|
params = {"path" => ctx_path,
|
79
79
|
"war" => war_path}
|
80
|
-
results =
|
80
|
+
results = do_get("deploy", {:headers => {:params => params}})
|
81
|
+
if !/^OK.*/.match results
|
82
|
+
puts "Unknown error: \n" + results
|
83
|
+
exit 1
|
84
|
+
end
|
85
|
+
return results
|
86
|
+
end
|
87
|
+
|
88
|
+
def remote_deploy(ctx_path, file)
|
89
|
+
params = {"path" => ctx_path}
|
90
|
+
results = do_put_with_file("deploy", file, {:headers => {:params => params}})
|
81
91
|
if !/^OK.*/.match results
|
82
92
|
puts "Unknown error: \n" + results
|
83
93
|
exit 1
|
@@ -86,7 +96,7 @@ class TomcatManager
|
|
86
96
|
end
|
87
97
|
|
88
98
|
def list()
|
89
|
-
apps_raw =
|
99
|
+
apps_raw = do_get("list")
|
90
100
|
lines = apps_raw.split "\n"
|
91
101
|
if !/^OK.*/.match lines[0]
|
92
102
|
die "Unknown error: \n" + apps_raw
|
@@ -108,10 +118,17 @@ class TomcatManager
|
|
108
118
|
self.list[name]
|
109
119
|
end
|
110
120
|
|
111
|
-
def
|
121
|
+
def do_get(cmd, options = {})
|
112
122
|
url = @base_url + '/' + cmd
|
113
123
|
opts = options.merge({:user => @user, :password => @pass, :timeout => @timeout, :open_timeout => @open_timeout})
|
114
124
|
resource = RestClient::Resource.new url, opts
|
115
125
|
resource.get
|
116
126
|
end
|
127
|
+
|
128
|
+
def do_put_with_file(cmd, file, options = {})
|
129
|
+
url = @base_url + '/' + cmd
|
130
|
+
opts = options.merge({:user => @user, :password => @pass, :timeout => @timeout, :open_timeout => @open_timeout})
|
131
|
+
resource = RestClient::Resource.new url, opts
|
132
|
+
resource.put File.read(file)
|
133
|
+
end
|
117
134
|
end
|
data/tomcat-manager.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{tomcat-manager}
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.6"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Dakota Bailey"]
|
12
|
-
s.date = %q{2012-04-
|
12
|
+
s.date = %q{2012-04-23}
|
13
13
|
s.description = %q{Library for interacting with the tomcat manager web application.}
|
14
14
|
s.email = %q{dakota.bailey@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 6
|
9
|
+
version: 0.0.6
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Dakota Bailey
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2012-04-
|
17
|
+
date: 2012-04-23 00:00:00 -06:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|