Sha256: 9c1f5937f02b5af836248e4fd282ba68159e33f2a0529e5872f4ba9bf0daff71

Contents?: true

Size: 681 Bytes

Versions: 15

Compression:

Stored size: 681 Bytes

Contents

require 'chef_fs/file_system/base_fs_dir'

module ChefFS
  module FileSystem
    class CookbookSubdir < BaseFSDir
      def initialize(name, parent, ruby_only, recursive)
        super(name, parent)
        @children = []
        @ruby_only = ruby_only
        @recursive = recursive
      end

      attr_reader :versions
      attr_reader :children

      def add_child(child)
        @children << child
      end

      def can_have_child?(name, is_dir)
        if is_dir
          return false if !@recursive
        else
          return false if @ruby_only && name !~ /\.rb$/
        end
        true
      end

      def rest
        parent.rest
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
knife-essentials-0.7.6 lib/chef_fs/file_system/cookbook_subdir.rb
knife-essentials-0.7.5 lib/chef_fs/file_system/cookbook_subdir.rb
knife-essentials-0.7.4 lib/chef_fs/file_system/cookbook_subdir.rb
knife-essentials-0.7.3 lib/chef_fs/file_system/cookbook_subdir.rb
knife-essentials-0.7.2 lib/chef_fs/file_system/cookbook_subdir.rb
knife-essentials-0.7.1 lib/chef_fs/file_system/cookbook_subdir.rb
knife-essentials-0.7 lib/chef_fs/file_system/cookbook_subdir.rb
knife-essentials-0.6.1 lib/chef_fs/file_system/cookbook_subdir.rb
knife-essentials-0.6 lib/chef_fs/file_system/cookbook_subdir.rb
knife-essentials-0.5.4 lib/chef_fs/file_system/cookbook_subdir.rb
knife-essentials-0.5.3 lib/chef_fs/file_system/cookbook_subdir.rb
knife-essentials-0.5.2 lib/chef_fs/file_system/cookbook_subdir.rb
knife-essentials-0.5.1 lib/chef_fs/file_system/cookbook_subdir.rb
knife-essentials-0.5 lib/chef_fs/file_system/cookbook_subdir.rb
knife-essentials-0.4 lib/chef_fs/file_system/cookbook_subdir.rb