tomcat-manager 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
 - data/lib/tomcat_manager/core.rb +25 -4
 - data/tomcat-manager.gemspec +1 -1
 - metadata +2 -2
 
    
        data/VERSION
    CHANGED
    
    | 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            0.0. 
     | 
| 
      
 1 
     | 
    
         
            +
            0.0.5
         
     | 
    
        data/lib/tomcat_manager/core.rb
    CHANGED
    
    | 
         @@ -15,21 +15,42 @@ class TomcatManager 
     | 
|
| 
       15 
15 
     | 
    
         
             
                  params = {"type" => type}
         
     | 
| 
       16 
16 
     | 
    
         
             
                  opts[:headers] = {:params => params}
         
     | 
| 
       17 
17 
     | 
    
         
             
                end
         
     | 
| 
       18 
     | 
    
         
            -
                results = execute(" 
     | 
| 
       19 
     | 
    
         
            -
                 
     | 
| 
      
 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 
     | 
    
         
            -
                 
     | 
| 
      
 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 
     | 
    
         | 
    
        data/tomcat-manager.gemspec
    CHANGED