Class: JarWrapper::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/jar_wrapper/runner.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeRunner

Returns a new instance of Runner.



12
13
14
# File 'lib/jar_wrapper/runner.rb', line 12

def initialize
  windows? ? (require "zip/zipfilesystem") : (require 'zip/zip')
end

Instance Attribute Details

#classpathObject

Returns the value of attribute classpath.



10
11
12
# File 'lib/jar_wrapper/runner.rb', line 10

def classpath
  @classpath
end

#jar_fileObject

Returns the value of attribute jar_file.



10
11
12
# File 'lib/jar_wrapper/runner.rb', line 10

def jar_file
  @jar_file
end

#java_optsObject

Returns the value of attribute java_opts.



10
11
12
# File 'lib/jar_wrapper/runner.rb', line 10

def java_opts
  @java_opts
end

#main_classObject

Returns the value of attribute main_class.



10
11
12
# File 'lib/jar_wrapper/runner.rb', line 10

def main_class
  @main_class
end

Instance Method Details

#install(source, destination) ⇒ Object



16
17
18
19
20
# File 'lib/jar_wrapper/runner.rb', line 16

def install source, destination
  download_file_to(source, destination)

  unzip_file(destination) if destination =~ /\.zip$/
end

#run(args) ⇒ Object



22
23
24
25
26
# File 'lib/jar_wrapper/runner.rb', line 22

def run args
  construct_command(args) do |command|
    exec(command.join(" "))
  end
end