lib/omnibus/packagers/base.rb in omnibus-5.4.0 vs lib/omnibus/packagers/base.rb in omnibus-5.5.0

- old
+ new

@@ -12,16 +12,17 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # -require 'fileutils' +require "fileutils" module Omnibus class Packager::Base include Cleanroom include Digestable + include Instrumentation include Logging include NullArgumentable include Sugarable include Templating include Util @@ -96,16 +97,16 @@ # of project exclusions and includes "common" SCM directories (like +.git+). # # @return [Array<String>] # def exclusions - project.exclusions + %w( + project.exclusions + %w{ **/.git **/.hg **/.svn **/.gitkeep - ) + } end # # @!group DSL methods # -------------------------------------------------- @@ -138,24 +139,26 @@ # def run! # Ensure the package directory exists create_directory(Config.package_dir) - # Run the setup and build sequences - instance_eval(&self.class.setup) if self.class.setup - instance_eval(&self.class.build) if self.class.build + measure("Packaging time") do + # Run the setup and build sequences + instance_eval(&self.class.setup) if self.class.setup + instance_eval(&self.class.build) if self.class.build - # Render the metadata - Metadata.generate(package_path, project) + # Render the metadata + Metadata.generate(package_path, project) - # Ensure the temporary directory is removed at the end of a successful - # run. Without removal, successful builds will "leak" in /tmp and cause - # increased disk usage. - # - # Instead of having this as an +ensure+ block, failed builds will persist - # this directory so developers can go poke around and figure out why the - # build failed. - remove_directory(staging_dir) + # Ensure the temporary directory is removed at the end of a successful + # run. Without removal, successful builds will "leak" in /tmp and cause + # increased disk usage. + # + # Instead of having this as an +ensure+ block, failed builds will persist + # this directory so developers can go poke around and figure out why the + # build failed. + remove_directory(staging_dir) + end end # # The path to the rendered package on disk. This is calculated by # combining the {Config#package_dir} with the name of the package, as