Sha256: 0069076aa8fb2419e4d4757e792d52c834d084480d1a0e6476bd60930fd86ac1
Contents?: true
Size: 1.5 KB
Versions: 2
Compression:
Stored size: 1.5 KB
Contents
# Copyright (c) 2010-2011 David Love # # Permission to use, copy, modify, and/or distribute this software for # any purpose with or without fee is hereby granted, provided that the # above copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # # @author David Love module WhiteCloth::Projections # Create a Projection for the specified directory class DirFile # Default constructor def initialize @file_stack = WhiteCloth::DataStructures::FlatTree.new end # Run the projection function, taking +path+ as the {File#glob} # shell glob for the path and pattern to match # when looking for files def project(path) # Walk the path, Dir.glob(path){|file_name| # Ignore directories unless File.directory?(file_name) then # Ignore the special files as well unless file_name == "." or file_name == ".." then end end } end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
WhiteCloth-0.0.5 | lib/projections/project_dir.rb |
WhiteCloth-0.0.4 | lib/projections/project_dir.rb |