Permalink
Browse files

Platform support for Linux

  • Loading branch information...
snscaimito committed Feb 27, 2012
1 parent 6d309d3 commit e6837de2e26c95bb2e2588317109f5f67e9f9bbe
Showing with 11 additions and 5 deletions.
  1. +1 −0 Gemfile.lock
  2. +10 −1 lib/rmq/mqclient.rb
  3. +0 −4 spec/rmq/queue_manager_spec.rb
View
@@ -14,6 +14,7 @@ GEM
rspec-mocks (2.7.0)
PLATFORMS
+ ruby
x86-mingw32
DEPENDENCIES
View
@@ -3,7 +3,16 @@ module MQClient
include Constants
extend FFI::Library
- ffi_lib "mqic32.dll"
+ def MQClient.running_on_windows?
+ (/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM) != nil
+ end
+
+ def MQClient.running_on_linux?
+ RUBY_PLATFORM.include?("linux")
+ end
+
+ ffi_lib "mqic32.dll" if running_on_windows?
+ ffi_lib "libmqic" if running_on_linux?
ffi_convention :stdcall
attach_function :mqconn, :MQCONN,
@@ -12,10 +12,6 @@
@qm.disconnect if !@qm.nil?
end
- it 'should pass the canary test' do
- true.should == true
- end
-
it 'should connect/disconnect to/from local queue manager' do
@qm = RMQ::QueueManager::connect(SpecHelper::DATA[:queue_manager])
@qm.should_not be_nil

0 comments on commit e6837de

Please sign in to comment.