Class: Expert::Environment

Inherits:
Object
  • Object
show all
Defined in:
lib/expert/environment.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(jarfile, pom, classpath) ⇒ Environment

Returns a new instance of Environment.



9
10
11
12
13
# File 'lib/expert/environment.rb', line 9

def initialize(jarfile, pom, classpath)
  @jarfile = jarfile
  @pom = pom
  @classpath = classpath
end

Instance Attribute Details

#classpathObject (readonly)

Returns the value of attribute classpath.



7
8
9
# File 'lib/expert/environment.rb', line 7

def classpath
  @classpath
end

#jarfileObject (readonly)

Returns the value of attribute jarfile.



7
8
9
# File 'lib/expert/environment.rb', line 7

def jarfile
  @jarfile
end

#pomObject (readonly)

Returns the value of attribute pom.



7
8
9
# File 'lib/expert/environment.rb', line 7

def pom
  @pom
end

Instance Method Details

#installObject



15
16
17
18
# File 'lib/expert/environment.rb', line 15

def install
  install_pom
  install_classpath
end

#installed?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/expert/environment.rb', line 20

def installed?
  pom && classpath
end

#require_allObject



24
25
26
27
28
29
30
31
32
# File 'lib/expert/environment.rb', line 24

def require_all
  if installed?
    classpath.require_all
  else
    raise DependenciesNotInstalledError,
      "Maven dependencies haven't been installed yet (did you forget to "\
      "run `expert install`?)"
  end
end