ffi 0.5.0-java → 0.5.3-java

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of ffi might be problematic. Click here for more details.

Files changed (3) hide show
  1. data/Rakefile +1 -1
  2. data/lib/ffi.rb +15 -10
  3. metadata +5 -14
data/Rakefile CHANGED
@@ -11,7 +11,7 @@ PROJ.name = 'ffi'
11
11
  PROJ.authors = "JRuby Project"
12
12
  PROJ.email = "dev@ruby-ffi.kenai.com"
13
13
  PROJ.url = "http://kenai.com/projects/ruby-ffi"
14
- PROJ.version = "0.5.0"
14
+ PROJ.version = "0.5.3"
15
15
  PROJ.rubyforge.name = 'ffi'
16
16
  PROJ.svn.path = 'ffi'
17
17
  PROJ.summary = "A Ruby foreign function interface"
data/lib/ffi.rb CHANGED
@@ -19,24 +19,29 @@ module FFI
19
19
 
20
20
  end
21
21
 
22
- # Fix for RUBY-3527
23
- if JRUBY_VERSION >= "1.2.0" && JRUBY_VERSION < "1.3.0"
22
+ if JRUBY_VERSION < "1.6.0"
24
23
  module Library
25
24
  def ffi_lib(*names)
26
- ffi_libs = []
27
- names.each do |name|
28
- [ name, FFI.map_library_name(name) ].each do |libname|
25
+
26
+ ffi_libs = names.map do |name|
27
+ libnames = (name.is_a?(::Array) ? name : [ name ]).map { |n| [ n, FFI.map_library_name(n) ].uniq }.flatten
28
+ lib = nil
29
+ errors = {}
30
+
31
+ libnames.each do |libname|
29
32
  begin
30
33
  lib = FFI::DynamicLibrary.open(libname, FFI::DynamicLibrary::RTLD_LAZY | FFI::DynamicLibrary::RTLD_GLOBAL)
31
- if lib
32
- ffi_libs << lib
33
- break
34
- end
34
+ break if lib
35
35
  rescue LoadError => ex
36
+ errors[libname] = ex
36
37
  end
37
38
  end
39
+
40
+ if lib.nil?
41
+ raise LoadError.new(errors.values.join('. '))
42
+ end
38
43
  end
39
- raise LoadError, "Could not open any of [#{names.join(", ")}]" if ffi_libs.empty?
44
+
40
45
  @ffi_libs = ffi_libs
41
46
  end
42
47
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ffi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.3
5
5
  platform: java
6
6
  authors:
7
7
  - JRuby Project
@@ -9,19 +9,10 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-10-06 00:00:00 +02:00
12
+ date: 2009-11-20 00:00:00 +10:00
13
13
  default_executable:
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
16
- name: bones
17
- type: :development
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
20
- requirements:
21
- - - ">="
22
- - !ruby/object:Gem::Version
23
- version: 2.5.1
24
- version:
14
+ dependencies: []
15
+
25
16
  description: ""
26
17
  email: dev@ruby-ffi.kenai.com
27
18
  executables: []
@@ -74,7 +65,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
74
65
  requirements: []
75
66
 
76
67
  rubyforge_project: ffi
77
- rubygems_version: 1.3.5
68
+ rubygems_version: 1.3.4
78
69
  signing_key:
79
70
  specification_version: 3
80
71
  summary: A Ruby foreign function interface