Sha256: 4db279f356d726b57c3d929e6f4f5d698fa99108066c7a3b8ddb145665d4886e

Contents?: true

Size: 611 Bytes

Versions: 15

Compression:

Stored size: 611 Bytes

Contents

require 'chef_fs/file_system/rest_list_dir'
require 'chef_fs/file_system/cookbook_dir'

module ChefFS
  module FileSystem
    class CookbooksDir < RestListDir
      def initialize(parent)
        super("cookbooks", parent)
      end

      def child(name)
        result = @children.select { |child| child.name == name }.first if @children
        result || CookbookDir.new(name, self)
      end

      def children
        @children ||= rest.get_rest(api_path).map { |key, value| CookbookDir.new(key, self, value) }
      end

      def can_have_child?(name, is_dir)
        is_dir
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
knife-essentials-0.7.2 lib/chef_fs/file_system/cookbooks_dir.rb
knife-essentials-0.7.1 lib/chef_fs/file_system/cookbooks_dir.rb
knife-essentials-0.7 lib/chef_fs/file_system/cookbooks_dir.rb
knife-essentials-0.6.1 lib/chef_fs/file_system/cookbooks_dir.rb
knife-essentials-0.6 lib/chef_fs/file_system/cookbooks_dir.rb
knife-essentials-0.5.4 lib/chef_fs/file_system/cookbooks_dir.rb
knife-essentials-0.5.3 lib/chef_fs/file_system/cookbooks_dir.rb
knife-essentials-0.5.2 lib/chef_fs/file_system/cookbooks_dir.rb
knife-essentials-0.5.1 lib/chef_fs/file_system/cookbooks_dir.rb
knife-essentials-0.5 lib/chef_fs/file_system/cookbooks_dir.rb
knife-essentials-0.4 lib/chef_fs/file_system/cookbooks_dir.rb
knife-essentials-0.3.1 lib/chef_fs/file_system/cookbooks_dir.rb
knife-essentials-0.3 lib/chef_fs/file_system/cookbooks_dir.rb
knife-essentials-0.2.1 lib/chef_fs/file_system/cookbooks_dir.rb
knife-essentials-0.2 lib/chef_fs/file_system/cookbooks_dir.rb