warbler 1.3.1 → 1.3.2

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/Gemfile CHANGED
@@ -1,6 +1,6 @@
1
1
  source "http://rubygems.org/"
2
2
 
3
- gem "rake", "~> 0.8.7"
3
+ gem "rake"
4
4
  gem "rubyzip"
5
5
  gem "jruby-jars"
6
6
  gem "jruby-rack"
@@ -1,3 +1,9 @@
1
+ == 1.3.2
2
+
3
+ - Compatibility with rake 0.9.x, avoid deprecation warnings and deal
4
+ with new FileList exclusion behavior
5
+ - Exclude config.bundle_without groups properly
6
+
1
7
  == 1.3.1
2
8
 
3
9
  - Pin rake version to ~> 0.8.7 for now. Rake 0.9.0 compatibility will
@@ -15,6 +15,7 @@ lib/warbler/application.rb
15
15
  lib/warbler/config.rb
16
16
  lib/warbler/gems.rb
17
17
  lib/warbler/jar.rb
18
+ lib/warbler/rake_helper.rb
18
19
  lib/warbler/task.rb
19
20
  lib/warbler/templates
20
21
  lib/warbler/templates/bundler.erb
data/Rakefile CHANGED
@@ -11,8 +11,6 @@ rescue LoadError
11
11
  puts "Please install Bundler and run 'bundle install' to ensure you have all dependencies"
12
12
  end
13
13
 
14
- require 'spec/rake/spectask'
15
- require 'spec/rake/verify_rcov'
16
14
 
17
15
  MANIFEST = FileList["History.txt", "Manifest.txt", "README.txt", "Gemfile",
18
16
  "LICENSE.txt", "Rakefile", "*.erb", "*.rb", "bin/*",
@@ -33,7 +31,7 @@ begin
33
31
  p.summary = "Warbler chirpily constructs .war files of your Rails applications."
34
32
  p.changes = p.paragraphs_of('History.txt', 0..1).join("\n\n")
35
33
  p.description = p.paragraphs_of('README.txt', 1...2).join("\n\n")
36
- p.extra_deps += [['rake', '~> 0.8.7'], ['jruby-jars', '>= 1.4.0'], ['jruby-rack', '>= 1.0.0'], ['rubyzip', '>= 0.9.4']]
34
+ p.extra_deps += [['rake', '>= 0.8.7'], ['jruby-jars', '>= 1.4.0'], ['jruby-rack', '>= 1.0.0'], ['rubyzip', '>= 0.9.4']]
37
35
  p.clean_globs += %w(MANIFEST web.xml init.rb).map{|f| "spec/sample*/#{f}*" }
38
36
  end
39
37
  hoe.spec.files = MANIFEST
@@ -47,13 +45,10 @@ rescue LoadError
47
45
  puts "You really need Hoe installed to be able to package this gem"
48
46
  end
49
47
 
50
- # Leave my tasks alone, Hoe
51
- %w(default spec rcov).each do |task|
52
- Rake::Task[task].prerequisites.clear
53
- Rake::Task[task].actions.clear
54
- end
48
+ require 'spec/rake/spectask'
49
+ require 'spec/rake/verify_rcov'
55
50
 
56
- Spec::Rake::SpecTask.new do |t|
51
+ Spec::Rake::SpecTask.new(:spec) do |t|
57
52
  t.spec_opts ||= []
58
53
  t.spec_opts << "--options" << "spec/spec.opts"
59
54
  end
@@ -29,5 +29,6 @@ module Warbler
29
29
  end
30
30
 
31
31
  require 'warbler/version'
32
+ require 'warbler/rake_helper'
32
33
  require 'warbler/task'
33
34
  require 'warbler/application'
@@ -11,6 +11,8 @@ require 'rake'
11
11
  # report its name properly and inject its own tasks without a
12
12
  # Rakefile.
13
13
  class Warbler::Application < Rake::Application
14
+ include Warbler::RakeHelper
15
+
14
16
  def initialize
15
17
  super
16
18
  Warbler.application = self
@@ -12,6 +12,8 @@ require 'warbler/traits'
12
12
  module Warbler
13
13
  # Warbler archive assembly configuration class.
14
14
  class Config
15
+ include RakeHelper
16
+
15
17
  TOP_DIRS = %w(app config lib log vendor)
16
18
  FILE = "config/warble.rb"
17
19
  BUILD_GEMS = %w(warbler rake rcov)
@@ -171,7 +173,7 @@ module Warbler
171
173
 
172
174
  @compiled_ruby_files ||= FileList[*@dirs.map {|d| "#{d}/**/*.rb"}]
173
175
 
174
- @excludes += ["tmp/war"] if File.directory?("tmp/war")
176
+ @excludes += ["tmp/war", "tmp/war/**/*"] if File.directory?("tmp/war")
175
177
  @excludes += warbler_vendor_excludes(warbler_home)
176
178
  @excludes += FileList["**/*.log"] if @exclude_logs
177
179
  end
@@ -17,6 +17,8 @@ module Warbler
17
17
  # * Any object responding to +read+ representing an in-memory blob
18
18
  # * A String filename pointing to a file on disk
19
19
  class Jar
20
+ include RakeHelper
21
+
20
22
  DEFAULT_MANIFEST = %{Manifest-Version: 1.0\nCreated-By: Warbler #{Warbler::VERSION}\n\n}
21
23
 
22
24
  attr_reader :files
@@ -0,0 +1,29 @@
1
+ #--
2
+ # Copyright (c) 2010-2011 Engine Yard, Inc.
3
+ # Copyright (c) 2007-2009 Sun Microsystems, Inc.
4
+ # This source code is available under the MIT license.
5
+ # See the file LICENSE.txt for details.
6
+ #++
7
+
8
+ module Warbler
9
+ # This module exists for compatibility with Rake 0.9.
10
+ module RakeHelper
11
+ def self.included(base)
12
+ base.class_eval do
13
+ include Rake::DSL if defined?(Rake::DSL)
14
+ if defined?(Rake::FileUtilsExt)
15
+ include FileUtils
16
+ include Rake::FileUtilsExt
17
+ end
18
+ end
19
+ end
20
+
21
+ def self.extended(base)
22
+ base.extend Rake::DSL if defined?(Rake::DSL)
23
+ if defined?(Rake::FileUtilsExt)
24
+ base.extend FileUtils
25
+ base.extend Rake::FileUtilsExt
26
+ end
27
+ end
28
+ end
29
+ end
@@ -29,6 +29,8 @@ module Warbler
29
29
  # With this setup, you can create two separate war files two
30
30
  # different configurations by running <tt>rake war1 war2</tt>.
31
31
  class Task < Rake::TaskLib
32
+ include RakeHelper
33
+
32
34
  # Task name
33
35
  attr_accessor :name
34
36
 
@@ -30,12 +30,12 @@ module Warbler
30
30
  end
31
31
 
32
32
  def add_bundler_gems
33
+ require 'bundler'
33
34
  config.gems.clear
34
35
  config.gem_dependencies = false # Bundler takes care of these
35
36
  config.bundler = {}
36
- ENV['BUNDLE_WITHOUT'] ||= config.bundle_without.join(':')
37
- require 'bundler'
38
- ::Bundler.setup.requested_specs.each do |spec|
37
+
38
+ bundler_specs.each do |spec|
39
39
  # Bundler HAX -- fixup bad #loaded_from attribute in fake
40
40
  # bundler gemspec from bundler/source.rb
41
41
  if spec.name == "bundler"
@@ -60,7 +60,8 @@ module Warbler
60
60
  config.bundler[:gemfile] = ::Bundler.default_gemfile
61
61
  config.bundler[:lockfile] = ::Bundler.default_lockfile
62
62
  config.bundler[:frozen] = ::Bundler.settings[:frozen]
63
- config.excludes += [::Bundler.settings[:path]] if ::Bundler.settings[:path]
63
+ path = ::Bundler.settings[:path]
64
+ config.excludes += [path, "#{path}/**/*"] if path
64
65
  config.init_contents << "#{config.warbler_templates}/bundler.erb"
65
66
  end
66
67
 
@@ -91,6 +92,18 @@ module Warbler
91
92
  end
92
93
  end
93
94
  end
95
+
96
+ private
97
+
98
+ def bundler_specs
99
+ original_without = ::Bundler.settings.without
100
+ ::Bundler.settings.without = config.bundle_without
101
+
102
+ ::Bundler::Definition.build(::Bundler.default_gemfile, ::Bundler.default_lockfile, nil).requested_specs
103
+ ensure
104
+ # need to set the settings back, otherwise they get persisted in .bundle/config
105
+ ::Bundler.settings[:without] = original_without.join(':')
106
+ end
94
107
  end
95
108
  end
96
109
  end
@@ -11,6 +11,7 @@ module Warbler
11
11
  module Traits
12
12
  # The War trait sets up the layout and generates web.xml for the war project.
13
13
  class War
14
+ include RakeHelper
14
15
  include Trait
15
16
 
16
17
  DEFAULT_GEM_PATH = '/WEB-INF/gems'
@@ -6,5 +6,5 @@
6
6
  #++
7
7
 
8
8
  module Warbler
9
- VERSION = "1.3.1"
9
+ VERSION = "1.3.2"
10
10
  end
Binary file
@@ -83,9 +83,9 @@ module Spec::Example::ExampleGroupMethods
83
83
 
84
84
  let(:drbclient) do
85
85
  drb
86
- DRbObject.new(nil, 'druby://127.0.0.1:7890').tap do |drbclient|
86
+ DRbObject.new(nil, 'druby://127.0.0.1:7890').tap {|drbclient|
87
87
  loop { (drbclient.alive? && break) rescue nil }
88
- end
88
+ }
89
89
  end
90
90
 
91
91
  let(:drb) do
@@ -102,6 +102,9 @@ module Spec::Example::ExampleGroupMethods
102
102
  end
103
103
 
104
104
  Spec::Runner.configure do |config|
105
+ config.include Warbler::RakeHelper
106
+ config.extend Warbler::RakeHelper
107
+
105
108
  config.after(:each) do
106
109
  class << Object
107
110
  public :remove_const
@@ -635,6 +635,7 @@ describe Warbler::Jar do
635
635
  config.dirs += ["tmp"]
636
636
  end
637
637
  jar.apply(config)
638
+ file_list(%r{WEB-INF/tmp/war}).should be_empty
638
639
  file_list(%r{WEB-INF/tmp/war/index\.html}).should be_empty
639
640
  end
640
641
 
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: warbler
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.3.1
5
+ version: 1.3.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - Nick Sieger
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-05-24 00:00:00 -05:00
13
+ date: 2011-08-16 00:00:00 -05:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -18,7 +18,7 @@ dependencies:
18
18
  version_requirements: &id001 !ruby/object:Gem::Requirement
19
19
  none: false
20
20
  requirements:
21
- - - ~>
21
+ - - ">="
22
22
  - !ruby/object:Gem::Version
23
23
  version: 0.8.7
24
24
  requirement: *id001
@@ -73,9 +73,9 @@ dependencies:
73
73
  version_requirements: &id006 !ruby/object:Gem::Requirement
74
74
  none: false
75
75
  requirements:
76
- - - ">="
76
+ - - ~>
77
77
  - !ruby/object:Gem::Version
78
- version: 2.9.1
78
+ version: "2.12"
79
79
  requirement: *id006
80
80
  prerelease: false
81
81
  type: :development
@@ -111,6 +111,7 @@ files:
111
111
  - lib/warbler/config.rb
112
112
  - lib/warbler/gems.rb
113
113
  - lib/warbler/jar.rb
114
+ - lib/warbler/rake_helper.rb
114
115
  - lib/warbler/task.rb
115
116
  - lib/warbler/templates/bundler.erb
116
117
  - lib/warbler/templates/config.erb