trinidad_mysql_dbpool_extension 0.1.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +22 -0
- data/LICENSE +1 -1
- data/README.rdoc +3 -1
- data/Rakefile +68 -0
- data/lib/trinidad_mysql_dbpool_extension.rb +1 -1
- data/trinidad-libs/mysql-connector-java-5.1.20-bin.jar +0 -0
- metadata +63 -76
- data/VERSION +0 -1
- data/spec/spec_helper.rb +0 -10
- data/spec/trinidad_mysql_dbpool_extension_spec.rb +0 -48
- data/trinidad-libs/mysql-connector-java-5.1.12-bin.jar +0 -0
data/History.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
== 0.3.0 (2011-07-01)
|
2
|
+
|
3
|
+
* Oracle connection pool extension
|
4
|
+
* Mssql connection pool extension
|
5
|
+
* Postgresql syntax error fix
|
6
|
+
* Add support for multiple pools per db extension
|
7
|
+
|
8
|
+
== 0.2.0 (2010-07-29)
|
9
|
+
|
10
|
+
* Update trinidad_dbpool_extension common gem to support Tomcat 7
|
11
|
+
|
12
|
+
== 0.1.1 (2010-05-05)
|
13
|
+
|
14
|
+
* Update trinidad_dbpool_extension common gem
|
15
|
+
* Remove adding jndi context and resource to the global tomcat context
|
16
|
+
|
17
|
+
== 0.1.0 (2010-04-04)
|
18
|
+
|
19
|
+
* First release
|
20
|
+
* General connection pool extension
|
21
|
+
* Mysql connection pool extension
|
22
|
+
* Postgresql connection pool extension
|
data/LICENSE
CHANGED
data/README.rdoc
CHANGED
@@ -7,6 +7,8 @@ container.
|
|
7
7
|
|
8
8
|
* MySql (trinidad_mysql_dbpool_extension)
|
9
9
|
* PostgreSQL (trinidad_postgresql_dbpool_extension)
|
10
|
+
* Mssql (trinidad_mssql_dbpool_extension)
|
11
|
+
* Oracle (trinidad_oracle_dbpool_extension)
|
10
12
|
|
11
13
|
== Usage
|
12
14
|
|
@@ -37,7 +39,7 @@ http://commons.apache.org/dbcp/configuration.html
|
|
37
39
|
production:
|
38
40
|
adapter: jdbc
|
39
41
|
jndi: java:/comp/env/jdbc/TestDB
|
40
|
-
driver: com.mysql.jdbc.Driver
|
42
|
+
driver: com.mysql.jdbc.Driver # jdbc driver is mandatory
|
41
43
|
|
42
44
|
== Note on Patches/Pull Requests
|
43
45
|
|
data/Rakefile
ADDED
@@ -0,0 +1,68 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
|
4
|
+
def build(gem)
|
5
|
+
mkdir_p 'pkg'
|
6
|
+
sh "gem build #{gem}.gemspec"
|
7
|
+
mv Dir["#{gem}*.gem"].last, 'pkg'
|
8
|
+
end
|
9
|
+
|
10
|
+
def release(gem, version = nil)
|
11
|
+
unless `git branch` =~ /^\* master$/
|
12
|
+
raise "must be on master to release !"
|
13
|
+
end
|
14
|
+
|
15
|
+
if version
|
16
|
+
unless gem_file = Dir.glob("pkg/#{gem}-#{version}.gem").first
|
17
|
+
raise "#{gem}-#{version}.gem not build !"
|
18
|
+
end
|
19
|
+
else
|
20
|
+
unless gem_file = Dir.glob("pkg/#{gem}*").sort.last
|
21
|
+
raise "#{gem}*.gem not build !"
|
22
|
+
end
|
23
|
+
unless match = gem_file.match(/.*?\-(\d\.\d\.\d)\.gem/)
|
24
|
+
raise "version number not matched from: #{gem_file}"
|
25
|
+
end
|
26
|
+
version = match[1]
|
27
|
+
end
|
28
|
+
|
29
|
+
sh "git tag #{gem}-#{version}"
|
30
|
+
sh "git push origin master --tags"
|
31
|
+
sh "gem push #{gem_file}"
|
32
|
+
end
|
33
|
+
|
34
|
+
all_gems = %W{ dbpool mysql_dbpool_extension postgresql_dbpool_extension mssql_dbpool_extension oracle_dbpool_extension }
|
35
|
+
all_gems.map! { |gem| "trinidad_#{gem}" }
|
36
|
+
all_gems.each do |gem_name|
|
37
|
+
namespace gem_name do
|
38
|
+
desc "Build the #{gem_name} gem"
|
39
|
+
task :build do
|
40
|
+
build(gem_name)
|
41
|
+
end
|
42
|
+
desc "Release the #{gem_name} gem"
|
43
|
+
task :release => :build do
|
44
|
+
release(gem_name)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
{
|
50
|
+
:build => 'Build all connection pool gems',
|
51
|
+
:release => 'Release all connection pool gems'
|
52
|
+
}.each do |t, d|
|
53
|
+
desc d
|
54
|
+
task t => all_gems.map { |name| "#{name}:#{t}" } # e.g. mysql_dbpool:build
|
55
|
+
end
|
56
|
+
|
57
|
+
desc "Clear out all built .gem files"
|
58
|
+
task :clear do
|
59
|
+
FileUtils.rm Dir["*.gem"]
|
60
|
+
FileUtils.rm_r Dir["pkg/*"] if File.exist?("pkg")
|
61
|
+
end
|
62
|
+
|
63
|
+
require 'rspec/core/rake_task'
|
64
|
+
RSpec::Core::RakeTask.new(:spec) do |spec|
|
65
|
+
spec.rspec_opts = ['--color', "--format documentation"]
|
66
|
+
end
|
67
|
+
|
68
|
+
task :default => :spec
|
@@ -1,3 +1,3 @@
|
|
1
1
|
require 'trinidad_dbpool'
|
2
|
-
require File.expand_path('../../trinidad-libs/mysql-connector-java-5.1.
|
2
|
+
require File.expand_path('../../trinidad-libs/mysql-connector-java-5.1.20-bin', __FILE__)
|
3
3
|
require 'trinidad_mysql_dbpool_extension/mysql_webapp_extension'
|
Binary file
|
metadata
CHANGED
@@ -1,106 +1,93 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trinidad_mysql_dbpool_extension
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
prerelease:
|
5
|
-
|
6
|
-
- 0
|
7
|
-
- 1
|
8
|
-
- 0
|
9
|
-
version: 0.1.0
|
4
|
+
prerelease:
|
5
|
+
version: 0.4.0
|
10
6
|
platform: ruby
|
11
7
|
authors:
|
12
|
-
- David Calavera
|
8
|
+
- David Calavera
|
13
9
|
autorequire:
|
14
10
|
bindir: bin
|
15
11
|
cert_chain: []
|
16
12
|
|
17
|
-
date:
|
18
|
-
default_executable:
|
13
|
+
date: 2012-05-31 00:00:00 Z
|
19
14
|
dependencies:
|
20
|
-
- !ruby/object:Gem::Dependency
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
- 0
|
55
|
-
version: "0"
|
56
|
-
type: :development
|
57
|
-
version_requirements: *id003
|
58
|
-
description: Addon to support MySql database pools in Trinidad
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: trinidad_dbpool
|
17
|
+
prerelease: false
|
18
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
19
|
+
none: false
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 0.4.0
|
24
|
+
type: :runtime
|
25
|
+
version_requirements: *id001
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: rspec
|
28
|
+
prerelease: false
|
29
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
30
|
+
none: false
|
31
|
+
requirements:
|
32
|
+
- - ">="
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: "2.10"
|
35
|
+
type: :development
|
36
|
+
version_requirements: *id002
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: mocha
|
39
|
+
prerelease: false
|
40
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ">="
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: "0.10"
|
46
|
+
type: :development
|
47
|
+
version_requirements: *id003
|
48
|
+
description: Addon to support MySQL database pools in Trinidad
|
59
49
|
email: calavera@apache.org
|
60
50
|
executables: []
|
61
51
|
|
62
52
|
extensions: []
|
63
53
|
|
64
54
|
extra_rdoc_files:
|
65
|
-
- LICENSE
|
66
|
-
- README.rdoc
|
55
|
+
- LICENSE
|
56
|
+
- README.rdoc
|
67
57
|
files:
|
68
|
-
-
|
69
|
-
-
|
70
|
-
-
|
71
|
-
-
|
72
|
-
-
|
73
|
-
-
|
74
|
-
|
75
|
-
homepage: http://github.com/
|
58
|
+
- lib/trinidad_mysql_dbpool_extension.rb
|
59
|
+
- lib/trinidad_mysql_dbpool_extension/mysql_webapp_extension.rb
|
60
|
+
- trinidad-libs/mysql-connector-java-5.1.20-bin.jar
|
61
|
+
- History.txt
|
62
|
+
- LICENSE
|
63
|
+
- README.rdoc
|
64
|
+
- Rakefile
|
65
|
+
homepage: http://github.com/trinidad/trinidad_dbpool_extension
|
76
66
|
licenses: []
|
77
67
|
|
78
68
|
post_install_message:
|
79
|
-
rdoc_options:
|
80
|
-
|
69
|
+
rdoc_options: []
|
70
|
+
|
81
71
|
require_paths:
|
82
|
-
- lib
|
72
|
+
- lib
|
83
73
|
required_ruby_version: !ruby/object:Gem::Requirement
|
74
|
+
none: false
|
84
75
|
requirements:
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
- 0
|
89
|
-
version: "0"
|
76
|
+
- - ">="
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: "0"
|
90
79
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
80
|
+
none: false
|
91
81
|
requirements:
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
- 0
|
96
|
-
version: "0"
|
82
|
+
- - ">="
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
version: "0"
|
97
85
|
requirements: []
|
98
86
|
|
99
87
|
rubyforge_project:
|
100
|
-
rubygems_version: 1.
|
88
|
+
rubygems_version: 1.8.15
|
101
89
|
signing_key:
|
102
90
|
specification_version: 3
|
103
|
-
summary: Addon to support
|
104
|
-
test_files:
|
105
|
-
|
106
|
-
- spec/trinidad_mysql_dbpool_extension_spec.rb
|
91
|
+
summary: Addon to support MySQL database pools in Trinidad
|
92
|
+
test_files: []
|
93
|
+
|
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
0.1.0
|
data/spec/spec_helper.rb
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
2
|
-
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
3
|
-
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'trinidad-libs'))
|
4
|
-
|
5
|
-
require 'trinidad_mysql_dbpool_extension'
|
6
|
-
require 'spec'
|
7
|
-
|
8
|
-
Spec::Runner.configure do |config|
|
9
|
-
config.mock_with :mocha
|
10
|
-
end
|
@@ -1,48 +0,0 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
|
-
|
3
|
-
describe Trinidad::Extensions::MysqlDbpoolWebAppExtension do
|
4
|
-
before(:each) do
|
5
|
-
@options = {
|
6
|
-
:url => 'jdbc:mysql://localhost:3306/test',
|
7
|
-
:jndi => 'jdbc/TestDB',
|
8
|
-
:maxIdle => 300
|
9
|
-
}
|
10
|
-
@extension = Trinidad::Extensions::MysqlDbpoolWebAppExtension.new(@options)
|
11
|
-
@context = Trinidad::Tomcat::StandardContext.new
|
12
|
-
|
13
|
-
@tomcat = mock
|
14
|
-
resource_context = mock
|
15
|
-
naming = mock
|
16
|
-
|
17
|
-
naming.stubs(:addResource)
|
18
|
-
resource_context.stubs(:naming_resources).returns(naming)
|
19
|
-
resource_context.stubs(:naming_resources=)
|
20
|
-
@tomcat.stubs(:addContext).returns(resource_context)
|
21
|
-
end
|
22
|
-
|
23
|
-
it "sets the mysql driver name as a resource property" do
|
24
|
-
resource = configure_extension
|
25
|
-
resource.getProperty('driverClassName').should == 'com.mysql.jdbc.Driver'
|
26
|
-
end
|
27
|
-
|
28
|
-
it "adds the resource to the tomcat standard context" do
|
29
|
-
configure_extension
|
30
|
-
@context.naming_resources.find_resource('jdbc/TestDB').should_not be_nil
|
31
|
-
end
|
32
|
-
|
33
|
-
it "adds properties to the resource" do
|
34
|
-
resource = configure_extension
|
35
|
-
resource.getProperty('maxIdle').should == '300'
|
36
|
-
end
|
37
|
-
|
38
|
-
it "adds the protocol if the url doesn't include it" do
|
39
|
-
@options[:url] = "localhost:3306/test_protocol"
|
40
|
-
extension = Trinidad::Extensions::MysqlDbpoolWebAppExtension.new(@options)
|
41
|
-
resource = extension.configure(@tomcat, @context)
|
42
|
-
resource.get_property('url').should == "jdbc:mysql://localhost:3306/test_protocol"
|
43
|
-
end
|
44
|
-
|
45
|
-
def configure_extension
|
46
|
-
@extension.configure(@tomcat, @context)
|
47
|
-
end
|
48
|
-
end
|
Binary file
|