Permalink
Browse files

Allow config.excludes to work for files in public/

Fixes WARBLER-17.
  • Loading branch information...
1 parent 1aafb34 commit d4242c9f24ed751e0174eb2b6155929c2caab539 @nicksieger committed Mar 29, 2011
Showing with 10 additions and 0 deletions.
  1. +1 −0 History.txt
  2. +1 −0 lib/warbler/traits/war.rb
  3. +8 −0 spec/warbler/jar_spec.rb
View
@@ -3,6 +3,7 @@
- Warbler can now package regular Ruby projects as executable jar
files. See the README.txt file for details.
- WARBLER-18: Heed BUNDLE_GEMFILE in environment
+- WARBLER-17: Allow config.excludes to work for files in public/
== 1.2.1
@@ -80,6 +80,7 @@ def update_archive(jar)
# Add public/static assets to the root of the war file.
def add_public_files(jar)
+ config.public_html.exclude *(config.excludes.to_a)
config.public_html.map {|f| jar.add_with_pathmaps(config, f, :public_html) }
end
View
@@ -369,6 +369,14 @@ def expand_webxml
file_list(%r{lib/tasks/utils.rake}).should be_empty
end
+ it "can exclude public files from the .war" do
+ use_config do |config|
+ config.excludes += FileList['public/robots.txt']
+ end
+ jar.apply(config)
+ file_list(%r{robots.txt}).should be_empty
+ end
+
it "reads configuration from #{Warbler::Config::FILE}" do
mkdir_p "config"
File.open(Warbler::Config::FILE, "w") do |dest|

0 comments on commit d4242c9

Please sign in to comment.