tomcat-manager 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.4
1
+ 0.0.5
@@ -15,21 +15,42 @@ class TomcatManager
15
15
  params = {"type" => type}
16
16
  opts[:headers] = {:params => params}
17
17
  end
18
- results = execute("redeploy", opts)
19
- if !/^OK.*/.match results
18
+ results = execute("resources", opts)
19
+ lines = results.split "\n"
20
+ if !/^OK.*/.match lines[0]
20
21
  puts "Unknown error: \n" + results
21
22
  exit 1
22
23
  end
24
+ info = {}
25
+ rg = /^(.*):(.*)$/
26
+ lines.slice(1, lines.length).each { |line|
27
+ data = rg.match line
28
+ name = data[1].strip
29
+ value = data[2].strip
30
+ info[name] = value
31
+ }
32
+ return info
33
+
23
34
  return results
24
35
  end
25
36
 
26
-
27
37
  def serverinfo()
28
38
  results = execute("serverinfo")
29
- if !/^OK.*/.match results
39
+ lines = results.split "\n"
40
+ if !/^OK.*/.match lines[0]
30
41
  puts "Unknown error: \n" + results
31
42
  exit 1
32
43
  end
44
+ info = {}
45
+ rg = /^(.*):(.*)$/
46
+ lines.slice(1, lines.length).each { |line|
47
+ data = rg.match line
48
+ name = data[1].strip
49
+ value = data[2].strip
50
+ info[name] = value
51
+ }
52
+ return info
53
+
33
54
  return results
34
55
  end
35
56
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{tomcat-manager}
8
- s.version = "0.0.4"
8
+ s.version = "0.0.5"
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"]
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 4
9
- version: 0.0.4
8
+ - 5
9
+ version: 0.0.5
10
10
  platform: ruby
11
11
  authors:
12
12
  - Dakota Bailey