rdkit_chem 2025.09.3.12 → 2025.09.3.13

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: 8fd525bf8f5e07e8759d0f36c18ecabdf2ec3147a0d6bd240dd5c951fd629285
4
- data.tar.gz: fa0cb66768fa9160dc781a6b374bfb4dc12abfa946f24daae07e851b5eb83346
3
+ metadata.gz: 4ead3b69c8da6f0fddb3a5fe01f5a8d6b50045831e09b041f3a41c77bd06c592
4
+ data.tar.gz: 6198fa63ccdece161d05392f179a1c25241707680e79ec16e98de72367bc449c
5
5
  SHA512:
6
- metadata.gz: e99aee43550767d548a3534e56609ad84607d7c88d1ef59943b8b6bd329837cc2fef2e8c660ddf8519d1bea43ee2705c6f8fc626fae528ed0604c58bd8a189d8
7
- data.tar.gz: adb78e57d89a631ff08f393bea2f26b356e181e7d52c2f46f7d628d80a1657cc3af2e1ab8d5de893be4f92cec01293bf83114c520075c9d73977854ff28621cc
6
+ metadata.gz: 5d552f59f51878f3e521d80ce47c82fd8bcb387cf0fff12f5fe07edb5efe55761a9167cbbaf8189de04fc3ecfcb87d389f68ab6f118b2bef675367bdc135ec72
7
+ data.tar.gz: 78ae51ccc565f8d70738184b8138efb80f43f50a4a092ab830232c085c9ec06e524b81de3acf285916e5237ceba6063a2a6c24dcb3f606435df9f84b93ed5bd5
@@ -2,5 +2,5 @@
2
2
 
3
3
  module RDKitChem
4
4
  VERSION = '2025.09.3'
5
- GEMVERSION = "#{VERSION}.12"
5
+ GEMVERSION = "#{VERSION}.13"
6
6
  end
data/lib/rdkit_chem.rb CHANGED
@@ -8,22 +8,31 @@ require 'rdkit_chem/version'
8
8
 
9
9
  def find_rdkit_native_extension
10
10
  ruby_version = "#{RUBY_VERSION.split('.')[0..1].join('.')}.0"
11
-
12
- # Location 1: Pre-compiled gem (platform-specific)
13
- precompiled_path = File.expand_path("rdkit_chem/#{ruby_version}", __dir__)
14
- if File.directory?(precompiled_path)
15
- return precompiled_path
11
+ base_dir = File.expand_path('rdkit_chem', __dir__)
12
+
13
+ # Location 1: Pre-compiled gem - exact Ruby version match
14
+ precompiled_path = File.join(base_dir, ruby_version)
15
+ return precompiled_path if File.directory?(precompiled_path) && has_native_extension?(precompiled_path)
16
+
17
+ # Location 2: Pre-compiled gem - any available Ruby version (fallback)
18
+ # This handles cases where gem was built with different Ruby minor version
19
+ if File.directory?(base_dir)
20
+ Dir.glob(File.join(base_dir, '*.0')).sort.reverse.each do |version_dir|
21
+ return version_dir if has_native_extension?(version_dir)
22
+ end
16
23
  end
17
24
 
18
- # Location 2: Source-compiled gem (legacy rdkit_chem/lib/)
25
+ # Location 3: Source-compiled gem (legacy rdkit_chem/lib/)
19
26
  source_compiled_path = File.expand_path('../rdkit_chem/lib', __dir__)
20
- if File.exist?(File.join(source_compiled_path, 'RDKitChem.so')) ||
21
- File.exist?(File.join(source_compiled_path, 'RDKitChem.bundle'))
22
- return source_compiled_path
23
- end
27
+ return source_compiled_path if has_native_extension?(source_compiled_path)
28
+
29
+ raise LoadError, 'Cannot find RDKitChem native extension. ' \
30
+ "Searched in:\n - #{precompiled_path}\n - #{base_dir}/*.0\n - #{source_compiled_path}"
31
+ end
24
32
 
25
- raise LoadError, "Cannot find RDKitChem native extension. " \
26
- "Searched in:\n - #{precompiled_path}\n - #{source_compiled_path}"
33
+ def has_native_extension?(dir)
34
+ File.exist?(File.join(dir, 'RDKitChem.so')) ||
35
+ File.exist?(File.join(dir, 'RDKitChem.bundle'))
27
36
  end
28
37
 
29
38
  native_path = find_rdkit_native_extension
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rdkit_chem
3
3
  version: !ruby/object:Gem::Version
4
- version: 2025.09.3.12
4
+ version: 2025.09.3.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - An Nguyen