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-31.3.0 lib/quality/ruby_spawn.rb
quality-31.2.1 lib/quality/ruby_spawn.rb
quality-31.2.0 lib/quality/ruby_spawn.rb
quality-31.1.0 lib/quality/ruby_spawn.rb
quality-31.0.0 lib/quality/ruby_spawn.rb
quality-30.0.1 lib/quality/ruby_spawn.rb
quality-30.0.0 lib/quality/ruby_spawn.rb
quality-29.0.0 lib/quality/ruby_spawn.rb
quality-28.0.0 lib/quality/ruby_spawn.rb
quality-27.4.0 lib/quality/ruby_spawn.rb
quality-27.3.1 lib/quality/ruby_spawn.rb
quality-27.3.0 lib/quality/ruby_spawn.rb
quality-27.2.0 lib/quality/ruby_spawn.rb
quality-27.1.1 lib/quality/ruby_spawn.rb
quality-27.1.0 lib/quality/ruby_spawn.rb
quality-27.0.0 lib/quality/ruby_spawn.rb
quality-26.0.0 lib/quality/ruby_spawn.rb
quality-25.0.0 lib/quality/ruby_spawn.rb
quality-24.0.0 lib/quality/ruby_spawn.rb
quality-23.0.7 lib/quality/ruby_spawn.rb