Sha256: 09ce2679da14b3a7cf46ff4190f0ff77fe72676a39b17ac218af42378cab3eef

Contents?: true

Size: 757 Bytes

Versions: 2

Compression:

Stored size: 757 Bytes

Contents

require 'vagabond/uploader/knife'

module Vagabond
  class Uploader
    class Librarian < Knife

      def initialize(*args)
        super
        unless(options[:cheffile])
          raise ArgumentError.new "Option 'cheffile' is required!"
        end
        unless(File.exists?(options[:cheffile]))
          raise ArgumentError.new "Option 'cheffile' is not a valid path!"
        end
      end

      def prepare
        com = "librarian-chef install --path=#{store}"
        debug(com)
        cmd = Mixlib::ShellOut.new(com,
          :live_stream => options[:debug],
          :cwd => File.dirname(options[:cheffile])
        )
        cmd.run_command
        cmd.error!
        options[:cookbook_paths] = [store]
      end
      
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
vagabond-0.2.4 lib/vagabond/uploader/librarian.rb
vagabond-0.2.2 lib/vagabond/uploader/librarian.rb