warbler 0.9.1 → 0.9.2

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,7 +1,12 @@
1
+ == 0.9.2
2
+
3
+ * Update bundled JRuby to version 1.0.3 and Goldspike 1.4.
4
+ * Add config.java_classes to allow you to copy loose Java classes into WEB-INF/classes.
5
+ * Make jar command a single command string so that jar creation doesn't fail (works around bug in JRuby 1.0.2)
6
+ * Use File.join to form staging directory, should produce the proper jar-command path in Windows
7
+
1
8
  == 0.9.1
2
9
 
3
- * Bundle Bouncy Castle JCE provider so that Digests work properly. See LICENSES.txt for details of
4
- the distribution.
5
10
  * Add rake >= 0.7.3 as a dependency in the gem specification.
6
11
  * Add debug tasks: war:debug, war:debug:gems, war:debug:public, war:debug:app, war:debug:includes,
7
12
  war:debug:excludes, war:debug:java_libs gives you a breakdown of what Warbler expects to package.
data/LICENSES.txt CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Warbler is provided under the terms of the MIT license.
4
4
 
5
- (c) Copyright 2007 Nick Sieger <nicksieger@gmail.com>
5
+ (c) Copyright 2007-08 Nick Sieger <nicksieger@gmail.com>
6
6
 
7
7
  Permission is hereby granted, free of charge, to any person
8
8
  obtaining a copy of this software and associated documentation files
data/Manifest.txt CHANGED
@@ -10,15 +10,18 @@ generators/warble/templates
10
10
  generators/warble/templates/warble.rb
11
11
  generators/warble/warble_generator.rb
12
12
  lib/activation-1.1.jar
13
+ lib/backport-util-concurrent-3.0.jar
13
14
  lib/commons-pool-1.3.jar
14
- lib/goldspike-1.4-SNAPSHOT.jar
15
- lib/jruby-complete-1.0.1.jar
15
+ lib/goldspike-1.4.jar
16
+ lib/jruby-complete-1.0.3.jar
16
17
  lib/warbler
17
18
  lib/warbler/config.rb
19
+ lib/warbler/gems.rb
18
20
  lib/warbler/task.rb
19
21
  lib/warbler/version.rb
20
22
  lib/warbler.rb
21
23
  spec/spec_helper.rb
22
24
  spec/warbler/config_spec.rb
25
+ spec/warbler/gems_spec.rb
23
26
  spec/warbler/task_spec.rb
24
27
  tasks/warbler.rake
data/README.txt CHANGED
@@ -100,7 +100,7 @@ Warbler source is not currently located in Rubyforge's SVN. To get the source:
100
100
 
101
101
  Warbler is provided under the terms of the MIT license.
102
102
 
103
- Warbler (c) 2007 Nick Sieger <nicksieger@gmail.com>
103
+ Warbler (c) 2007-08 Nick Sieger <nicksieger@gmail.com>
104
104
 
105
105
  Warbler also bundles several other pieces of software. Please read the file LICENSES.txt to ensure
106
106
  that you agree with the terms of all the components.
data/Rakefile CHANGED
@@ -1,4 +1,5 @@
1
1
  require 'spec/rake/spectask'
2
+ require 'spec/rake/verify_rcov'
2
3
 
3
4
  MANIFEST = FileList["History.txt", "Manifest.txt", "README.txt", "LICENSES.txt", "Rakefile",
4
5
  "*.erb", "bin/*", "generators/**/*", "lib/**/*", "spec/**/*.rb", "tasks/**/*.rake"]
@@ -29,9 +30,22 @@ end
29
30
  # !@#$ no easy way to empty the default list of prerequisites
30
31
  Rake::Task['default'].send :instance_variable_set, "@prerequisites", FileList[]
31
32
 
32
- task :default => :spec
33
+ task :default => :rcov
33
34
 
34
35
  Spec::Rake::SpecTask.new do |t|
35
36
  t.spec_opts ||= []
36
- t.spec_opts << "--diff" << "unified"
37
+ t.spec_opts << "--options" << "spec/spec.opts"
37
38
  end
39
+
40
+ Spec::Rake::SpecTask.new("spec:rcov") do |t|
41
+ t.rcov = true
42
+ end
43
+ # so we don't confuse autotest
44
+ RCov::VerifyTask.new(:rcov) do |t|
45
+ t.threshold = 100
46
+ end
47
+
48
+ task "spec:rcov" do
49
+ rm_f "Manifest.txt"
50
+ end
51
+ task :rcov => "spec:rcov"
@@ -18,11 +18,21 @@ Warbler::Config.new do |config|
18
18
  # own versions if you directly set the value
19
19
  # config.java_libs += FileList["lib/java/*.jar"]
20
20
 
21
+ # Loose Java classes and miscellaneous files to be placed in WEB-INF/classes.
22
+ # config.java_classes = FileList["target/classes/**.*"]
23
+
24
+ # One or more pathmaps defining how the java classes should be copied into
25
+ # WEB-INF/classes. The example pathmap below accompanies the java_classes
26
+ # configuration above. See http://rake.rubyforge.org/classes/String.html#M000017
27
+ # for details of how to specify a pathmap.
28
+ # config.pathmaps.java_classes << "%{target/classes/,}"
29
+
21
30
  # Gems to be packaged in the webapp. Note that Rails gems are added to this
22
31
  # list if vendor/rails is not present, so be sure to include rails if you
23
32
  # overwrite the value
24
- # config.gems = ["ActiveRecord-JDBC", "jruby-openssl"]
33
+ # config.gems = ["activerecord-jdbc-adapter", "jruby-openssl"]
25
34
  # config.gems << "tzinfo"
35
+ # config.gems["rails"] = "1.2.3"
26
36
 
27
37
  # Include gem dependencies not mentioned specifically
28
38
  config.gem_dependencies = true
@@ -31,6 +41,9 @@ Warbler::Config.new do |config|
31
41
  # will have the leading 'public/' part of the path stripped during staging.
32
42
  # config.public_html = FileList["public/**/*", "doc/**/*"]
33
43
 
44
+ # Pathmaps for controlling how public HTML files are copied into the .war
45
+ # config.pathmaps.public_html = ["%{public/,}p"]
46
+
34
47
  # Name of the war file (without the .war) -- defaults to the basename
35
48
  # of RAILS_ROOT
36
49
  # config.war_name = "mywar"
Binary file
@@ -11,6 +11,7 @@ module Warbler
11
11
  class Config
12
12
  TOP_DIRS = %w(app config lib log vendor tmp)
13
13
  FILE = "config/warble.rb"
14
+ BUILD_GEMS = %w(warbler rake rcov)
14
15
 
15
16
  # Directory where files will be staged, defaults to tmp/war
16
17
  attr_accessor :staging_dir
@@ -26,6 +27,9 @@ module Warbler
26
27
  # Files to exclude from the WEB-INF directory
27
28
  attr_accessor :excludes
28
29
 
30
+ # Java classes and other files to copy to WEB-INF/classes
31
+ attr_accessor :java_classes
32
+
29
33
  # Java libraries to copy to WEB-INF/lib
30
34
  attr_accessor :java_libs
31
35
 
@@ -38,6 +42,11 @@ module Warbler
38
42
  # Public HTML directory file list, to be copied into the root of the war
39
43
  attr_accessor :public_html
40
44
 
45
+ # Container of pathmaps used for specifying source-to-destination transformations
46
+ # under various situations (<tt>public_html</tt> and <tt>java_classes</tt> are two
47
+ # entries in this structure).
48
+ attr_accessor :pathmaps
49
+
41
50
  # Name of war file (without the .war), defaults to the directory name containing
42
51
  # the Rails application
43
52
  attr_accessor :war_name
@@ -73,30 +82,32 @@ module Warbler
73
82
  # files.
74
83
  attr_accessor :webxml
75
84
 
76
- def initialize
77
- @staging_dir = "tmp/war"
85
+ def initialize(warbler_home = WARBLER_HOME)
86
+ @staging_dir = File.join("tmp", "war")
78
87
  @dirs = TOP_DIRS
79
88
  @includes = FileList[]
80
89
  @excludes = FileList[]
81
- @java_libs = FileList["#{WARBLER_HOME}/lib/*.jar"]
90
+ @java_libs = FileList["#{warbler_home}/lib/*.jar"]
91
+ @java_classes = FileList[]
82
92
  @gems = default_gems
83
93
  @gem_dependencies = true
84
94
  @public_html = FileList["public/**/*"]
95
+ @pathmaps = default_pathmaps
85
96
  @webxml = default_webxml_config
86
97
  @rails_root = File.expand_path(defined?(RAILS_ROOT) ? RAILS_ROOT : Dir.getwd)
87
98
  @war_name = File.basename(@rails_root)
88
99
  yield self if block_given?
89
- @excludes += warbler_vendor_excludes
100
+ @excludes += warbler_vendor_excludes(warbler_home)
90
101
  @excludes << @staging_dir
91
102
  end
92
103
 
93
- def gem_target_path
94
- "#{@staging_dir}/WEB-INF/gems"
104
+ def gems=(value)
105
+ @gems = Warbler::Gems.new(value)
95
106
  end
96
107
 
97
108
  private
98
- def warbler_vendor_excludes
99
- warbler = File.expand_path(WARBLER_HOME)
109
+ def warbler_vendor_excludes(warbler_home)
110
+ warbler = File.expand_path(warbler_home)
100
111
  if warbler =~ %r{^#{@rails_root}/(.*)}
101
112
  FileList["#{$1}"]
102
113
  else
@@ -104,6 +115,17 @@ module Warbler
104
115
  end
105
116
  end
106
117
 
118
+ def default_pathmaps
119
+ p = OpenStruct.new
120
+ p.public_html = ["%{public/,}p"]
121
+ p.java_libs = ["WEB-INF/lib/%f"]
122
+ p.java_classes = ["WEB-INF/classes/%p"]
123
+ p.application = ["WEB-INF/%p"]
124
+ p.gemspecs = ["WEB-INF/gems/specifications/%f"]
125
+ p.gems = ["WEB-INF/gems/gems/%n"]
126
+ p
127
+ end
128
+
107
129
  def default_webxml_config
108
130
  c = OpenStruct.new
109
131
  c.standalone = true
@@ -113,7 +135,15 @@ module Warbler
113
135
  end
114
136
 
115
137
  def default_gems
116
- File.directory?("vendor/rails") ? [] : ["rails"]
138
+ gems = Warbler::Gems.new
139
+ # Include all gems which are used by the web application, this only works when run as a plugin
140
+ #for gem in Gem.loaded_specs.values
141
+ # next if BUILD_GEMS.include?(gem.name)
142
+ # gems[gem.name] = gem.version.version
143
+ #end
144
+ gems << "rails" unless File.directory?("vendor/rails")
145
+ gems
117
146
  end
147
+
118
148
  end
119
149
  end
@@ -0,0 +1,27 @@
1
+ #--
2
+ # (c) Copyright 2008 Robert Egglestone <r.egglestone@auckland.ac.nz>
3
+ # See the file LICENSES.txt included with the distribution for
4
+ # software license details.
5
+ #++
6
+
7
+ module Warbler
8
+ # A set of gems. This only exists to allow expected operations
9
+ # to be used to add gems, and for backwards compatibility.
10
+ # It would be easier to just use a hash.
11
+ class Gems < Hash
12
+ ANY_VERSION = nil
13
+
14
+ def initialize(gems = nil)
15
+ if gems.is_a?(Hash)
16
+ self.merge!(gems)
17
+ elsif gems.is_a?(Array)
18
+ gems.each {|gem| self << gem }
19
+ end
20
+ end
21
+
22
+ def <<(gem)
23
+ self[gem] ||= ANY_VERSION
24
+ end
25
+
26
+ end
27
+ end
data/lib/warbler/task.rb CHANGED
@@ -79,7 +79,7 @@ module Warbler
79
79
  end
80
80
 
81
81
  def define_gems_task
82
- directory "#{@config.gem_target_path}/gems"
82
+ directory "#{config.staging_dir}/#{apply_pathmaps("sources-0.0.1.gem", :gems).pathmap("%d")}"
83
83
  targets = define_copy_gems_tasks
84
84
  with_namespace_and_config do
85
85
  desc "Unpack all gems into WEB-INF/gems"
@@ -117,7 +117,7 @@ module Warbler
117
117
  def define_java_libs_task
118
118
  target_files = @config.java_libs.map do |lib|
119
119
  define_file_task(lib,
120
- "#{@config.staging_dir}/WEB-INF/lib/#{File.basename(lib)}")
120
+ "#{@config.staging_dir}/#{apply_pathmaps(lib, :java_libs)}")
121
121
  end
122
122
  with_namespace_and_config do |name, config|
123
123
  desc "Copy all java libraries into the .war"
@@ -130,6 +130,22 @@ module Warbler
130
130
  target_files
131
131
  end
132
132
 
133
+ def define_java_classes_task
134
+ target_files = @config.java_classes.map do |f|
135
+ define_file_task(f,
136
+ "#{@config.staging_dir}/#{apply_pathmaps(f, :java_classes)}")
137
+ end
138
+ with_namespace_and_config do |name, config|
139
+ desc "Copy java classes into the .war"
140
+ task "java_classes" => target_files
141
+ task "debug:java_classes" do
142
+ puts "", "java_classes files:"
143
+ puts *target_files
144
+ end
145
+ end
146
+ target_files
147
+ end
148
+
133
149
  def define_app_task
134
150
  webinf_target_files = define_webinf_file_tasks
135
151
  with_namespace_and_config do |name, config|
@@ -157,7 +173,7 @@ module Warbler
157
173
  require 'yaml'
158
174
  puts YAML::dump(config)
159
175
  end
160
- all_debug_tasks = %w(: app java_libs gems public includes excludes).map do |n|
176
+ all_debug_tasks = %w(: app java_libs java_classes gems public includes excludes).map do |n|
161
177
  n.sub(/^:?/, "#{name}:debug:").sub(/:$/, '')
162
178
  end
163
179
  task "debug:all" => all_debug_tasks
@@ -166,7 +182,7 @@ module Warbler
166
182
 
167
183
  def define_public_file_tasks
168
184
  @config.public_html.map do |f|
169
- define_file_task(f, "#{@config.staging_dir}/#{f.sub(%r{public/},'')}")
185
+ define_file_task(f, "#{@config.staging_dir}/#{apply_pathmaps(f, :public_html)}")
170
186
  end
171
187
  end
172
188
 
@@ -175,9 +191,11 @@ module Warbler
175
191
  files.include *(@config.includes.to_a)
176
192
  files.exclude *(@config.excludes.to_a)
177
193
  target_files = files.map do |f|
178
- define_file_task(f, "#{@config.staging_dir}/WEB-INF/#{f}")
194
+ define_file_task(f,
195
+ "#{@config.staging_dir}/#{apply_pathmaps(f, :application)}")
179
196
  end
180
197
  target_files += define_java_libs_task
198
+ target_files += define_java_classes_task
181
199
  task "#@name:debug:includes" do
182
200
  puts "", "included files:"
183
201
  puts *files.include
@@ -210,8 +228,8 @@ module Warbler
210
228
 
211
229
  def define_copy_gems_tasks
212
230
  targets = []
213
- @config.gems.each do |gem|
214
- define_single_gem_tasks(gem, targets)
231
+ @config.gems.each do |gem, version|
232
+ define_single_gem_tasks(gem, targets, version)
215
233
  end
216
234
  targets
217
235
  end
@@ -221,20 +239,23 @@ module Warbler
221
239
  fail "gem '#{gem}' not installed" if matched.empty?
222
240
  spec = matched.last
223
241
 
224
- gem_unpack_task_name = "gem:#{spec.name}-#{spec.version}"
242
+ gem_name = "#{spec.name}-#{spec.version}"
243
+ gem_unpack_task_name = "gem:#{gem_name}"
225
244
  return if Rake::Task.task_defined?(gem_unpack_task_name)
226
245
 
227
- targets << define_file_task(spec.loaded_from,
228
- "#{config.gem_target_path}/specifications/#{File.basename(spec.loaded_from)}")
246
+ targets << define_file_task(spec.loaded_from,
247
+ "#{@config.staging_dir}/#{apply_pathmaps(spec.loaded_from, :gemspecs)}")
229
248
 
230
249
  task targets.last do
231
250
  Rake::Task[gem_unpack_task_name].invoke
232
251
  end
233
252
 
234
- task gem_unpack_task_name => ["#{config.gem_target_path}/gems"] do |t|
235
- Dir.chdir(t.prerequisites.last) do
236
- ruby "-S", "gem", "unpack", "-v", spec.version.to_s, spec.name
237
- end
253
+ src = File.join(Gem.dir, 'cache', "#{gem_name}.gem")
254
+ dest = "#{config.staging_dir}/#{apply_pathmaps(src, :gems)}"
255
+
256
+ task gem_unpack_task_name => [dest.pathmap("%d")] do |t|
257
+ require 'rubygems/installer'
258
+ Gem::Installer.new(src).unpack(dest)
238
259
  end
239
260
 
240
261
  if @config.gem_dependencies
@@ -247,5 +268,13 @@ module Warbler
247
268
  def erb_binding(webxml)
248
269
  binding
249
270
  end
271
+
272
+ def apply_pathmaps(file, pathmaps)
273
+ pathmaps = @config.pathmaps.send(pathmaps)
274
+ pathmaps.each do |p|
275
+ file = file.pathmap(p)
276
+ end if pathmaps
277
+ file
278
+ end
250
279
  end
251
280
  end
@@ -5,5 +5,5 @@
5
5
  #++
6
6
 
7
7
  module Warbler
8
- VERSION = "0.9.1"
8
+ VERSION = "0.9.2"
9
9
  end
data/lib/warbler.rb CHANGED
@@ -10,6 +10,7 @@ module Warbler
10
10
  WARBLER_HOME = File.expand_path(File.dirname(__FILE__) + '/..') unless defined?(WARBLER_HOME)
11
11
  end
12
12
 
13
+ require 'warbler/gems'
13
14
  require 'warbler/config'
14
15
  require 'warbler/task'
15
16
  require 'warbler/version'
data/spec/spec_helper.rb CHANGED
@@ -10,3 +10,24 @@ require 'spec'
10
10
  $LOAD_PATH.unshift File.dirname(__FILE__) + '/../lib'
11
11
  require 'warbler'
12
12
 
13
+ raise %{Error: detected running Warbler specs in a Rails app;
14
+ Warbler specs are destructive to application directories.} if File.directory?("app")
15
+
16
+ def silence(io = nil)
17
+ require 'stringio'
18
+ old_stdout = $stdout
19
+ old_stderr = $stderr
20
+ $stdout = io || StringIO.new
21
+ $stderr = io || StringIO.new
22
+ yield
23
+ ensure
24
+ $stdout = old_stdout
25
+ $stderr = old_stderr
26
+ end
27
+
28
+ def capture(&block)
29
+ require 'stringio'
30
+ io = StringIO.new
31
+ silence(io, &block)
32
+ io.string
33
+ end
@@ -20,6 +20,8 @@ describe Warbler::Config do
20
20
  config.war_name.size.should > 0
21
21
  config.webxml.should be_kind_of(OpenStruct)
22
22
  config.webxml.pool.should be_kind_of(OpenStruct)
23
+ config.pathmaps.should be_kind_of(OpenStruct)
24
+ config.pathmaps.public_html.should == ["%{public/,}p"]
23
25
  end
24
26
 
25
27
  it "should allow configuration through an initializer block" do
@@ -39,4 +41,17 @@ describe Warbler::Config do
39
41
  config = Warbler::Config.new
40
42
  config.gems.should be_empty
41
43
  end
44
+
45
+ it "should exclude Warbler itself when run as a plugin" do
46
+ config = Warbler::Config.new
47
+ config.excludes.include?("vendor/plugins/warbler").should == false
48
+ config = Warbler::Config.new File.join(Dir.getwd, "vendor", "plugins", "warbler")
49
+ config.excludes.include?("vendor/plugins/warbler").should == true
50
+ end
51
+
52
+ #it "should automatically gems used by the web application" do
53
+ # gem "actionpack"
54
+ # config = Warbler::Config.new
55
+ # config.gems.should include("actionpack")
56
+ #end
42
57
  end
@@ -0,0 +1,32 @@
1
+ #--
2
+ # (c) Copyright 2008 Robert Egglestone <r.egglestone@auckland.ac.nz>
3
+ # See the file LICENSES.txt included with the distribution for
4
+ # software license details.
5
+ #++
6
+
7
+ require File.dirname(__FILE__) + '/../spec_helper'
8
+
9
+ describe Warbler::Gems do
10
+ it "should accept a hash for initialization" do
11
+ gems = Warbler::Gems.new({"actionpack" => "1.2.3"})
12
+ gems.should include("actionpack")
13
+ gems["actionpack"].should == "1.2.3"
14
+ end
15
+
16
+ it "should accept an array for initialization" do
17
+ gems = Warbler::Gems.new ["activerecord"]
18
+ gems.should include("activerecord")
19
+ end
20
+
21
+ it "should allow gems with a version" do
22
+ gems = Warbler::Gems.new
23
+ gems["actionpack"] = "> 1.2.3"
24
+ gems["actionpack"].should == "> 1.2.3"
25
+ end
26
+
27
+ it "should allow gems without an explicit version" do
28
+ gems = Warbler::Gems.new
29
+ gems << "actionpack"
30
+ gems.should include("actionpack")
31
+ end
32
+ end
@@ -10,14 +10,24 @@ describe Warbler::Task do
10
10
  before(:each) do
11
11
  @rake = Rake::Application.new
12
12
  Rake.application = @rake
13
+ mkdir_p "public"
14
+ touch "public/index.html"
13
15
  @config = Warbler::Config.new do |config|
14
16
  config.staging_dir = "pkg/tmp/war"
15
17
  config.war_name = "warbler"
16
18
  config.gems = ["rake"]
17
19
  config.dirs = %w(bin generators lib)
18
- config.public_html = FileList["tasks/**/*"]
20
+ config.public_html = FileList["public/**/*", "tasks/**/*"]
19
21
  config.webxml.pool.maxActive = 5
20
22
  end
23
+ verbose(false)
24
+ end
25
+
26
+ after(:each) do
27
+ define_tasks "clean"
28
+ Rake::Task["warble:clean"].invoke
29
+ rm_rf "public"
30
+ rm_rf "config"
21
31
  end
22
32
 
23
33
  def define_tasks(*tasks)
@@ -37,12 +47,6 @@ describe Warbler::Task do
37
47
  FileList["#{@config.staging_dir}/**/*"].select {|f| f =~ regex }
38
48
  end
39
49
 
40
- after(:each) do
41
- define_tasks "clean"
42
- Rake::Task["warble:clean"].invoke
43
- rm_rf "config"
44
- end
45
-
46
50
  it "should define a clean task for removing the staging directory" do
47
51
  define_tasks "clean"
48
52
  mkdir_p @config.staging_dir
@@ -53,7 +57,8 @@ describe Warbler::Task do
53
57
  it "should define a public task for copying the public files" do
54
58
  define_tasks "public"
55
59
  Rake::Task["warble:public"].invoke
56
- file_list(%r{tasks/warbler\.rake}).should_not be_nil
60
+ file_list(%r{^#{@config.staging_dir}/index\.html}).should_not be_empty
61
+ file_list(%r{tasks/warbler\.rake}).should_not be_empty
57
62
  end
58
63
 
59
64
  it "should define a gems task for unpacking gems" do
@@ -80,6 +85,26 @@ describe Warbler::Task do
80
85
  ).first.text.should == "5"
81
86
  end
82
87
 
88
+ it "should use a config/web.xml if it exists" do
89
+ define_tasks "webxml"
90
+ mkdir_p "config"
91
+ File.open("config/web.xml", "w") {|f| f << "Hi there" }
92
+ Rake::Task["warble:webxml"].invoke
93
+ files = file_list(%r{WEB-INF/web.xml$})
94
+ files.should_not be_empty
95
+ File.open(files.first) {|f| f.read}.should == "Hi there"
96
+ end
97
+
98
+ it "should use a config/web.xml.erb if it exists" do
99
+ define_tasks "webxml"
100
+ mkdir_p "config"
101
+ File.open("config/web.xml.erb", "w") {|f| f << "Hi <%= webxml.standalone %>" }
102
+ Rake::Task["warble:webxml"].invoke
103
+ files = file_list(%r{WEB-INF/web.xml$})
104
+ files.should_not be_empty
105
+ File.open(files.first) {|f| f.read}.should == "Hi true"
106
+ end
107
+
83
108
  it "should define a java_libs task for copying java libraries" do
84
109
  define_tasks "java_libs"
85
110
  Rake::Task["warble:java_libs"].invoke
@@ -153,6 +178,13 @@ describe Warbler::Task do
153
178
  Warbler::Task.new "warble", @config
154
179
  }.should raise_error
155
180
  end
181
+
182
+ it "should define a java_classes task for copying loose java classes" do
183
+ @config.java_classes = FileList["Rakefile"]
184
+ define_tasks "java_classes"
185
+ Rake::Task["warble:java_classes"].invoke
186
+ file_list(%r{WEB-INF/classes/Rakefile$}).should_not be_empty
187
+ end
156
188
  end
157
189
 
158
190
  describe "The warbler.rake file" do
@@ -164,6 +196,27 @@ describe "The warbler.rake file" do
164
196
  output.should =~ /war:gems/
165
197
  output.should =~ /war:jar/
166
198
  output.should =~ /war:java_libs/
199
+ output.should =~ /war:java_classes/
167
200
  output.should =~ /war:public/
168
201
  end
202
+ end
203
+
204
+ describe "Debug targets" do
205
+ before(:each) do
206
+ @rake = Rake::Application.new
207
+ Rake.application = @rake
208
+ verbose(false)
209
+ silence { Warbler::Task.new :war, Object.new }
210
+ end
211
+
212
+ it "should print out lists of files" do
213
+ capture { Rake::Task["war:debug:public"].invoke }.should =~ /public/
214
+ capture { Rake::Task["war:debug:gems"].invoke }.should =~ /gems/
215
+ capture { Rake::Task["war:debug:java_libs"].invoke }.should =~ /java_libs/
216
+ capture { Rake::Task["war:debug:java_classes"].invoke }.should =~ /java_classes/
217
+ capture { Rake::Task["war:debug:app"].invoke }.should =~ /app/
218
+ capture { Rake::Task["war:debug:includes"].invoke }.should =~ /include/
219
+ capture { Rake::Task["war:debug:excludes"].invoke }.should =~ /exclude/
220
+ capture { Rake::Task["war:debug"].invoke }.should =~ /Config/
221
+ end
169
222
  end
metadata CHANGED
@@ -1,33 +1,37 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.9.4
3
- specification_version: 1
4
2
  name: warbler
5
3
  version: !ruby/object:Gem::Version
6
- version: 0.9.1
7
- date: 2007-12-13 00:00:00 -08:00
8
- summary: Warbler chirpily constructs .war files of your Rails applications.
9
- require_paths:
10
- - lib
11
- email: nick@nicksieger.com
12
- homepage: http://caldersphere.rubyforge.org/warbler
13
- rubyforge_project: caldersphere
14
- description: = Warbler
15
- autorequire:
16
- default_executable:
17
- bindir: bin
18
- has_rdoc: true
19
- required_ruby_version: !ruby/object:Gem::Version::Requirement
20
- requirements:
21
- - - ">"
22
- - !ruby/object:Gem::Version
23
- version: 0.0.0
24
- version:
4
+ version: 0.9.2
25
5
  platform: ruby
26
- signing_key:
27
- cert_chain:
28
- post_install_message:
29
6
  authors:
30
7
  - Nick Sieger
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2008-02-18 00:00:00 -08:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: rake
17
+ version_requirement:
18
+ version_requirements: !ruby/object:Gem::Requirement
19
+ requirements:
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 0.7.3
23
+ version:
24
+ description: = Warbler
25
+ email: nick@nicksieger.com
26
+ executables:
27
+ - warble
28
+ extensions: []
29
+
30
+ extra_rdoc_files:
31
+ - History.txt
32
+ - Manifest.txt
33
+ - README.txt
34
+ - LICENSES.txt
31
35
  files:
32
36
  - History.txt
33
37
  - Manifest.txt
@@ -41,42 +45,49 @@ files:
41
45
  - generators/warble/templates/warble.rb
42
46
  - generators/warble/warble_generator.rb
43
47
  - lib/activation-1.1.jar
48
+ - lib/backport-util-concurrent-3.0.jar
44
49
  - lib/commons-pool-1.3.jar
45
- - lib/goldspike-1.4-SNAPSHOT.jar
46
- - lib/jruby-complete-1.0.1.jar
50
+ - lib/goldspike-1.4.jar
51
+ - lib/jruby-complete-1.0.3.jar
47
52
  - lib/warbler
48
53
  - lib/warbler/config.rb
54
+ - lib/warbler/gems.rb
49
55
  - lib/warbler/task.rb
50
56
  - lib/warbler/version.rb
51
57
  - lib/warbler.rb
52
58
  - spec/spec_helper.rb
53
59
  - spec/warbler/config_spec.rb
60
+ - spec/warbler/gems_spec.rb
54
61
  - spec/warbler/task_spec.rb
55
62
  - tasks/warbler.rake
56
- test_files:
57
- - spec/warbler/config_spec.rb
58
- - spec/warbler/task_spec.rb
63
+ has_rdoc: true
64
+ homepage: http://caldersphere.rubyforge.org/warbler
65
+ post_install_message:
59
66
  rdoc_options:
60
67
  - --main
61
68
  - README.txt
62
- extra_rdoc_files:
63
- - History.txt
64
- - Manifest.txt
65
- - README.txt
66
- - LICENSES.txt
67
- executables:
68
- - warble
69
- extensions: []
70
-
69
+ require_paths:
70
+ - lib
71
+ required_ruby_version: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: "0"
76
+ version:
77
+ required_rubygems_version: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ version: "0"
82
+ version:
71
83
  requirements: []
72
84
 
73
- dependencies:
74
- - !ruby/object:Gem::Dependency
75
- name: rake
76
- version_requirement:
77
- version_requirements: !ruby/object:Gem::Version::Requirement
78
- requirements:
79
- - - ">="
80
- - !ruby/object:Gem::Version
81
- version: 0.7.3
82
- version:
85
+ rubyforge_project: caldersphere
86
+ rubygems_version: 1.0.1
87
+ signing_key:
88
+ specification_version: 2
89
+ summary: Warbler chirpily constructs .war files of your Rails applications.
90
+ test_files:
91
+ - spec/warbler/config_spec.rb
92
+ - spec/warbler/gems_spec.rb
93
+ - spec/warbler/task_spec.rb
Binary file