Permalink
Browse files

Rake 0.9.x compatibility

  • Loading branch information...
1 parent 0bf8599 commit f682b6f7665b1c3cea74ae3a24e6e36a0b667df5 @nicksieger committed Aug 16, 2011
View
@@ -1,6 +1,6 @@
source "http://rubygems.org/"
-gem "rake", "~> 0.8.7"
+gem "rake"
gem "rubyzip"
gem "jruby-jars"
gem "jruby-rack"
View
@@ -1,35 +1,33 @@
GEM
remote: http://rubygems.org/
specs:
- bouncy-castle-java (1.5.0145.2)
+ bouncy-castle-java (1.5.0146.1)
diff-lcs (1.1.2)
- hoe (2.9.1)
- rake (>= 0.8.7)
- jruby-jars (1.6.0)
- jruby-openssl (0.7.1)
+ hoe (2.12.0)
+ rake (~> 0.8)
+ jruby-jars (1.6.3)
+ jruby-openssl (0.7.4)
bouncy-castle-java
- jruby-rack (1.0.8)
- json_pure (1.4.6)
- rake (0.8.7)
- rcov (0.9.9)
- rcov (0.9.9-java)
- rdoc (3.5.3)
- rspec (1.3.1)
+ jruby-rack (1.0.9)
+ json_pure (1.5.3)
+ rake (0.9.2)
+ rcov (0.9.10-java)
+ rdoc (3.9.2)
+ rspec (1.3.2)
rubyforge (2.0.4)
json_pure (>= 1.1.7)
rubyzip (0.9.4)
PLATFORMS
java
- ruby
DEPENDENCIES
diff-lcs
hoe (>= 2.3.2)
jruby-jars
jruby-openssl
jruby-rack
- rake (~> 0.8.7)
+ rake
rcov (>= 0.9.8)
rdoc
rspec (~> 1.3)
View
@@ -15,6 +15,7 @@ lib/warbler/application.rb
lib/warbler/config.rb
lib/warbler/gems.rb
lib/warbler/jar.rb
+lib/warbler/rake_helper.rb
lib/warbler/task.rb
lib/warbler/templates
lib/warbler/templates/bundler.erb
View
@@ -11,8 +11,6 @@ rescue LoadError
puts "Please install Bundler and run 'bundle install' to ensure you have all dependencies"
end
-require 'spec/rake/spectask'
-require 'spec/rake/verify_rcov'
MANIFEST = FileList["History.txt", "Manifest.txt", "README.txt", "Gemfile",
"LICENSE.txt", "Rakefile", "*.erb", "*.rb", "bin/*",
@@ -33,7 +31,7 @@ begin
p.summary = "Warbler chirpily constructs .war files of your Rails applications."
p.changes = p.paragraphs_of('History.txt', 0..1).join("\n\n")
p.description = p.paragraphs_of('README.txt', 1...2).join("\n\n")
- p.extra_deps += [['rake', '~> 0.8.7'], ['jruby-jars', '>= 1.4.0'], ['jruby-rack', '>= 1.0.0'], ['rubyzip', '>= 0.9.4']]
+ p.extra_deps += [['rake', '>= 0.8.7'], ['jruby-jars', '>= 1.4.0'], ['jruby-rack', '>= 1.0.0'], ['rubyzip', '>= 0.9.4']]
p.clean_globs += %w(MANIFEST web.xml init.rb).map{|f| "spec/sample*/#{f}*" }
end
hoe.spec.files = MANIFEST
@@ -47,13 +45,10 @@ rescue LoadError
puts "You really need Hoe installed to be able to package this gem"
end
-# Leave my tasks alone, Hoe
-%w(default spec rcov).each do |task|
- Rake::Task[task].prerequisites.clear
- Rake::Task[task].actions.clear
-end
+require 'spec/rake/spectask'
+require 'spec/rake/verify_rcov'
-Spec::Rake::SpecTask.new do |t|
+Spec::Rake::SpecTask.new(:spec) do |t|
t.spec_opts ||= []
t.spec_opts << "--options" << "spec/spec.opts"
end
View
@@ -29,5 +29,6 @@ def self.project_application
end
require 'warbler/version'
+require 'warbler/rake_helper'
require 'warbler/task'
require 'warbler/application'
@@ -11,6 +11,8 @@
# report its name properly and inject its own tasks without a
# Rakefile.
class Warbler::Application < Rake::Application
+ include Warbler::RakeHelper
+
def initialize
super
Warbler.application = self
View
@@ -12,6 +12,8 @@
module Warbler
# Warbler archive assembly configuration class.
class Config
+ include RakeHelper
+
TOP_DIRS = %w(app config lib log vendor)
FILE = "config/warble.rb"
BUILD_GEMS = %w(warbler rake rcov)
@@ -171,7 +173,7 @@ def initialize(warbler_home = WARBLER_HOME)
@compiled_ruby_files ||= FileList[*@dirs.map {|d| "#{d}/**/*.rb"}]
- @excludes += ["tmp/war"] if File.directory?("tmp/war")
+ @excludes += ["tmp/war", "tmp/war/**/*"] if File.directory?("tmp/war")
@excludes += warbler_vendor_excludes(warbler_home)
@excludes += FileList["**/*.log"] if @exclude_logs
end
View
@@ -17,6 +17,8 @@ module Warbler
# * Any object responding to +read+ representing an in-memory blob
# * A String filename pointing to a file on disk
class Jar
+ include RakeHelper
+
DEFAULT_MANIFEST = %{Manifest-Version: 1.0\nCreated-By: Warbler #{Warbler::VERSION}\n\n}
attr_reader :files
View
@@ -0,0 +1,29 @@
+#--
+# Copyright (c) 2010-2011 Engine Yard, Inc.
+# Copyright (c) 2007-2009 Sun Microsystems, Inc.
+# This source code is available under the MIT license.
+# See the file LICENSE.txt for details.
+#++
+
+module Warbler
+ # This module exists for compatibility with Rake 0.9.
+ module RakeHelper
+ def self.included(base)
+ base.class_eval do
+ include Rake::DSL if defined?(Rake::DSL)
+ if defined?(Rake::FileUtilsExt)
+ include FileUtils
+ include Rake::FileUtilsExt
+ end
+ end
+ end
+
+ def self.extended(base)
+ base.extend Rake::DSL if defined?(Rake::DSL)
+ if defined?(Rake::FileUtilsExt)
+ base.extend FileUtils
+ base.extend Rake::FileUtilsExt
+ end
+ end
+ end
+end
View
@@ -29,6 +29,8 @@ module Warbler
# With this setup, you can create two separate war files two
# different configurations by running <tt>rake war1 war2</tt>.
class Task < Rake::TaskLib
+ include RakeHelper
+
# Task name
attr_accessor :name
@@ -60,7 +60,8 @@ def add_bundler_gems
config.bundler[:gemfile] = ::Bundler.default_gemfile
config.bundler[:lockfile] = ::Bundler.default_lockfile
config.bundler[:frozen] = ::Bundler.settings[:frozen]
- config.excludes += [::Bundler.settings[:path]] if ::Bundler.settings[:path]
+ path = ::Bundler.settings[:path]
+ config.excludes += [path, "#{path}/**/*"] if path
config.init_contents << "#{config.warbler_templates}/bundler.erb"
end
@@ -11,6 +11,7 @@ module Warbler
module Traits
# The War trait sets up the layout and generates web.xml for the war project.
class War
+ include RakeHelper
include Trait
DEFAULT_GEM_PATH = '/WEB-INF/gems'
@@ -2,3 +2,4 @@
BUNDLE_FROZEN: "1"
BUNDLE_PATH: vendor/bundle
BUNDLE_DISABLE_SHARED_GEMS: "1"
+BUNDLE_WITHOUT: ""
View
@@ -83,9 +83,9 @@ def run_out_of_process_with_drb
let(:drbclient) do
drb
- DRbObject.new(nil, 'druby://127.0.0.1:7890').tap do |drbclient|
+ DRbObject.new(nil, 'druby://127.0.0.1:7890').tap {|drbclient|
loop { (drbclient.alive? && break) rescue nil }
- end
+ }
end
let(:drb) do
@@ -102,6 +102,9 @@ def run_out_of_process_with_drb
end
Spec::Runner.configure do |config|
+ config.include Warbler::RakeHelper
+ config.extend Warbler::RakeHelper
+
config.after(:each) do
class << Object
public :remove_const
View
@@ -635,6 +635,7 @@ def self.dependencies=(deps)
config.dirs += ["tmp"]
end
jar.apply(config)
+ file_list(%r{WEB-INF/tmp/war}).should be_empty
file_list(%r{WEB-INF/tmp/war/index\.html}).should be_empty
end
View
@@ -14,34 +14,34 @@ deployment to a Java environment.}
s.email = %q{nick@nicksieger.com}
s.executables = ["warble"]
s.extra_rdoc_files = ["History.txt", "LICENSE.txt", "Manifest.txt", "README.txt"]
- s.files = ["Gemfile", "History.txt", "LICENSE.txt", "Manifest.txt", "README.txt", "Rakefile", "bin/warble", "ext/JarMain.java", "ext/WarMain.java", "ext/WarblerJar.java", "ext/WarblerJarService.java", "lib/warbler.rb", "lib/warbler/application.rb", "lib/warbler/config.rb", "lib/warbler/gems.rb", "lib/warbler/jar.rb", "lib/warbler/task.rb", "lib/warbler/templates/bundler.erb", "lib/warbler/templates/config.erb", "lib/warbler/templates/jar.erb", "lib/warbler/templates/rack.erb", "lib/warbler/templates/rails.erb", "lib/warbler/templates/war.erb", "lib/warbler/traits.rb", "lib/warbler/traits/bundler.rb", "lib/warbler/traits/gemspec.rb", "lib/warbler/traits/jar.rb", "lib/warbler/traits/merb.rb", "lib/warbler/traits/nogemspec.rb", "lib/warbler/traits/rack.rb", "lib/warbler/traits/rails.rb", "lib/warbler/traits/war.rb", "lib/warbler/version.rb", "lib/warbler/war.rb", "lib/warbler_jar.jar", "spec/drb_helper.rb", "spec/sample_bundler/Gemfile.lock", "spec/sample_bundler/config.ru", "spec/sample_bundler/vendor/bundle/jruby/1.8/cache/rake-0.8.7.gem", "spec/sample_bundler/vendor/bundle/jruby/1.8/gems/rake-0.8.7/lib/rake.rb", "spec/sample_bundler/vendor/bundle/jruby/1.8/specifications/rake-0.8.7.gemspec", "spec/sample_bundler/vendor/bundle/ruby/1.8/cache/rake-0.8.7.gem", "spec/sample_bundler/vendor/bundle/ruby/1.8/gems/rake-0.8.7/lib/rake.rb", "spec/sample_bundler/vendor/bundle/ruby/1.8/specifications/rake-0.8.7.gemspec", "spec/sample_bundler/vendor/bundle/ruby/1.9.1/cache/rake-0.8.7.gem", "spec/sample_bundler/vendor/bundle/ruby/1.9.1/gems/rake-0.8.7/lib/rake.rb", "spec/sample_bundler/vendor/bundle/ruby/1.9.1/specifications/rake-0.8.7.gemspec", "spec/sample_jar/History.txt", "spec/sample_jar/Manifest.txt", "spec/sample_jar/README.txt", "spec/sample_jar/lib/sample_jar.rb", "spec/sample_jar/sample_jar.gemspec", "spec/sample_jar/test/test_sample_jar.rb", "spec/sample_war/app/controllers/application.rb", "spec/sample_war/app/helpers/application_helper.rb", "spec/sample_war/config/boot.rb", "spec/sample_war/config/database.yml", "spec/sample_war/config/environment.rb", "spec/sample_war/config/environments/development.rb", "spec/sample_war/config/environments/production.rb", "spec/sample_war/config/environments/test.rb", "spec/sample_war/config/initializers/inflections.rb", "spec/sample_war/config/initializers/mime_types.rb", "spec/sample_war/config/initializers/new_rails_defaults.rb", "spec/sample_war/config/routes.rb", "spec/sample_war/lib/tasks/utils.rake", "spec/sample_war/public/404.html", "spec/sample_war/public/422.html", "spec/sample_war/public/500.html", "spec/sample_war/public/favicon.ico", "spec/sample_war/public/index.html", "spec/sample_war/public/robots.txt", "spec/spec_helper.rb", "spec/warbler/application_spec.rb", "spec/warbler/bundler_spec.rb", "spec/warbler/config_spec.rb", "spec/warbler/gems_spec.rb", "spec/warbler/jar_spec.rb", "spec/warbler/task_spec.rb", "spec/warbler/traits_spec.rb", "spec/warbler/war_spec.rb", "warble.rb", "web.xml.erb"]
+ s.files = ["Gemfile", "History.txt", "LICENSE.txt", "Manifest.txt", "README.txt", "Rakefile", "bin/warble", "ext/JarMain.java", "ext/WarMain.java", "ext/WarblerJar.java", "ext/WarblerJarService.java", "lib/warbler", "lib/warbler.rb", "lib/warbler/application.rb", "lib/warbler/config.rb", "lib/warbler/gems.rb", "lib/warbler/jar.rb", "lib/warbler/task.rb", "lib/warbler/templates", "lib/warbler/templates/bundler.erb", "lib/warbler/templates/config.erb", "lib/warbler/templates/jar.erb", "lib/warbler/templates/rack.erb", "lib/warbler/templates/rails.erb", "lib/warbler/templates/war.erb", "lib/warbler/traits", "lib/warbler/traits.rb", "lib/warbler/traits/bundler.rb", "lib/warbler/traits/gemspec.rb", "lib/warbler/traits/jar.rb", "lib/warbler/traits/merb.rb", "lib/warbler/traits/nogemspec.rb", "lib/warbler/traits/rack.rb", "lib/warbler/traits/rails.rb", "lib/warbler/traits/war.rb", "lib/warbler/version.rb", "lib/warbler/war.rb", "lib/warbler_jar.jar", "spec/drb_helper.rb", "spec/sample_bundler/Gemfile.lock", "spec/sample_bundler/config.ru", "spec/sample_bundler/vendor/bundle/jruby/1.8", "spec/sample_bundler/vendor/bundle/jruby/1.8/cache/rake-0.8.7.gem", "spec/sample_bundler/vendor/bundle/jruby/1.8/gems/rake-0.8.7", "spec/sample_bundler/vendor/bundle/jruby/1.8/gems/rake-0.8.7/lib/rake.rb", "spec/sample_bundler/vendor/bundle/jruby/1.8/specifications/rake-0.8.7.gemspec", "spec/sample_bundler/vendor/bundle/ruby/1.8", "spec/sample_bundler/vendor/bundle/ruby/1.8/cache/rake-0.8.7.gem", "spec/sample_bundler/vendor/bundle/ruby/1.8/gems/rake-0.8.7", "spec/sample_bundler/vendor/bundle/ruby/1.8/gems/rake-0.8.7/lib/rake.rb", "spec/sample_bundler/vendor/bundle/ruby/1.8/specifications/rake-0.8.7.gemspec", "spec/sample_bundler/vendor/bundle/ruby/1.9.1", "spec/sample_bundler/vendor/bundle/ruby/1.9.1/cache/rake-0.8.7.gem", "spec/sample_bundler/vendor/bundle/ruby/1.9.1/gems/rake-0.8.7", "spec/sample_bundler/vendor/bundle/ruby/1.9.1/gems/rake-0.8.7/lib/rake.rb", "spec/sample_bundler/vendor/bundle/ruby/1.9.1/specifications/rake-0.8.7.gemspec", "spec/sample_jar/History.txt", "spec/sample_jar/Manifest.txt", "spec/sample_jar/README.txt", "spec/sample_jar/lib/sample_jar.rb", "spec/sample_jar/sample_jar.gemspec", "spec/sample_jar/test/test_sample_jar.rb", "spec/sample_war/app/controllers/application.rb", "spec/sample_war/app/helpers/application_helper.rb", "spec/sample_war/config/boot.rb", "spec/sample_war/config/database.yml", "spec/sample_war/config/environment.rb", "spec/sample_war/config/environments/development.rb", "spec/sample_war/config/environments/production.rb", "spec/sample_war/config/environments/test.rb", "spec/sample_war/config/initializers/inflections.rb", "spec/sample_war/config/initializers/mime_types.rb", "spec/sample_war/config/initializers/new_rails_defaults.rb", "spec/sample_war/config/routes.rb", "spec/sample_war/lib/tasks/utils.rake", "spec/sample_war/public/404.html", "spec/sample_war/public/422.html", "spec/sample_war/public/500.html", "spec/sample_war/public/favicon.ico", "spec/sample_war/public/index.html", "spec/sample_war/public/robots.txt", "spec/spec_helper.rb", "spec/warbler/application_spec.rb", "spec/warbler/bundler_spec.rb", "spec/warbler/config_spec.rb", "spec/warbler/gems_spec.rb", "spec/warbler/jar_spec.rb", "spec/warbler/task_spec.rb", "spec/warbler/traits_spec.rb", "spec/warbler/war_spec.rb", "warble.rb", "web.xml.erb"]
s.homepage = %q{http://caldersphere.rubyforge.org/warbler}
s.rdoc_options = ["--main", "README.txt", "-SHN", "-f", "darkfish"]
s.require_paths = ["lib"]
s.rubyforge_project = %q{caldersphere}
- s.rubygems_version = %q{1.7.2}
+ s.rubygems_version = %q{1.5.1}
s.summary = %q{Warbler chirpily constructs .war files of your Rails applications.}
if s.respond_to? :specification_version then
s.specification_version = 3
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
- s.add_runtime_dependency(%q<rake>, ["~> 0.8.7"])
+ s.add_runtime_dependency(%q<rake>, [">= 0.8.7"])
s.add_runtime_dependency(%q<jruby-jars>, [">= 1.4.0"])
s.add_runtime_dependency(%q<jruby-rack>, [">= 1.0.0"])
s.add_runtime_dependency(%q<rubyzip>, [">= 0.9.4"])
s.add_development_dependency(%q<rubyforge>, [">= 2.0.4"])
s.add_development_dependency(%q<hoe>, [">= 2.9.1"])
else
- s.add_dependency(%q<rake>, ["~> 0.8.7"])
+ s.add_dependency(%q<rake>, [">= 0.8.7"])
s.add_dependency(%q<jruby-jars>, [">= 1.4.0"])
s.add_dependency(%q<jruby-rack>, [">= 1.0.0"])
s.add_dependency(%q<rubyzip>, [">= 0.9.4"])
s.add_dependency(%q<rubyforge>, [">= 2.0.4"])
s.add_dependency(%q<hoe>, [">= 2.9.1"])
end
else
- s.add_dependency(%q<rake>, ["~> 0.8.7"])
+ s.add_dependency(%q<rake>, [">= 0.8.7"])
s.add_dependency(%q<jruby-jars>, [">= 1.4.0"])
s.add_dependency(%q<jruby-rack>, [">= 1.0.0"])
s.add_dependency(%q<rubyzip>, [">= 0.9.4"])

0 comments on commit f682b6f

Please sign in to comment.