sys-filesystem 1.3.4 → 1.4.3

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.
@@ -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
@@ -2,27 +2,25 @@ require 'rubygems'
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = 'sys-filesystem'
5
- spec.version = '1.3.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'
9
9
  spec.summary = 'A Ruby interface for getting file system information.'
10
10
  spec.license = 'Apache-2.0'
11
- spec.test_files = Dir['test/*.rb']
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.extra_rdoc_files = Dir['*.rdoc']
16
-
17
- spec.add_dependency('ffi')
15
+ spec.add_dependency('ffi', '~> 1.1')
16
+ spec.add_development_dependency('mkmf-lite', '~> 0.5') unless Gem.win_platform?
18
17
  spec.add_development_dependency('rake')
19
- spec.add_development_dependency('test-unit', '~> 3.3')
20
- spec.add_development_dependency('mkmf-lite', '~> 0.3')
18
+ spec.add_development_dependency('rspec', '~> 3.9')
21
19
 
22
20
  spec.metadata = {
23
21
  'homepage_uri' => 'https://github.com/djberg96/sys-filesystem',
24
22
  'bug_tracker_uri' => 'https://github.com/djberg96/sys-filesystem/issues',
25
- 'changelog_uri' => 'https://github.com/djberg96/sys-filesystem/blob/ffi/CHANGES',
23
+ 'changelog_uri' => 'https://github.com/djberg96/sys-filesystem/blob/main/CHANGES.md',
26
24
  'documentation_uri' => 'https://github.com/djberg96/sys-filesystem/wiki',
27
25
  'source_code_uri' => 'https://github.com/djberg96/sys-filesystem',
28
26
  'wiki_uri' => 'https://github.com/djberg96/sys-filesystem/wiki'
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.3.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,119 +35,106 @@ cert_chain:
35
35
  ORVCZpRuCPpmC8qmqxUnARDArzucjaclkxjLWvCVHeFa9UP7K3Nl9oTjJNv+7/jM
36
36
  WZs4eecIcUc4tKdHxcAJ0MO/Dkqq7hGaiHpwKY76wQ1+8xAh
37
37
  -----END CERTIFICATE-----
38
- date:
38
+ date: 2021-10-20 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: ffi
42
42
  requirement: !ruby/object:Gem::Requirement
43
43
  requirements:
44
- - - ">="
44
+ - - "~>"
45
45
  - !ruby/object:Gem::Version
46
- version: '0'
46
+ version: '1.1'
47
47
  type: :runtime
48
48
  prerelease: false
49
49
  version_requirements: !ruby/object:Gem::Requirement
50
50
  requirements:
51
- - - ">="
51
+ - - "~>"
52
52
  - !ruby/object:Gem::Version
53
- version: '0'
53
+ version: '1.1'
54
54
  - !ruby/object:Gem::Dependency
55
- name: rake
55
+ name: mkmf-lite
56
56
  requirement: !ruby/object:Gem::Requirement
57
57
  requirements:
58
- - - ">="
58
+ - - "~>"
59
59
  - !ruby/object:Gem::Version
60
- version: '0'
60
+ version: '0.5'
61
61
  type: :development
62
62
  prerelease: false
63
63
  version_requirements: !ruby/object:Gem::Requirement
64
64
  requirements:
65
- - - ">="
65
+ - - "~>"
66
66
  - !ruby/object:Gem::Version
67
- version: '0'
67
+ version: '0.5'
68
68
  - !ruby/object:Gem::Dependency
69
- name: test-unit
69
+ name: rake
70
70
  requirement: !ruby/object:Gem::Requirement
71
71
  requirements:
72
- - - "~>"
72
+ - - ">="
73
73
  - !ruby/object:Gem::Version
74
- version: '3.3'
74
+ version: '0'
75
75
  type: :development
76
76
  prerelease: false
77
77
  version_requirements: !ruby/object:Gem::Requirement
78
78
  requirements:
79
- - - "~>"
79
+ - - ">="
80
80
  - !ruby/object:Gem::Version
81
- version: '3.3'
81
+ version: '0'
82
82
  - !ruby/object:Gem::Dependency
83
- name: mkmf-lite
83
+ name: rspec
84
84
  requirement: !ruby/object:Gem::Requirement
85
85
  requirements:
86
86
  - - "~>"
87
87
  - !ruby/object:Gem::Version
88
- version: '0.3'
88
+ version: '3.9'
89
89
  type: :development
90
90
  prerelease: false
91
91
  version_requirements: !ruby/object:Gem::Requirement
92
92
  requirements:
93
93
  - - "~>"
94
94
  - !ruby/object:Gem::Version
95
- version: '0.3'
95
+ version: '3.9'
96
96
  description: |2
97
97
  The sys-filesystem library provides a cross-platform interface for
98
98
  gathering filesystem information, such as disk space and mount point data.
99
99
  email: djberg96@gmail.com
100
100
  executables: []
101
101
  extensions: []
102
- extra_rdoc_files:
103
- - CHANGES.rdoc
104
- - MANIFEST.rdoc
105
- - README.rdoc
102
+ extra_rdoc_files: []
106
103
  files:
104
+ - CHANGES.md
105
+ - Gemfile
107
106
  - LICENSE
108
- - test
109
- - test/test_sys_filesystem_windows.rb
110
- - test/test_sys_filesystem_unix.rb
111
- - test/test_sys_filesystem.rb
107
+ - MANIFEST.md
108
+ - README.md
112
109
  - Rakefile
113
- - sys-filesystem.gemspec
114
- - certs
115
110
  - certs/djberg96_pub.pem
116
- - examples
117
- - examples/example_stat.rb
118
111
  - examples/example_mount.rb
119
- - lib
112
+ - examples/example_stat.rb
120
113
  - lib/sys-filesystem.rb
121
- - lib/sys
122
- - lib/sys/unix
123
- - lib/sys/unix/sys
124
- - lib/sys/unix/sys/filesystem
125
- - lib/sys/unix/sys/filesystem/structs.rb
114
+ - lib/sys/filesystem.rb
115
+ - lib/sys/unix/sys/filesystem.rb
126
116
  - lib/sys/unix/sys/filesystem/constants.rb
127
117
  - lib/sys/unix/sys/filesystem/functions.rb
128
- - lib/sys/unix/sys/filesystem.rb
129
- - lib/sys/filesystem.rb
130
- - lib/sys/windows
131
- - lib/sys/windows/sys
132
- - lib/sys/windows/sys/filesystem
133
- - lib/sys/windows/sys/filesystem/helper.rb
118
+ - lib/sys/unix/sys/filesystem/structs.rb
119
+ - lib/sys/windows/sys/filesystem.rb
134
120
  - lib/sys/windows/sys/filesystem/constants.rb
135
121
  - lib/sys/windows/sys/filesystem/functions.rb
136
- - lib/sys/windows/sys/filesystem.rb
137
- - CHANGES.rdoc
138
- - MANIFEST.rdoc
139
- - README.rdoc
122
+ - lib/sys/windows/sys/filesystem/helper.rb
123
+ - spec/spec_helper.rb
124
+ - spec/sys_filesystem_unix_spec.rb
125
+ - spec/sys_filesystem_windows_spec.rb
126
+ - sys-filesystem.gemspec
140
127
  homepage: https://github.com/djberg96/sys-filesystem
141
128
  licenses:
142
129
  - Apache-2.0
143
130
  metadata:
144
131
  homepage_uri: https://github.com/djberg96/sys-filesystem
145
132
  bug_tracker_uri: https://github.com/djberg96/sys-filesystem/issues
146
- changelog_uri: https://github.com/djberg96/sys-filesystem/blob/ffi/CHANGES
133
+ changelog_uri: https://github.com/djberg96/sys-filesystem/blob/main/CHANGES.md
147
134
  documentation_uri: https://github.com/djberg96/sys-filesystem/wiki
148
135
  source_code_uri: https://github.com/djberg96/sys-filesystem
149
136
  wiki_uri: https://github.com/djberg96/sys-filesystem/wiki
150
- post_install_message:
137
+ post_install_message:
151
138
  rdoc_options: []
152
139
  require_paths:
153
140
  - lib
@@ -162,11 +149,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
162
149
  - !ruby/object:Gem::Version
163
150
  version: '0'
164
151
  requirements: []
165
- rubygems_version: 3.0.6
166
- signing_key:
152
+ rubygems_version: 3.2.29
153
+ signing_key:
167
154
  specification_version: 4
168
155
  summary: A Ruby interface for getting file system information.
169
156
  test_files:
170
- - test/test_sys_filesystem_windows.rb
171
- - test/test_sys_filesystem_unix.rb
172
- - test/test_sys_filesystem.rb
157
+ - spec/sys_filesystem_unix_spec.rb
158
+ - spec/sys_filesystem_windows_spec.rb
metadata.gz.sig CHANGED
Binary file
data/README.rdoc DELETED
@@ -1,77 +0,0 @@
1
- == Description
2
- A cross platform Ruby interface for getting file system information.
3
-
4
- == Installation
5
- gem install sys-filesystem
6
-
7
- == Synopsis
8
- require 'sys/filesystem'
9
- include Sys
10
-
11
- # Display information about a particular filesystem.
12
- p Filesystem.stat('/')
13
-
14
- # Sample output
15
-
16
- #<Sys::Filesystem::Stat:0x517440
17
- @base_type = "ufs",
18
- @flags = 4,
19
- @files_available = 3817457,
20
- @block_size = 8192,
21
- @blocks_available = 19957633,
22
- @blocks = 34349612,
23
- @name_max = 255,
24
- @path = "/",
25
- @filesystem_id = 35651592,
26
- @files = 4135040,
27
- @fragment_size = 1024,
28
- @files_free = 3817457,
29
- @blocks_free = 20301129
30
- >
31
-
32
- # Describe all mount points on the system
33
- Filesystem.mounts{ |mount| p mount }
34
-
35
- # Find the mount point of any particular file
36
- puts Filesystem.mount_point('/home/djberge/some_file.txt') => '/home'
37
-
38
- == Notes
39
- This is a pure Ruby implementation that uses FFI. This means it should work
40
- with JRuby, too.
41
-
42
- == Sample code
43
- Run 'rake example' if you want to see a basic sample run. The actual code
44
- is 'example_stat.rb' in the 'examples' directory. Modify it as you see fit.
45
-
46
- == Known Bugs
47
- None that I'm aware of. Please report bugs on the project page at:
48
-
49
- https://github.com/djberg96/sys-filesystem
50
-
51
- == Future Plans
52
-
53
- * Add better 64-bit support for Linux and BSD.
54
- * Other suggestions welcome.
55
-
56
- == Acknowledgements
57
- Mike Hall, for ideas and code that I borrowed from his 'filesystem' library.
58
-
59
- Park Heesob, for implementation and API ideas for the MS Windows version.
60
-
61
- Nobuyoshi Miyokawa, for adding the original FreeBSD and OS X support.
62
-
63
- == License
64
- Apache-2.0
65
-
66
- == Copyright
67
- (C) 2003-2019 Daniel J. Berger
68
-
69
- All Rights Reserved
70
-
71
- == Warranty
72
- This library is provided "as is" and without any express or
73
- implied warranties, including, without limitation, the implied
74
- warranties of merchantability and fitness for a particular purpose.
75
-
76
- == Author
77
- Daniel J. Berger
@@ -1,7 +0,0 @@
1
- $LOAD_PATH.unshift File.dirname(File.expand_path(__FILE__))
2
-
3
- if File::ALT_SEPARATOR
4
- require 'test_sys_filesystem_windows'
5
- else
6
- require 'test_sys_filesystem_unix'
7
- end