sys-filesystem 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +4 -0
- data/ext/sys/filesystem.c +9 -2
- data/sys-filesystem.gemspec +1 -1
- data/test/test_sys_filesystem_unix.rb +6 -1
- data/test/test_sys_filesystem_windows.rb +1 -1
- metadata +22 -9
data/CHANGES
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
== 0.3.3 - 21-May-2010
|
2
|
+
* Added a workaround for the Sys::Filesystem#block_size member to deal with
|
3
|
+
a bug in OS X. Thanks go to Josh Pasqualetto for the spot.
|
4
|
+
|
1
5
|
== 0.3.2 - 29-Dec-2009
|
2
6
|
* Source has been moved to github.
|
3
7
|
* Added the 'gem' task and removed build logic from the gemspec.
|
data/ext/sys/filesystem.c
CHANGED
@@ -163,7 +163,14 @@ static VALUE fs_stat(VALUE klass, VALUE v_path){
|
|
163
163
|
v_stat = rb_funcall(cStat, rb_intern("new"), 0, 0);
|
164
164
|
|
165
165
|
rb_iv_set(v_stat, "@path", v_path);
|
166
|
+
|
167
|
+
// You gotta love OS X, right?
|
168
|
+
#ifdef __MACH__
|
169
|
+
rb_iv_set(v_stat, "@block_size", ULONG2NUM(fs.f_bsize/256));
|
170
|
+
#else
|
166
171
|
rb_iv_set(v_stat, "@block_size", ULONG2NUM(fs.f_bsize));
|
172
|
+
#endif
|
173
|
+
|
167
174
|
rb_iv_set(v_stat, "@fragment_size", ULONG2NUM(fs.f_frsize));
|
168
175
|
rb_iv_set(v_stat, "@blocks", LONG2NUM(fs.f_blocks));
|
169
176
|
rb_iv_set(v_stat, "@blocks_free", LONG2NUM(fs.f_bfree));
|
@@ -457,8 +464,8 @@ void Init_filesystem(){
|
|
457
464
|
|
458
465
|
/* Constants */
|
459
466
|
|
460
|
-
/* 0.3.
|
461
|
-
rb_define_const(cFilesys, "VERSION", rb_str_new2("0.3.
|
467
|
+
/* 0.3.3: The version of this library (a String) */
|
468
|
+
rb_define_const(cFilesys, "VERSION", rb_str_new2("0.3.3"));
|
462
469
|
|
463
470
|
/* 0x00000001: Read only file system */
|
464
471
|
rb_define_const(cStat, "RDONLY", INT2FIX(ST_RDONLY));
|
data/sys-filesystem.gemspec
CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
|
|
2
2
|
|
3
3
|
spec = Gem::Specification.new do |gem|
|
4
4
|
gem.name = 'sys-filesystem'
|
5
|
-
gem.version = '0.3.
|
5
|
+
gem.version = '0.3.3'
|
6
6
|
gem.author = 'Daniel J. Berger'
|
7
7
|
gem.email = 'djberg96@gmail.com'
|
8
8
|
gem.homepage = 'http://www.rubyforge.org/projects/sysutils'
|
@@ -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.3', Filesystem::VERSION)
|
32
32
|
end
|
33
33
|
|
34
34
|
def test_stat_path
|
@@ -41,6 +41,11 @@ class TC_Sys_Filesystem_Unix < Test::Unit::TestCase
|
|
41
41
|
assert_kind_of(Fixnum, @stat.block_size)
|
42
42
|
end
|
43
43
|
|
44
|
+
def test_block_size_is_a_plausible_value
|
45
|
+
assert_true(@stat.block_size >= 1024)
|
46
|
+
assert_true(@stat.block_size <= 16384)
|
47
|
+
end
|
48
|
+
|
44
49
|
def test_stat_fragment_size
|
45
50
|
assert_respond_to(@stat, :fragment_size)
|
46
51
|
assert_kind_of(Fixnum, @stat.fragment_size)
|
metadata
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sys-filesystem
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 3
|
8
|
+
- 3
|
9
|
+
version: 0.3.3
|
5
10
|
platform: ruby
|
6
11
|
authors:
|
7
12
|
- Daniel J. Berger
|
@@ -9,19 +14,23 @@ autorequire:
|
|
9
14
|
bindir: bin
|
10
15
|
cert_chain: []
|
11
16
|
|
12
|
-
date:
|
17
|
+
date: 2010-05-21 00:00:00 -06:00
|
13
18
|
default_executable:
|
14
19
|
dependencies:
|
15
20
|
- !ruby/object:Gem::Dependency
|
16
21
|
name: test-unit
|
17
|
-
|
18
|
-
|
19
|
-
version_requirements: !ruby/object:Gem::Requirement
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
20
24
|
requirements:
|
21
25
|
- - ">="
|
22
26
|
- !ruby/object:Gem::Version
|
27
|
+
segments:
|
28
|
+
- 2
|
29
|
+
- 0
|
30
|
+
- 3
|
23
31
|
version: 2.0.3
|
24
|
-
|
32
|
+
type: :development
|
33
|
+
version_requirements: *id001
|
25
34
|
description: " The sys-filesystem library provides an interface for gathering filesystem\n information, such as disk space and mount point data.\n"
|
26
35
|
email: djberg96@gmail.com
|
27
36
|
executables: []
|
@@ -58,18 +67,22 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
58
67
|
requirements:
|
59
68
|
- - ">="
|
60
69
|
- !ruby/object:Gem::Version
|
70
|
+
segments:
|
71
|
+
- 1
|
72
|
+
- 8
|
73
|
+
- 0
|
61
74
|
version: 1.8.0
|
62
|
-
version:
|
63
75
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
64
76
|
requirements:
|
65
77
|
- - ">="
|
66
78
|
- !ruby/object:Gem::Version
|
79
|
+
segments:
|
80
|
+
- 0
|
67
81
|
version: "0"
|
68
|
-
version:
|
69
82
|
requirements: []
|
70
83
|
|
71
84
|
rubyforge_project: sysutils
|
72
|
-
rubygems_version: 1.3.
|
85
|
+
rubygems_version: 1.3.6
|
73
86
|
signing_key:
|
74
87
|
specification_version: 3
|
75
88
|
summary: A Ruby interface for getting file system information.
|