Sha256: 099cc042a6e9ad0253a15ccca17de35b494c0fbe3877a3767709dbb8900de827

Contents?: true

Size: 1.13 KB

Versions: 1

Compression:

Stored size: 1.13 KB

Contents

#!/usr/bin/env ruby
# -*- coding: utf-8 -*-

require "chef/fork/commands"

class Chef
  class Fork
    module Commands
      class Data < Noop
        def run(args=[])
          rest = optparse.order(args)
          case rest.first
          when "bag"
            data_bag(rest.slice(1..-1) || [])
          else
            raise(NameError.new(rest.inspect))
          end
        end

        private
        def data_bag(args=[])
          case args.first
          when "from"
            data_bag_from(args.slice(1..-1) || [])
          when "show"
            data_bag_show(args.slice(1..-1) || [])
          else
            raise(NameError.new(args.inspect))
          end
        end

        def data_bag_from(args=[])
          case args.first
          when "file"
            data_bag_from_file(args.slice(1..-1) || [])
          else
            raise(NameError.new(args.inspect))
          end
        end

        def data_bag_from_file(args=[])
          raise(NotImplementedError.new(args.inspect))
        end

        def data_bag_show(args=[])
          raise(NotImplementedError.new(args.inspect))
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
chef-fork-0.1.1 lib/chef/fork/commands/data.rb