Class: JavaCommand

Inherits:
Object
  • Object
show all
Defined in:
lib/jruby_art/launcher.rb

Overview

Wrap creation of java command string as a class

Constant Summary collapse

MAIN =
'org.jruby.Main'.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(runner, args, filename) ⇒ JavaCommand

Returns a new instance of JavaCommand.



37
38
39
40
41
# File 'lib/jruby_art/launcher.rb', line 37

def initialize(runner, args, filename)
  @runner, @args, @filename = runner, args, filename
  @complete = JRubyComplete.complete
  @opts = JavaOpts.new.opts
end

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args.



36
37
38
# File 'lib/jruby_art/launcher.rb', line 36

def args
  @args
end

#completeObject (readonly)

Returns the value of attribute complete.



36
37
38
# File 'lib/jruby_art/launcher.rb', line 36

def complete
  @complete
end

#filenameObject (readonly)

Returns the value of attribute filename.



36
37
38
# File 'lib/jruby_art/launcher.rb', line 36

def filename
  @filename
end

#optsObject (readonly)

Returns the value of attribute opts.



36
37
38
# File 'lib/jruby_art/launcher.rb', line 36

def opts
  @opts
end

#runnerObject (readonly)

Returns the value of attribute runner.



36
37
38
# File 'lib/jruby_art/launcher.rb', line 36

def runner
  @runner
end

Instance Method Details

#cmdObject



43
44
45
# File 'lib/jruby_art/launcher.rb', line 43

def cmd
  ['java', opts, '-cp', complete, MAIN, runner, filename, args].flatten
end