You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildr.apache.org by to...@apache.org on 2017/07/30 07:52:33 UTC
[2/2] buildr git commit: Rename aggregate to concatenate
Rename aggregate to concatenate
Project: http://git-wip-us.apache.org/repos/asf/buildr/repo
Commit: http://git-wip-us.apache.org/repos/asf/buildr/commit/ae528730
Tree: http://git-wip-us.apache.org/repos/asf/buildr/tree/ae528730
Diff: http://git-wip-us.apache.org/repos/asf/buildr/diff/ae528730
Branch: refs/heads/master
Commit: ae528730035cc2c4298a96313de9bc4220f19455
Parents: b78da3c
Author: Antoine Toulme <an...@lunar-ocean.com>
Authored: Sun Jul 30 00:52:20 2017 -0700
Committer: Antoine Toulme <an...@lunar-ocean.com>
Committed: Sun Jul 30 00:52:20 2017 -0700
----------------------------------------------------------------------
lib/buildr/packaging/archive.rb | 12 ++++++------
spec/packaging/archive_spec.rb | 4 ++--
2 files changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/buildr/blob/ae528730/lib/buildr/packaging/archive.rb
----------------------------------------------------------------------
diff --git a/lib/buildr/packaging/archive.rb b/lib/buildr/packaging/archive.rb
index 59e2f61..cd24fa4 100644
--- a/lib/buildr/packaging/archive.rb
+++ b/lib/buildr/packaging/archive.rb
@@ -268,8 +268,8 @@ module Buildr #:nodoc:
self
end
- def aggregate(*files)
- @expanders.each { |expander| expander.aggregate(*files) }
+ def concatenate(*files)
+ @expanders.each { |expander| expander.concatenate(*files) }
self
end
end
@@ -282,7 +282,7 @@ module Buildr #:nodoc:
@zip_file = zip_file.to_s
@includes = []
@excludes = []
- @aggregates = []
+ @concatenates = []
end
def include(*files)
@@ -296,8 +296,8 @@ module Buildr #:nodoc:
self
end
- def aggregate(*files)
- @aggregates |= files
+ def concatenate(*files)
+ @concatenates |= files
self
end
@@ -309,7 +309,7 @@ module Buildr #:nodoc:
!@excludes.any? { |pattern| File.fnmatch(pattern, entry.name) }
dest = path =~ /^\/?$/ ? entry.name : Util.relative_path(path + "/" + entry.name)
trace "Adding #{dest}"
- if @aggregates.any? { |pattern| File.fnmatch(pattern, entry.name) }
+ if @concatenates.any? { |pattern| File.fnmatch(pattern, entry.name) }
file_map[dest] << ZipEntryData.new(source, entry)
else
file_map[dest] = ZipEntryData.new(source, entry)
http://git-wip-us.apache.org/repos/asf/buildr/blob/ae528730/spec/packaging/archive_spec.rb
----------------------------------------------------------------------
diff --git a/spec/packaging/archive_spec.rb b/spec/packaging/archive_spec.rb
index 73ba1ba..6da2365 100644
--- a/spec/packaging/archive_spec.rb
+++ b/spec/packaging/archive_spec.rb
@@ -307,14 +307,14 @@ shared_examples_for 'ArchiveTask' do
end
end
- it 'should merge archives, aggregating file contents' do
+ it 'should merge archives, concatenate file contents' do
@files = %w{foo1 foo2}.map { |folder| File.join(@dir, folder) }.
map do |dir|
txt_file = File.join(dir, 'test1.txt')
write txt_file, content_for('test1.txt')
zip(File.join(dir, 'test1.zip')).include(txt_file)
end
- archive(@archive).merge(@files).aggregate("test1.txt")
+ archive(@archive).merge(@files).concatenate("test1.txt")
archive(@archive).invoke
inspect_archive do |archive|
archive['test1.txt'].should eql(content_for('test1.txt') * @files.size)