sys-filesystem 1.4.4 → 1.4.5

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: 50a6340749a1de440a2a5dbc159b9b91c8eec2af1f781ba797ab13a938e7977f
4
- data.tar.gz: 22caa97a8e08a651aed674f3baefb717f8667a39387956dffbd7a84f4694a226
3
+ metadata.gz: 867cb33509a3fa99a58dbf3e0ee69107470a3cecebe4efc2346f49ec1dc1cea6
4
+ data.tar.gz: 9b1de11209f227d00584c021323b3de75db44e399823941bbad5bf9dd407cab2
5
5
  SHA512:
6
- metadata.gz: 604a600ddd040bfe5aed253ec8994d6a0314076b10bb0e322485d9fff5e5b964c4e900b35cb3e0785741b16ed4295dddcae8cbeb851efb5be0c8b0c5b3df7e6f
7
- data.tar.gz: a7603a397ef5a8d5c20bf93460686d80ed53d49cb8abd193addd10d38d6e900cea985b283b712c5c6a61d34baa784fd394dd27a0cb303e68e8023ece7070e944
6
+ metadata.gz: 29b4307434bda5a5447b45675a447d90421c104ba138f296c932272d6054c1cd81d4a3ddd68bdd9b099c30b012409a66ca9befd0275491d448fc2ae6f2184825
7
+ data.tar.gz: 5a6ee063a349093b3b0161814ce6f3b56af683d2a87960ab26d2975530bce91b4a1b31b1f2af1949fb315589116ef8ce5896a95802739a3e85573b436d6c5b6e
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGES.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 1.4.5 - 22-May-2024
2
+ * Handle the possibility that a statvs64 alias may not exist on some Linux
3
+ platforms. Thanks go to Antoine Martin for the report.
4
+
1
5
  ## 1.4.4 - 12-Sep-2023
2
6
  * Yet another fix for 32-bit vs 64-bit linux, specifically for the Statvfs
3
7
  struct. Thanks go to Josh Cooper for the spot and the patch.
@@ -16,7 +16,7 @@ module Sys
16
16
  # return objects of other types. Do not instantiate.
17
17
  class Filesystem
18
18
  # The version of the sys-filesystem library
19
- VERSION = '1.4.4'
19
+ VERSION = '1.4.5'
20
20
 
21
21
  # Stat objects are returned by the Sys::Filesystem.stat method. Here
22
22
  # we're adding universal methods.
@@ -27,7 +27,11 @@ module Sys
27
27
  private_class_method :linux64?
28
28
 
29
29
  if linux64? || solaris?
30
- attach_function(:statvfs, :statvfs64, %i[string pointer], :int)
30
+ begin
31
+ attach_function(:statvfs, :statvfs64, %i[string pointer], :int)
32
+ rescue FFI::NotFoundError # Not every Linux distro has an alias
33
+ attach_function(:statvfs, %i[string pointer], :int)
34
+ end
31
35
  else
32
36
  attach_function(:statvfs, %i[string pointer], :int)
33
37
  end
@@ -4,7 +4,7 @@ require 'sys-filesystem'
4
4
 
5
5
  RSpec.shared_examples Sys::Filesystem do
6
6
  example 'version number is set to the expected value' do
7
- expect(Sys::Filesystem::VERSION).to eq('1.4.4')
7
+ expect(Sys::Filesystem::VERSION).to eq('1.4.5')
8
8
  expect(Sys::Filesystem::VERSION).to be_frozen
9
9
  end
10
10
 
@@ -503,5 +503,10 @@ RSpec.describe Sys::Filesystem, :unix => true do
503
503
  msg = 'statvfs() function failed: No such file or directory'
504
504
  expect{ described_class.stat('/whatever') }.to raise_error(Sys::Filesystem::Error, msg)
505
505
  end
506
+
507
+ example 'statvfs alias is used for statvfs64' do
508
+ expect(Sys::Filesystem::Functions.attached_functions[:statvfs]).to be_a(FFI::Function)
509
+ expect(Sys::Filesystem::Functions.attached_functions[:statvfs64]).to be_nil
510
+ end
506
511
  end
507
512
  end
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = 'sys-filesystem'
5
- spec.version = '1.4.4'
5
+ spec.version = '1.4.5'
6
6
  spec.author = 'Daniel J. Berger'
7
7
  spec.email = 'djberg96@gmail.com'
8
8
  spec.homepage = 'https://github.com/djberg96/sys-filesystem'
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sys-filesystem
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.4
4
+ version: 1.4.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel J. Berger
@@ -35,7 +35,7 @@ cert_chain:
35
35
  ORVCZpRuCPpmC8qmqxUnARDArzucjaclkxjLWvCVHeFa9UP7K3Nl9oTjJNv+7/jM
36
36
  WZs4eecIcUc4tKdHxcAJ0MO/Dkqq7hGaiHpwKY76wQ1+8xAh
37
37
  -----END CERTIFICATE-----
38
- date: 2023-09-12 00:00:00.000000000 Z
38
+ date: 2024-05-22 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: ffi
metadata.gz.sig CHANGED
Binary file