trinidad 0.7.2 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,8 @@
1
+ == 0.8.0 (??)
2
+
3
+ * Support for extensions (database connection pooling is the first one using it)
4
+ * Splitting the gem in two, the core gem and the jars gem
5
+
1
6
  == 0.7.0 (2009-12-01)
2
7
 
3
8
  * Support to run different applications within the same Tomcat container
data/README.rdoc CHANGED
@@ -35,6 +35,14 @@ You can also specify a default web.xml to config your web application. By defaul
35
35
 
36
36
  Other advanced options can be found in the wiki: http://wiki.github.com/calavera/trinidad/advanced-configuration
37
37
 
38
+ == EXTENSIONS:
39
+
40
+ From the version 0.8.0 Trinidad allows to extend the server with more Tomcat features, here there is a list with the current available extensions:
41
+
42
+ * Database connection pooling: http://github.com/calavera/trinidad-dbpool
43
+
44
+ You can find further information on how to write your onw extension in the wiki: http://wiki.github.com/calavera/trinidad/extensions
45
+
38
46
  == Copyright
39
47
 
40
- Copyright (c) 2009 David Calavera<calavera@apache.org>. See LICENSE for details.
48
+ Copyright (c) 2010 David Calavera<calavera@apache.org>. See LICENSE for details.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.7.2
1
+ 0.8.0
data/lib/trinidad.rb CHANGED
@@ -3,9 +3,11 @@ $:.unshift(File.dirname(__FILE__)) unless
3
3
 
4
4
  require "java"
5
5
  require 'rubygems'
6
+ gem 'trinidad_jars'
6
7
 
7
8
  require 'trinidad/core_ext'
8
9
 
10
+ require 'trinidad/extensions'
9
11
  require 'trinidad/command_line_parser'
10
12
  require 'trinidad/jars'
11
13
  require 'trinidad/server'
@@ -14,5 +16,4 @@ require 'trinidad/rails_web_app'
14
16
  require 'trinidad/rackup_web_app'
15
17
 
16
18
  module Trinidad
17
- TRINIDAD_LIBS = File.dirname(__FILE__) + "/../trinidad-libs" unless defined?(TRINIDAD_LIBS)
18
19
  end
@@ -1,7 +1,8 @@
1
1
  module Trinidad
2
2
  require 'optparse'
3
-
3
+
4
4
  class CommandLineParser
5
+
5
6
  def self.parse
6
7
  default_options = {
7
8
  :port => 3000,
@@ -13,7 +14,7 @@ module Trinidad
13
14
  :ssl_port => 8443,
14
15
  :ajp_port => 8009
15
16
  }
16
-
17
+
17
18
  parser = OptionParser.new do |opts|
18
19
  opts.banner = 'Trinidad server default options:'
19
20
  opts.separator ''
@@ -22,22 +23,22 @@ module Trinidad
22
23
  "default: #{default_options[:environment]}") do |v|
23
24
  default_options[:environment] = v
24
25
  end
25
-
26
+
26
27
  opts.on('-p', '--port PORT', 'Port to bind to',
27
28
  "default: #{default_options[:port]}") do |v|
28
29
  default_options[:port] = v
29
30
  end
30
-
31
+
31
32
  opts.on('-c', '--context CONTEXT_PATH', 'The application context path',
32
33
  "default: #{default_options[:context_path]}") do |v|
33
34
  default_options[:context_path] = v
34
35
  end
35
-
36
+
36
37
  opts.on('--lib', '--jars LIBS_DIR', 'Directory containing jars used by the application',
37
38
  "default: #{default_options[:libs_dir]}") do |v|
38
39
  default_options[:libs_dir] = v
39
40
  end
40
-
41
+
41
42
  opts.on('--classes', '--classes CLASSES_DIR', 'Directory containing classes used by the application',
42
43
  "default: #{default_options[:classes_dir]}") do |v|
43
44
  default_options[:classes_dir] = v
@@ -48,7 +49,7 @@ module Trinidad
48
49
  ssl_port = v.nil? ? default_options.delete(:ssl_port) : v.to_i
49
50
  default_options[:ssl] = {:port => ssl_port}
50
51
  end
51
-
52
+
52
53
  opts.on('-a', '--ajp [AJP_PORT]', 'Enable ajp connections',
53
54
  "default port: #{default_options[:ajp_port]}") do |v|
54
55
  ajp_port = v.nil? ? default_options.delete(:ajp_port) : v.to_i
@@ -69,21 +70,21 @@ module Trinidad
69
70
  opts.on('--public', '--public DIRECTORY', 'Public directory', 'default: public') do |v|
70
71
  default_options[:public] = v
71
72
  end
72
-
73
+
73
74
  opts.on('-v', '--version', 'display the current version') do
74
75
  puts File.read(File.join(File.dirname(__FILE__), '..', '..', 'VERSION')).chomp
75
76
  exit
76
77
  end
77
-
78
+
78
79
  opts.on('-h', '--help', 'display the help') do
79
80
  puts opts
80
81
  exit
81
82
  end
82
-
83
+
83
84
  opts.parse!(ARGV)
84
85
  end
85
-
86
- default_options
86
+
87
+ default_options
87
88
  end
88
89
  end
89
90
  end
@@ -30,4 +30,17 @@ Hash.class_eval do
30
30
  end
31
31
  end
32
32
 
33
+ def symbolize!
34
+ keys.each do |key|
35
+ self[key].symbolize! if self[key].is_a?(Hash)
36
+ self[key.to_sym] = self.delete(key)
37
+ end
38
+ self
39
+ end
40
+ end
41
+
42
+ class String
43
+ def camelize
44
+ self.gsub(/\/(.?)/) { "::#{$1.upcase}" }.gsub(/(?:^|_)(.)/) { $1.upcase }
45
+ end
33
46
  end
@@ -0,0 +1,47 @@
1
+ module Trinidad
2
+ module Extensions
3
+ def self.configure_webapp_extensions(extensions, tomcat, app_context)
4
+ if extensions
5
+ extensions.each do |name, options|
6
+ extension(name, 'WebAppExtension').new(options).configure(tomcat, app_context)
7
+ end
8
+ end
9
+ end
10
+
11
+ def self.configure_server_extensions(extensions, tomcat)
12
+ if extensions
13
+ extensions.each do |name, options|
14
+ extension(name, 'ServerExtension').new(options).configure(tomcat)
15
+ end
16
+ end
17
+ end
18
+
19
+ def self.extension(name, type)
20
+ class_name = (name.to_s.camelize << type).to_sym
21
+ load_extension(name) unless const_defined?(class_name)
22
+ const_get(class_name)
23
+ end
24
+
25
+ def self.load_extension(name)
26
+ require "trinidad_#{name}_extension"
27
+ end
28
+
29
+ class Extension
30
+ def initialize(options)
31
+ @options = options.dup
32
+ end
33
+ end
34
+
35
+ class WebAppExtension < Extension
36
+ def configure(tomcat, app_context)
37
+ raise NotImplementedError, "#{self.class}#configure not implemented"
38
+ end
39
+ end
40
+
41
+ class ServerExtension < Extension
42
+ def configure(tomcat)
43
+ raise NotImplementedError, "#{self.class}#configure not implemented"
44
+ end
45
+ end
46
+ end
47
+ end
@@ -1,7 +1,9 @@
1
1
  module Trinidad
2
- class Server
2
+ JSystem = java.lang.System
3
+ JContext = javax.naming.Context
3
4
 
4
- attr_reader :tomcat
5
+ class Server
6
+ attr_reader :tomcat, :config
5
7
 
6
8
  def default_options
7
9
  {
@@ -23,7 +25,7 @@ module Trinidad
23
25
  end
24
26
 
25
27
  def load_config(config)
26
- @config = default_options.deep_merge(config)
28
+ @config = default_options.deep_merge(config).symbolize!
27
29
  add_default_web_app!(@config)
28
30
  end
29
31
 
@@ -31,9 +33,12 @@ module Trinidad
31
33
  @tomcat = Trinidad::Tomcat::Tomcat.new
32
34
  @tomcat.setPort(@config[:port].to_i)
33
35
  @tomcat.setBaseDir(Dir.pwd)
36
+ enable_naming
34
37
 
35
38
  add_ssl_connector if ssl_enabled?
36
39
  add_ajp_connector if ajp_enabled?
40
+
41
+ Trinidad::Extensions.configure_server_extensions(@config[:extensions], @tomcat)
37
42
  end
38
43
 
39
44
  def create_web_apps
@@ -47,6 +52,7 @@ module Trinidad
47
52
 
48
53
  web_app.load_default_web_xml
49
54
  web_app.add_rack_filter
55
+ web_app.configure_extensions(@tomcat)
50
56
  web_app.add_context_loader
51
57
  web_app.add_init_params
52
58
  web_app.add_web_dir_resources
@@ -64,7 +70,7 @@ module Trinidad
64
70
  connector.secure = opts.delete(:secure) || false
65
71
  connector.port = opts.delete(:port).to_i
66
72
 
67
- options.each do |key, value|
73
+ opts.each do |key, value|
68
74
  connector.setProperty(key.to_s, value.to_s)
69
75
  end
70
76
 
@@ -97,7 +103,7 @@ module Trinidad
97
103
  end
98
104
 
99
105
  def create_default_keystore(config)
100
- keystore_file = java.io.File.new(config[:ssl][:keystore])
106
+ keystore_file = java.io.File.new(config[:keystore])
101
107
 
102
108
  if (!keystore_file.parent_file.exists() &&
103
109
  !keystore_file.parent_file.mkdir())
@@ -110,9 +116,9 @@ module Trinidad
110
116
  "-keyalg", "RSA",
111
117
  "-validity", "365",
112
118
  "-storepass", "key",
113
- "-keystore", config[:ssl][:keystore],
114
- "-storepass", config[:ssl][:keystorePass],
115
- "-keypass", config[:ssl][:keystorePass]]
119
+ "-keystore", config[:keystore],
120
+ "-storepass", config[:keystorePass],
121
+ "-keypass", config[:keystorePass]]
116
122
 
117
123
  Trinidad::Tomcat::KeyTool.main(keytool_args.to_java(:string))
118
124
  end
@@ -136,5 +142,21 @@ module Trinidad
136
142
  end
137
143
  end
138
144
 
145
+ def enable_naming
146
+ @tomcat.getServer().addLifecycleListener(Trinidad::Tomcat::NamingContextListener.new)
147
+
148
+ JSystem.setProperty("catalina.useNaming", "true")
149
+
150
+ value = "org.apache.naming"
151
+ old_value = JSystem.getProperty(JContext.URL_PKG_PREFIXES) || value
152
+
153
+ value = value + ":" + old_value unless old_value.include?(value)
154
+ JSystem.setProperty(JContext.URL_PKG_PREFIXES, value)
155
+
156
+ value = JSystem.getProperty(JContext.INITIAL_CONTEXT_FACTORY)
157
+ unless value
158
+ JSystem.setProperty(JContext.INITIAL_CONTEXT_FACTORY, "org.apache.naming.java.javaURLContextFactory")
159
+ end
160
+ end
139
161
  end
140
162
  end
@@ -1,17 +1,19 @@
1
1
  module Trinidad
2
2
  class WebApp
3
3
  attr_reader :context, :config
4
-
4
+
5
5
  def self.create(context, config, app)
6
6
  app.has_key?(:rackup) ? RackupWebApp.new(context, config, app) : RailsWebApp.new(context, config, app)
7
7
  end
8
-
8
+
9
9
  def initialize(context, config, app)
10
10
  @context = context
11
11
  @config = config
12
12
  @app = app
13
+
14
+ @class_loader = org.jruby.util.JRubyClassLoader.new(JRuby.runtime.jruby_class_loader)
13
15
  end
14
-
16
+
15
17
  def add_rack_filter
16
18
  unless rack_filter_configured?
17
19
  filter_def = Trinidad::Tomcat::FilterDef.new
@@ -26,47 +28,46 @@ module Trinidad
26
28
  @context.addFilterMap(filter_map)
27
29
  end
28
30
  end
29
-
31
+
30
32
  def add_context_loader
31
- class_loader = org.jruby.util.JRubyClassLoader.new(JRuby.runtime.jruby_class_loader)
32
- add_application_libs(class_loader)
33
- add_application_classes(class_loader)
34
-
35
- loader = Trinidad::Tomcat::WebappLoader.new(class_loader)
33
+ add_application_libs(@class_loader)
34
+ add_application_classes(@class_loader)
35
+
36
+ loader = Trinidad::Tomcat::WebappLoader.new(@class_loader)
36
37
 
37
38
  loader.container = @context
38
39
  @context.loader = loader
39
40
  end
40
-
41
+
41
42
  def add_init_params
42
43
  [:jruby_min_runtimes, :jruby_max_runtimes].each do |param|
43
44
  param_name = param.to_s.gsub(/_/, '.')
44
45
  add_parameter_unless_exist(param_name, @config[param].to_s)
45
46
  end
46
-
47
+
47
48
  add_parameter_unless_exist('jruby.initial.runtimes', @config[:jruby_min_runtimes].to_s)
48
49
  add_parameter_unless_exist('public.root', File.join('/', public_root))
49
50
  end
50
-
51
+
51
52
  def add_web_dir_resources
52
53
  doc_base = File.join(@app[:web_app_dir], public_root)
53
54
  @context.setDocBase(doc_base) if File.exist?(doc_base)
54
55
  end
55
-
56
+
56
57
  def add_rack_context_listener
57
58
  unless rack_listener_configured?
58
59
  @context.addApplicationListener(context_listener)
59
60
  end
60
61
  end
61
-
62
+
62
63
  def add_application_libs(class_loader)
63
64
  resources_dir = File.join(@app[:web_app_dir], libs_dir, '**', '*.jar')
64
-
65
+
65
66
  Dir[resources_dir].each do |resource|
66
67
  class_loader.addURL(java.io.File.new(resource).to_url)
67
68
  end
68
69
  end
69
-
70
+
70
71
  def add_application_classes(class_loader)
71
72
  resources_dir = File.join(@app[:web_app_dir], classes_dir)
72
73
  class_loader.addURL(java.io.File.new(resources_dir).to_url)
@@ -74,7 +75,7 @@ module Trinidad
74
75
 
75
76
  def load_default_web_xml
76
77
  default_web_xml = File.expand_path(File.join(@app[:web_app_dir], default_web_xml_file))
77
-
78
+
78
79
  if File.exist?(default_web_xml)
79
80
  @context.setDefaultWebXml(default_web_xml)
80
81
  @context.setDefaultContextXml(default_web_xml)
@@ -126,5 +127,15 @@ module Trinidad
126
127
  def add_parameter_unless_exist(name, value)
127
128
  @context.addParameter(name, value) unless @context.findParameter(name)
128
129
  end
130
+
131
+ def load_extensions?
132
+ @app.has_key?(:extensions)
133
+ end
134
+
135
+ def configure_extensions(tomcat)
136
+ return unless load_extensions?
137
+
138
+ Trinidad::Extensions.configure_webapp_extensions(@app[:extensions], tomcat, @context)
139
+ end
129
140
  end
130
141
  end
@@ -0,0 +1,15 @@
1
+ module Trinidad
2
+ module Extensions
3
+ class FooWebAppExtension < WebAppExtension
4
+ def configure(tomcat, app_context)
5
+ @options
6
+ end
7
+ end
8
+
9
+ class FooServerExtension < ServerExtension
10
+ def configure(tomcat)
11
+ @options
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1 @@
1
+ require File.dirname(__FILE__) + '/foo'
data/spec/spec_helper.rb CHANGED
@@ -8,6 +8,7 @@ end
8
8
 
9
9
  $:.unshift(File.dirname(__FILE__) + '/../lib')
10
10
  $:.unshift(File.dirname(__FILE__) + '/../trinidad-libs')
11
+ $:.unshift(File.dirname(__FILE__) + '/fixtures')
11
12
 
12
13
  require 'java'
13
14
  require 'trinidad'
@@ -17,4 +18,4 @@ Spec::Runner.configure do |config|
17
18
  config.mock_with :mocha
18
19
  end
19
20
 
20
- MOCK_WEB_APP_DIR = File.join(File.dirname(__FILE__), 'web_app_mock')
21
+ MOCK_WEB_APP_DIR = File.join(File.dirname(__FILE__), 'web_app_mock')
@@ -0,0 +1,19 @@
1
+ require File.dirname(__FILE__) + '/../spec_helper'
2
+ require 'optparse'
3
+
4
+ describe Trinidad::Extensions do
5
+
6
+ before(:each) do
7
+ @extensions = {:foo => {:bar => :bazz}}
8
+ end
9
+
10
+ it "configures the server with new stuff" do
11
+ lambda {Trinidad::Extensions.configure_server_extensions(@extensions, nil)}.should_not raise_error
12
+ lambda {Trinidad::Extensions.const_get(:FooServerExtension)}.should_not raise_error
13
+ end
14
+
15
+ it "configures the webapp with new stuff" do
16
+ lambda {Trinidad::Extensions.configure_webapp_extensions(@extensions, nil, nil)}.should_not raise_error
17
+ lambda {Trinidad::Extensions.const_get(:FooWebAppExtension)}.should_not raise_error
18
+ end
19
+ end
@@ -1,7 +1,22 @@
1
1
  require File.dirname(__FILE__) + '/../spec_helper'
2
2
 
3
+ JSystem = java.lang.System
4
+ JContext = javax.naming.Context
5
+
3
6
  describe Trinidad::Server do
4
7
 
8
+ it "always uses symbols as configuration keys" do
9
+ server = Trinidad::Server.new({'port' => 4000})
10
+ server.config[:port].should == 4000
11
+ end
12
+
13
+ it "enables catalina naming" do
14
+ Trinidad::Server.new
15
+ JSystem.getProperty(JContext.URL_PKG_PREFIXES).should include("org.apache.naming")
16
+ JSystem.getProperty(JContext.INITIAL_CONTEXT_FACTORY).should == "org.apache.naming.java.javaURLContextFactory"
17
+ JSystem.getProperty("catalina.useNaming").should == "true"
18
+ end
19
+
5
20
  it "should have ssl disabled when config param is nil" do
6
21
  server = Trinidad::Server.new
7
22
  server.ssl_enabled?.should == false
metadata CHANGED
@@ -1,113 +1,129 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trinidad
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.2
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 8
8
+ - 0
9
+ version: 0.8.0
5
10
  platform: ruby
6
11
  authors:
7
- - David Calavera
12
+ - David Calavera
8
13
  autorequire:
9
14
  bindir: bin
10
15
  cert_chain: []
11
16
 
12
- date: 2009-12-08 00:00:00 +01:00
17
+ date: 2010-04-04 00:00:00 +02:00
13
18
  default_executable: trinidad
14
19
  dependencies:
15
- - !ruby/object:Gem::Dependency
16
- name: rack
17
- type: :runtime
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
20
- requirements:
21
- - - ">="
22
- - !ruby/object:Gem::Version
23
- version: "1.0"
24
- version:
25
- - !ruby/object:Gem::Dependency
26
- name: rspec
27
- type: :development
28
- version_requirement:
29
- version_requirements: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: "0"
34
- version:
35
- - !ruby/object:Gem::Dependency
36
- name: mocha
37
- type: :development
38
- version_requirement:
39
- version_requirements: !ruby/object:Gem::Requirement
40
- requirements:
41
- - - ">="
42
- - !ruby/object:Gem::Version
43
- version: "0"
44
- version:
20
+ - !ruby/object:Gem::Dependency
21
+ name: rack
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ segments:
28
+ - 1
29
+ - 0
30
+ version: "1.0"
31
+ type: :runtime
32
+ version_requirements: *id001
33
+ - !ruby/object:Gem::Dependency
34
+ name: trinidad_jars
35
+ prerelease: false
36
+ requirement: &id002 !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ segments:
41
+ - 0
42
+ version: "0"
43
+ type: :runtime
44
+ version_requirements: *id002
45
+ - !ruby/object:Gem::Dependency
46
+ name: rspec
47
+ prerelease: false
48
+ requirement: &id003 !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ segments:
53
+ - 0
54
+ version: "0"
55
+ type: :development
56
+ version_requirements: *id003
57
+ - !ruby/object:Gem::Dependency
58
+ name: mocha
59
+ prerelease: false
60
+ requirement: &id004 !ruby/object:Gem::Requirement
61
+ requirements:
62
+ - - ">="
63
+ - !ruby/object:Gem::Version
64
+ segments:
65
+ - 0
66
+ version: "0"
67
+ type: :development
68
+ version_requirements: *id004
45
69
  description:
46
70
  email: calavera@apache.org
47
71
  executables:
48
- - trinidad
72
+ - trinidad
49
73
  extensions: []
50
74
 
51
75
  extra_rdoc_files:
52
- - LICENSE
53
- - README.rdoc
76
+ - LICENSE
77
+ - README.rdoc
54
78
  files:
55
- - History.txt
56
- - LICENSE
57
- - README.rdoc
58
- - Rakefile
59
- - VERSION
60
- - bin/trinidad
61
- - lib/trinidad.rb
62
- - lib/trinidad/command_line_parser.rb
63
- - lib/trinidad/core_ext.rb
64
- - lib/trinidad/jars.rb
65
- - lib/trinidad/rackup_web_app.rb
66
- - lib/trinidad/rails_web_app.rb
67
- - lib/trinidad/server.rb
68
- - lib/trinidad/web_app.rb
69
- - trinidad-libs/core-3.1.1.jar
70
- - trinidad-libs/jasper-el.jar
71
- - trinidad-libs/jasper-jdt.jar
72
- - trinidad-libs/jasper.jar
73
- - trinidad-libs/jetty-util-6.1.14.jar
74
- - trinidad-libs/jruby-rack-0.9.5.jar
75
- - trinidad-libs/jsp-2.1.jar
76
- - trinidad-libs/jsp-api-2.1.jar
77
- - trinidad-libs/servlet-api-2.5-6.1.14.jar
78
- - trinidad-libs/tomcat-core.jar
79
- - trinidad-libs/tomcat-dbcp.jar
80
- - trinidad-libs/tomcat-jasper.jar
79
+ - History.txt
80
+ - LICENSE
81
+ - README.rdoc
82
+ - VERSION
83
+ - bin/trinidad
84
+ - lib/trinidad.rb
85
+ - lib/trinidad/command_line_parser.rb
86
+ - lib/trinidad/core_ext.rb
87
+ - lib/trinidad/extensions.rb
88
+ - lib/trinidad/rackup_web_app.rb
89
+ - lib/trinidad/rails_web_app.rb
90
+ - lib/trinidad/server.rb
91
+ - lib/trinidad/web_app.rb
81
92
  has_rdoc: true
82
93
  homepage: http://calavera.github.com/trinidad
83
94
  licenses: []
84
95
 
85
96
  post_install_message:
86
97
  rdoc_options:
87
- - --charset=UTF-8
98
+ - --charset=UTF-8
88
99
  require_paths:
89
- - lib
100
+ - lib
90
101
  required_ruby_version: !ruby/object:Gem::Requirement
91
102
  requirements:
92
- - - ">="
93
- - !ruby/object:Gem::Version
94
- version: "0"
95
- version:
103
+ - - ">="
104
+ - !ruby/object:Gem::Version
105
+ segments:
106
+ - 0
107
+ version: "0"
96
108
  required_rubygems_version: !ruby/object:Gem::Requirement
97
109
  requirements:
98
- - - ">="
99
- - !ruby/object:Gem::Version
100
- version: "0"
101
- version:
110
+ - - ">="
111
+ - !ruby/object:Gem::Version
112
+ segments:
113
+ - 0
114
+ version: "0"
102
115
  requirements: []
103
116
 
104
117
  rubyforge_project: trinidad
105
- rubygems_version: 1.3.5
118
+ rubygems_version: 1.3.6
106
119
  signing_key:
107
120
  specification_version: 3
108
121
  summary: Simple library to run rails applications into an embedded Tomcat
109
122
  test_files:
110
- - spec/spec_helper.rb
111
- - spec/trinidad/command_line_parser_spec.rb
112
- - spec/trinidad/server_spec.rb
113
- - spec/trinidad/web_app_spec.rb
123
+ - spec/fixtures/foo.rb
124
+ - spec/fixtures/trinidad_foo_extension.rb
125
+ - spec/spec_helper.rb
126
+ - spec/trinidad/command_line_parser_spec.rb
127
+ - spec/trinidad/extensions_spec.rb
128
+ - spec/trinidad/server_spec.rb
129
+ - spec/trinidad/web_app_spec.rb
data/Rakefile DELETED
@@ -1,83 +0,0 @@
1
- require 'rubygems'
2
- require 'rake'
3
-
4
- begin
5
- require 'jeweler'
6
- Jeweler::Tasks.new do |gem|
7
- gem.name = "trinidad"
8
- gem.summary = %Q{Simple library to run rails applications into an embedded Tomcat}
9
- gem.email = "calavera@apache.org"
10
- gem.homepage = "http://calavera.github.com/trinidad"
11
- gem.authors = ["David Calavera"]
12
- gem.rubyforge_project = 'trinidad'
13
-
14
- gem.files = FileList['bin/*', 'lib/**/*.rb', 'trinidad-libs/*.jar', 'History.txt', 'LICENSE', 'Rakefile', 'README.rdoc', 'VERSION']
15
- # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
16
- gem.add_dependency 'rack', '>=1.0'
17
-
18
- gem.add_development_dependency 'rspec'
19
- gem.add_development_dependency 'mocha'
20
- end
21
-
22
- Jeweler::GemcutterTasks.new
23
- rescue LoadError
24
- puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
25
- end
26
-
27
- require 'spec/rake/spectask'
28
- Spec::Rake::SpecTask.new(:spec) do |spec|
29
- spec.libs << 'lib' << 'spec'
30
- spec.spec_opts = ['--options', "spec/spec.opts"]
31
- spec.spec_files = FileList['spec/**/*_spec.rb']
32
- end
33
-
34
- Spec::Rake::SpecTask.new(:rcov) do |spec|
35
- spec.libs << 'lib' << 'spec'
36
- spec.spec_opts = ['--options', "spec/spec.opts"]
37
- spec.pattern = 'spec/**/*_spec.rb'
38
- spec.rcov = true
39
- end
40
-
41
- task :default => :spec
42
-
43
- require 'rake/rdoctask'
44
- Rake::RDocTask.new do |rdoc|
45
- if File.exist?('VERSION.yml')
46
- config = YAML.load(File.read('VERSION.yml'))
47
- version = "#{config[:major]}.#{config[:minor]}.#{config[:patch]}"
48
- else
49
- version = ""
50
- end
51
-
52
- rdoc.rdoc_dir = 'rdoc'
53
- rdoc.title = "trinidad #{version}"
54
- rdoc.rdoc_files.include('README*')
55
- rdoc.rdoc_files.include('lib/**/*.rb')
56
- end
57
-
58
- begin
59
- require 'rake/contrib/sshpublisher'
60
- namespace :rubyforge do
61
-
62
- desc "Release gem and RDoc documentation to RubyForge"
63
- task :release => ["rubyforge:release:gem"]
64
-
65
- namespace :release do
66
- desc "Publish RDoc to RubyForge."
67
- task :docs => [:rdoc] do
68
- config = YAML.load(
69
- File.read(File.expand_path('~/.rubyforge/user-config.yml'))
70
- )
71
-
72
- host = "#{config['username']}@rubyforge.org"
73
- remote_dir = "/var/www/gforge-projects/trinidad/"
74
- local_dir = 'rdoc'
75
-
76
- Rake::SshDirPublisher.new(host, remote_dir, local_dir).upload
77
- end
78
- end
79
- end
80
- rescue LoadError
81
- puts "Rake SshDirPublisher is unavailable or your rubyforge environment is not configured."
82
- end
83
-
data/lib/trinidad/jars.rb DELETED
@@ -1,29 +0,0 @@
1
- module Trinidad
2
-
3
- require "servlet-api-2.5-6.1.14"
4
- require "core-3.1.1"
5
- require "jsp-api-2.1"
6
- require "jsp-2.1"
7
- require 'tomcat-core'
8
- require 'jetty-util-6.1.14'
9
-
10
- require "jruby-rack-0.9.5"
11
-
12
- module Tomcat
13
- include_package 'org.apache.catalina'
14
- include_package 'org.apache.catalina.startup'
15
- include_package 'org.apache.catalina.core'
16
- include_package 'org.apache.catalina.deploy'
17
- include_package 'org.apache.catalina.loader'
18
-
19
- include_package 'org.apache.naming.resources'
20
-
21
- import 'org.apache.catalina.connector.Connector'
22
- import 'sun.security.tools.KeyTool'
23
- end
24
-
25
- module Rack
26
- include_package "org.jruby.rack"
27
- include_package "org.jruby.rack.rails"
28
- end
29
- end
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file