Class: Java::Classpath
- Inherits:
-
Object
- Object
- Java::Classpath
- Defined in:
- lib/java/classpath.rb
Instance Method Summary collapse
- #<<(paths) ⇒ Object
- #definition ⇒ Object
-
#initialize(root_dir) ⇒ Classpath
constructor
A new instance of Classpath.
- #separator ⇒ Object
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 |
#definition ⇒ Object
18 19 20 |
# File 'lib/java/classpath.rb', line 18 def definition @locations.map {|path| File.native_path(path)}.join(self.separator) end |
#separator ⇒ Object
22 23 24 |
# File 'lib/java/classpath.rb', line 22 def separator PLATFORM['win32'] ? ";" : ":" end |