sys-filesystem 1.1.6 → 1.4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- checksums.yaml.gz.sig +0 -0
- data/CHANGES.md +162 -0
- data/Gemfile +2 -0
- data/LICENSE +177 -0
- data/{MANIFEST → MANIFEST.md} +9 -6
- data/README.md +92 -0
- data/Rakefile +14 -24
- data/certs/djberg96_pub.pem +22 -17
- data/examples/example_mount.rb +73 -0
- data/examples/example_stat.rb +2 -0
- data/lib/sys/filesystem.rb +72 -1
- data/lib/sys/unix/sys/filesystem/constants.rb +32 -3
- data/lib/sys/unix/sys/filesystem/functions.rb +36 -9
- data/lib/sys/unix/sys/filesystem/structs.rb +77 -11
- data/lib/sys/unix/sys/filesystem.rb +105 -58
- data/lib/sys/windows/sys/filesystem/functions.rb +11 -8
- data/lib/sys/windows/sys/filesystem/helper.rb +1 -1
- data/lib/sys/windows/sys/filesystem.rb +100 -81
- data/spec/spec_helper.rb +6 -0
- data/spec/sys_filesystem_unix_spec.rb +396 -0
- data/spec/sys_filesystem_windows_spec.rb +348 -0
- data/sys-filesystem.gemspec +15 -7
- data.tar.gz.sig +0 -0
- metadata +75 -61
- metadata.gz.sig +0 -0
- data/CHANGES +0 -89
- data/README +0 -80
- data/test/test_sys_filesystem.rb +0 -7
- data/test/test_sys_filesystem_unix.rb +0 -278
- data/test/test_sys_filesystem_windows.rb +0 -250
@@ -0,0 +1,348 @@
|
|
1
|
+
####################################################################
|
2
|
+
# sys_filesystem_windows_spec.rb
|
3
|
+
#
|
4
|
+
# Specs for the Sys::Filesystem.stat method and related stuff.
|
5
|
+
# This should be run via the 'rake spec' task.
|
6
|
+
####################################################################
|
7
|
+
require 'spec_helper'
|
8
|
+
require 'sys/filesystem'
|
9
|
+
require 'pathname'
|
10
|
+
|
11
|
+
RSpec.describe Sys::Filesystem, :windows => true do
|
12
|
+
let(:root) { 'C:/' }
|
13
|
+
|
14
|
+
before do
|
15
|
+
@stat = Sys::Filesystem.stat(root)
|
16
|
+
@size = 58720256
|
17
|
+
end
|
18
|
+
|
19
|
+
example "version number is set to the expected value" do
|
20
|
+
expect(Sys::Filesystem::VERSION).to eq('1.4.3')
|
21
|
+
expect(Sys::Filesystem::VERSION).to be_frozen
|
22
|
+
end
|
23
|
+
|
24
|
+
example "you cannot instantiate an instance" do
|
25
|
+
expect{ described_class.new }.to raise_error(NoMethodError)
|
26
|
+
end
|
27
|
+
|
28
|
+
example "stat path works as expected" do
|
29
|
+
expect(@stat).to respond_to(:path)
|
30
|
+
expect(@stat.path).to eq(root)
|
31
|
+
end
|
32
|
+
|
33
|
+
example "stat block_size works as expected" do
|
34
|
+
expect(@stat).to respond_to(:block_size)
|
35
|
+
expect(@stat.block_size).to be_kind_of(Numeric)
|
36
|
+
end
|
37
|
+
|
38
|
+
example "stat works with or without trailing slash on standard paths" do
|
39
|
+
expect(Sys::Filesystem.stat("C:/").path).to eq("C:/")
|
40
|
+
expect(Sys::Filesystem.stat("C:/Users").path).to eq("C:/Users")
|
41
|
+
expect(Sys::Filesystem.stat("C:/Users/").path).to eq("C:/Users/")
|
42
|
+
expect(Sys::Filesystem.stat("C:/Users/").path).to eq("C:/Users/")
|
43
|
+
end
|
44
|
+
|
45
|
+
example "stat works with or without trailing slash on UNC paths" do
|
46
|
+
expect(Sys::Filesystem.stat("//127.0.0.1/C$").path).to eq("//127.0.0.1/C$")
|
47
|
+
expect(Sys::Filesystem.stat("//127.0.0.1/C$/").path).to eq("//127.0.0.1/C$/")
|
48
|
+
expect(Sys::Filesystem.stat("\\\\127.0.0.1\\C$").path).to eq("\\\\127.0.0.1\\C$")
|
49
|
+
expect(Sys::Filesystem.stat("\\\\127.0.0.1\\C$\\").path).to eq("\\\\127.0.0.1\\C$\\")
|
50
|
+
end
|
51
|
+
|
52
|
+
example "stat fragment_size works as expected" do
|
53
|
+
expect(@stat).to respond_to(:fragment_size)
|
54
|
+
expect(@stat.fragment_size).to be_nil
|
55
|
+
end
|
56
|
+
|
57
|
+
example "stat blocks works as expected" do
|
58
|
+
expect(@stat).to respond_to(:blocks)
|
59
|
+
expect(@stat.blocks).to be_kind_of(Numeric)
|
60
|
+
end
|
61
|
+
|
62
|
+
example "stat blocks_free works as expected" do
|
63
|
+
expect(@stat).to respond_to(:blocks_free)
|
64
|
+
expect(@stat.blocks_free).to be_kind_of(Numeric)
|
65
|
+
end
|
66
|
+
|
67
|
+
example "stat blocks_available works as expected" do
|
68
|
+
expect(@stat).to respond_to(:blocks_available)
|
69
|
+
expect(@stat.blocks_available).to be_kind_of(Numeric)
|
70
|
+
end
|
71
|
+
|
72
|
+
example "block stats return expected relative values" do
|
73
|
+
expect(@stat.blocks >= @stat.blocks_free).to be true
|
74
|
+
expect(@stat.blocks_free >= @stat.blocks_available).to be true
|
75
|
+
end
|
76
|
+
|
77
|
+
example "stat files works as expected" do
|
78
|
+
expect(@stat).to respond_to(:files)
|
79
|
+
expect(@stat.files).to be_nil
|
80
|
+
end
|
81
|
+
|
82
|
+
example "stat inodes is an alias for files" do
|
83
|
+
expect(@stat.method(:inodes)).to eq(@stat.method(:files))
|
84
|
+
end
|
85
|
+
|
86
|
+
example "stat files_free works as expected" do
|
87
|
+
expect(@stat).to respond_to(:files_free)
|
88
|
+
expect(@stat.files_free).to be_nil
|
89
|
+
end
|
90
|
+
|
91
|
+
example "stat inodes_free is an alias for files_free" do
|
92
|
+
expect(@stat).to respond_to(:inodes_free)
|
93
|
+
end
|
94
|
+
|
95
|
+
example "stat files available works as expected" do
|
96
|
+
expect(@stat).to respond_to(:files_available)
|
97
|
+
expect(@stat.files_available).to be_nil
|
98
|
+
end
|
99
|
+
|
100
|
+
example "stat inodes_available is an alias for files_available" do
|
101
|
+
expect(@stat.method(:inodes_available)).to eq(@stat.method(:files_available))
|
102
|
+
end
|
103
|
+
|
104
|
+
example "stat filesystem_id works as expected" do
|
105
|
+
expect(@stat).to respond_to(:filesystem_id)
|
106
|
+
expect(@stat.filesystem_id).to be_kind_of(Integer)
|
107
|
+
end
|
108
|
+
|
109
|
+
example "stat flags works as expected" do
|
110
|
+
expect(@stat).to respond_to(:flags)
|
111
|
+
expect(@stat.flags).to be_kind_of(Numeric)
|
112
|
+
end
|
113
|
+
|
114
|
+
example "stat name_max works as expected" do
|
115
|
+
expect(@stat).to respond_to(:name_max)
|
116
|
+
expect(@stat.name_max).to be_kind_of(Numeric)
|
117
|
+
end
|
118
|
+
|
119
|
+
example "stat base_type works as expected" do
|
120
|
+
expect(@stat).to respond_to(:base_type)
|
121
|
+
expect(@stat.base_type).to be_kind_of(String)
|
122
|
+
end
|
123
|
+
|
124
|
+
example "stat bytes_total basic functionality" do
|
125
|
+
expect(@stat).to respond_to(:bytes_total)
|
126
|
+
expect(@stat.bytes_total).to be_kind_of(Numeric)
|
127
|
+
end
|
128
|
+
|
129
|
+
example "stat bytes_free basic functionality" do
|
130
|
+
expect(@stat).to respond_to(:bytes_free)
|
131
|
+
expect(@stat.bytes_free).to be_kind_of(Numeric)
|
132
|
+
expect(@stat.blocks_free * @stat.block_size).to eq(@stat.bytes_free)
|
133
|
+
end
|
134
|
+
|
135
|
+
example "stat bytes_available basic functionality" do
|
136
|
+
expect(@stat).to respond_to(:bytes_available)
|
137
|
+
expect(@stat.bytes_available).to be_kind_of(Numeric)
|
138
|
+
expect(@stat.blocks_available * @stat.block_size).to eq(@stat.bytes_available)
|
139
|
+
end
|
140
|
+
|
141
|
+
example "stat bytes_used basic functionality" do
|
142
|
+
expect(@stat).to respond_to(:bytes_used)
|
143
|
+
expect(@stat.bytes_used).to be_kind_of(Numeric)
|
144
|
+
end
|
145
|
+
|
146
|
+
example "stat percent_used basic functionality" do
|
147
|
+
expect(@stat).to respond_to(:percent_used)
|
148
|
+
expect(@stat.percent_used).to be_kind_of(Float)
|
149
|
+
end
|
150
|
+
|
151
|
+
example "case_insensitive returns expected result" do
|
152
|
+
expect(@stat).to respond_to(:case_insensitive?)
|
153
|
+
expect(@stat.case_insensitive?).to eq(true)
|
154
|
+
end
|
155
|
+
|
156
|
+
context "Filesystem.stat(Pathname)" do
|
157
|
+
before do
|
158
|
+
@stat_pathname = Sys::Filesystem.stat(Pathname.new(root))
|
159
|
+
end
|
160
|
+
|
161
|
+
example "stat with Pathname argument works as expected" do
|
162
|
+
expect(@stat_pathname.class).to eq(@stat.class)
|
163
|
+
expect(@stat_pathname.path).to eq(@stat.path)
|
164
|
+
expect(@stat_pathname.block_size).to eq(@stat.block_size)
|
165
|
+
expect(@stat_pathname.fragment_size).to eq(@stat.fragment_size)
|
166
|
+
expect(@stat_pathname.blocks).to eq(@stat.blocks)
|
167
|
+
expect(@stat_pathname.blocks_free).to eq(@stat.blocks_free)
|
168
|
+
expect(@stat_pathname.blocks_available).to eq(@stat.blocks_available)
|
169
|
+
expect(@stat_pathname.files).to eq(@stat.files)
|
170
|
+
expect(@stat_pathname.files_free).to eq(@stat.files_free)
|
171
|
+
expect(@stat_pathname.files_available).to eq(@stat.files_available)
|
172
|
+
expect(@stat_pathname.filesystem_id).to eq(@stat.filesystem_id)
|
173
|
+
expect(@stat_pathname.flags).to eq(@stat.flags)
|
174
|
+
expect(@stat_pathname.name_max).to eq(@stat.name_max)
|
175
|
+
expect(@stat_pathname.base_type).to eq(@stat.base_type)
|
176
|
+
end
|
177
|
+
end
|
178
|
+
|
179
|
+
context "Filesystem.stat(Dir)" do
|
180
|
+
before do
|
181
|
+
@stat_dir = Dir.open(root){ |dir| Sys::Filesystem.stat(dir) }
|
182
|
+
end
|
183
|
+
|
184
|
+
example "stat with Dir argument works as expected" do
|
185
|
+
expect( @stat_dir.class).to eq(@stat.class)
|
186
|
+
expect( @stat_dir.path).to eq(@stat.path)
|
187
|
+
expect( @stat_dir.block_size).to eq(@stat.block_size)
|
188
|
+
expect( @stat_dir.fragment_size).to eq(@stat.fragment_size)
|
189
|
+
expect( @stat_dir.blocks).to eq(@stat.blocks)
|
190
|
+
expect( @stat_dir.blocks_free).to eq(@stat.blocks_free)
|
191
|
+
expect( @stat_dir.blocks_available).to eq(@stat.blocks_available)
|
192
|
+
expect( @stat_dir.files).to eq(@stat.files)
|
193
|
+
expect( @stat_dir.files_free).to eq(@stat.files_free)
|
194
|
+
expect( @stat_dir.files_available).to eq(@stat.files_available)
|
195
|
+
expect( @stat_dir.filesystem_id).to eq(@stat.filesystem_id)
|
196
|
+
expect( @stat_dir.flags).to eq(@stat.flags)
|
197
|
+
expect( @stat_dir.name_max).to eq(@stat.name_max)
|
198
|
+
expect( @stat_dir.base_type).to eq(@stat.base_type)
|
199
|
+
end
|
200
|
+
end
|
201
|
+
|
202
|
+
context "mount_point" do
|
203
|
+
example "mount_point singleton method basic functionality" do
|
204
|
+
expect(Sys::Filesystem).to respond_to(:mount_point)
|
205
|
+
expect{ Sys::Filesystem.mount_point(Dir.pwd) }.not_to raise_error
|
206
|
+
expect(Sys::Filesystem.mount_point(Dir.pwd)).to be_kind_of(String)
|
207
|
+
end
|
208
|
+
|
209
|
+
example "mount_point singleton method returns expected value" do
|
210
|
+
expect(Sys::Filesystem.mount_point("C:\\Users\\foo")).to eq("C:\\")
|
211
|
+
expect(Sys::Filesystem.mount_point("//foo/bar/baz")).to eq("\\\\foo\\bar")
|
212
|
+
end
|
213
|
+
|
214
|
+
example "mount_point works with Pathname object" do
|
215
|
+
expect{ Sys::Filesystem.mount_point(Pathname.new("C:/Users/foo")) }.not_to raise_error
|
216
|
+
expect(Sys::Filesystem.mount_point("C:\\Users\\foo")).to eq("C:\\")
|
217
|
+
expect(Sys::Filesystem.mount_point("//foo/bar/baz")).to eq("\\\\foo\\bar")
|
218
|
+
end
|
219
|
+
end
|
220
|
+
|
221
|
+
example "filesystem constants are defined" do
|
222
|
+
expect(Sys::Filesystem::CASE_SENSITIVE_SEARCH).not_to be_nil
|
223
|
+
expect(Sys::Filesystem::CASE_PRESERVED_NAMES).not_to be_nil
|
224
|
+
expect(Sys::Filesystem::UNICODE_ON_DISK).not_to be_nil
|
225
|
+
expect(Sys::Filesystem::PERSISTENT_ACLS).not_to be_nil
|
226
|
+
expect(Sys::Filesystem::FILE_COMPRESSION).not_to be_nil
|
227
|
+
expect(Sys::Filesystem::VOLUME_QUOTAS).not_to be_nil
|
228
|
+
expect(Sys::Filesystem::SUPPORTS_SPARSE_FILES).not_to be_nil
|
229
|
+
expect(Sys::Filesystem::SUPPORTS_REPARSE_POINTS).not_to be_nil
|
230
|
+
expect(Sys::Filesystem::SUPPORTS_REMOTE_STORAGE).not_to be_nil
|
231
|
+
expect(Sys::Filesystem::VOLUME_IS_COMPRESSED).not_to be_nil
|
232
|
+
expect(Sys::Filesystem::SUPPORTS_OBJECT_IDS).not_to be_nil
|
233
|
+
expect(Sys::Filesystem::SUPPORTS_ENCRYPTION).not_to be_nil
|
234
|
+
expect(Sys::Filesystem::NAMED_STREAMS).not_to be_nil
|
235
|
+
expect(Sys::Filesystem::READ_ONLY_VOLUME).not_to be_nil
|
236
|
+
end
|
237
|
+
|
238
|
+
example "stat singleton method defaults to root path if proviced" do
|
239
|
+
expect{ Sys::Filesystem.stat("C://Program Files") }.not_to raise_error
|
240
|
+
end
|
241
|
+
|
242
|
+
example "stat singleton method accepts a Pathname object" do
|
243
|
+
expect{ Sys::Filesystem.stat(Pathname.new("C://Program Files")) }.not_to raise_error
|
244
|
+
end
|
245
|
+
|
246
|
+
example "stat singleton method requires a single argument" do
|
247
|
+
expect{ Sys::Filesystem.stat }.to raise_error(ArgumentError)
|
248
|
+
expect{ Sys::Filesystem.stat(Dir.pwd, Dir.pwd) }.to raise_error(ArgumentError)
|
249
|
+
end
|
250
|
+
|
251
|
+
example "stat singleton method raises an error if path is not found" do
|
252
|
+
expect{ Sys::Filesystem.stat("C://Bogus//Dir") }.to raise_error(Errno::ESRCH)
|
253
|
+
end
|
254
|
+
|
255
|
+
context "Filesystem::Mount" do
|
256
|
+
let(:mount){ Sys::Filesystem.mounts[0] }
|
257
|
+
|
258
|
+
before do
|
259
|
+
@array = []
|
260
|
+
end
|
261
|
+
|
262
|
+
example "mount singleton method exists" do
|
263
|
+
expect(Sys::Filesystem).to respond_to(:mount)
|
264
|
+
end
|
265
|
+
|
266
|
+
example "umount singleton method exists" do
|
267
|
+
expect(Sys::Filesystem).to respond_to(:umount)
|
268
|
+
end
|
269
|
+
|
270
|
+
example "mounts singleton method basic functionality" do
|
271
|
+
expect(Sys::Filesystem).to respond_to(:mounts)
|
272
|
+
expect{ Sys::Filesystem.mounts }.not_to raise_error
|
273
|
+
expect{ Sys::Filesystem.mounts{}.not_to raise_error }
|
274
|
+
end
|
275
|
+
|
276
|
+
example "mounts singleton method returns the expected value" do
|
277
|
+
expect(Sys::Filesystem.mounts).to be_kind_of(Array)
|
278
|
+
expect(Sys::Filesystem.mounts[0]).to be_kind_of(Sys::Filesystem::Mount)
|
279
|
+
end
|
280
|
+
|
281
|
+
example "mounts singleton method works as expected when a block is provided" do
|
282
|
+
expect(Sys::Filesystem.mounts{}).to be_nil
|
283
|
+
expect{ Sys::Filesystem.mounts{ |mt| @array << mt } }.not_to raise_error
|
284
|
+
expect(@array[0]).to be_kind_of(Sys::Filesystem::Mount)
|
285
|
+
end
|
286
|
+
|
287
|
+
example "mount name works as expected" do
|
288
|
+
expect(mount).to respond_to(:name)
|
289
|
+
expect(mount.name).to be_kind_of(String)
|
290
|
+
end
|
291
|
+
|
292
|
+
example "mount_time works as expected" do
|
293
|
+
expect(mount).to respond_to(:mount_time)
|
294
|
+
expect(mount.mount_time).to be_kind_of(Time)
|
295
|
+
end
|
296
|
+
|
297
|
+
example "mount type works as expected" do
|
298
|
+
expect(mount).to respond_to(:mount_type)
|
299
|
+
expect(mount.mount_type).to be_kind_of(String)
|
300
|
+
end
|
301
|
+
|
302
|
+
example "mount point works as expected" do
|
303
|
+
expect(mount).to respond_to(:mount_point)
|
304
|
+
expect(mount.mount_point).to be_kind_of(String)
|
305
|
+
end
|
306
|
+
|
307
|
+
example "mount options works as expected" do
|
308
|
+
expect(mount).to respond_to(:options)
|
309
|
+
expect(mount.options).to be_kind_of(String)
|
310
|
+
end
|
311
|
+
|
312
|
+
example "mount pass_number works as expected" do
|
313
|
+
expect(mount).to respond_to(:pass_number)
|
314
|
+
expect(mount.pass_number).to be_nil
|
315
|
+
end
|
316
|
+
|
317
|
+
example "mount frequency works as expected" do
|
318
|
+
expect(mount).to respond_to(:frequency)
|
319
|
+
expect(mount.frequency).to be_nil
|
320
|
+
end
|
321
|
+
|
322
|
+
example "mounts singleton method does not accept any arguments" do
|
323
|
+
expect{ Sys::Filesystem.mounts("C:\\") }.to raise_error(ArgumentError)
|
324
|
+
end
|
325
|
+
end
|
326
|
+
|
327
|
+
example "custom Numeric#to_kb method works as expected" do
|
328
|
+
expect(@size).to respond_to(:to_kb)
|
329
|
+
expect(@size.to_kb).to eq(57344)
|
330
|
+
end
|
331
|
+
|
332
|
+
example "custom Numeric#to_mb method works as expected" do
|
333
|
+
expect(@size).to respond_to(:to_mb)
|
334
|
+
expect(@size.to_mb).to eq(56)
|
335
|
+
end
|
336
|
+
|
337
|
+
example "custom Numeric#to_gb method works as expected" do
|
338
|
+
expect(@size).to respond_to(:to_gb)
|
339
|
+
expect(@size.to_gb).to eq(0)
|
340
|
+
end
|
341
|
+
|
342
|
+
context "FFI" do
|
343
|
+
example "internal ffi functions are not public" do
|
344
|
+
expect(Sys::Filesystem.methods.include?(:GetVolumeInformationA)).to eq(false)
|
345
|
+
expect(Sys::Filesystem.instance_methods.include?(:GetVolumeInformationA)).to eq(false)
|
346
|
+
end
|
347
|
+
end
|
348
|
+
end
|
data/sys-filesystem.gemspec
CHANGED
@@ -2,21 +2,29 @@ require 'rubygems'
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |spec|
|
4
4
|
spec.name = 'sys-filesystem'
|
5
|
-
spec.version = '1.
|
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'
|
9
9
|
spec.summary = 'A Ruby interface for getting file system information.'
|
10
|
-
spec.
|
11
|
-
spec.
|
10
|
+
spec.license = 'Apache-2.0'
|
11
|
+
spec.test_files = Dir['spec/*_spec.rb']
|
12
12
|
spec.files = Dir['**/*'].reject{ |f| f.include?('git') }
|
13
13
|
spec.cert_chain = Dir['certs/*']
|
14
14
|
|
15
|
-
spec.
|
16
|
-
|
17
|
-
spec.add_dependency('ffi')
|
18
|
-
spec.add_development_dependency('test-unit', '>= 2.5.0')
|
15
|
+
spec.add_dependency('ffi', '~> 1.1')
|
16
|
+
spec.add_development_dependency('mkmf-lite', '~> 0.5') unless Gem.win_platform?
|
19
17
|
spec.add_development_dependency('rake')
|
18
|
+
spec.add_development_dependency('rspec', '~> 3.9')
|
19
|
+
|
20
|
+
spec.metadata = {
|
21
|
+
'homepage_uri' => 'https://github.com/djberg96/sys-filesystem',
|
22
|
+
'bug_tracker_uri' => 'https://github.com/djberg96/sys-filesystem/issues',
|
23
|
+
'changelog_uri' => 'https://github.com/djberg96/sys-filesystem/blob/main/CHANGES.md',
|
24
|
+
'documentation_uri' => 'https://github.com/djberg96/sys-filesystem/wiki',
|
25
|
+
'source_code_uri' => 'https://github.com/djberg96/sys-filesystem',
|
26
|
+
'wiki_uri' => 'https://github.com/djberg96/sys-filesystem/wiki'
|
27
|
+
}
|
20
28
|
|
21
29
|
spec.description = <<-EOF
|
22
30
|
The sys-filesystem library provides a cross-platform interface for
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,65 +1,70 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sys-filesystem
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
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
|
- |
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
|
-
|
13
|
+
MIIEcDCCAtigAwIBAgIBATANBgkqhkiG9w0BAQsFADA/MREwDwYDVQQDDAhkamJl
|
14
14
|
cmc5NjEVMBMGCgmSJomT8ixkARkWBWdtYWlsMRMwEQYKCZImiZPyLGQBGRYDY29t
|
15
|
-
|
15
|
+
MB4XDTE4MDMxODE1MjIwN1oXDTI4MDMxNTE1MjIwN1owPzERMA8GA1UEAwwIZGpi
|
16
16
|
ZXJnOTYxFTATBgoJkiaJk/IsZAEZFgVnbWFpbDETMBEGCgmSJomT8ixkARkWA2Nv
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
17
|
+
bTCCAaIwDQYJKoZIhvcNAQEBBQADggGPADCCAYoCggGBALgfaroVM6CI06cxr0/h
|
18
|
+
A+j+pc8fgpRgBVmHFaFunq28GPC3IvW7Nvc3Y8SnAW7pP1EQIbhlwRIaQzJ93/yj
|
19
|
+
u95KpkP7tA9erypnV7dpzBkzNlX14ACaFD/6pHoXoe2ltBxk3CCyyzx70mTqJpph
|
20
|
+
75IB03ni9a8yqn8pmse+s83bFJOAqddSj009sGPcQO+QOWiNxqYv1n5EHcvj2ebO
|
21
|
+
6hN7YTmhx7aSia4qL/quc4DlIaGMWoAhvML7u1fmo53CYxkKskfN8MOecq2vfEmL
|
22
|
+
iLu+SsVVEAufMDDFMXMJlvDsviolUSGMSNRTujkyCcJoXKYYxZSNtIiyd9etI0X3
|
23
|
+
ctu0uhrFyrMZXCedutvXNjUolD5r9KGBFSWH1R9u2I3n3SAyFF2yzv/7idQHLJJq
|
24
|
+
74BMnx0FIq6fCpu5slAipvxZ3ZkZpEXZFr3cIBtO1gFvQWW7E/Y3ijliWJS1GQFq
|
25
|
+
058qERadHGu1yu1dojmFRo6W2KZvY9al2yIlbkpDrD5MYQIDAQABo3cwdTAJBgNV
|
26
|
+
HRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFgQUFZsMapgzJimzsbaBG2Tm8j5e
|
27
|
+
AzgwHQYDVR0RBBYwFIESZGpiZXJnOTZAZ21haWwuY29tMB0GA1UdEgQWMBSBEmRq
|
28
|
+
YmVyZzk2QGdtYWlsLmNvbTANBgkqhkiG9w0BAQsFAAOCAYEAW2tnYixXQtKxgGXq
|
29
|
+
/3iSWG2bLwvxS4go3srO+aRXZHrFUMlJ5W0mCxl03aazxxKTsVVpZD8QZxvK91OQ
|
30
|
+
h9zr9JBYqCLcCVbr8SkmYCi/laxIZxsNE5YI8cC8vvlLI7AMgSfPSnn/Epq1GjGY
|
31
|
+
6L1iRcEDtanGCIvjqlCXO9+BmsnCfEVehqZkQHeYczA03tpOWb6pon2wzvMKSsKH
|
32
|
+
ks0ApVdstSLz1kzzAqem/uHdG9FyXdbTAwH1G4ZPv69sQAFAOCgAqYmdnzedsQtE
|
33
|
+
1LQfaQrx0twO+CZJPcRLEESjq8ScQxWRRkfuh2VeR7cEU7L7KqT10mtUwrvw7APf
|
34
|
+
DYoeCY9KyjIBjQXfbj2ke5u1hZj94Fsq9FfbEQg8ygCgwThnmkTrrKEiMSs3alYR
|
35
|
+
ORVCZpRuCPpmC8qmqxUnARDArzucjaclkxjLWvCVHeFa9UP7K3Nl9oTjJNv+7/jM
|
36
|
+
WZs4eecIcUc4tKdHxcAJ0MO/Dkqq7hGaiHpwKY76wQ1+8xAh
|
32
37
|
-----END CERTIFICATE-----
|
33
|
-
date:
|
38
|
+
date: 2021-10-20 00:00:00.000000000 Z
|
34
39
|
dependencies:
|
35
40
|
- !ruby/object:Gem::Dependency
|
36
41
|
name: ffi
|
37
42
|
requirement: !ruby/object:Gem::Requirement
|
38
43
|
requirements:
|
39
|
-
- - "
|
44
|
+
- - "~>"
|
40
45
|
- !ruby/object:Gem::Version
|
41
|
-
version: '
|
46
|
+
version: '1.1'
|
42
47
|
type: :runtime
|
43
48
|
prerelease: false
|
44
49
|
version_requirements: !ruby/object:Gem::Requirement
|
45
50
|
requirements:
|
46
|
-
- - "
|
51
|
+
- - "~>"
|
47
52
|
- !ruby/object:Gem::Version
|
48
|
-
version: '
|
53
|
+
version: '1.1'
|
49
54
|
- !ruby/object:Gem::Dependency
|
50
|
-
name:
|
55
|
+
name: mkmf-lite
|
51
56
|
requirement: !ruby/object:Gem::Requirement
|
52
57
|
requirements:
|
53
|
-
- - "
|
58
|
+
- - "~>"
|
54
59
|
- !ruby/object:Gem::Version
|
55
|
-
version:
|
60
|
+
version: '0.5'
|
56
61
|
type: :development
|
57
62
|
prerelease: false
|
58
63
|
version_requirements: !ruby/object:Gem::Requirement
|
59
64
|
requirements:
|
60
|
-
- - "
|
65
|
+
- - "~>"
|
61
66
|
- !ruby/object:Gem::Version
|
62
|
-
version:
|
67
|
+
version: '0.5'
|
63
68
|
- !ruby/object:Gem::Dependency
|
64
69
|
name: rake
|
65
70
|
requirement: !ruby/object:Gem::Requirement
|
@@ -74,53 +79,62 @@ dependencies:
|
|
74
79
|
- - ">="
|
75
80
|
- !ruby/object:Gem::Version
|
76
81
|
version: '0'
|
82
|
+
- !ruby/object:Gem::Dependency
|
83
|
+
name: rspec
|
84
|
+
requirement: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - "~>"
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '3.9'
|
89
|
+
type: :development
|
90
|
+
prerelease: false
|
91
|
+
version_requirements: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - "~>"
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '3.9'
|
77
96
|
description: |2
|
78
97
|
The sys-filesystem library provides a cross-platform interface for
|
79
98
|
gathering filesystem information, such as disk space and mount point data.
|
80
99
|
email: djberg96@gmail.com
|
81
100
|
executables: []
|
82
101
|
extensions: []
|
83
|
-
extra_rdoc_files:
|
84
|
-
- CHANGES
|
85
|
-
- README
|
86
|
-
- MANIFEST
|
102
|
+
extra_rdoc_files: []
|
87
103
|
files:
|
88
|
-
-
|
104
|
+
- CHANGES.md
|
105
|
+
- Gemfile
|
106
|
+
- LICENSE
|
107
|
+
- MANIFEST.md
|
108
|
+
- README.md
|
109
|
+
- Rakefile
|
89
110
|
- certs/djberg96_pub.pem
|
90
|
-
-
|
91
|
-
- examples
|
111
|
+
- examples/example_mount.rb
|
92
112
|
- examples/example_stat.rb
|
93
|
-
- lib
|
94
|
-
- lib/sys
|
113
|
+
- lib/sys-filesystem.rb
|
95
114
|
- lib/sys/filesystem.rb
|
96
|
-
- lib/sys/unix
|
97
|
-
- lib/sys/unix/sys
|
98
|
-
- lib/sys/unix/sys/filesystem
|
115
|
+
- lib/sys/unix/sys/filesystem.rb
|
99
116
|
- lib/sys/unix/sys/filesystem/constants.rb
|
100
117
|
- lib/sys/unix/sys/filesystem/functions.rb
|
101
118
|
- lib/sys/unix/sys/filesystem/structs.rb
|
102
|
-
- lib/sys/
|
103
|
-
- lib/sys/windows
|
104
|
-
- lib/sys/windows/sys
|
105
|
-
- lib/sys/windows/sys/filesystem
|
119
|
+
- lib/sys/windows/sys/filesystem.rb
|
106
120
|
- lib/sys/windows/sys/filesystem/constants.rb
|
107
121
|
- lib/sys/windows/sys/filesystem/functions.rb
|
108
122
|
- lib/sys/windows/sys/filesystem/helper.rb
|
109
|
-
-
|
110
|
-
-
|
111
|
-
-
|
112
|
-
- Rakefile
|
113
|
-
- README
|
123
|
+
- spec/spec_helper.rb
|
124
|
+
- spec/sys_filesystem_unix_spec.rb
|
125
|
+
- spec/sys_filesystem_windows_spec.rb
|
114
126
|
- sys-filesystem.gemspec
|
115
|
-
- test
|
116
|
-
- test/test_sys_filesystem.rb
|
117
|
-
- test/test_sys_filesystem_unix.rb
|
118
|
-
- test/test_sys_filesystem_windows.rb
|
119
127
|
homepage: https://github.com/djberg96/sys-filesystem
|
120
128
|
licenses:
|
121
|
-
-
|
122
|
-
metadata:
|
123
|
-
|
129
|
+
- Apache-2.0
|
130
|
+
metadata:
|
131
|
+
homepage_uri: https://github.com/djberg96/sys-filesystem
|
132
|
+
bug_tracker_uri: https://github.com/djberg96/sys-filesystem/issues
|
133
|
+
changelog_uri: https://github.com/djberg96/sys-filesystem/blob/main/CHANGES.md
|
134
|
+
documentation_uri: https://github.com/djberg96/sys-filesystem/wiki
|
135
|
+
source_code_uri: https://github.com/djberg96/sys-filesystem
|
136
|
+
wiki_uri: https://github.com/djberg96/sys-filesystem/wiki
|
137
|
+
post_install_message:
|
124
138
|
rdoc_options: []
|
125
139
|
require_paths:
|
126
140
|
- lib
|
@@ -135,10 +149,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
135
149
|
- !ruby/object:Gem::Version
|
136
150
|
version: '0'
|
137
151
|
requirements: []
|
138
|
-
|
139
|
-
|
140
|
-
signing_key:
|
152
|
+
rubygems_version: 3.2.29
|
153
|
+
signing_key:
|
141
154
|
specification_version: 4
|
142
155
|
summary: A Ruby interface for getting file system information.
|
143
156
|
test_files:
|
144
|
-
-
|
157
|
+
- spec/sys_filesystem_unix_spec.rb
|
158
|
+
- spec/sys_filesystem_windows_spec.rb
|
metadata.gz.sig
CHANGED
Binary file
|
data/CHANGES
DELETED
@@ -1,89 +0,0 @@
|
|
1
|
-
== 1.1.6 - 17-May-2016
|
2
|
-
* On versions that use setmntent or fopen, explicitly raise an error if
|
3
|
-
either of those calls return a null value.
|
4
|
-
|
5
|
-
== 1.1.5 - 5-Dec-2015
|
6
|
-
* This gem is now signed.
|
7
|
-
* The gem related tasks in the Rakefile now assume Rubygems 2.x.
|
8
|
-
* Updates to the gemspec, added cert_chain, removed rubyforge_project.
|
9
|
-
* Internal reorganization, and use of relative_require as appropriate.
|
10
|
-
* Added a sys-filesystem.rb file for convenience.
|
11
|
-
|
12
|
-
== 1.1.4 - 15-Mar-2015
|
13
|
-
* The File.mounts method no longer raises an error if a mount point
|
14
|
-
is not accessible. Thanks go to Michael Pope for the patch.
|
15
|
-
* Some internal code reorganization.
|
16
|
-
|
17
|
-
== 1.1.3 - 1-Oct-2014
|
18
|
-
* Now ignores EPERM errors when trying to find the mount point for a path.
|
19
|
-
Thanks go to petersen for the patch.
|
20
|
-
* The Filesystem.stat method now defaults to using the root path on Windows
|
21
|
-
for volume information.
|
22
|
-
|
23
|
-
== 1.1.2 - 9-May-2014
|
24
|
-
* Added the percent_used, bytes_total, bytes_free and bytes_used methods
|
25
|
-
to the Filesystem::Stat class. Thanks go to xanview for the suggestion.
|
26
|
-
* Changed File.exists? to File.exist? to avoid warnings in Ruby 2.1.x.
|
27
|
-
* The convenience methods to_mb, to_gb, etc, are now defined in Numeric
|
28
|
-
instead of Fixnum.
|
29
|
-
* Added the to_tb method for terabytes.
|
30
|
-
* Minor updates to the gem:create and gem:install Rake tasks.
|
31
|
-
|
32
|
-
== 1.1.1 - 3-Oct-2013
|
33
|
-
* Solaris now always uses statvfs64 on Solaris for better 64-bit support.
|
34
|
-
Thanks go to Jeff Shantz for the spot.
|
35
|
-
|
36
|
-
== 1.1.0 - 19-Jan-2013
|
37
|
-
* Converted the Windows source code to use FFI. Consequently, there is now
|
38
|
-
a single gem rather than separate gems for Windows and Unix.
|
39
|
-
* Revamped the Windows tests.
|
40
|
-
|
41
|
-
== 1.0.0 - 11-Jan-2012
|
42
|
-
* Converted everything from C to FFI for the Unix flavors. The Windows
|
43
|
-
source code remains untouched.
|
44
|
-
|
45
|
-
== 0.3.4 - 19-Nov-2010
|
46
|
-
* Fixed a bug where negative block counts were happening on very large
|
47
|
-
hard drives. Thanks go to Jonas Pfenniger for the spot.
|
48
|
-
* Refactored the clean task in the Rakefile.
|
49
|
-
* Some cosmetic source code changes.
|
50
|
-
|
51
|
-
== 0.3.3 - 21-May-2010
|
52
|
-
* Added a workaround for the Sys::Filesystem#block_size member to deal with
|
53
|
-
a bug in OS X. Thanks go to Josh Pasqualetto for the spot.
|
54
|
-
|
55
|
-
== 0.3.2 - 29-Dec-2009
|
56
|
-
* Source has been moved to github.
|
57
|
-
* Added the 'gem' task and removed build logic from the gemspec.
|
58
|
-
* Updated the install task.
|
59
|
-
* Minor correction to the manifest.
|
60
|
-
* Removed some junk build files that were inadvertently included in
|
61
|
-
the last gem.
|
62
|
-
|
63
|
-
== 0.3.1 - 5-Aug-2009
|
64
|
-
* Now compatible with Ruby 1.9.x.
|
65
|
-
* Changed license to Artistic 2.0
|
66
|
-
* Updated the gemspec, including the explicit addition of a license and
|
67
|
-
test-unit as a development dependency, as well as an updated description.
|
68
|
-
|
69
|
-
== 0.3.0 - 26-Feb-2009
|
70
|
-
* Added support for OS X and FreeBSD thanks to an awesome patch by Nobuyoshi
|
71
|
-
Miyokawa.
|
72
|
-
* Added the Filesystem.mount_point method that takes a file and returns
|
73
|
-
the mount point it's sitting on.
|
74
|
-
|
75
|
-
== 0.2.0 - 30-Dec-2008
|
76
|
-
* Added the Filesystem.mounts method for iterating over mount or volume
|
77
|
-
information.
|
78
|
-
|
79
|
-
== 0.1.1 - 28-Mar-2007
|
80
|
-
* Bug fix for BSD flavors. Thanks go to Jeremy Kemper and Ole Christian
|
81
|
-
Rynning for the spot.
|
82
|
-
* Bug fix for OS X (along the same lines as the BSD fix). Thanks go to
|
83
|
-
Aurelian Dehay for the spot.
|
84
|
-
* Some Rdoc improvements for the C extension.
|
85
|
-
* Tweaks to the gemspec.
|
86
|
-
* Added synopsis to the README.
|
87
|
-
|
88
|
-
== 0.1.0 - 17-Nov-2006
|
89
|
-
* Initial release. Alpha. Code is stable, but API is not.
|