class Rmk::Processor
general interface for a “compiler/linker-like” tool
Attributes
exclude_patterns[R]
list of patters for files to #exclude
flags[R]
processor Utility::Flags
main_sources[R]
source files for binaries (e.g., containing a +main()+ function)
sources[R]
all source files
Public Class Methods
new()
click to toggle source
Calls superclass method
# File lib/processors.rb, line 15 def initialize super @flags = Flags.new @sources = [] @main_sources = {} @exclude_patterns = [] end
Public Instance Methods
add_project(proj, options = {})
click to toggle source
Interface to pass used projects to processors.
# File lib/processors.rb, line 25 def add_project(proj, options = {}) raise 'expected Hash as options' unless options.is_a?(Hash) @@log.debug "#{self.class}#add_project #{proj}, #{options.inspect}" end
exclude(*pattern)
click to toggle source
add regex pattern to #exclude_patterns
# File lib/processors.rb, line 31 def exclude(*pattern) pattern.each do |p| @exclude_patterns << if p.is_a?(Regexp) p else Regexp.compile(p.to_s) end end end
exclude?(name)
click to toggle source
Is name matched by any pattern in #exclude_patterns?
# File lib/processors.rb, line 42 def exclude?(name) !@exclude_patterns.find { |p| name =~ p }.nil? end
find_sources(pattern)
click to toggle source
# File lib/processors.rb, line 46 def find_sources(pattern) @sources = generator.files.find_all do |f| f =~ pattern && !exclude?(f) end end
ninja_begin(writer = generator.ninja)
click to toggle source
# File lib/processors.rb, line 56 def ninja_begin(writer = generator.ninja); end
ninja_end(writer = generator.ninja)
click to toggle source
# File lib/processors.rb, line 58 def ninja_end(writer = generator.ninja) writer.newline end
Protected Instance Methods
find_main_sources()
click to toggle source
# File lib/processors.rb, line 52 def find_main_sources raise 'not implemented' end