Class: Java::Classpath

Inherits:
Object
  • Object
show all
Defined in:
lib/selenium-grid/lib/ruby/java/classpath.rb

Instance Method Summary collapse

Constructor Details

#initialize(root_dir) ⇒ Classpath

Returns a new instance of Classpath.



6
7
8
9
10
# File 'lib/selenium-grid/lib/ruby/java/classpath.rb', line 6

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

Instance Method Details

#<<(paths) ⇒ Object



12
13
14
15
# File 'lib/selenium-grid/lib/ruby/java/classpath.rb', line 12

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

#definitionObject



17
18
19
20
# File 'lib/selenium-grid/lib/ruby/java/classpath.rb', line 17

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

end

#separatorObject



22
23
24
# File 'lib/selenium-grid/lib/ruby/java/classpath.rb', line 22

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