Sha256: adc097215acb0e20d16d4949b186044fc7bdad6b4b902b859976a681c95ef792

Contents?: true

Size: 550 Bytes

Versions: 10

Compression:

Stored size: 550 Bytes

Contents

module Berkshelf
  class CookbookSource
    # @author Jamie Winsor <jamie@vialstudios.com>
    class PathLocation
      include Location

      attr_accessor :path

      def initialize(name, options = {})
        @name = name
        @path = File.expand_path(options[:path])
      end

      def download(destination)
        unless File.chef_cookbook?(path)
          raise CookbookNotFound, "Cookbook '#{name}' not found at path: '#{path}'"
        end

        path
      end

      def to_s
        "path: '#{path}'"
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
berkshelf-0.3.3 lib/berkshelf/cookbook_source/path_location.rb
berkshelf-0.3.2 lib/berkshelf/cookbook_source/path_location.rb
berkshelf-0.3.1 lib/berkshelf/cookbook_source/path_location.rb
berkshelf-0.3.0 lib/berkshelf/cookbook_source/path_location.rb
berkshelf-0.2.0 lib/berkshelf/cookbook_source/path_location.rb
berkshelf-0.1.5 lib/berkshelf/cookbook_source/path_location.rb
berkshelf-0.1.4 lib/berkshelf/cookbook_source/path_location.rb
berkshelf-0.1.3 lib/berkshelf/cookbook_source/path_location.rb
berkshelf-0.1.2 lib/berkshelf/cookbook_source/path_location.rb
berkshelf-0.1.1 lib/berkshelf/cookbook_source/path_location.rb