From e9b3907bd8f725f005a950d948206763d6aa0013 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Tue, 12 Feb 2013 10:41:10 -0800 Subject: [PATCH] conditionalize to avoid deprecation in 2.0.0 --- lib/spring/sid.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/spring/sid.rb b/lib/spring/sid.rb index 632c6949..c70e2123 100644 --- a/lib/spring/sid.rb +++ b/lib/spring/sid.rb @@ -2,8 +2,14 @@ module Spring module SID + if RUBY_VERSION >= '2.0.0' + handle = Fiddle::Handle + else + handle = DL::Handle + end + FUNC = Fiddle::Function.new( - DL::Handle::DEFAULT['getsid'], + handle::DEFAULT['getsid'], [Fiddle::TYPE_INT], Fiddle::TYPE_INT )