Class: Quality::RubySpawn
- Inherits:
-
Object
- Object
- Quality::RubySpawn
- Defined in:
- lib/quality/ruby_spawn.rb
Overview
Spawn a ruby process
Instance Method Summary collapse
- #cmd_with_ruby_hack_prefix ⇒ Object
-
#initialize(cmd, args) ⇒ RubySpawn
constructor
A new instance of RubySpawn.
- #invocation ⇒ Object
Constructor Details
#initialize(cmd, args) ⇒ RubySpawn
Returns a new instance of RubySpawn.
4 5 6 7 |
# File 'lib/quality/ruby_spawn.rb', line 4 def initialize(cmd, args) @cmd = cmd @args = args end |
Instance Method Details
#cmd_with_ruby_hack_prefix ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'lib/quality/ruby_spawn.rb', line 17 def cmd_with_ruby_hack_prefix if defined?(RUBY_ENGINE) && (RUBY_ENGINE == 'jruby') "jruby -S #{@cmd}" elsif RbConfig::CONFIG['host_os'] =~ /mswin|mingw/ "#{@cmd}.bat" else @cmd end end |
#invocation ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/quality/ruby_spawn.rb', line 9 def invocation if !@args.empty? "#{cmd_with_ruby_hack_prefix} #{@args}" else cmd_with_ruby_hack_prefix.to_s end end |