summaryrefslogtreecommitdiff
path: root/ruby
diff options
context:
space:
mode:
Diffstat (limited to 'ruby')
-rwxr-xr-xruby/config/slice2rb.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/ruby/config/slice2rb.rb b/ruby/config/slice2rb.rb
index 7fcddf9582a..2744db07692 100755
--- a/ruby/config/slice2rb.rb
+++ b/ruby/config/slice2rb.rb
@@ -10,6 +10,31 @@
$:.unshift File.join(File.dirname(__FILE__), "..", "ruby")
+# Fix up the environment PATH under Windows so that the plugin can load.
+if RUBY_PLATFORM =~ /mswin|mingw|cygwin/
+ path = ENV["PATH"]
+
+ iceBinDir = File.join(File.dirname(__FILE__), "..", "..", "cpp", "bin")
+ programFiles = "ProgramFiles"
+ suffix = ""
+
+ # 64 bit windows machine?
+ arch1 = ENV['PROCESSOR_ARCHITECTURE']
+ arch2 = ENV['PROCESSOR_ARCHITEW6432']
+ if arch1 == "AMD64" || arch1 == "IA64" || arch2 == "AMD64" || arch2 == "IA64"
+ programFiles += "(x86)"
+
+ # 64 bit ruby?
+ if RUBY_PLATFORM == "x64-mingw32"
+ suffix = "x64"
+ end
+ end
+ path = path + ";" + File.join(ENV[programFiles], "ZeroC","Ice-3.6.0-ThirdParty", "bin", suffix)
+ path = path + ";" + File.join(iceBinDir, suffix)
+
+ ENV['PATH'] = path
+end
+
require 'IceRuby'
rc = Ice::compile(ARGV)