tomcat-manager 0.0.0

Sign up to get free protection for your applications and to get access to all the features.
data/.document ADDED
@@ -0,0 +1,5 @@
1
+ lib/**/*.rb
2
+ bin/*
3
+ -
4
+ features/**/*.feature
5
+ LICENSE.txt
data/Gemfile ADDED
@@ -0,0 +1,14 @@
1
+ source "http://rubygems.org"
2
+ # Add dependencies required to use your gem here.
3
+ # Example:
4
+ # gem "activesupport", ">= 2.3.5"
5
+
6
+ # Add dependencies to develop your gem here.
7
+ # Include everything needed to run rake, tests, features, etc.
8
+ group :development do
9
+ gem "shoulda", ">= 0"
10
+ gem "rdoc", "~> 3.12"
11
+ gem "bundler", "~> 1.0.0"
12
+ gem "jeweler", "~> 1.8.3"
13
+ gem "rcov", ">= 0"
14
+ end
data/LICENSE ADDED
@@ -0,0 +1,10 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2012 Dakota Bailey
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
10
+
data/README ADDED
@@ -0,0 +1,3 @@
1
+ This is a ruby library that allows access to the tomcat manager application.
2
+
3
+
data/Rakefile ADDED
@@ -0,0 +1,53 @@
1
+ # encoding: utf-8
2
+
3
+ require 'rubygems'
4
+ require 'bundler'
5
+ begin
6
+ Bundler.setup(:default, :development)
7
+ rescue Bundler::BundlerError => e
8
+ $stderr.puts e.message
9
+ $stderr.puts "Run `bundle install` to install missing gems"
10
+ exit e.status_code
11
+ end
12
+ require 'rake'
13
+
14
+ require 'jeweler'
15
+ Jeweler::Tasks.new do |gem|
16
+ # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
17
+ gem.name = "tomcat-manager"
18
+ gem.homepage = "http://github.com/dbailey/tomcat-manager"
19
+ gem.license = "MIT"
20
+ gem.summary = "TomcatManager"
21
+ gem.description = "Library for interacting with the tomcat manager web application."
22
+ gem.email = "dakota.bailey@gmail.com"
23
+ gem.authors = ["Dakota Bailey"]
24
+ # dependencies defined in Gemfile
25
+ end
26
+ Jeweler::RubygemsDotOrgTasks.new
27
+
28
+ require 'rake/testtask'
29
+ Rake::TestTask.new(:test) do |test|
30
+ test.libs << 'lib' << 'test'
31
+ test.pattern = 'test/**/test_*.rb'
32
+ test.verbose = true
33
+ end
34
+
35
+ require 'rcov/rcovtask'
36
+ Rcov::RcovTask.new do |test|
37
+ test.libs << 'test'
38
+ test.pattern = 'test/**/test_*.rb'
39
+ test.verbose = true
40
+ test.rcov_opts << '--exclude "gems/*"'
41
+ end
42
+
43
+ task :default => :test
44
+
45
+ require 'rdoc/task'
46
+ Rake::RDocTask.new do |rdoc|
47
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
48
+
49
+ rdoc.rdoc_dir = 'rdoc'
50
+ rdoc.title = "tomcat-manager #{version}"
51
+ rdoc.rdoc_files.include('README*')
52
+ rdoc.rdoc_files.include('lib/**/*.rb')
53
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.0.0
@@ -0,0 +1,3 @@
1
+ # -*- coding: utf-8 -*-
2
+ # © 2012 Dakota Bailey
3
+ require 'tomcat_manager/core.rb'
@@ -0,0 +1,64 @@
1
+ # -*- coding: utf-8 -*-
2
+ # © 2012 Dakota Bailey
3
+ class TomcatManager
4
+ @apps = nil
5
+
6
+ def initialize(base_url, user, pass)
7
+ @base_url = base_url
8
+ @user = user
9
+ @pass = pass
10
+ end
11
+
12
+ def undeploy(ctx_path)
13
+ params = {"path" => ctx_path}
14
+ results = execute("undeploy", {:headers => {:params => params}})
15
+ if !/^OK.*/.match results
16
+ puts "Unknown error: \n" + results
17
+ exit 1
18
+ end
19
+ return results
20
+ end
21
+
22
+ def deploy(ctx_path, war_path)
23
+ params = {"path" => ctx_path,
24
+ "war" => war_path}
25
+ results = execute("deploy", {:headers => {:params => params}})
26
+ if !/^OK.*/.match results
27
+ puts "Unknown error: \n" + results
28
+ exit 1
29
+ end
30
+ return results
31
+ end
32
+
33
+ def list()
34
+ if @apps == nil
35
+ @apps = {}
36
+ apps_raw = execute("list")
37
+ lines = apps_raw.split "\n"
38
+ if !/^OK.*/.match lines[0]
39
+ die "Unknown error: \n" + apps_raw
40
+ end
41
+ lines.slice(1, lines.length).each { |line|
42
+ foo = /^\/(.*):(.*):(.*):(.*)$/
43
+ data = foo.match line
44
+ name = data[4].chomp
45
+ ctx = data[1]
46
+ status = data[2]
47
+ foo = data[3]
48
+ @apps[name] = {:name => name, :ctx => ctx, :status => status, :foo => foo}
49
+ }
50
+ end
51
+ return @apps
52
+ end
53
+
54
+ def installed?(name)
55
+ self.list[name]
56
+ end
57
+
58
+ def execute(cmd, options = {})
59
+ url = @base_url + '/' + cmd
60
+ opts = options.merge({:user => USER, :password => PASS})
61
+ resource = RestClient::Resource.new url, opts
62
+ resource.get
63
+ end
64
+ end
@@ -0,0 +1,3 @@
1
+ # -*- coding: utf-8 -*-
2
+ # © 2012 Dakota Bailey
3
+ require 'tomcat_manager/core.rb'
data/test/helper.rb ADDED
@@ -0,0 +1,18 @@
1
+ require 'rubygems'
2
+ require 'bundler'
3
+ begin
4
+ Bundler.setup(:default, :development)
5
+ rescue Bundler::BundlerError => e
6
+ $stderr.puts e.message
7
+ $stderr.puts "Run `bundle install` to install missing gems"
8
+ exit e.status_code
9
+ end
10
+ require 'test/unit'
11
+ require 'shoulda'
12
+
13
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
14
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
15
+ require 'tomcat-manager'
16
+
17
+ class Test::Unit::TestCase
18
+ end
@@ -0,0 +1,7 @@
1
+ require 'helper'
2
+
3
+ class TestTomcatManager < Test::Unit::TestCase
4
+ should "probably rename this file and start testing for real" do
5
+ flunk "hey buddy, you should probably rename this file and start testing for real"
6
+ end
7
+ end
@@ -0,0 +1,65 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{tomcat-manager}
8
+ s.version = "0.0.0"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Dakota Bailey"]
12
+ s.date = %q{2012-04-03}
13
+ s.description = %q{Library for interacting with the tomcat manager web application.}
14
+ s.email = %q{dakota.bailey@gmail.com}
15
+ s.extra_rdoc_files = [
16
+ "LICENSE",
17
+ "README"
18
+ ]
19
+ s.files = [
20
+ ".document",
21
+ "Gemfile",
22
+ "LICENSE",
23
+ "README",
24
+ "Rakefile",
25
+ "VERSION",
26
+ "lib/tomcat_manager.rb",
27
+ "lib/tomcat_manager/core.rb",
28
+ "lib/tomcat_manager/tomcat_manager.rb",
29
+ "test/helper.rb",
30
+ "test/test_tomcat-manager.rb",
31
+ "tomcat-manager.gemspec",
32
+ "tomcat_manager.gemspec"
33
+ ]
34
+ s.homepage = %q{http://github.com/dbailey/tomcat-manager}
35
+ s.licenses = ["MIT"]
36
+ s.require_paths = ["lib"]
37
+ s.rubygems_version = %q{1.3.6}
38
+ s.summary = %q{TomcatManager}
39
+
40
+ if s.respond_to? :specification_version then
41
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
42
+ s.specification_version = 3
43
+
44
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
45
+ s.add_development_dependency(%q<shoulda>, [">= 0"])
46
+ s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
47
+ s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
48
+ s.add_development_dependency(%q<jeweler>, ["~> 1.8.3"])
49
+ s.add_development_dependency(%q<rcov>, [">= 0"])
50
+ else
51
+ s.add_dependency(%q<shoulda>, [">= 0"])
52
+ s.add_dependency(%q<rdoc>, ["~> 3.12"])
53
+ s.add_dependency(%q<bundler>, ["~> 1.0.0"])
54
+ s.add_dependency(%q<jeweler>, ["~> 1.8.3"])
55
+ s.add_dependency(%q<rcov>, [">= 0"])
56
+ end
57
+ else
58
+ s.add_dependency(%q<shoulda>, [">= 0"])
59
+ s.add_dependency(%q<rdoc>, ["~> 3.12"])
60
+ s.add_dependency(%q<bundler>, ["~> 1.0.0"])
61
+ s.add_dependency(%q<jeweler>, ["~> 1.8.3"])
62
+ s.add_dependency(%q<rcov>, [">= 0"])
63
+ end
64
+ end
65
+
@@ -0,0 +1,11 @@
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
metadata ADDED
@@ -0,0 +1,139 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: tomcat-manager
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 0
8
+ - 0
9
+ version: 0.0.0
10
+ platform: ruby
11
+ authors:
12
+ - Dakota Bailey
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2012-04-03 00:00:00 -06:00
18
+ default_executable:
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ prerelease: false
22
+ type: :development
23
+ name: shoulda
24
+ version_requirements: &id001 !ruby/object:Gem::Requirement
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ segments:
29
+ - 0
30
+ version: "0"
31
+ requirement: *id001
32
+ - !ruby/object:Gem::Dependency
33
+ prerelease: false
34
+ type: :development
35
+ name: rdoc
36
+ version_requirements: &id002 !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ segments:
41
+ - 3
42
+ - 12
43
+ version: "3.12"
44
+ requirement: *id002
45
+ - !ruby/object:Gem::Dependency
46
+ prerelease: false
47
+ type: :development
48
+ name: bundler
49
+ version_requirements: &id003 !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ~>
52
+ - !ruby/object:Gem::Version
53
+ segments:
54
+ - 1
55
+ - 0
56
+ - 0
57
+ version: 1.0.0
58
+ requirement: *id003
59
+ - !ruby/object:Gem::Dependency
60
+ prerelease: false
61
+ type: :development
62
+ name: jeweler
63
+ version_requirements: &id004 !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ~>
66
+ - !ruby/object:Gem::Version
67
+ segments:
68
+ - 1
69
+ - 8
70
+ - 3
71
+ version: 1.8.3
72
+ requirement: *id004
73
+ - !ruby/object:Gem::Dependency
74
+ prerelease: false
75
+ type: :development
76
+ name: rcov
77
+ version_requirements: &id005 !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ segments:
82
+ - 0
83
+ version: "0"
84
+ requirement: *id005
85
+ description: Library for interacting with the tomcat manager web application.
86
+ email: dakota.bailey@gmail.com
87
+ executables: []
88
+
89
+ extensions: []
90
+
91
+ extra_rdoc_files:
92
+ - LICENSE
93
+ - README
94
+ files:
95
+ - .document
96
+ - Gemfile
97
+ - LICENSE
98
+ - README
99
+ - Rakefile
100
+ - VERSION
101
+ - lib/tomcat_manager.rb
102
+ - lib/tomcat_manager/core.rb
103
+ - lib/tomcat_manager/tomcat_manager.rb
104
+ - test/helper.rb
105
+ - test/test_tomcat-manager.rb
106
+ - tomcat-manager.gemspec
107
+ - tomcat_manager.gemspec
108
+ has_rdoc: true
109
+ homepage: http://github.com/dbailey/tomcat-manager
110
+ licenses:
111
+ - MIT
112
+ post_install_message:
113
+ rdoc_options: []
114
+
115
+ require_paths:
116
+ - lib
117
+ required_ruby_version: !ruby/object:Gem::Requirement
118
+ requirements:
119
+ - - ">="
120
+ - !ruby/object:Gem::Version
121
+ segments:
122
+ - 0
123
+ version: "0"
124
+ required_rubygems_version: !ruby/object:Gem::Requirement
125
+ requirements:
126
+ - - ">="
127
+ - !ruby/object:Gem::Version
128
+ segments:
129
+ - 0
130
+ version: "0"
131
+ requirements: []
132
+
133
+ rubyforge_project:
134
+ rubygems_version: 1.3.6
135
+ signing_key:
136
+ specification_version: 3
137
+ summary: TomcatManager
138
+ test_files: []
139
+