Sha256: cfa7e4c9546edbe7123aaa224e57d460ba4068b70a21e93789ccdbcd18bf17c5

Contents?: true

Size: 693 Bytes

Versions: 2

Compression:

Stored size: 693 Bytes

Contents

require 'rbconfig'

module Swt
  def self.jar_path
    case Config::CONFIG["host_os"]
    when /darwin/i
      if Config::CONFIG["host_cpu"] == "x86_64"
        '../vendor/swt_osx64'
      else
        '../vendor/swt_osx'
      end
    when /linux/i
      if %w(amd64 x84_64).include? Config::CONFIG["host_cpu"]
        '../vendor/swt_linux64'
      else
        '../vendor/swt_linux'
      end
    when /windows|mswin/i
      '../vendor/swt_win32'
    end
  end

  path = File.expand_path(File.dirname(__FILE__) + "/../" + Swt.jar_path)
  if File.exist?(path + ".jar")
    puts "loading #{Swt.jar_path}"
    require path
  else
    puts "SWT jar file required: #{path}.jar"
    exit
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
swt-0.2-java lib/swt/jar.rb
swt-0.1-java lib/swt/jar.rb