Files

Class/Module Index [+]

Quicksearch

Chef::ChefFS::FileSystem::CookbookFile

Attributes

file[R]

Public Class Methods

new(name, parent, file) click to toggle source
# File lib/chef/chef_fs/file_system/cookbook_file.rb, line 26
def initialize(name, parent, file)
  super(name, parent)
  @file = file
end

Public Instance Methods

checksum() click to toggle source
# File lib/chef/chef_fs/file_system/cookbook_file.rb, line 33
def checksum
  file[:checksum]
end
compare_to(other) click to toggle source
# File lib/chef/chef_fs/file_system/cookbook_file.rb, line 51
def compare_to(other)
  other_value = nil
  if other.respond_to?(:checksum)
    other_checksum = other.checksum
  else
    begin
      other_value = other.read
    rescue Chef::ChefFS::FileSystem::NotFoundError
      return [ false, nil, :none ]
    end
    other_checksum = calc_checksum(other_value)
  end
  [ checksum == other_checksum, nil, other_value ]
end
read() click to toggle source
# File lib/chef/chef_fs/file_system/cookbook_file.rb, line 37
def read
  old_sign_on_redirect = rest.sign_on_redirect
  rest.sign_on_redirect = false
  begin
    rest.get_rest(file[:url])
  ensure
    rest.sign_on_redirect = old_sign_on_redirect
  end
end
rest() click to toggle source
# File lib/chef/chef_fs/file_system/cookbook_file.rb, line 47
def rest
  parent.rest
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.