Class: Albacore::FpmAppSpec::Task

Inherits:
Object
  • Object
show all
Includes:
CrossPlatformCmd, Logging
Defined in:
lib/albacore/fpm_app_spec.rb

Overview

task implementation that can be #execute’d

Constant Summary

Constants included from CrossPlatformCmd

CrossPlatformCmd::KILL_TIMEOUT

Instance Attribute Summary

Attributes included from CrossPlatformCmd

#pid

Instance Method Summary collapse

Methods included from CrossPlatformCmd

#chdir, #make_command, #normalise_slashes, #sh, #shie, #stop, #system, #which

Methods included from Logging

#debug, #err, #error, #fatal, #info, #puts, #trace, #warn

Constructor Details

#initialize(opts) ⇒ Task

create a new task instance with the given opts

Raises:

  • (ArgumentError)


101
102
103
104
# File 'lib/albacore/fpm_app_spec.rb', line 101

def initialize opts
  raise ArgumentError, 'opts is nil' if opts.nil?
  @opts = opts
end

Instance Method Details

#executeObject

this runs fpm and does some file copying



107
108
109
110
111
112
# File 'lib/albacore/fpm_app_spec.rb', line 107

def execute
  warn 'executing fpm app spec task, but there are no input files [fpm_app_spec::task#execute]' if
    @opts.get(:files).empty?

  fpm_package @opts.get(:out), @opts.get(:files)
end