Class: BuildMaster::Classpath

Inherits:
Object
  • Object
show all
Defined in:
lib/buildmaster/auto/classpath.rb

Instance Method Summary collapse

Constructor Details

#initialize(root = nil) ⇒ Classpath

Returns a new instance of Classpath.



34
35
36
37
# File 'lib/buildmaster/auto/classpath.rb', line 34

def initialize(root = nil)
  @entries = Array.new
  @root = root
end

Instance Method Details

#add(entry) ⇒ Object



47
48
49
# File 'lib/buildmaster/auto/classpath.rb', line 47

def add(entry)
  @entries.push(convert(entry))
end

#add_all(dir) ⇒ Object



51
52
53
# File 'lib/buildmaster/auto/classpath.rb', line 51

def add_all(dir)
  @entries.push(ClasspathEntries.new(dir))
end

#empty?Boolean

Returns:

  • (Boolean)


55
56
57
# File 'lib/buildmaster/auto/classpath.rb', line 55

def empty?
  @entries.empty?
end

#include?(entry) ⇒ Boolean

Returns:

  • (Boolean)


39
40
41
# File 'lib/buildmaster/auto/classpath.rb', line 39

def include?(entry)
  @entries.include?(convert(entry))
end

#insert(entry) ⇒ Object



43
44
45
# File 'lib/buildmaster/auto/classpath.rb', line 43

def insert(entry)
  @entries.unshift(convert(entry))
end

#to_ant(id = nil) ⇒ Object



59
60
61
62
63
64
65
66
67
68
69
# File 'lib/buildmaster/auto/classpath.rb', line 59

def to_ant(id=nil)
  return '' if empty?
  result = entries_to_ant
  if (not id.nil?)
    result = <<RESULT
  <path id="#{id}">
#{result}  </path>
RESULT
  end
  result
end