Class: Java::Classpath

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

Instance Method Summary collapse

Constructor Details

#initialize(root_dir) ⇒ Classpath

Returns a new instance of Classpath.



7
8
9
10
11
# File 'lib/java/classpath.rb', line 7

def initialize(root_dir)
  @root = root_dir
  @locations = []
  self
end

Instance Method Details

#<<(paths) ⇒ Object



13
14
15
16
# File 'lib/java/classpath.rb', line 13

def <<(paths)
  @locations = (@locations << Dir[@root + '/' + paths]).flatten
  self
end

#definitionObject



18
19
20
# File 'lib/java/classpath.rb', line 18

def definition
  @locations.map {|path| File.native_path(path)}.join(self.separator)
end

#separatorObject



22
23
24
# File 'lib/java/classpath.rb', line 22

def separator
 PLATFORM['win32'] ? ";" : ":"
end