Sha256: 40abdd4f909c713fdb321ca5006e0bae5d3f806c87bd5901c46df4e51854b304

Contents?: true

Size: 543 Bytes

Versions: 9

Compression:

Stored size: 543 Bytes

Contents

module Quality
  # Spawn a ruby process
  class RubySpawn
    def initialize(cmd, args)
      @cmd = cmd
      @args = args
    end

    def invocation
      if !@args.empty?
        "#{cmd_with_ruby_hack_prefix} #{@args}"
      else
        cmd_with_ruby_hack_prefix.to_s
      end
    end

    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
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
quality-22.0.0 lib/quality/ruby_spawn.rb
quality-21.0.6 lib/quality/ruby_spawn.rb
quality-21.0.5 lib/quality/ruby_spawn.rb
quality-21.0.4 lib/quality/ruby_spawn.rb
quality-21.0.3 lib/quality/ruby_spawn.rb
quality-21.0.2 lib/quality/ruby_spawn.rb
quality-21.0.1 lib/quality/ruby_spawn.rb
quality-20.1.1 lib/quality/ruby_spawn.rb
quality-21.0.0 lib/quality/ruby_spawn.rb