Rename aggregate to concatenate
authorAntoine Toulme <antoine@lunar-ocean.com>
Sun, 30 Jul 2017 07:52:20 +0000 (00:52 -0700)
committerAntoine Toulme <antoine@lunar-ocean.com>
Sun, 30 Jul 2017 07:52:20 +0000 (00:52 -0700)
lib/buildr/packaging/archive.rb
spec/packaging/archive_spec.rb

index 59e2f61..cd24fa4 100644 (file)
@@ -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)
index 73ba1ba..6da2365 100644 (file)
@@ -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)