ffi-compiler 1.3.1 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6b5d2323276536d7b5525a84f71e6b740d93dbb7599bc593b07c6cbe4555d71a
4
- data.tar.gz: 59c2d2f0e72494eb68b396f2c99b6c78229839b363abda938869134c205b1aab
3
+ metadata.gz: 36bee4e03a58265eef9313e6f533b78b75c6ad29fc3fd14c1d666d85f8b9ed1b
4
+ data.tar.gz: cdb95bdc8c5840447ac5b41aea31a4807b10d6a529476deec812dd75004d6f14
5
5
  SHA512:
6
- metadata.gz: '074259969bc26ce9cf1c5ef33b6e64c16bdc6f6283248ed1b2d124268d8686eb103421a3208fbfd30d43518933c65f012d3394ebb5fc9c5566564aa50f04ff35'
7
- data.tar.gz: 861960b3190b87b5b6ca902b2076e12abb6788a137bc7cf04d7fb6eb27fea7b9fb673e20b887c2a6e5285c6c4a4b3bf27f7d45362360d3149851e50c32cff25e
6
+ metadata.gz: 2c43be7e67718870c5e2e293c32694429df1cff6b7ae2716ad026ea6743f75b687cc54f21ed5659d71f762c8c788fc8445449d29cf72f5701bde5fcba52b4e1d
7
+ data.tar.gz: 2751d878035dc257e7739348107582a6acd630565fbef10d8b9b827fac6bc62550c8bc6fcc0e73b04feab247ac27477376bb22b52de6bd9ea7382baa64bc2c5a
@@ -144,7 +144,7 @@ module FFI
144
144
  src_files = []
145
145
  obj_files = []
146
146
  @source_dirs.each do |dir|
147
- files = FileList["#{dir}/**/*.{c,cpp}"]
147
+ files = FileList["#{dir}/**/*.{c,cpp,m}"]
148
148
  unless @exclude.empty?
149
149
  files.delete_if { |f| f =~ Regexp.union(*@exclude) }
150
150
  end
@@ -155,7 +155,7 @@ module FFI
155
155
  index = 0
156
156
  src_files.each do |src|
157
157
  obj_file = obj_files[index]
158
- if src =~ /\.c$/
158
+ if src =~ /\.[cm]$/
159
159
  file obj_file => [ src, File.dirname(obj_file) ] do |t|
160
160
  sh "#{cc} #{cflags} -o #{shellescape(t.name)} -c #{shellescape(t.prerequisites[0])}"
161
161
  end
@@ -7,8 +7,21 @@ module FFI
7
7
  module Loader
8
8
  def self.find(name, start_path = nil)
9
9
  library = Platform.system.map_library_name(name)
10
+ start_path ||= caller_path(caller[0])
11
+
12
+ # Load from modern extension fast-path when called from an active gem spec
13
+ if defined?(Gem::Specification) &&
14
+ (spec = Gem::Specification.find_active_stub_by_path(library)&.spec) &&
15
+ spec.respond_to?(:extension_dir) &&
16
+ start_path.start_with?(spec.gem_dir)
17
+
18
+ ext_path = File.join(spec.extension_dir, library)
19
+ return ext_path if File.exist?(ext_path)
20
+ end
21
+
22
+ # Try to find the library in the legacy lib path, passed start_path or local folder
10
23
  root = false
11
- Pathname.new(start_path || caller_path(caller[0])).ascend do |path|
24
+ Pathname.new(start_path).ascend do |path|
12
25
  Dir.glob("#{path}/**/#{FFI::Platform::ARCH}-#{FFI::Platform::OS}/#{library}") do |f|
13
26
  return f
14
27
  end
@@ -24,6 +24,12 @@ module FFI
24
24
  super
25
25
  end
26
26
 
27
+ # This is here for backwards-compatibility so we have namespace-free name
28
+ # FileTask (which we used in past) never uses scope
29
+ def self.scope_name(scope, task_name)
30
+ task_name
31
+ end
32
+
27
33
  private
28
34
 
29
35
  def out_of_date?(timestamp)
@@ -1,7 +1,7 @@
1
1
 
2
2
  module FFI
3
3
  module Compiler
4
- VERSION = "1.3.1"
4
+ VERSION = "1.4.0"
5
5
  end
6
6
  end
7
7
 
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ffi-compiler
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wayne Meissner
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-03-13 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: rake
@@ -94,7 +93,6 @@ homepage: https://github.com/ffi/ffi-compiler
94
93
  licenses:
95
94
  - Apache-2.0
96
95
  metadata: {}
97
- post_install_message:
98
96
  rdoc_options: []
99
97
  require_paths:
100
98
  - lib
@@ -109,8 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
109
107
  - !ruby/object:Gem::Version
110
108
  version: '0'
111
109
  requirements: []
112
- rubygems_version: 3.5.6
113
- signing_key:
110
+ rubygems_version: 4.0.5
114
111
  specification_version: 4
115
112
  summary: Ruby FFI Rakefile generator
116
113
  test_files: []