Sha256: 20e054b59f9118ec6c185493764c042a1386c55f97263cd3f1c7c844590e5d9b

Contents?: true

Size: 1.53 KB

Versions: 16

Compression:

Stored size: 1.53 KB

Contents

# encoding: utf-8

require 'rake/helpers/filelist'
require 'rake/common/logger'

module Rake
  module Delphi
        class LibList < FileList
            def read_ignored_libs
                libs = []
                file = (ENV['RAKE_DIR'] || Rake.original_dir) + '/.rake.ignored.libs'
                unless File.exists?(file)
                  Logger.trace(Logger::TRACE, "File #{file} not found")
                  return libs
                end
                Logger.trace(Logger::TRACE, "Reading #{file}")
                IO.readlines(file).each do |line|
                    # skip comment lines (started with # or ;)
                    if /^\s*[#;]/.match(line)
                      Logger.trace(Logger::TRACE, "Line #{line} ignored as a comment")
                      next
                    end
                    libs << FileList.get_ignored_dir_pattern(line.chomp)
                end
                libs
            end

            alias_method :initialize_base, :initialize

            def initialize(*patterns)
                initialize_base(patterns)
                @exclude_patterns_libs = read_ignored_libs
                @exclude_procs << proc do |fn|
                  ! File.directory?(fn)
                end << proc do |fn|
                  @exclude_patterns_libs.any? do |pat|
                    match = fn =~ pat
                    Logger.trace(Logger::TRACE, "Dir #{fn} match pattern /#{pat}/. Ignored") if match
                    match
                  end
                end
            end
        end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
rake-delphi-0.0.34 lib/rake/delphi/liblist.rb
rake-delphi-0.0.33 lib/rake/delphi/liblist.rb
rake-delphi-0.0.32 lib/rake/delphi/liblist.rb
rake-delphi-0.0.31 lib/rake/delphi/liblist.rb
rake-delphi-0.0.29 lib/rake/delphi/liblist.rb
rake-delphi-0.0.30 lib/rake/delphi/liblist.rb
rake-delphi-0.0.28 lib/rake/delphi/liblist.rb
rake-delphi-0.0.27 lib/rake/delphi/liblist.rb
rake-delphi-0.0.26 lib/rake/delphi/liblist.rb
rake-delphi-0.0.25 lib/rake/delphi/liblist.rb
rake-delphi-0.0.24 lib/rake/delphi/liblist.rb
rake-delphi-0.0.23 lib/rake/delphi/liblist.rb
rake-delphi-0.0.22 lib/rake/delphi/liblist.rb
rake-delphi-0.0.21 lib/rake/delphi/liblist.rb
rake-delphi-0.0.20 lib/rake/delphi/liblist.rb
rake-delphi-0.0.19 lib/rake/delphi/liblist.rb