Sha256: 3c0d10fe4d197359e4c0fab3b35b5f44b9d99e8e09fa440f110b997569813523

Contents?: true

Size: 715 Bytes

Versions: 6

Compression:

Stored size: 715 Bytes

Contents

module UnitF
  module Tag
    class FileSet < Array
      def initialize(targets)
        targets.each do |target|
          process_target(target)
        end
      end

      def process_target(target)
        if ::File.directory?(target)
          find_files(target)
        elsif UnitF::Tag.valid_file?(target)
          append(UnitF::Tag::File.new(target))
        end
      end

      def find_files(root_path)
        Find.find(root_path) do |file_path|
          UnitF::Log.debug("Considering #{file_path}")
          next unless UnitF::Tag.valid_file?(file_path)
          UnitF::Log.debug("Including #{file_path}")
          append(UnitF::Tag::File.new(file_path))
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
unitf-tag-0.1.16 lib/unitf/tag/fileset.rb
unitf-tag-0.1.10 lib/unitf/tag/fileset.rb
unitf-tag-0.1.9 lib/unitf/tag/fileset.rb
unitf-tag-0.1.8 lib/unitf/tag/fileset.rb
unitf-tag-0.1.7 lib/unitf/tag/fileset.rb
unitf-tag-0.1.6 lib/unitf/tag/fileset.rb