tomcat-manager 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README +5 -2
- data/VERSION +1 -1
- data/lib/tomcat_manager/core.rb +50 -20
- data/tomcat-manager.gemspec +3 -4
- metadata +3 -4
- data/tomcat_manager.gemspec +0 -11
data/README
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
-
This is a ruby library that allows access to the tomcat manager application.
|
1
|
+
This is a ruby library that allows access to the tomcat manager application.
|
2
2
|
|
3
|
-
|
3
|
+
|
4
|
+
See Also:
|
5
|
+
http://tomcat.apache.org/tomcat-6.0-doc/manager-howto.html
|
6
|
+
http://www.datadisk.co.uk/html_docs/java_app/tomcat6/tomcat6_admin.htm
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.4
|
data/lib/tomcat_manager/core.rb
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
2
|
# © 2012 Dakota Bailey
|
3
3
|
class TomcatManager
|
4
|
-
@apps = nil
|
5
|
-
|
6
4
|
def initialize(base_url, user, pass, timeout = nil, open_timeout = nil)
|
7
5
|
@base_url = base_url
|
8
6
|
@user = user
|
@@ -11,6 +9,40 @@ class TomcatManager
|
|
11
9
|
@open_timeout = open_timeout
|
12
10
|
end
|
13
11
|
|
12
|
+
def resources(type = nil)
|
13
|
+
opts = {}
|
14
|
+
if type != nil
|
15
|
+
params = {"type" => type}
|
16
|
+
opts[:headers] = {:params => params}
|
17
|
+
end
|
18
|
+
results = execute("redeploy", opts)
|
19
|
+
if !/^OK.*/.match results
|
20
|
+
puts "Unknown error: \n" + results
|
21
|
+
exit 1
|
22
|
+
end
|
23
|
+
return results
|
24
|
+
end
|
25
|
+
|
26
|
+
|
27
|
+
def serverinfo()
|
28
|
+
results = execute("serverinfo")
|
29
|
+
if !/^OK.*/.match results
|
30
|
+
puts "Unknown error: \n" + results
|
31
|
+
exit 1
|
32
|
+
end
|
33
|
+
return results
|
34
|
+
end
|
35
|
+
|
36
|
+
def redeploy(ctx_path)
|
37
|
+
params = {"path" => ctx_path}
|
38
|
+
results = execute("redeploy", {:headers => {:params => params}})
|
39
|
+
if !/^OK.*/.match results
|
40
|
+
puts "Unknown error: \n" + results
|
41
|
+
exit 1
|
42
|
+
end
|
43
|
+
return results
|
44
|
+
end
|
45
|
+
|
14
46
|
def undeploy(ctx_path)
|
15
47
|
params = {"path" => ctx_path}
|
16
48
|
results = execute("undeploy", {:headers => {:params => params}})
|
@@ -33,24 +65,22 @@ class TomcatManager
|
|
33
65
|
end
|
34
66
|
|
35
67
|
def list()
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
end
|
53
|
-
return @apps
|
68
|
+
apps_raw = execute("list")
|
69
|
+
lines = apps_raw.split "\n"
|
70
|
+
if !/^OK.*/.match lines[0]
|
71
|
+
die "Unknown error: \n" + apps_raw
|
72
|
+
end
|
73
|
+
apps = {}
|
74
|
+
lines.slice(1, lines.length).each { |line|
|
75
|
+
rg = /^\/(.*):(.*):(.*):(.*)$/
|
76
|
+
data = rg.match line
|
77
|
+
name = data[4].chomp
|
78
|
+
ctx = data[1]
|
79
|
+
status = data[2]
|
80
|
+
sess_cnt = data[3]
|
81
|
+
apps[name] = {:name => name, :ctx => ctx, :status => status, :sessions => sess_cnt}
|
82
|
+
}
|
83
|
+
return apps
|
54
84
|
end
|
55
85
|
|
56
86
|
def installed?(name)
|
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.4"
|
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-17}
|
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 = [
|
@@ -27,8 +27,7 @@ Gem::Specification.new do |s|
|
|
27
27
|
"lib/tomcat_manager/core.rb",
|
28
28
|
"test/helper.rb",
|
29
29
|
"test/test_tomcat-manager.rb",
|
30
|
-
"tomcat-manager.gemspec"
|
31
|
-
"tomcat_manager.gemspec"
|
30
|
+
"tomcat-manager.gemspec"
|
32
31
|
]
|
33
32
|
s.homepage = %q{http://github.com/dbailey/tomcat-manager}
|
34
33
|
s.licenses = ["MIT"]
|
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
|
+
- 4
|
9
|
+
version: 0.0.4
|
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-17 00:00:00 -06:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -117,7 +117,6 @@ files:
|
|
117
117
|
- test/helper.rb
|
118
118
|
- test/test_tomcat-manager.rb
|
119
119
|
- tomcat-manager.gemspec
|
120
|
-
- tomcat_manager.gemspec
|
121
120
|
has_rdoc: true
|
122
121
|
homepage: http://github.com/dbailey/tomcat-manager
|
123
122
|
licenses:
|
data/tomcat_manager.gemspec
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
Gem::Specification.new do |s|
|
2
|
-
s.name = 'tomcat_manager'
|
3
|
-
s.version = '0.0.1.pre'
|
4
|
-
s.date = '2012-04-03'
|
5
|
-
s.summary = "Ruby Gem to interact with the tomcat manager application."
|
6
|
-
s.description = "Ruby Gem to interact with the tomcat manager application."
|
7
|
-
s.authors = ["Dakota Bailey"]
|
8
|
-
s.email = 'dakota.bailey@gmail.com'
|
9
|
-
s.files = ["lib/tomcat_manager.rb"]
|
10
|
-
s.homepage = 'https://github.com/dbailey/tomcat_manager.rb'
|
11
|
-
end
|