finnlabs-warbler 0.9.14
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/History.txt +108 -0
- data/LICENSES.txt +37 -0
- data/Manifest.txt +35 -0
- data/README.txt +170 -0
- data/Rakefile +61 -0
- data/bin/warble +68 -0
- data/generators/warble/templates/warble.rb +89 -0
- data/generators/warble/warble_generator.rb +19 -0
- data/lib/jruby-complete-1.3.1.jar +0 -0
- data/lib/jruby-rack-0.9.4.jar +0 -0
- data/lib/warbler.rb +16 -0
- data/lib/warbler/config.rb +240 -0
- data/lib/warbler/gems.rb +36 -0
- data/lib/warbler/task.rb +347 -0
- data/lib/warbler/version.rb +9 -0
- data/spec/sample/app/controllers/application.rb +15 -0
- data/spec/sample/app/helpers/application_helper.rb +3 -0
- data/spec/sample/config/boot.rb +109 -0
- data/spec/sample/config/environment.rb +67 -0
- data/spec/sample/config/environments/development.rb +17 -0
- data/spec/sample/config/environments/production.rb +22 -0
- data/spec/sample/config/environments/test.rb +22 -0
- data/spec/sample/config/initializers/inflections.rb +10 -0
- data/spec/sample/config/initializers/mime_types.rb +5 -0
- data/spec/sample/config/initializers/new_rails_defaults.rb +15 -0
- data/spec/sample/config/routes.rb +41 -0
- data/spec/spec_helper.rb +43 -0
- data/spec/warbler/config_spec.rb +110 -0
- data/spec/warbler/gems_spec.rb +39 -0
- data/spec/warbler/task_spec.rb +486 -0
- data/tasks/warbler.rake +18 -0
- data/web.xml.erb +32 -0
- metadata +102 -0
data/History.txt
ADDED
@@ -0,0 +1,108 @@
|
|
1
|
+
== 0.9.14
|
2
|
+
|
3
|
+
* Bug Fix Release
|
4
|
+
* Now includes JRuby 1.3.1 with a fix to BigDecimal vulnerability
|
5
|
+
|
6
|
+
== 0.9.13
|
7
|
+
|
8
|
+
* RailsConf 2009 edition.
|
9
|
+
* Only bundled JRuby and JRuby-Rack upgrades. Bug fixes will have to come in 0.9.14.
|
10
|
+
* This should also be the last release with bundled JRuby and JRuby-Rack.
|
11
|
+
* Upgrade to JRuby 1.3.0RC1 and JRuby-Rack 0.9.4. The latter allows
|
12
|
+
Rails 2.3 to work with Warbler.
|
13
|
+
|
14
|
+
== 0.9.12
|
15
|
+
|
16
|
+
* Allow framework auto-detection to be disabled. Set
|
17
|
+
`Warbler.framework_detection = false` at the top of config/warble.rb
|
18
|
+
or uncomment the line from a newly generated config.
|
19
|
+
* Add configuration option to set manifest file (thanks Tommy McGuire)
|
20
|
+
* Mitigate RubyGems 1.3 compatibility issue (thanks Jens Norrgrann)
|
21
|
+
* Add experimental `war:exploded` task. This allows you to deploy your
|
22
|
+
application in an exploded mode, thus allowing continual development
|
23
|
+
without re-warring and re-deploying. Feedback is appreciated if you
|
24
|
+
try this feature; it may not work in all application servers and for
|
25
|
+
applications other than Rails.
|
26
|
+
* Handle Rails gem dependencies better (thanks Laszlo Bacsi)
|
27
|
+
* Auto-detect Merb dependencies (Merb >= 1.0 only). Please give
|
28
|
+
feedback if you try Warbler with a Merb 1.0 app.
|
29
|
+
* Ignore gem development dependencies
|
30
|
+
* Upgrade to JRuby 1.1.6 and JRuby-Rack 0.9.3
|
31
|
+
|
32
|
+
== 0.9.11
|
33
|
+
|
34
|
+
* Auto-detect Rails and Merb and configure appropriately
|
35
|
+
- For Rails, set rails booter, determine max runtimes based on Rails.configuration.threadsafe!,
|
36
|
+
add Rails gem, detect Rails version, set gems to be packaged based on
|
37
|
+
Rails.configuration.gems if available
|
38
|
+
- Rails gems only added if Rails application detected
|
39
|
+
- For Merb, set merb booter automatically
|
40
|
+
* Auto-detect config.ru rackup script and pass it into config.webxml.rackup
|
41
|
+
* rails.env now commented by default in config/warble.rb and internally default
|
42
|
+
the value to 'production'
|
43
|
+
* Default directories in config.dirs to only those that are found to be present
|
44
|
+
* Allow config.gems array to contain regexps and Gem::Dependency objects as well
|
45
|
+
(assist from Jani Soila)
|
46
|
+
* Fix bug ensuring you can += and -= for config.gems
|
47
|
+
* Upgrade to JRuby 1.1.4 and JRuby-Rack 0.9.2
|
48
|
+
* add [] as a way to specify non-identifier keys, example: config.webxml['!@#$%^'] = 'haha'
|
49
|
+
|
50
|
+
== 0.9.10
|
51
|
+
|
52
|
+
* Upgraded to JRuby-Rack 0.9.1. Fixes JRUBY-2620, JRUBY-2594, JRUBY-2507.
|
53
|
+
* Now verified to work with Camping and Sinatra. See
|
54
|
+
http://github.com/nicksieger/jruby-rack/tree/master/examples for examples
|
55
|
+
of how to configure Warbler to package your Camping and Sinatra apps.
|
56
|
+
* Upgraded to JRuby 1.1.3.
|
57
|
+
* Log files are no longer packaged in the .war file.
|
58
|
+
* Fix #<Warbler::WebxmlOpenStruct ...> appearing in web.xml and document workarounds.
|
59
|
+
* Add config.autodeploy_dir that, when specified, will create the war there.
|
60
|
+
|
61
|
+
== 0.9.9
|
62
|
+
|
63
|
+
* Now shipping with JRuby-Rack 0.9!
|
64
|
+
* Upgrade to JRuby 1.1.1
|
65
|
+
* warble.rb and web.xml.erb have changed as a result of the change to JRuby-Rack -- we
|
66
|
+
recommend comparing the new base copies with any existing configuration you have to
|
67
|
+
make sure you pick up the differences.
|
68
|
+
* Config changes:
|
69
|
+
** config.webxml.booter chooses what kind of application to use (:rails, :merb or plain :rack).
|
70
|
+
** config.webxml.pool.* have been replaced by config.webxml.jruby.(min|max).runtimes
|
71
|
+
** config.webxml.standalone and config.webxml.jruby_home no longer have any effect.
|
72
|
+
|
73
|
+
== 0.9.5
|
74
|
+
|
75
|
+
* Fix bug in plugin warbler.rake task file that would favor loading warbler from gems before the version
|
76
|
+
installed as a plugin
|
77
|
+
* Upgrade to JRuby 1.1 final and Goldspike 1.6.1
|
78
|
+
|
79
|
+
== 0.9.4
|
80
|
+
|
81
|
+
* Update bundled JRuby to 1.1RC3 and Goldspike to 1.6.
|
82
|
+
* Fix inclusion of gems with platform-specific bits (e.g., Hpricot)
|
83
|
+
|
84
|
+
== 0.9.3
|
85
|
+
|
86
|
+
* Update bundled JRuby to 1.1RC2, and Goldspike to 1.5.
|
87
|
+
* The bundled JRuby and Goldspike now require JDK 5 or greater. If you wish to use JDK 1.4, use Warbler 0.9.2.
|
88
|
+
|
89
|
+
== 0.9.2
|
90
|
+
|
91
|
+
* Update bundled JRuby to version 1.0.3 and Goldspike 1.4.
|
92
|
+
* Add config.java_classes to allow you to copy loose Java classes into WEB-INF/classes.
|
93
|
+
* Make jar command a single command string so that jar creation doesn't fail (works around bug in JRuby 1.0.2)
|
94
|
+
* Use File.join to form staging directory, should produce the proper jar-command path in Windows
|
95
|
+
|
96
|
+
== 0.9.1
|
97
|
+
|
98
|
+
* Add rake >= 0.7.3 as a dependency in the gem specification.
|
99
|
+
* Add debug tasks: war:debug, war:debug:gems, war:debug:public, war:debug:app, war:debug:includes,
|
100
|
+
war:debug:excludes, war:debug:java_libs gives you a breakdown of what Warbler expects to package.
|
101
|
+
|
102
|
+
== 0.9
|
103
|
+
|
104
|
+
* Birthday! Warbler is a gem to make a .war file out of a Rails project. The intent is to provide a
|
105
|
+
minimal, flexible, ruby-like way to bundle up all of your application files for deployment to a
|
106
|
+
Java application server.
|
107
|
+
* Bundled versions: goldspike-1.4-SNAPSHOT and jruby-complete-1.0.1
|
108
|
+
* Works as both a gem (rake application) or a plugin
|
data/LICENSES.txt
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
= Warbler
|
2
|
+
|
3
|
+
Warbler is provided under the terms of the MIT license.
|
4
|
+
|
5
|
+
(c) Copyright 2007-2008 Sun Microsystems, Inc.
|
6
|
+
|
7
|
+
Permission is hereby granted, free of charge, to any person
|
8
|
+
obtaining a copy of this software and associated documentation files
|
9
|
+
(the "Software"), to deal in the Software without restriction,
|
10
|
+
including without limitation the rights to use, copy, modify, merge,
|
11
|
+
publish, distribute, sublicense, and/or sell copies of the Software,
|
12
|
+
and to permit persons to whom the Software is furnished to do so,
|
13
|
+
subject to the following conditions:
|
14
|
+
|
15
|
+
The above copyright notice and this permission notice shall be
|
16
|
+
included in all copies or substantial portions of the Software.
|
17
|
+
|
18
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
19
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
20
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
21
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
22
|
+
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
23
|
+
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
24
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
25
|
+
SOFTWARE.
|
26
|
+
|
27
|
+
= Additional Bundled Software
|
28
|
+
|
29
|
+
JRuby-Rack (jruby-rack-*.jar) is distributed under the terms of the MIT license.
|
30
|
+
See http://svn.codehaus.org/jruby-contrib/trunk/rack/LICENSE.txt
|
31
|
+
for details.
|
32
|
+
|
33
|
+
JRuby (jruby-complete-*.jar) is distrubuted under the terms of the Common
|
34
|
+
Public License. See http://www.eclipse.org/legal/cpl-v10.html for details. At
|
35
|
+
your option, JRuby is also available under the GPL or LGPL licenses. See the
|
36
|
+
file COPYING in the JRuby distribution for details
|
37
|
+
(http://svn.codehaus.org/jruby/trunk/jruby/COPYING).
|
data/Manifest.txt
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
History.txt
|
2
|
+
Manifest.txt
|
3
|
+
README.txt
|
4
|
+
LICENSES.txt
|
5
|
+
Rakefile
|
6
|
+
web.xml.erb
|
7
|
+
bin/warble
|
8
|
+
generators/warble
|
9
|
+
generators/warble/templates
|
10
|
+
generators/warble/warble_generator.rb
|
11
|
+
generators/warble/templates/warble.rb
|
12
|
+
lib/jruby-complete-1.3.1.jar
|
13
|
+
lib/jruby-rack-0.9.4.jar
|
14
|
+
lib/warbler
|
15
|
+
lib/warbler.rb
|
16
|
+
lib/warbler/config.rb
|
17
|
+
lib/warbler/gems.rb
|
18
|
+
lib/warbler/task.rb
|
19
|
+
lib/warbler/version.rb
|
20
|
+
spec/spec_helper.rb
|
21
|
+
spec/sample/app/controllers/application.rb
|
22
|
+
spec/sample/app/helpers/application_helper.rb
|
23
|
+
spec/sample/config/boot.rb
|
24
|
+
spec/sample/config/environment.rb
|
25
|
+
spec/sample/config/routes.rb
|
26
|
+
spec/sample/config/environments/development.rb
|
27
|
+
spec/sample/config/environments/production.rb
|
28
|
+
spec/sample/config/environments/test.rb
|
29
|
+
spec/sample/config/initializers/inflections.rb
|
30
|
+
spec/sample/config/initializers/mime_types.rb
|
31
|
+
spec/sample/config/initializers/new_rails_defaults.rb
|
32
|
+
spec/warbler/config_spec.rb
|
33
|
+
spec/warbler/gems_spec.rb
|
34
|
+
spec/warbler/task_spec.rb
|
35
|
+
tasks/warbler.rake
|
data/README.txt
ADDED
@@ -0,0 +1,170 @@
|
|
1
|
+
= Warbler
|
2
|
+
|
3
|
+
Warbler is a gem to make a .war file out of a Rails, Merb, or Rack-based
|
4
|
+
application. The intent is to provide a minimal, flexible, ruby-like way to
|
5
|
+
bundle up all of your application files for deployment to a Java application
|
6
|
+
server.
|
7
|
+
|
8
|
+
Warbler provides a sane set of out-of-the box defaults that should allow most
|
9
|
+
Rails applications without external gem dependencies (aside from Rails itself)
|
10
|
+
to assemble and Just Work.
|
11
|
+
|
12
|
+
Warbler bundles JRuby and the JRuby-Rack servlet adapter for dispatching
|
13
|
+
requests to your application inside the java application server, and assembles
|
14
|
+
all jar files in WARBLER_HOME/lib/*.jar into your application. No external
|
15
|
+
dependencies are downloaded.
|
16
|
+
|
17
|
+
== Getting Started
|
18
|
+
|
19
|
+
1. Install the gem: <tt>gem install warbler</tt>.
|
20
|
+
2. Run warbler in the top directory of your Rails application: <tt>warble</tt>.
|
21
|
+
3. Deploy your railsapp.war file to your favorite Java application server.
|
22
|
+
|
23
|
+
== Usage
|
24
|
+
|
25
|
+
Warbler's +warble+ command is just a small wrapper around Rake with internally
|
26
|
+
defined tasks. (Notice "rake" still prints out in the message, but you should
|
27
|
+
substitute "warble" for "rake" on the command line when running this way.)
|
28
|
+
|
29
|
+
$ warble -T
|
30
|
+
rake config # Generate a configuration file to customize your war assembly
|
31
|
+
rake pluginize # Unpack warbler as a plugin in your Rails application
|
32
|
+
rake war # Create trunk.war
|
33
|
+
rake war:app # Copy all application files into the .war
|
34
|
+
rake war:clean # Clean up the .war file and the staging area
|
35
|
+
rake war:gems # Unpack all gems into WEB-INF/gems
|
36
|
+
rake war:jar # Run the jar command to create the .war
|
37
|
+
rake war:java_libs # Copy all java libraries into the .war
|
38
|
+
rake war:public # Copy all public HTML files to the root of the .war
|
39
|
+
rake war:webxml # Generate a web.xml file for the webapp
|
40
|
+
|
41
|
+
Warbler makes heavy use of Rake's file and directory tasks, so only recently
|
42
|
+
updated files will be copied, making repeated assemblies much faster.
|
43
|
+
|
44
|
+
== Configuration
|
45
|
+
|
46
|
+
=== Rails applications
|
47
|
+
|
48
|
+
Rails applications are detected automatically and configured appropriately.
|
49
|
+
The following items are set up for you:
|
50
|
+
|
51
|
+
* The Rails gem is packaged if you haven't vendored Rails.
|
52
|
+
* Other gems configured in Rails.configuration.gems are packaged
|
53
|
+
(Rails 2.1 or later)
|
54
|
+
* Multi-thread-safe execution (as introduced in Rails 2.2) is detected
|
55
|
+
and runtime pooling is disabled.
|
56
|
+
|
57
|
+
=== Merb applications
|
58
|
+
|
59
|
+
Merb applications are detected automatically, and the merb-core gem and its
|
60
|
+
dependencies are packaged.
|
61
|
+
|
62
|
+
=== Other Rack-based applications
|
63
|
+
|
64
|
+
If you have a 'config.ru' file in the top directory of your application, its
|
65
|
+
contents will be used as the rackup script for your Rack-based application.
|
66
|
+
You will probably need to specify framework and application gems in
|
67
|
+
config/warble.rb.
|
68
|
+
|
69
|
+
See <a href="http://jruby-rack.kenai.com/sources/main/show/examples">the examples in the jruby-rack project</a>
|
70
|
+
of how to configure Warbler to package Camping and Sinatra apps.
|
71
|
+
|
72
|
+
=== Configuration auto-detect notes
|
73
|
+
|
74
|
+
* If you don't have database access in the environment where you
|
75
|
+
package your application, you may wish to set
|
76
|
+
`Warbler.framework_detection` to false at the top of config.rb. In
|
77
|
+
this case you may need to specify additional details such as booter,
|
78
|
+
gems and other settings.
|
79
|
+
* A more accurate way of detecting a Merb application's gems is
|
80
|
+
needed. Until then, you will have to specify them in
|
81
|
+
config/warble.rb. See below.
|
82
|
+
* Is it possible to more generally detect what gems an application
|
83
|
+
uses? Gem.loaded_specs is available, but the application needs to be
|
84
|
+
loaded first before its contents are reliable.
|
85
|
+
|
86
|
+
=== Custom configuration
|
87
|
+
|
88
|
+
The default configuration puts application files (+app+, +config+, +lib+,
|
89
|
+
+log+, +vendor+, +tmp+) under the .war file's WEB-INF directory, and files in
|
90
|
+
+public+ in the root of the .war file. Any Java .jar files stored in lib will
|
91
|
+
automatically be placed in WEB-INF/lib for placement on the web app's
|
92
|
+
classpath.
|
93
|
+
|
94
|
+
If the default settings are not appropriate for your application, you can
|
95
|
+
customize Warbler's behavior. To customize files, libraries, and gems included
|
96
|
+
in the .war file, you'll need a config/warble.rb file. There a two ways of
|
97
|
+
doing this. With the gem, simply run
|
98
|
+
|
99
|
+
warble config
|
100
|
+
|
101
|
+
If you have Warbler installed as a plugin, use the generator:
|
102
|
+
|
103
|
+
script/generate warble
|
104
|
+
|
105
|
+
Finally, edit the config/warble.rb to your taste. If you install the gem but
|
106
|
+
later decide you'd like to have it as a plugin, use the +pluginize+ command:
|
107
|
+
|
108
|
+
warble pluginize
|
109
|
+
|
110
|
+
If you wish to upgrade or switch one or more java libraries from what's
|
111
|
+
bundled in the Warbler gem, simply change the jars in WARBLER_HOME/lib, or
|
112
|
+
modify the +java_libs+ attribute of Warbler::Config to include the files you
|
113
|
+
need.
|
114
|
+
|
115
|
+
Once Warbler is installed as a plugin, you can use +rake+ to build the war
|
116
|
+
(with the same set of tasks as above).
|
117
|
+
|
118
|
+
The generated config/warble.rb file is fully-documented with the available
|
119
|
+
options and default values.
|
120
|
+
|
121
|
+
=== Web.xml
|
122
|
+
|
123
|
+
Java web applications are configured mainly through this file, and Warbler
|
124
|
+
creates a suitable default file for you for use. However, if you need to
|
125
|
+
customize it in any way, you have two options.
|
126
|
+
|
127
|
+
1. If you just want a static web.xml file whose contents you manually
|
128
|
+
control, you may copy the one generated for you in
|
129
|
+
<tt>tmp/war/WEB-INF/web.xml</tt> to <tt>config/web.xml</tt> and
|
130
|
+
modify as needed. It will be copied into the webapp for you.
|
131
|
+
2. If you want to inject some dynamic information into the file, copy
|
132
|
+
the <tt>WARBLER_HOME/web.xml.erb</tt> to
|
133
|
+
<tt>config/web.xml.erb</tt>. Its contents will be evaluated for you
|
134
|
+
and put in the webapp. Note that you can also pass arbitrary
|
135
|
+
properties to the ERb template by setting
|
136
|
+
<tt>config.webxml.customkey</tt> values in your
|
137
|
+
<tt>config/warble.rb</tt> file.
|
138
|
+
|
139
|
+
For more information on configuration, see Warbler::Config.
|
140
|
+
|
141
|
+
=== Troubleshooting
|
142
|
+
|
143
|
+
If Warbler isn't packaging the files you were expecting, there are several
|
144
|
+
debug tasks available to give you more insight into what's going on.
|
145
|
+
|
146
|
+
* <tt>war:debug</tt> prints a YAML dump of the current configuration
|
147
|
+
* <tt>war:debug:X</tt> prints a list of files that Warbler will
|
148
|
+
include during that stage of assembly. Valid values of <tt>X</tt>
|
149
|
+
are <tt>app, java_libs, gems, public, includes, excludes</tt>.
|
150
|
+
|
151
|
+
== Source
|
152
|
+
|
153
|
+
You can get the Warbler source using Git, in any of the following ways:
|
154
|
+
|
155
|
+
git clone git://kenai.com/warbler~main
|
156
|
+
git clone git://git.caldersphere.net/warbler.git
|
157
|
+
git clone git://github.com/nicksieger/warbler.git
|
158
|
+
|
159
|
+
You can also download a tarball of Warbler source at
|
160
|
+
http://github.com/nicksieger/warbler/tree/master.
|
161
|
+
|
162
|
+
== License
|
163
|
+
|
164
|
+
Warbler is provided under the terms of the MIT license.
|
165
|
+
|
166
|
+
Warbler (c) 2007-2009 Sun Microsystems, Inc.
|
167
|
+
|
168
|
+
Warbler also bundles several other pieces of software for convenience.
|
169
|
+
Please read the file LICENSES.txt to ensure that you agree with the
|
170
|
+
terms of all the components.
|
data/Rakefile
ADDED
@@ -0,0 +1,61 @@
|
|
1
|
+
require 'spec/rake/spectask'
|
2
|
+
require 'spec/rake/verify_rcov'
|
3
|
+
|
4
|
+
MANIFEST = FileList["History.txt", "Manifest.txt", "README.txt", "LICENSES.txt", "Rakefile",
|
5
|
+
"*.erb", "bin/*", "generators/**/*", "lib/**/*", "spec/**/*.rb", "tasks/**/*.rake"]
|
6
|
+
|
7
|
+
begin
|
8
|
+
File.open("Manifest.txt", "w") {|f| MANIFEST.each {|n| f << "#{n}\n"} }
|
9
|
+
require 'hoe'
|
10
|
+
require File.dirname(__FILE__) + '/lib/warbler/version'
|
11
|
+
hoe = Hoe.new("warbler", Warbler::VERSION) do |p|
|
12
|
+
p.rubyforge_name = "caldersphere"
|
13
|
+
p.url = "http://caldersphere.rubyforge.org/warbler"
|
14
|
+
p.author = "Nick Sieger"
|
15
|
+
p.email = "nick@nicksieger.com"
|
16
|
+
p.summary = "Warbler chirpily constructs .war files of your Rails applications."
|
17
|
+
p.changes = p.paragraphs_of('History.txt', 0..1).join("\n\n")
|
18
|
+
p.description = p.paragraphs_of('README.txt', 1...2).join("\n\n")
|
19
|
+
p.extra_deps << ['rake', '>= 0.7.3']
|
20
|
+
p.test_globs = ["spec/**/*_spec.rb"]
|
21
|
+
end
|
22
|
+
hoe.spec.files = MANIFEST
|
23
|
+
hoe.spec.dependencies.delete_if { |dep| dep.name == "hoe" }
|
24
|
+
|
25
|
+
task :gemspec do
|
26
|
+
File.open("#{hoe.name}.gemspec", "w") {|f| f << hoe.spec.to_ruby }
|
27
|
+
end
|
28
|
+
task :package => :gemspec
|
29
|
+
rescue LoadError
|
30
|
+
puts "You really need Hoe installed to be able to package this gem"
|
31
|
+
end
|
32
|
+
|
33
|
+
# Hoe insists on setting task :default => :test
|
34
|
+
# !@#$ no easy way to empty the default list of prerequisites
|
35
|
+
Rake::Task['default'].send :instance_variable_set, "@prerequisites", FileList[]
|
36
|
+
|
37
|
+
if defined?(JRUBY_VERSION)
|
38
|
+
task :default => :spec
|
39
|
+
else
|
40
|
+
task :default => :rcov
|
41
|
+
end
|
42
|
+
|
43
|
+
Spec::Rake::SpecTask.new do |t|
|
44
|
+
t.spec_opts ||= []
|
45
|
+
t.spec_opts << "--options" << "spec/spec.opts"
|
46
|
+
end
|
47
|
+
|
48
|
+
Spec::Rake::SpecTask.new("spec:rcov") do |t|
|
49
|
+
t.rcov = true
|
50
|
+
t.rcov_opts << '--exclude gems/*'
|
51
|
+
end
|
52
|
+
|
53
|
+
# so we don't confuse autotest
|
54
|
+
RCov::VerifyTask.new(:rcov) do |t|
|
55
|
+
t.threshold = 100
|
56
|
+
end
|
57
|
+
|
58
|
+
task "spec:rcov" do
|
59
|
+
rm_f "Manifest.txt"
|
60
|
+
end
|
61
|
+
task :rcov => "spec:rcov"
|
data/bin/warble
ADDED
@@ -0,0 +1,68 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
#--
|
4
|
+
# (c) Copyright 2007-2008 Sun Microsystems, Inc.
|
5
|
+
# See the file LICENSES.txt included with the distribution for
|
6
|
+
# software license details.
|
7
|
+
#++
|
8
|
+
|
9
|
+
require 'rubygems'
|
10
|
+
require 'rake'
|
11
|
+
require 'warbler'
|
12
|
+
|
13
|
+
application = Rake.application
|
14
|
+
|
15
|
+
# Load any application rakefiles to aid in autodetecting applications
|
16
|
+
Warbler.project_application = Rake::Application.new
|
17
|
+
Rake.application = Warbler.project_application
|
18
|
+
Rake::Application::DEFAULT_RAKEFILES.each do |rf|
|
19
|
+
if File.exist?(rf)
|
20
|
+
load rf
|
21
|
+
break
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
Rake.application = application
|
26
|
+
application.standard_exception_handling do
|
27
|
+
application.init
|
28
|
+
|
29
|
+
# Load the main warbler tasks
|
30
|
+
Warbler::Task.new
|
31
|
+
|
32
|
+
task :default => :war
|
33
|
+
|
34
|
+
desc "Generate a configuration file to customize your war assembly"
|
35
|
+
task :config do
|
36
|
+
if File.exists?(Warbler::Config::FILE) && ENV["FORCE"].nil?
|
37
|
+
puts "There's another bird sitting on my favorite branch"
|
38
|
+
puts "(file '#{Warbler::Config::FILE}' already exists. Pass argument FORCE=1 to override)"
|
39
|
+
elsif !File.directory?("config")
|
40
|
+
puts "I'm confused; my favorite branch is missing"
|
41
|
+
puts "(directory 'config' is missing)"
|
42
|
+
else
|
43
|
+
cp "#{Warbler::WARBLER_HOME}/generators/warble/templates/warble.rb", Warbler::Config::FILE
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
desc "Unpack warbler as a plugin in your Rails application"
|
48
|
+
task :pluginize do
|
49
|
+
if !Dir["vendor/plugins/warbler*"].empty?
|
50
|
+
puts "I found an old nest in vendor/plugins; please trash it so I can make a new one"
|
51
|
+
puts "(directory vendor/plugins/warbler* exists)"
|
52
|
+
elsif !File.directory?("vendor/plugins")
|
53
|
+
puts "I can't find a place to build my nest"
|
54
|
+
puts "(directory 'vendor/plugins' is missing)"
|
55
|
+
else
|
56
|
+
Dir.chdir("vendor/plugins") do
|
57
|
+
ruby "-S", "gem", "unpack", "warbler"
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
desc "Display version of warbler"
|
63
|
+
task :version do
|
64
|
+
puts "Warbler version #{Warbler::VERSION}"
|
65
|
+
end
|
66
|
+
|
67
|
+
application.top_level
|
68
|
+
end
|