Sha256: 01f2fad446aa3694c1f31f6968e390a2652083dcc40376e9f8c384428e6a1064

Contents?: true

Size: 574 Bytes

Versions: 47

Compression:

Stored size: 574 Bytes

Contents

# frozen_string_literal: true

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

47 entries across 47 versions & 1 rubygems

Version Path
quality-38.0.1 lib/quality/ruby_spawn.rb
quality-38.0.0 lib/quality/ruby_spawn.rb
quality-37.1.1 lib/quality/ruby_spawn.rb
quality-37.1.0 lib/quality/ruby_spawn.rb
quality-37.0.1 lib/quality/ruby_spawn.rb
quality-37.0.0 lib/quality/ruby_spawn.rb
quality-36.1.0 lib/quality/ruby_spawn.rb
quality-36.0.0 lib/quality/ruby_spawn.rb
quality-35.2.1 lib/quality/ruby_spawn.rb
quality-35.2.0 lib/quality/ruby_spawn.rb
quality-35.1.1 lib/quality/ruby_spawn.rb
quality-35.0.1 lib/quality/ruby_spawn.rb
quality-35.0.0 lib/quality/ruby_spawn.rb
quality-34.0.2 lib/quality/ruby_spawn.rb
quality-34.0.1 lib/quality/ruby_spawn.rb
quality-34.0.0 lib/quality/ruby_spawn.rb
quality-33.0.0 lib/quality/ruby_spawn.rb
quality-32.1.1 lib/quality/ruby_spawn.rb
quality-32.1.0 lib/quality/ruby_spawn.rb
quality-32.0.0 lib/quality/ruby_spawn.rb