jetty-rails 0.2 → 0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +12 -3
- data/{License.txt → Licenses.txt} +18 -1
- data/Manifest.txt +3 -2
- data/README.txt +28 -33
- data/bin/jetty_rails +5 -4
- data/config/hoe.rb +7 -8
- data/lib/jetty_rails/jars.rb +19 -16
- data/lib/jetty_rails/version.rb +1 -1
- data/lib/{jruby-rack-1.0-SNAPSHOT.jar → jruby-rack-0.9.jar} +0 -0
- data/spec/jetty_rails/runner_spec.rb +8 -8
- data/tasks/rspec.rake +14 -1
- metadata +18 -9
data/History.txt
CHANGED
@@ -1,5 +1,14 @@
|
|
1
|
-
== 0.
|
1
|
+
== 0.3
|
2
2
|
|
3
|
-
*
|
3
|
+
* Improved Documentation: rdoc and site.
|
4
4
|
|
5
|
-
|
5
|
+
== 0.2
|
6
|
+
|
7
|
+
* Running any rails applications with no extra classpath.
|
8
|
+
* Command line options for jett_rails binary executable.
|
9
|
+
See: <tt>jruby -S jetty_rails --help</tt> for details.
|
10
|
+
|
11
|
+
== 0.1
|
12
|
+
|
13
|
+
* Initial release.
|
14
|
+
* Running default rails applications inside Jetty.
|
@@ -1,3 +1,7 @@
|
|
1
|
+
= Jetty Rails
|
2
|
+
|
3
|
+
Jetty Rails is distributed under the terms of the MIT License.
|
4
|
+
|
1
5
|
Copyright (c) 2008 Fabio Kung
|
2
6
|
|
3
7
|
Permission is hereby granted, free of charge, to any person obtaining
|
@@ -17,4 +21,17 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
17
21
|
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
22
|
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
23
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
24
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
25
|
+
|
26
|
+
= Additional Bundled Software
|
27
|
+
|
28
|
+
JRuby-Rack (jruby-rack-*.jar) is distributed under the terms of the
|
29
|
+
MIT license. See http://svn.codehaus.org/jruby-contrib/trunk/rack/LICENSE.txt
|
30
|
+
for details.
|
31
|
+
|
32
|
+
Jetty (jetty-*.jar) is distributed under the terms of the Apache 2.0 License.
|
33
|
+
See http://jetty.mortbay.org/jetty-6/LICENSE.txt for details.
|
34
|
+
|
35
|
+
Servlet API 2.5, a.k.a JSR-154, (servlet-api-2.5-*.jar) is distributed
|
36
|
+
under the terms of the Berkeley License. See http://developers.sun.com/license/berkeley_license.html
|
37
|
+
for details.
|
data/Manifest.txt
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
History.txt
|
2
|
-
|
2
|
+
Licenses.txt
|
3
3
|
Manifest.txt
|
4
4
|
PostInstall.txt
|
5
5
|
README.txt
|
@@ -15,13 +15,14 @@ lib/jetty_rails/handler/delegate_on_errors_handler.rb
|
|
15
15
|
lib/jetty_rails/jars.rb
|
16
16
|
lib/jetty_rails/runner.rb
|
17
17
|
lib/jetty_rails/version.rb
|
18
|
-
lib/jruby-rack-
|
18
|
+
lib/jruby-rack-0.9.jar
|
19
19
|
lib/servlet-api-2.5-6.1.9.jar
|
20
20
|
script/console
|
21
21
|
script/destroy
|
22
22
|
script/generate
|
23
23
|
script/txt2html
|
24
24
|
setup.rb
|
25
|
+
spec/jetty_rails/handler/delegate_on_errors_handler_spec.rb
|
25
26
|
spec/jetty_rails/runner_spec.rb
|
26
27
|
spec/jetty_rails_spec.rb
|
27
28
|
spec/spec.opts
|
data/README.txt
CHANGED
@@ -8,50 +8,45 @@ jetty_rails aims to run any Warbler based jruby on rails applications with Jetty
|
|
8
8
|
|
9
9
|
This project is useful for people developing jruby on rails apps that can not use mongrel for development. Rails applications integrated with servlet based applications in the same context would be a reasonable reason.
|
10
10
|
|
11
|
-
The project has born from my own needs. I needed to run JForum (http://jforum.net) on the same context of my jruby on rails application. I
|
11
|
+
The project has born from my own needs. I needed to run JForum (http://jforum.net) on the same context of my jruby on rails application. I had also to integrate HttpSessions (avoiding single sign on) and use ServletContext in-memory cache store.
|
12
12
|
|
13
|
-
== FEATURES
|
13
|
+
== FEATURES:
|
14
14
|
|
15
|
-
*
|
15
|
+
* Uses {JRuby Rack}[http://wiki.jruby.org/wiki/JRuby_Rack].
|
16
|
+
* FIX (list of features)
|
16
17
|
|
17
|
-
==
|
18
|
+
== KNOWN ISSUES
|
18
19
|
|
19
|
-
*
|
20
|
-
|
21
|
-
== REQUIREMENTS:
|
22
|
-
|
23
|
-
* FIX (list of requirements)
|
20
|
+
* To generate coverage report with jruby (>= 1.1) follow instructions from http://www.ruby-forum.com/topic/146252 and run (inside jetty-rails root dir):
|
21
|
+
jruby -S rake rcov
|
24
22
|
|
25
|
-
*
|
26
|
-
http://www.ruby-forum.com/topic/146252 and:
|
23
|
+
* Hoe in jruby has an issue reading the ~/.hoerc file. Just remove it.
|
27
24
|
|
28
|
-
|
25
|
+
== USAGE:
|
29
26
|
|
30
|
-
|
27
|
+
cd myrailsapp
|
28
|
+
jruby -S jetty_rails
|
29
|
+
|
30
|
+
--help option shows usage details:
|
31
|
+
|
32
|
+
jruby -S jetty_rails --help
|
31
33
|
|
32
|
-
|
34
|
+
== REQUIREMENTS:
|
33
35
|
|
34
|
-
|
36
|
+
jetty-rails requires jruby (>=1.1). Please make sure you already have
|
37
|
+
it properly installed and inserted in your PATH environment variable.
|
35
38
|
|
36
|
-
|
39
|
+
{Installing JRuby Instructions}[http://wiki.jruby.org/wiki/Getting_Started]
|
37
40
|
|
38
|
-
|
41
|
+
== INSTALL:
|
39
42
|
|
40
|
-
|
41
|
-
a copy of this software and associated documentation files (the
|
42
|
-
'Software'), to deal in the Software without restriction, including
|
43
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
44
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
45
|
-
permit persons to whom the Software is furnished to do so, subject to
|
46
|
-
the following conditions:
|
43
|
+
jruby -S gem install jetty-rails
|
47
44
|
|
48
|
-
|
49
|
-
included in all copies or substantial portions of the Software.
|
45
|
+
== LICENSE:
|
50
46
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
47
|
+
Jetty Rails is distributed under the terms of The MIT License.
|
48
|
+
Copyright (c) 2008 Fabio Kung <fabio.kung@gmail.com>
|
49
|
+
|
50
|
+
Read more details in the bundled +Licenses.txt+ file. There are other
|
51
|
+
pieces of software bundled with jetty-rails. Before using jetty-rails,
|
52
|
+
make sure you agree with all of them.
|
data/bin/jetty_rails
CHANGED
@@ -8,19 +8,20 @@
|
|
8
8
|
#
|
9
9
|
# jetty_tails [OPTION] ... BASEDIR
|
10
10
|
#
|
11
|
-
# -h, --help
|
11
|
+
# -h, --help::
|
12
12
|
# show help
|
13
13
|
#
|
14
|
-
# --context-path PATH, -u PATH
|
14
|
+
# --context-path PATH, -u PATH::
|
15
15
|
# change the application context path (default: '/')
|
16
16
|
#
|
17
|
-
# --port PORT, -p PORT
|
17
|
+
# --port PORT, -p PORT::
|
18
18
|
# change server port (default: 8080)
|
19
19
|
#
|
20
|
-
# --environment ENV, -e ENV
|
20
|
+
# --environment ENV, -e ENV::
|
21
21
|
# change rails environment (default: development)
|
22
22
|
#
|
23
23
|
# BASEDIR (optional): directory to be run (default: current).
|
24
|
+
|
24
25
|
require "java"
|
25
26
|
require "jetty_rails"
|
26
27
|
require 'rdoc/usage'
|
data/config/hoe.rb
CHANGED
@@ -2,7 +2,7 @@ require 'jetty_rails/version'
|
|
2
2
|
|
3
3
|
AUTHOR = 'Fabio Kung' # can also be an array of Authors
|
4
4
|
EMAIL = "fabio.kung@gmail.com"
|
5
|
-
DESCRIPTION = "
|
5
|
+
DESCRIPTION = "jetty server for rails applications"
|
6
6
|
GEM_NAME = 'jetty-rails' # what ppl will type to install your gem
|
7
7
|
RUBYFORGE_PROJECT = 'jetty-rails' # The unix name for your project
|
8
8
|
HOMEPATH = "http://#{RUBYFORGE_PROJECT}.rubyforge.org"
|
@@ -39,6 +39,7 @@ RDOC_OPTS = ['--quiet', '--title', 'jetty-rails documentation',
|
|
39
39
|
"--opname", "index.html",
|
40
40
|
"--line-numbers",
|
41
41
|
"--main", "README",
|
42
|
+
"--exclude", "*.jar",
|
42
43
|
"--inline-source"]
|
43
44
|
|
44
45
|
class Hoe
|
@@ -57,16 +58,14 @@ $hoe = Hoe.new(GEM_NAME, VERS) do |p|
|
|
57
58
|
p.url = HOMEPATH
|
58
59
|
p.rubyforge_name = RUBYFORGE_PROJECT if RUBYFORGE_PROJECT
|
59
60
|
p.test_globs = ["spec/**/*_spec.rb"]
|
60
|
-
p.clean_globs |= ['**/.*.sw?', '*.gem', '.config', '**/.DS_Store']
|
61
|
-
|
62
|
-
|
63
|
-
# p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
|
64
|
-
#p.extra_deps = EXTRA_DEPENDENCIES
|
61
|
+
p.clean_globs |= ['**/.*.sw?', '*.gem', '.config', '**/.DS_Store']
|
62
|
+
p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
|
63
|
+
p.extra_deps = EXTRA_DEPENDENCIES
|
65
64
|
|
66
65
|
# A hash of extra values to set in the gemspec.
|
67
|
-
p.spec_extras = {
|
66
|
+
# p.spec_extras = {
|
68
67
|
# :platform => "java"
|
69
|
-
}
|
68
|
+
# }
|
70
69
|
end
|
71
70
|
|
72
71
|
CHANGES = $hoe.paragraphs_of('History.txt', 0..1).join("\\n\\n")
|
data/lib/jetty_rails/jars.rb
CHANGED
@@ -1,19 +1,22 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
require "jetty-
|
4
|
-
require "
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
1
|
+
module JettyRails
|
2
|
+
|
3
|
+
require "jetty-6.1.9"
|
4
|
+
require "servlet-api-2.5-6.1.9"
|
5
|
+
require "jetty-util-6.1.9"
|
6
|
+
require "jetty-plus-6.1.9"
|
7
|
+
module Jetty
|
8
|
+
include_package "org.mortbay.jetty"
|
9
|
+
include_package "org.mortbay.jetty.servlet"
|
10
|
+
module Handler
|
11
|
+
include_package "org.mortbay.jetty.handler"
|
12
|
+
include_package "org.mortbay.jetty.webapp"
|
13
|
+
end
|
12
14
|
end
|
13
|
-
end
|
14
15
|
|
15
|
-
require "jruby-rack-
|
16
|
-
module Rack
|
17
|
-
|
18
|
-
|
16
|
+
require "jruby-rack-0.9"
|
17
|
+
module Rack
|
18
|
+
include_package "org.jruby.rack"
|
19
|
+
include_package "org.jruby.rack.rails"
|
20
|
+
end
|
21
|
+
|
19
22
|
end
|
data/lib/jetty_rails/version.rb
CHANGED
Binary file
|
@@ -51,18 +51,18 @@ describe JettyRails::Runner, "with no extra configuration" do
|
|
51
51
|
runner = JettyRails::Runner.new :base => Dir.pwd
|
52
52
|
listeners = runner.app_context.event_listeners
|
53
53
|
listeners.size.should eql(1)
|
54
|
-
listeners[0].should be_kind_of(Rack::RailsServletContextListener)
|
54
|
+
listeners[0].should be_kind_of(JettyRails::Rack::RailsServletContextListener)
|
55
55
|
end
|
56
56
|
|
57
57
|
it "should install RackFilter" do
|
58
58
|
context = mock("web application context", :null_object => true)
|
59
|
-
server = Jetty::Server.new
|
59
|
+
server = JettyRails::Jetty::Server.new
|
60
60
|
context.stub!(:getServer).and_return(server)
|
61
|
-
Jetty::Handler::WebAppContext.should_receive(:new).and_return(context)
|
61
|
+
JettyRails::Jetty::Handler::WebAppContext.should_receive(:new).and_return(context)
|
62
62
|
context.should_receive(:add_filter).once do |filter_holder, url_pattern, dispatches|
|
63
|
-
filter_holder.filter.should be_kind_of(Rack::RackFilter)
|
63
|
+
filter_holder.filter.should be_kind_of(JettyRails::Rack::RackFilter)
|
64
64
|
url_pattern.should eql('/*')
|
65
|
-
dispatches.should eql(Jetty::Context::DEFAULT)
|
65
|
+
dispatches.should eql(JettyRails::Jetty::Context::DEFAULT)
|
66
66
|
end
|
67
67
|
runner = JettyRails::Runner.new :base => Dir.pwd
|
68
68
|
end
|
@@ -70,9 +70,9 @@ describe JettyRails::Runner, "with no extra configuration" do
|
|
70
70
|
it "should have handlers for static and dynamic content" do
|
71
71
|
runner = JettyRails::Runner.new :base => Dir.pwd
|
72
72
|
runner.server.handlers.size.should eql(2)
|
73
|
-
resource_handlers = runner.server.getChildHandlersByClass(Jetty::Handler::ResourceHandler)
|
73
|
+
resource_handlers = runner.server.getChildHandlersByClass(JettyRails::Jetty::Handler::ResourceHandler)
|
74
74
|
resource_handlers.size.should eql(1)
|
75
|
-
webapp_handlers = runner.server.getChildHandlersByClass(Jetty::Handler::WebAppContext)
|
75
|
+
webapp_handlers = runner.server.getChildHandlersByClass(JettyRails::Jetty::Handler::WebAppContext)
|
76
76
|
webapp_handlers.size.should eql(1)
|
77
77
|
end
|
78
78
|
|
@@ -109,7 +109,7 @@ describe JettyRails::Runner, "with custom configuration" do
|
|
109
109
|
|
110
110
|
it "should handle custom context paths for static and dynamic content" do
|
111
111
|
runner = JettyRails::Runner.new :base => Dir.pwd, :context_path => "/myapp"
|
112
|
-
context_handlers = runner.server.getChildHandlersByClass(Jetty::Handler::ContextHandler)
|
112
|
+
context_handlers = runner.server.getChildHandlersByClass(JettyRails::Jetty::Handler::ContextHandler)
|
113
113
|
context_handlers.size.should eql(2) # one for static, one for dynamic
|
114
114
|
end
|
115
115
|
end
|
data/tasks/rspec.rake
CHANGED
@@ -33,4 +33,17 @@ Spec::Rake::SpecTask.new('spec_report') do |t|
|
|
33
33
|
t.spec_opts = ["--format", "html:../doc/rspec/specs.html", "--diff"]
|
34
34
|
t.spec_files = FileList['spec/**/*_spec.rb']
|
35
35
|
t.fail_on_error = false
|
36
|
-
end
|
36
|
+
end
|
37
|
+
|
38
|
+
# credits to http://blog.jayfields.com/2008/02/rake-task-overwriting.html
|
39
|
+
class Rake::Task
|
40
|
+
def overwrite(&block)
|
41
|
+
@actions.clear
|
42
|
+
prerequisites.clear
|
43
|
+
enhance(&block)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
Rake::Task['test'].overwrite do
|
48
|
+
Rake::Task['spec'].invoke
|
49
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jetty-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: "0.
|
4
|
+
version: "0.3"
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fabio Kung
|
@@ -9,11 +9,19 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-05-
|
12
|
+
date: 2008-05-10 00:00:00 -03:00
|
13
13
|
default_executable:
|
14
|
-
dependencies:
|
15
|
-
|
16
|
-
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: activesupport
|
17
|
+
version_requirement:
|
18
|
+
version_requirements: !ruby/object:Gem::Requirement
|
19
|
+
requirements:
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 1.3.1
|
23
|
+
version:
|
24
|
+
description: jetty server for rails applications
|
17
25
|
email:
|
18
26
|
- fabio.kung@gmail.com
|
19
27
|
executables:
|
@@ -22,13 +30,13 @@ extensions: []
|
|
22
30
|
|
23
31
|
extra_rdoc_files:
|
24
32
|
- History.txt
|
25
|
-
-
|
33
|
+
- Licenses.txt
|
26
34
|
- Manifest.txt
|
27
35
|
- PostInstall.txt
|
28
36
|
- README.txt
|
29
37
|
files:
|
30
38
|
- History.txt
|
31
|
-
-
|
39
|
+
- Licenses.txt
|
32
40
|
- Manifest.txt
|
33
41
|
- PostInstall.txt
|
34
42
|
- README.txt
|
@@ -44,13 +52,14 @@ files:
|
|
44
52
|
- lib/jetty_rails/jars.rb
|
45
53
|
- lib/jetty_rails/runner.rb
|
46
54
|
- lib/jetty_rails/version.rb
|
47
|
-
- lib/jruby-rack-
|
55
|
+
- lib/jruby-rack-0.9.jar
|
48
56
|
- lib/servlet-api-2.5-6.1.9.jar
|
49
57
|
- script/console
|
50
58
|
- script/destroy
|
51
59
|
- script/generate
|
52
60
|
- script/txt2html
|
53
61
|
- setup.rb
|
62
|
+
- spec/jetty_rails/handler/delegate_on_errors_handler_spec.rb
|
54
63
|
- spec/jetty_rails/runner_spec.rb
|
55
64
|
- spec/jetty_rails_spec.rb
|
56
65
|
- spec/spec.opts
|
@@ -88,7 +97,7 @@ rubyforge_project: jetty-rails
|
|
88
97
|
rubygems_version: 1.0.1
|
89
98
|
signing_key:
|
90
99
|
specification_version: 2
|
91
|
-
summary:
|
100
|
+
summary: jetty server for rails applications
|
92
101
|
test_files:
|
93
102
|
- spec/jetty_rails/handler/delegate_on_errors_handler_spec.rb
|
94
103
|
- spec/jetty_rails/runner_spec.rb
|