Module: ANTLR3::Test::DependantFile

Included in:
Grammar
Defined in:
lib/antlr3/test/grammar.rb

Constant Summary collapse

GLOBAL_DEPENDENCIES =
[]

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#forceObject Also known as: force?

Returns the value of attribute force


18
19
20
# File 'lib/antlr3/test/grammar.rb', line 18

def force
  @force
end

#pathObject

Returns the value of attribute path


18
19
20
# File 'lib/antlr3/test/grammar.rb', line 18

def path
  @path
end

Instance Method Details

#dependenciesObject


23
24
25
# File 'lib/antlr3/test/grammar.rb', line 23

def dependencies
  @dependencies ||= GLOBAL_DEPENDENCIES.clone
end

#depends_on(path) ⇒ Object


27
28
29
30
31
# File 'lib/antlr3/test/grammar.rb', line 27

def depends_on( path )
  path = File.expand_path path.to_s
  dependencies << path if test( ?f, path )
  return path
end

#stale?Boolean

Returns:

  • (Boolean)

33
34
35
36
37
38
39
# File 'lib/antlr3/test/grammar.rb', line 33

def stale?
  force and return( true )
  target_files.any? do |target|
    not test( ?f, target ) or
      dependencies.any? { |dep| test( ?>, dep, target ) }
  end
end