Class: Builderator::Util::Cookbook::Metadata

Inherits:
Chef::Cookbook::Metadata
  • Object
show all
Defined in:
lib/builderator/util/cookbook.rb

Instance Method Summary collapse

Instance Method Details

#archiveObject



29
30
31
# File 'lib/builderator/util/cookbook.rb', line 29

def archive
  Util.working_dir("#{ name }-#{ version }.tgz")
end

#chefignoreObject



33
34
35
# File 'lib/builderator/util/cookbook.rb', line 33

def chefignore
  Util::Cookbook.path.join('chefignore')
end

#filesObject



20
21
22
23
24
25
26
27
# File 'lib/builderator/util/cookbook.rb', line 20

def files
  return @files unless @files.nil?

  @files ||= Pathname.glob(Util::Cookbook.path.join('**/{*,.*}'))
  ignorefile.apply!(@files)

  @files
end

#gitignoreObject



37
38
39
# File 'lib/builderator/util/cookbook.rb', line 37

def gitignore
  Util.working_dir('.gitignore')
end

#ignorefileObject



41
42
43
44
45
46
47
48
# File 'lib/builderator/util/cookbook.rb', line 41

def ignorefile
  return @ignorefile unless @ignorefile.nil?

  ## Construct an ignorefile
  @ignorefile = IgnoreFile.new(Util::Cookbook::EXCLUDED_VCS_FILES)
  @ignorefile.load_file(chefignore)
  @ignorefile.load_file(gitignore)
end