Class JavaClass::Classpath::EclipseClasspath
In: lib/javaclass/classpath/eclipse_classpath.rb
Parent: CompositeClasspath

An Eclipse workspace aware classpath.

Author:Peter Kofler

Methods

Constants

DOT_CLASSPATH = '.classpath'

Public Class methods

Add an Eclipse variable name with _value to look up libraries.

[Source]

# File lib/javaclass/classpath/eclipse_classpath.rb, line 18
      def self.add_variable(name, value)
        @@variables ||= Hash.new
        @@variables.delete(name)
        @@variables[name] = value if value
      end

Create a classpath for an Eclipse base project in folder where the .classpath is.

[Source]

# File lib/javaclass/classpath/eclipse_classpath.rb, line 30
      def initialize(folder)
        unless EclipseClasspath::valid_location?(folder)
          raise IOError, "folder #{folder} not an Eclipse project"
        end
        @folder = folder
        dot_classpath = File.join(@folder, DOT_CLASSPATH)
        super(dot_classpath)
        
        add_entries_from(dot_classpath)
      end

Skip the lib containers if .classpath.

[Source]

# File lib/javaclass/classpath/eclipse_classpath.rb, line 25
      def self.skip_lib(flag=:skip)
        @@skip_lib = flag
      end

Check if the file is a valid location for an Eclipse classpath.

[Source]

# File lib/javaclass/classpath/eclipse_classpath.rb, line 13
      def self.valid_location?(file)
        FileTest.exist?(file) && FileTest.directory?(file) && FileTest.exist?(File.join(file, DOT_CLASSPATH))
      end

[Validate]