Class: Stove::Packager

Inherits:
Object
  • Object
show all
Defined in:
lib/stove/packager.rb

Constant Summary collapse

ACCEPTABLE_FILES =
[
  'README.*',
  'CHANGELOG.*',
  'metadata.{json,rb}',
  'attributes',
  'definitions',
  'files',
  'libraries',
  'providers',
  'recipes',
  'resources',
  'templates',
]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cookbook) ⇒ Packager

Create a new packager instance.

Parameters:



32
33
34
# File 'lib/stove/packager.rb', line 32

def initialize(cookbook)
  @cookbook = cookbook
end

Instance Attribute Details

#cookbookObject (readonly)

The cookbook to package.



26
27
28
# File 'lib/stove/packager.rb', line 26

def cookbook
  @cookbook
end

Instance Method Details

#cookbook_filesArray

The list of files that should actually be uploaded.

Returns:

  • (Array)

    the array of file paths



40
41
42
# File 'lib/stove/packager.rb', line 40

def cookbook_files
  Dir.glob("#{File.expand_path(cookbook.path)}/{#{ACCEPTABLE_FILES.join(',')}}")
end

#package_pathString

The path to the tar.gz package in the temporary directory.

Returns:

  • (String)


47
48
49
# File 'lib/stove/packager.rb', line 47

def package_path
  pack!
end