Sha256: 7046a1e62a79aa1f570c406e47cadadf2023d3b2557f6173d9cbd9ef3c56f590

Contents?: true

Size: 582 Bytes

Versions: 55

Compression:

Stored size: 582 Bytes

Contents

module PlatformExtensionHelpers
  def binary_extension(platform = RUBY_PLATFORM)
    case platform
      when /darwin/
        'bundle'
      when /mingw|mswin|linux/
        'so'
      when /java/
        'jar'
      else
        RbConfig::CONFIG['DLEXT']
    end
  end

  def search_path(binaries)
    paths = ENV['PATH'].split(File::PATH_SEPARATOR)
    binary = binaries.find do |bin_file|
      paths.find do |path|
        bin = File.join(path, bin_file)
        File.exist?(bin) && File.executable?(bin)
      end
    end
    binary
  end
end

World(PlatformExtensionHelpers)

Version data entries

55 entries across 55 versions & 4 rubygems

Version Path
rake-compiler-1.2.9 features/support/platform_extension_helpers.rb
rake-compiler-1.2.8 features/support/platform_extension_helpers.rb
rake-compiler-1.2.7 features/support/platform_extension_helpers.rb
rake-compiler-1.2.6 features/support/platform_extension_helpers.rb
getargv-0.3.3-universal-darwin vendor/bundle/ruby/3.3.0/gems/rake-compiler-1.2.5/features/support/platform_extension_helpers.rb
rake-compiler-1.2.5 features/support/platform_extension_helpers.rb
rake-compiler-1.2.4 features/support/platform_extension_helpers.rb
rake-compiler-1.2.3 features/support/platform_extension_helpers.rb
rake-compiler-1.2.2 features/support/platform_extension_helpers.rb
rake-compiler-1.2.1 features/support/platform_extension_helpers.rb
rake-compiler-1.2.0 features/support/platform_extension_helpers.rb
rake-compiler-1.1.9 features/support/platform_extension_helpers.rb
rake-compiler-1.1.8 features/support/platform_extension_helpers.rb
rake-compiler-1.1.7 features/support/platform_extension_helpers.rb
rake-compiler-1.1.6 features/support/platform_extension_helpers.rb
rake-compiler-1.1.5 features/support/platform_extension_helpers.rb
rake-compiler-1.1.4 features/support/platform_extension_helpers.rb
rake-compiler-1.1.3 features/support/platform_extension_helpers.rb
rake-compiler-1.1.2 features/support/platform_extension_helpers.rb
rake-compiler-1.1.1 features/support/platform_extension_helpers.rb