sys-filesystem 1.4.2 → 1.4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/CHANGES.md +8 -0
- data/Gemfile +2 -3
- data/MANIFEST.md +7 -6
- data/README.md +3 -0
- data/lib/sys/filesystem.rb +1 -1
- data/lib/sys/unix/sys/filesystem/functions.rb +12 -1
- data/lib/sys/unix/sys/filesystem/structs.rb +12 -1
- data/lib/sys/unix/sys/filesystem.rb +2 -0
- data/lib/sys/windows/sys/filesystem.rb +2 -0
- data/spec/sys_filesystem_unix_spec.rb +5 -1
- data/spec/sys_filesystem_windows_spec.rb +5 -1
- data/sys-filesystem.gemspec +1 -1
- data.tar.gz.sig +0 -0
- metadata +6 -6
- metadata.gz.sig +1 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3b00e624e22bd699630d63b34f90be7758f82630a069f7db2a61e2139cb55888
|
4
|
+
data.tar.gz: 59add440f0203bade0430b2acd410e785b4ab0de416f272755a72db9276aa767
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eb24f3c965a15d090fd7fff5800cc4c1829a7ddc7f2cbc4e943bb7e57ae92749a6abfccfecd94e8522287e9700916fc22f57af164afa413459321fa9460ba9a3
|
7
|
+
data.tar.gz: d5d30e84e01f370ac62b77251f2c80c07964a99bebfa0cc30252237bc33830198d3a065c28a546c230327b1b951d45d95bc309f75276d17d7e1e8968ade216f2
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/CHANGES.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
## 1.4.3 - 20-Oct-2021
|
2
|
+
* Another fix for 32-bit vs 64-bit Linux since it was realized we cannot always
|
3
|
+
rely on the host architecture information. Handling for JRuby was improved
|
4
|
+
as well. Thanks go to Scott Bradnick for the spot.
|
5
|
+
* The constructor is now explicitly private. This class was never meant to
|
6
|
+
actually be instantiated.
|
7
|
+
* Updated the MANIFEST.md file.
|
8
|
+
|
1
9
|
## 1.4.2 - 22-Jul-2021
|
2
10
|
* Fixed support for 32-bit Linux. Thanks go to ciprianbadescu for the spot.
|
3
11
|
|
data/Gemfile
CHANGED
@@ -1,3 +1,2 @@
|
|
1
|
-
source 'https://rubygems.org'
|
2
|
-
|
3
|
-
end
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
gemspec
|
data/MANIFEST.md
CHANGED
@@ -1,11 +1,12 @@
|
|
1
|
-
* CHANGES.
|
1
|
+
* CHANGES.md
|
2
2
|
* Gemfile
|
3
3
|
* LICENSE
|
4
|
-
* MANIFEST.
|
4
|
+
* MANIFEST.md
|
5
5
|
* Rakefile
|
6
|
-
* README.
|
6
|
+
* README.md
|
7
7
|
* sys-fileystem.gemspec
|
8
8
|
* certs/djberg96_pub.pem
|
9
|
+
* examples/example_mount.rb
|
9
10
|
* examples/example_stat.rb
|
10
11
|
* lib/sys-filesystem.rb
|
11
12
|
* lib/sys/filesystem.rb
|
@@ -17,6 +18,6 @@
|
|
17
18
|
* lib/sys/windows/sys/filesystem/constants.rb
|
18
19
|
* lib/sys/windows/sys/filesystem/functions.rb
|
19
20
|
* lib/sys/windows/sys/filesystem/helper.rb
|
20
|
-
*
|
21
|
-
*
|
22
|
-
*
|
21
|
+
* spec/spec_helper.rb
|
22
|
+
* spec/sys_filesystem_unix_spec.rb
|
23
|
+
* spec/sys_filesystem_windows_spec.rb
|
data/README.md
CHANGED
@@ -8,6 +8,9 @@ A cross platform Ruby interface for getting file system information.
|
|
8
8
|
|
9
9
|
`gem install sys-filesystem`
|
10
10
|
|
11
|
+
## Adding the trusted cert
|
12
|
+
`gem cert --add <(curl -Ls https://raw.githubusercontent.com/djberg96/sys-filesystem/main/certs/djberg96_pub.pem)`
|
13
|
+
|
11
14
|
## Synopsis
|
12
15
|
|
13
16
|
```ruby
|
data/lib/sys/filesystem.rb
CHANGED
@@ -7,9 +7,20 @@ module Sys
|
|
7
7
|
|
8
8
|
ffi_lib FFI::Library::LIBC
|
9
9
|
|
10
|
+
def self.linux64?
|
11
|
+
if RUBY_PLATFORM == 'java'
|
12
|
+
ENV_JAVA['sun.arch.data.model'].to_i == 64
|
13
|
+
else
|
14
|
+
RbConfig::CONFIG['host_os'] =~ /linux/i &&
|
15
|
+
(RbConfig::CONFIG['arch'] =~ /64/ || RbConfig::CONFIG['DEFS'] =~ /64/)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
private_class_method :linux64?
|
20
|
+
|
10
21
|
if RbConfig::CONFIG['host_os'] =~ /sunos|solaris/i
|
11
22
|
attach_function(:statvfs, :statvfs64, %i[string pointer], :int)
|
12
|
-
elsif
|
23
|
+
elsif linux64?
|
13
24
|
attach_function(:statvfs, :statvfs64, %i[string pointer], :int)
|
14
25
|
else
|
15
26
|
attach_function(:statvfs, %i[string pointer], :int)
|
@@ -6,6 +6,17 @@ module Sys
|
|
6
6
|
module Structs
|
7
7
|
class Statfs < FFI::Struct
|
8
8
|
|
9
|
+
def self.linux64?
|
10
|
+
if RUBY_PLATFORM == 'java'
|
11
|
+
ENV_JAVA['sun.arch.data.model'].to_i == 64
|
12
|
+
else
|
13
|
+
RbConfig::CONFIG['host_os'] =~ /linux/i &&
|
14
|
+
(RbConfig::CONFIG['arch'] =~ /64/ || RbConfig::CONFIG['DEFS'] =~ /64/)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
private_class_method :linux64?
|
19
|
+
|
9
20
|
# FreeBSD 12.0 MNAMELEN from 88 => 1024.
|
10
21
|
MNAMELEN =
|
11
22
|
if RbConfig::CONFIG['host_os'] =~ /freebsd(.*)/i
|
@@ -40,7 +51,7 @@ module Sys
|
|
40
51
|
:f_mntonname, [:char, MNAMELEN]
|
41
52
|
)
|
42
53
|
elsif RbConfig::CONFIG['host_os'] =~ /linux/i
|
43
|
-
if
|
54
|
+
if linux64?
|
44
55
|
layout(
|
45
56
|
:f_type, :ulong,
|
46
57
|
:f_bsize, :ulong,
|
@@ -21,10 +21,14 @@ RSpec.describe Sys::Filesystem, :unix => true do
|
|
21
21
|
end
|
22
22
|
|
23
23
|
example "version number is set to the expected value" do
|
24
|
-
expect(Sys::Filesystem::VERSION).to eq('1.4.
|
24
|
+
expect(Sys::Filesystem::VERSION).to eq('1.4.3')
|
25
25
|
expect(Sys::Filesystem::VERSION).to be_frozen
|
26
26
|
end
|
27
27
|
|
28
|
+
example "you cannot instantiate an instance" do
|
29
|
+
expect{ described_class.new }.to raise_error(NoMethodError)
|
30
|
+
end
|
31
|
+
|
28
32
|
example "stat path works as expected" do
|
29
33
|
expect(@stat).to respond_to(:path)
|
30
34
|
expect(@stat.path).to eq(root)
|
@@ -17,10 +17,14 @@ RSpec.describe Sys::Filesystem, :windows => true do
|
|
17
17
|
end
|
18
18
|
|
19
19
|
example "version number is set to the expected value" do
|
20
|
-
expect(Sys::Filesystem::VERSION).to eq('1.4.
|
20
|
+
expect(Sys::Filesystem::VERSION).to eq('1.4.3')
|
21
21
|
expect(Sys::Filesystem::VERSION).to be_frozen
|
22
22
|
end
|
23
23
|
|
24
|
+
example "you cannot instantiate an instance" do
|
25
|
+
expect{ described_class.new }.to raise_error(NoMethodError)
|
26
|
+
end
|
27
|
+
|
24
28
|
example "stat path works as expected" do
|
25
29
|
expect(@stat).to respond_to(:path)
|
26
30
|
expect(@stat.path).to eq(root)
|
data/sys-filesystem.gemspec
CHANGED
@@ -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.
|
5
|
+
spec.version = '1.4.3'
|
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,11 +1,11 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sys-filesystem
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel J. Berger
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain:
|
11
11
|
- |
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
35
35
|
ORVCZpRuCPpmC8qmqxUnARDArzucjaclkxjLWvCVHeFa9UP7K3Nl9oTjJNv+7/jM
|
36
36
|
WZs4eecIcUc4tKdHxcAJ0MO/Dkqq7hGaiHpwKY76wQ1+8xAh
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date: 2021-
|
38
|
+
date: 2021-10-20 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: ffi
|
@@ -134,7 +134,7 @@ metadata:
|
|
134
134
|
documentation_uri: https://github.com/djberg96/sys-filesystem/wiki
|
135
135
|
source_code_uri: https://github.com/djberg96/sys-filesystem
|
136
136
|
wiki_uri: https://github.com/djberg96/sys-filesystem/wiki
|
137
|
-
post_install_message:
|
137
|
+
post_install_message:
|
138
138
|
rdoc_options: []
|
139
139
|
require_paths:
|
140
140
|
- lib
|
@@ -149,8 +149,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
149
149
|
- !ruby/object:Gem::Version
|
150
150
|
version: '0'
|
151
151
|
requirements: []
|
152
|
-
rubygems_version: 3.
|
153
|
-
signing_key:
|
152
|
+
rubygems_version: 3.2.29
|
153
|
+
signing_key:
|
154
154
|
specification_version: 4
|
155
155
|
summary: A Ruby interface for getting file system information.
|
156
156
|
test_files:
|
metadata.gz.sig
CHANGED
@@ -1,3 +1 @@
|
|
1
|
-
�~)
|
2
|
-
L��"5�ފ�rȥ�5�/����E9������,;}̡������h�'Sp|q�IlB2Z�p�L��k�XzyV����\�Ҩnx������b��*r������))`�!��rr_����{hkB=8���
|
3
|
-
���]�L��a��yc�pkS�L�oGO�b��qR�?1;O�J&�����&���M�@BU�{>��[����p��i"S}
|
4
|
-
�����٤��a�,Q'3"�%�|,YU���j��B�J���RȎ�-��E>�A=i��e�%���b9d\�C~� !%���;�:F��,�u�\��=2.�4ݿ]�@�O�Ϭs,Yi���i��wUt��T=�������
|
1
|
+
�)Q�ge������@������F`FT"��1�O&���j$�<�O/>�D�n�3�`s��8�,���,�$"p%���sG��?�F�~i�K0�Ю#�b��^�>�0�",Y�v "L��P�lW��l�2�]О+Kɦ��M"�o���ݞ�>��D�M��*��*ݷu����4�:Z��tv&GiɊD�?Ệε\���QI�8��]Do89��l/���7��Q���q�$��l@�ᗆ��x��[H[�y�HWя���-�;������)1}��+�PpxMwM���Y2�#�����'y;��μ���>��`�k�����c[��Zo�}+�\V_�X�=�R���~�O���K������gN�c�Z��O�
|