Class: Rsense::Client::Daemon
- Inherits:
-
Object
- Object
- Rsense::Client::Daemon
- Extended by:
- Forwardable
- Defined in:
- lib/rsense/client/daemon.rb
Instance Attribute Summary collapse
-
#argslist ⇒ Object
Returns the value of attribute argslist.
-
#classpath ⇒ Object
Returns the value of attribute classpath.
-
#external_args ⇒ Object
Returns the value of attribute external_args.
-
#rsense_bin ⇒ Object
Returns the value of attribute rsense_bin.
-
#rsense_home ⇒ Object
Returns the value of attribute rsense_home.
-
#rsense_lib ⇒ Object
Returns the value of attribute rsense_lib.
-
#runner ⇒ Object
Returns the value of attribute runner.
Instance Method Summary collapse
- #build_argslist ⇒ Object
- #gem_path ⇒ Object
-
#initialize(args = []) ⇒ Daemon
constructor
A new instance of Daemon.
- #java_args ⇒ Object
- #jruby_args(cli_args = []) ⇒ Object
- #set_gem_path_env(gp) ⇒ Object
Constructor Details
#initialize(args = []) ⇒ Daemon
Returns a new instance of Daemon.
15 16 17 18 19 20 21 22 23 |
# File 'lib/rsense/client/daemon.rb', line 15 def initialize(args=[]) @external_args = args @rsense_home = rsense_home @rsense_lib = rsense_lib @rsense_bin = rsense_bin @argslist = build_argslist() @runner = Rsense::Client::Runner.new(@argslist) set_gem_path_env(gem_path) end |
Instance Attribute Details
#argslist ⇒ Object
Returns the value of attribute argslist.
11 12 13 |
# File 'lib/rsense/client/daemon.rb', line 11 def argslist @argslist end |
#classpath ⇒ Object
Returns the value of attribute classpath.
11 12 13 |
# File 'lib/rsense/client/daemon.rb', line 11 def classpath @classpath end |
#external_args ⇒ Object
Returns the value of attribute external_args.
11 12 13 |
# File 'lib/rsense/client/daemon.rb', line 11 def external_args @external_args end |
#rsense_bin ⇒ Object
Returns the value of attribute rsense_bin.
11 12 13 |
# File 'lib/rsense/client/daemon.rb', line 11 def rsense_bin @rsense_bin end |
#rsense_home ⇒ Object
Returns the value of attribute rsense_home.
11 12 13 |
# File 'lib/rsense/client/daemon.rb', line 11 def rsense_home @rsense_home end |
#rsense_lib ⇒ Object
Returns the value of attribute rsense_lib.
11 12 13 |
# File 'lib/rsense/client/daemon.rb', line 11 def rsense_lib @rsense_lib end |
#runner ⇒ Object
Returns the value of attribute runner.
11 12 13 |
# File 'lib/rsense/client/daemon.rb', line 11 def runner @runner end |
Instance Method Details
#build_argslist ⇒ Object
25 26 27 |
# File 'lib/rsense/client/daemon.rb', line 25 def build_argslist java_args + jruby_args(@external_args) end |
#gem_path ⇒ Object
48 49 50 |
# File 'lib/rsense/client/daemon.rb', line 48 def gem_path Gem.path.join(File::PATH_SEPARATOR) end |
#java_args ⇒ Object
56 57 58 |
# File 'lib/rsense/client/daemon.rb', line 56 def java_args ["env", "java", "-cp", classpath, "org.jruby.Main"] end |
#jruby_args(cli_args = []) ⇒ Object
60 61 62 63 |
# File 'lib/rsense/client/daemon.rb', line 60 def jruby_args(cli_args=[]) cli_args ||= [""] ["-I#{@rsense_lib}", @rsense_bin] + cli_args end |
#set_gem_path_env(gp) ⇒ Object
52 53 54 |
# File 'lib/rsense/client/daemon.rb', line 52 def set_gem_path_env(gp) ENV["GEM_PATH"] = gp end |