Class: BuildpackSupport::Rake::PackageTask

Inherits:
Rake::TaskLib
  • Object
show all
Defined in:
lib/buildpack_support/rake/package_task.rb

Overview

A task generator for the package task. Responsible for creating the package task and all of the sub-tasks that are required to do the work of creating the package

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args, &task_block) ⇒ PackageTask

Returns a new instance of PackageTask.



58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/buildpack_support/rake/package_task.rb', line 58

def initialize(*args, &task_block)
  setup_ivars args

  task_block.call(*[self].slice(0, task_block.arity)) if task_block
  abort 'package prefix must be configured' unless prefix

  CLEAN.include build_dir, staging_dir

  desc 'Create packaged buildpack' unless ::Rake.application.last_comment
  task(name, *args)
  task name => package_name

  add_universal_tasks
  add_offline_tasks if @buildpack_version.offline
end

Instance Attribute Details

#build_dirString

Returns the directory to place the created package in. Defaults to build.

Returns:

  • (String)

    the directory to place the created package in. Defaults to build.



36
37
38
# File 'lib/buildpack_support/rake/package_task.rb', line 36

def build_dir
  @build_dir
end

#filesArray<String>

Returns the files to copy to the staging_dir.

Returns:

  • (Array<String>)

    the files to copy to the staging_dir



40
41
42
# File 'lib/buildpack_support/rake/package_task.rb', line 40

def files
  @files
end

#nameString

Returns the name of the task. Defaults to :package.

Returns:

  • (String)

    the name of the task. Defaults to :package.



44
45
46
# File 'lib/buildpack_support/rake/package_task.rb', line 44

def name
  @name
end

#prefixString

Returns the prefix of the package that is created.

Returns:

  • (String)

    the prefix of the package that is created



48
49
50
# File 'lib/buildpack_support/rake/package_task.rb', line 48

def prefix
  @prefix
end

#staging_dirString

Returns the directory to zip the contents of. Defaults to build/staging.

Returns:

  • (String)

    the directory to zip the contents of. Defaults to build/staging.



52
53
54
# File 'lib/buildpack_support/rake/package_task.rb', line 52

def staging_dir
  @staging_dir
end

#verboseBoolean

Returns the verbosity of the task.

Returns:

  • (Boolean)

    the verbosity of the task



56
57
58
# File 'lib/buildpack_support/rake/package_task.rb', line 56

def verbose
  @verbose
end