Sha256: 8899f899c8c3b072ba675e912b8d1deec7f10b91674d80a6976b289f6e13d8e0

Contents?: true

Size: 610 Bytes

Versions: 10

Compression:

Stored size: 610 Bytes

Contents

require 'chef_fs/file_system/base_fs_object'

module ChefFS
  module FileSystem
    class CookbookFile < BaseFSObject
      def initialize(name, parent, file)
        super(name, parent)
        @file = file
      end

      attr_reader :file

      def checksum
        file[:checksum]
      end

      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

      def rest
        parent.rest
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
knife-essentials-0.5.4 lib/chef_fs/file_system/cookbook_file.rb
knife-essentials-0.5.3 lib/chef_fs/file_system/cookbook_file.rb
knife-essentials-0.5.2 lib/chef_fs/file_system/cookbook_file.rb
knife-essentials-0.5.1 lib/chef_fs/file_system/cookbook_file.rb
knife-essentials-0.5 lib/chef_fs/file_system/cookbook_file.rb
knife-essentials-0.4 lib/chef_fs/file_system/cookbook_file.rb
knife-essentials-0.3.1 lib/chef_fs/file_system/cookbook_file.rb
knife-essentials-0.3 lib/chef_fs/file_system/cookbook_file.rb
knife-essentials-0.2.1 lib/chef_fs/file_system/cookbook_file.rb
knife-essentials-0.2 lib/chef_fs/file_system/cookbook_file.rb