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'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(runner, args, filename) ⇒ JavaCommand

Returns a new instance of JavaCommand.



38
39
40
41
42
43
44
# File 'lib/jruby_art/launcher.rb', line 38

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

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args.



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

def args
  @args
end

#completeObject (readonly)

Returns the value of attribute complete.



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

def complete
  @complete
end

#filenameObject (readonly)

Returns the value of attribute filename.



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

def filename
  @filename
end

#optsObject (readonly)

Returns the value of attribute opts.



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

def opts
  @opts
end

#runnerObject (readonly)

Returns the value of attribute runner.



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

def runner
  @runner
end

Instance Method Details

#cmdObject



46
47
48
# File 'lib/jruby_art/launcher.rb', line 46

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