class Build::Files::Directory

Public Class Methods

join(*args) click to toggle source
# File lib/build/files/directory.rb, line 26
def self.join(*args)
        self.new(Path.join(*args))
end
new(root) click to toggle source
# File lib/build/files/directory.rb, line 30
def initialize(root)
        @root = root
end

Public Instance Methods

each() { |path| ... } click to toggle source
# File lib/build/files/directory.rb, line 42
def each
        return to_enum(:each) unless block_given?
        
        # We match both normal files with * and dotfiles with .?*
        Dir.glob(@root + "**/{*,.?*}") do |path|
                yield Path.new(path, @root)
        end
end
eql?(other) click to toggle source
# File lib/build/files/directory.rb, line 51
def eql?(other)
        self.class.eql?(other.class) and @root.eql?(other.root)
end
hash() click to toggle source
# File lib/build/files/directory.rb, line 55
def hash
        @root.hash
end
include?(path) click to toggle source
# File lib/build/files/directory.rb, line 59
def include?(path)
        # Would be true if path is a descendant of full_path.
        path.start_with?(@root)
end
rebase(root) click to toggle source
# File lib/build/files/directory.rb, line 64
def rebase(root)
        self.class.new(@root.rebase(root))
end
root() click to toggle source
# File lib/build/files/directory.rb, line 34
def root
        @root
end
roots() click to toggle source
# File lib/build/files/directory.rb, line 38
def roots
        [root]
end
to_path() click to toggle source
# File lib/build/files/directory.rb, line 77
def to_path
        @root
end
to_s() click to toggle source
# File lib/build/files/directory.rb, line 73
def to_s
        to_str
end
to_str() click to toggle source

Convert a Directory into a String, can be used as an argument to a command.

# File lib/build/files/directory.rb, line 69
def to_str
        @root.to_str
end