Class: JarWrapper::Runner
- Inherits:
-
Object
- Object
- JarWrapper::Runner
- Defined in:
- lib/jar_wrapper/runner.rb
Instance Attribute Summary collapse
-
#classpath ⇒ Object
Returns the value of attribute classpath.
-
#jar_file ⇒ Object
Returns the value of attribute jar_file.
-
#java_opts ⇒ Object
Returns the value of attribute java_opts.
-
#main_class ⇒ Object
Returns the value of attribute main_class.
Instance Method Summary collapse
-
#initialize ⇒ Runner
constructor
A new instance of Runner.
- #install(source, destination) ⇒ Object
- #run(args) ⇒ Object
Constructor Details
#initialize ⇒ Runner
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
#classpath ⇒ Object
Returns the value of attribute classpath.
10 11 12 |
# File 'lib/jar_wrapper/runner.rb', line 10 def classpath @classpath end |
#jar_file ⇒ Object
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_opts ⇒ Object
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_class ⇒ Object
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 |