sys-filesystem 0.3.0 → 0.3.1
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.
- data/CHANGES +6 -0
- data/README +3 -2
- data/doc/sys-filesystem.txt +2 -4
- data/ext/sys/filesystem.c +15 -4
- data/sys-filesystem.gemspec +41 -0
- data/test/test_sys_filesystem_unix.rb +2 -2
- data/test/test_sys_filesystem_windows.rb +2 -2
- metadata +26 -15
data/CHANGES
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
== 0.3.1 - 5-Aug-2009
|
2
|
+
* Now compatible with Ruby 1.9.x.
|
3
|
+
* Changed license to Artistic 2.0
|
4
|
+
* Updated the gemspec, including the explicit addition of a license and
|
5
|
+
test-unit as a development dependency, as well as an updated description.
|
6
|
+
|
1
7
|
== 0.3.0 - 26-Feb-2009
|
2
8
|
* Added support for OS X and FreeBSD thanks to an awesome patch by Nobuyoshi
|
3
9
|
Miyokawa.
|
data/README
CHANGED
@@ -65,6 +65,9 @@
|
|
65
65
|
Park Heesob, for implementation and API ideas for the MS Windows version.
|
66
66
|
|
67
67
|
Nobuyoshi Miyokawa, for adding FreeBSD and OS X support.
|
68
|
+
|
69
|
+
= License
|
70
|
+
Artistic 2.0
|
68
71
|
|
69
72
|
= Copyright
|
70
73
|
(C) 2003-2009 Daniel J. Berger
|
@@ -77,5 +80,3 @@
|
|
77
80
|
|
78
81
|
= Author
|
79
82
|
Daniel J. Berger
|
80
|
-
djberg96 at gmail dot com
|
81
|
-
imperator on IRC (irc.freenode.net)
|
data/doc/sys-filesystem.txt
CHANGED
@@ -140,10 +140,10 @@ Fixnum#to_mb
|
|
140
140
|
website at http://www.rubyforge.org/projects/sysutils.
|
141
141
|
|
142
142
|
== License
|
143
|
-
|
143
|
+
Artistic 2.0
|
144
144
|
|
145
145
|
== Copyright
|
146
|
-
Copyright 2002-
|
146
|
+
Copyright 2002-2009, Daniel J. Berger
|
147
147
|
|
148
148
|
All Rights Reserved. This module is free software. It may be used,
|
149
149
|
redistributed and/or modified under the same terms as Ruby itself.
|
@@ -158,8 +158,6 @@ Fixnum#to_mb
|
|
158
158
|
|
159
159
|
== Author
|
160
160
|
Daniel J. Berger
|
161
|
-
djberg96 at nospam at gmail dot com
|
162
|
-
imperator on IRC (Freenode)
|
163
161
|
|
164
162
|
== See Also
|
165
163
|
mount
|
data/ext/sys/filesystem.c
CHANGED
@@ -25,6 +25,17 @@
|
|
25
25
|
#define END_MNT(F) fclose(F)
|
26
26
|
#define MOUNTFILE "/etc/mnttab"
|
27
27
|
|
28
|
+
/* Ruby 1.9.x compatibility */
|
29
|
+
#ifndef RSTRING_PTR
|
30
|
+
#define RSTRING_PTR(v) (RSTRING(v)->ptr)
|
31
|
+
#define RSTRING_LEN(v) (RSTRING(v)->len)
|
32
|
+
#endif
|
33
|
+
|
34
|
+
#ifndef RARRAY_PTR
|
35
|
+
#define RARRAY_PTR(v) (RARRAY(v)->ptr)
|
36
|
+
#define RARRAY_LEN(v) (RARRAY(v)->len)
|
37
|
+
#endif
|
38
|
+
|
28
39
|
#elif HAVE_GETMNTINFO
|
29
40
|
|
30
41
|
struct _ment {
|
@@ -334,8 +345,8 @@ static VALUE fs_mount_point(VALUE klass, VALUE v_file){
|
|
334
345
|
/* Stat each mount point and compare its device number with the device
|
335
346
|
* number of the file provided. If they match, we have a winner.
|
336
347
|
*/
|
337
|
-
for(i = 0; i <
|
338
|
-
v_mount =
|
348
|
+
for(i = 0; i < RARRAY_LEN(v_mounts); i++){
|
349
|
+
v_mount = RARRAY_PTR(v_mounts)[i];
|
339
350
|
v_mount_pt = rb_funcall(v_mount, rb_intern("mount_point"), 0, 0);
|
340
351
|
v_stat_m = rb_funcall(rb_cFile, rb_intern("stat"), 1, v_mount_pt);
|
341
352
|
dev2 = FIX2LONG(rb_funcall(v_stat_m, rb_intern("dev"), 0, 0));
|
@@ -446,8 +457,8 @@ void Init_filesystem(){
|
|
446
457
|
|
447
458
|
/* Constants */
|
448
459
|
|
449
|
-
/* 0.3.
|
450
|
-
rb_define_const(cFilesys, "VERSION", rb_str_new2("0.3.
|
460
|
+
/* 0.3.1: The version of this library (a String) */
|
461
|
+
rb_define_const(cFilesys, "VERSION", rb_str_new2("0.3.1"));
|
451
462
|
|
452
463
|
/* 0x00000001: Read only file system */
|
453
464
|
rb_define_const(cStat, "RDONLY", INT2FIX(ST_RDONLY));
|
@@ -0,0 +1,41 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
|
3
|
+
spec = Gem::Specification.new do |gem|
|
4
|
+
gem.name = 'sys-filesystem'
|
5
|
+
gem.version = '0.3.1'
|
6
|
+
gem.author = 'Daniel J. Berger'
|
7
|
+
gem.email = 'djberg96@gmail.com'
|
8
|
+
gem.homepage = 'http://www.rubyforge.org/projects/sysutils'
|
9
|
+
gem.platform = Gem::Platform::RUBY
|
10
|
+
gem.summary = 'A Ruby interface for getting file system information.'
|
11
|
+
gem.test_file = 'test/test_sys_filesystem.rb'
|
12
|
+
gem.has_rdoc = true
|
13
|
+
gem.files = Dir['**/*'].reject{ |f| f.include?('CVS') }
|
14
|
+
gem.license = 'Artistic 2.0'
|
15
|
+
|
16
|
+
gem.extra_rdoc_files = ['CHANGES', 'README', 'MANIFEST']
|
17
|
+
gem.rubyforge_project = 'sysutils'
|
18
|
+
|
19
|
+
gem.add_development_dependency('test-unit', '>= 2.0.3')
|
20
|
+
|
21
|
+
gem.description = <<-EOF
|
22
|
+
The sys-filesystem library provides an interface for gathering filesystem
|
23
|
+
information, such as disk space and mount point data.
|
24
|
+
EOF
|
25
|
+
end
|
26
|
+
|
27
|
+
if $PROGRAM_NAME == __FILE__
|
28
|
+
if RUBY_PLATFORM.match('mswin')
|
29
|
+
spec.required_ruby_version = '>= 1.8.2'
|
30
|
+
spec.files -= Dir['ext/**/*']
|
31
|
+
spec.platform = Gem::Platform::CURRENT
|
32
|
+
spec.add_dependency('windows-pr', '>= 0.6.0')
|
33
|
+
else
|
34
|
+
spec.required_ruby_version = '>= 1.8.0'
|
35
|
+
spec.extensions = ['ext/extconf.rb']
|
36
|
+
spec.files -= Dir['lib/**/*']
|
37
|
+
spec.extra_rdoc_files << 'ext/sys/filesystem.c'
|
38
|
+
end
|
39
|
+
|
40
|
+
Gem::Builder.new(spec).build
|
41
|
+
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
####################################################################
|
2
|
-
#
|
2
|
+
# test_sys_filesystem_unix.rb
|
3
3
|
#
|
4
4
|
# Test case for the Sys::Filesystem.stat method and related stuff.
|
5
5
|
# This test suite should be run via the 'rake test' task.
|
@@ -28,7 +28,7 @@ class TC_Sys_Filesystem_Unix < Test::Unit::TestCase
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def test_version
|
31
|
-
assert_equal('0.3.
|
31
|
+
assert_equal('0.3.1', Filesystem::VERSION)
|
32
32
|
end
|
33
33
|
|
34
34
|
def test_stat_path
|
@@ -1,5 +1,5 @@
|
|
1
1
|
####################################################################
|
2
|
-
#
|
2
|
+
# test_sys_filesystem_windows.rb
|
3
3
|
#
|
4
4
|
# Test case for the Sys::Filesystem.stat method and related stuff.
|
5
5
|
# This should be run via the 'rake test' task.
|
@@ -22,7 +22,7 @@ class TC_Sys_Filesystem_Windows < Test::Unit::TestCase
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def test_version
|
25
|
-
assert_equal('0.3.
|
25
|
+
assert_equal('0.3.1', Filesystem::VERSION)
|
26
26
|
end
|
27
27
|
|
28
28
|
def test_stat_path
|
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: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel J. Berger
|
@@ -9,11 +9,20 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-08-05 00:00:00 -06:00
|
13
13
|
default_executable:
|
14
|
-
dependencies:
|
15
|
-
|
16
|
-
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: test-unit
|
17
|
+
type: :development
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 2.0.3
|
24
|
+
version:
|
25
|
+
description: " The sys-filesystem library provides an interface for gathering filesystem\n information, such as disk space and mount point data.\n"
|
17
26
|
email: djberg96@gmail.com
|
18
27
|
executables: []
|
19
28
|
|
@@ -25,20 +34,22 @@ extra_rdoc_files:
|
|
25
34
|
- MANIFEST
|
26
35
|
- ext/sys/filesystem.c
|
27
36
|
files:
|
37
|
+
- CHANGES
|
28
38
|
- doc/sys-filesystem.txt
|
29
39
|
- examples/example_stat.rb
|
30
|
-
- test/test_sys_filesystem_unix.rb
|
31
|
-
- test/test_sys_filesystem.rb
|
32
|
-
- test/test_sys_filesystem_windows.rb
|
33
|
-
- MANIFEST
|
34
|
-
- README
|
35
|
-
- CHANGES
|
36
|
-
- Rakefile
|
37
40
|
- ext/extconf.rb
|
38
|
-
- ext/sys
|
39
41
|
- ext/sys/filesystem.c
|
42
|
+
- MANIFEST
|
43
|
+
- Rakefile
|
44
|
+
- README
|
45
|
+
- sys-filesystem.gemspec
|
46
|
+
- test/test_sys_filesystem.rb
|
47
|
+
- test/test_sys_filesystem_unix.rb
|
48
|
+
- test/test_sys_filesystem_windows.rb
|
40
49
|
has_rdoc: true
|
41
50
|
homepage: http://www.rubyforge.org/projects/sysutils
|
51
|
+
licenses:
|
52
|
+
- Artistic 2.0
|
42
53
|
post_install_message:
|
43
54
|
rdoc_options: []
|
44
55
|
|
@@ -59,9 +70,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
59
70
|
requirements: []
|
60
71
|
|
61
72
|
rubyforge_project: sysutils
|
62
|
-
rubygems_version: 1.3.
|
73
|
+
rubygems_version: 1.3.5
|
63
74
|
signing_key:
|
64
|
-
specification_version:
|
75
|
+
specification_version: 3
|
65
76
|
summary: A Ruby interface for getting file system information.
|
66
77
|
test_files:
|
67
78
|
- test/test_sys_filesystem.rb
|