sys-filesystem 0.3.3-x86-mingw32 → 0.3.4-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES CHANGED
@@ -1,3 +1,9 @@
1
+ == 0.3.4 - 19-Nov-2010
2
+ * Fixed a bug where negative block counts were happening on very large
3
+ hard drives. Thanks go to Jonas Pfenniger for the spot.
4
+ * Refactored the clean task in the Rakefile.
5
+ * Some cosmetic source code changes.
6
+
1
7
  == 0.3.3 - 21-May-2010
2
8
  * Added a workaround for the Sys::Filesystem#block_size member to deal with
3
9
  a bug in OS X. Thanks go to Josh Pasqualetto for the spot.
data/README CHANGED
@@ -1,82 +1,83 @@
1
1
  = Description
2
- A Ruby interface for getting file system information.
3
-
4
- = Prerequisites
5
- === MS Windows
6
- * windows-pr, 0.9.8 or later.
2
+ A Ruby interface for getting file system information.
7
3
 
8
4
  = Installation
9
- rake test (optional)
10
- rake install (non-gem) OR rake install_gem (gem)
5
+ gem install sys-filesystem
6
+
7
+ == Windows
8
+ If the installation command above doesn't work try this:
9
+
10
+ gem install sys-filesystem --platform x86-mingw32
11
11
 
12
12
  = Synopsis
13
- require 'sys/filesystem'
14
- include Sys
13
+ require 'sys/filesystem'
14
+ include Sys
15
15
 
16
- # Display information about a particular filesystem.
17
- p Filesystem.stat('/')
16
+ # Display information about a particular filesystem.
17
+ p Filesystem.stat('/')
18
18
 
19
- # Sample output
19
+ # Sample output
20
20
 
21
- #<Sys::Filesystem::Stat:0x517440
22
- @base_type = "ufs",
23
- @flags = 4,
24
- @files_available = 3817457,
25
- @block_size = 8192,
26
- @blocks_available = 19957633,
27
- @blocks = 34349612,
28
- @name_max = 255,
29
- @path = "/",
30
- @filesystem_id = 35651592,
31
- @files = 4135040,
32
- @fragment_size = 1024,
33
- @files_free = 3817457,
34
- @blocks_free = 20301129
35
- >
21
+ #<Sys::Filesystem::Stat:0x517440
22
+ @base_type = "ufs",
23
+ @flags = 4,
24
+ @files_available = 3817457,
25
+ @block_size = 8192,
26
+ @blocks_available = 19957633,
27
+ @blocks = 34349612,
28
+ @name_max = 255,
29
+ @path = "/",
30
+ @filesystem_id = 35651592,
31
+ @files = 4135040,
32
+ @fragment_size = 1024,
33
+ @files_free = 3817457,
34
+ @blocks_free = 20301129
35
+ >
36
36
 
37
- # Describe all mount points on the system
38
- Filesystem.mounts{ |mount| p mount }
37
+ # Describe all mount points on the system
38
+ Filesystem.mounts{ |mount| p mount }
39
39
 
40
- # Find the mount point of any particular file
41
- puts Filesystem.mount_point('/home/djberge/some_file.txt') => '/home'
40
+ # Find the mount point of any particular file
41
+ puts Filesystem.mount_point('/home/djberge/some_file.txt') => '/home'
42
42
 
43
43
  = Notes
44
44
  === MS Windows
45
- This is a pure Ruby implementation using the windows-pr library, which in
46
- turn wraps native Windows functions.
45
+ This is a pure Ruby implementation using the windows-pr library, which in
46
+ turn wraps native Windows functions.
47
+
47
48
  === UNIX
48
- This is a C extension that wraps statvfs, etc.
49
+ This is a C extension that wraps statvfs, etc.
49
50
 
50
51
  = Sample code
51
- Run 'rake example' if you want to see a basic sample run. The actual code
52
- is 'example_stat.rb' in the 'examples' directory. Modify it as you see fit.
52
+ Run 'rake example' if you want to see a basic sample run. The actual code
53
+ is 'example_stat.rb' in the 'examples' directory. Modify it as you see fit.
53
54
 
54
55
  = Known Bugs
55
- None that I'm aware of. Please report bugs on the project page at
56
- http://www.rubyforge.org/projects/sysutils.
56
+ None that I'm aware of. Please report bugs on the project page at
57
+ http://www.rubyforge.org/projects/sysutils.
57
58
 
58
59
  = Future Plans
59
- Suggestions welcome.
60
+ Suggestions welcome.
60
61
 
61
62
  = Acknowledgements
62
- Mike Hall, for ideas and code that I borrowed from his 'filesystem'
63
- library.
63
+ Mike Hall, for ideas and code that I borrowed from his 'filesystem'
64
+ library.
64
65
 
65
- Park Heesob, for implementation and API ideas for the MS Windows version.
66
+ Park Heesob, for implementation and API ideas for the MS Windows version.
66
67
 
67
- Nobuyoshi Miyokawa, for adding FreeBSD and OS X support.
68
+ Nobuyoshi Miyokawa, for adding FreeBSD and OS X support.
68
69
 
69
70
  = License
70
- Artistic 2.0
71
+ Artistic 2.0
71
72
 
72
73
  = Copyright
73
- (C) 2003-2009 Daniel J. Berger
74
- All Rights Reserved
74
+ (C) 2003-2010 Daniel J. Berger
75
+ All Rights Reserved
75
76
 
76
77
  = Warranty
77
- This library is provided "as is" and without any express or
78
- implied warranties, including, without limitation, the implied
79
- warranties of merchantability and fitness for a particular purpose.
78
+ This library is provided "as is" and without any express or
79
+ implied warranties, including, without limitation, the implied
80
+ warranties of merchantability and fitness for a particular purpose.
80
81
 
81
82
  = Author
82
- Daniel J. Berger
83
+ Daniel J. Berger
data/Rakefile CHANGED
@@ -3,25 +3,19 @@ require 'rake/clean'
3
3
  require 'rake/testtask'
4
4
  include Config
5
5
 
6
- desc "Clean the build files for the sys-filesystem source for UNIX systems"
7
- task :clean do |task|
8
- Dir.chdir('examples') do
9
- FileUtils.rm_rf('sys') if File.exists?('sys')
10
- end
11
-
12
- unless Config::CONFIG['host_os'] =~ /mswin32|mingw|cygwin|windows|dos/i
13
- file = 'sys/filesystem.' + CONFIG['DLEXT']
14
- Dir.chdir('ext') do
15
- sh 'make distclean' rescue nil
16
- rm file if File.exists?(file)
17
- rm_rf 'conftest.dSYM' if File.exists?('conftest.dSYM') # OS X weirdness
18
- end
19
- end
20
- end
6
+ CLEAN.include(
7
+ '**/*.gem', # Gem files
8
+ '**/*.rbc', # Rubinius
9
+ '**/*.o', # C object file
10
+ '**/*.log', # Ruby extension build log
11
+ '**/Makefile', # C Makefile
12
+ '**/conftest.dSYM', # OS X build directory
13
+ "**/*.#{CONFIG['DLEXT']}" # C shared object
14
+ )
21
15
 
22
16
  desc "Build the sys-filesystem library on UNIX systems (but don't install it)"
23
17
  task :build => [:clean] do
24
- unless Config::CONFIG['host_os'] =~ /mswin32|mingw|cygwin|windows|dos/i
18
+ unless CONFIG['host_os'] =~ /mswin32|mingw|cygwin|windows|dos/i
25
19
  file = 'filesystem.' + CONFIG['DLEXT']
26
20
  Dir.chdir('ext') do
27
21
  ruby 'extconf.rb'
@@ -31,23 +25,9 @@ task :build => [:clean] do
31
25
  end
32
26
  end
33
27
 
34
- desc "Install the sys-filesystem library"
35
- task :install do
36
- unless Config::CONFIG['host_os'] =~ /mswin32|mingw|cygwin|windows|dos/i
37
- install_dir = File.join(CONFIG['sitelibdir'], 'sys')
38
- Dir.mkdir(install_dir) unless File.exists?(install_dir)
39
- FileUtils.cp('lib/sys/filesystem.rb', install_dir, :verbose => true)
40
- else
41
- task :install => :build
42
- Dir.chdir('ext') do
43
- sh 'make install'
44
- end
45
- end
46
- end
47
-
48
28
  desc "Run the test suite"
49
29
  Rake::TestTask.new("test") do |t|
50
- unless Config::CONFIG['host_os'] =~ /mswin32|mingw|cygwin|windows|dos/i
30
+ unless CONFIG['host_os'] =~ /mswin32|mingw|cygwin|windows|dos/i
51
31
  task :test => :build
52
32
  t.libs << 'ext'
53
33
  t.libs.delete('lib')
@@ -68,28 +48,36 @@ task :example => [:build] do |t|
68
48
  Dir.mkdir('sys') unless File.exists?('sys')
69
49
  end
70
50
 
71
- FileUtils.cp('ext/sys/filesystem.' + Config::CONFIG['DLEXT'], 'examples/sys')
51
+ FileUtils.cp('ext/sys/filesystem.' + CONFIG['DLEXT'], 'examples/sys')
72
52
 
73
53
  Dir.chdir('examples') do
74
54
  ruby 'example_stat.rb'
75
55
  end
76
56
  end
77
57
 
78
- desc "Build a gem"
79
- task :gem => [:clean] do |t|
80
- spec = eval(IO.read('sys-filesystem.gemspec'))
58
+ namespace :gem do
59
+ desc "Build the sys-filesystem gem"
60
+ task :create => [:clean] do |t|
61
+ spec = eval(IO.read('sys-filesystem.gemspec'))
81
62
 
82
- if Config::CONFIG['host_os'] =~ /mswin32|mingw|cygwin|windows|dos/i
83
- spec.required_ruby_version = '>= 1.8.2'
84
- spec.files -= Dir['ext/**/*']
85
- spec.platform = Gem::Platform::CURRENT
86
- spec.add_dependency('windows-pr', '>= 1.0.5')
87
- else
88
- spec.required_ruby_version = '>= 1.8.0'
89
- spec.extensions = ['ext/extconf.rb']
90
- spec.files -= Dir['lib/**/*']
91
- spec.extra_rdoc_files << 'ext/sys/filesystem.c'
63
+ if Config::CONFIG['host_os'] =~ /mswin32|mingw|cygwin|windows|dos/i
64
+ spec.files -= Dir['ext/**/*']
65
+ spec.platform = Gem::Platform::CURRENT
66
+ spec.add_dependency('windows-pr', '>= 1.0.5')
67
+ else
68
+ spec.extensions = ['ext/extconf.rb']
69
+ spec.files -= Dir['lib/**/*']
70
+ spec.extra_rdoc_files << 'ext/sys/filesystem.c'
71
+ end
72
+
73
+ Gem::Builder.new(spec).build
92
74
  end
93
75
 
94
- Gem::Builder.new(spec).build
76
+ desc "Install the sys-filesystem gem"
77
+ task :install => [:create] do
78
+ file = Dir['*.gem'].first
79
+ sh "gem install #{file}"
80
+ end
95
81
  end
82
+
83
+ task :default => :test
@@ -42,7 +42,7 @@ module Sys
42
42
  READ_ONLY_VOLUME = 0x00080000
43
43
 
44
44
  # The version of the sys-filesystem library.
45
- VERSION = '0.3.3'
45
+ VERSION = '0.3.4'
46
46
 
47
47
  class Mount
48
48
  # The name of the volume. This is the device mapping.
@@ -171,7 +171,7 @@ module Sys
171
171
 
172
172
  mounts = block_given? ? nil : []
173
173
 
174
- # Try again if it fails
174
+ # Try again if it fails because the buffer is too small
175
175
  if length > buffer.size
176
176
  buffer = 0.chr * length
177
177
  if GetLogicalDriveStrings(buffer.size, buffer) == 0
@@ -1,24 +1,24 @@
1
1
  require 'rubygems'
2
2
 
3
- spec = Gem::Specification.new do |gem|
4
- gem.name = 'sys-filesystem'
5
- gem.version = '0.3.3'
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?('git') }
14
- gem.license = 'Artistic 2.0'
3
+ Gem::Specification.new do |spec|
4
+ spec.name = 'sys-filesystem'
5
+ spec.version = '0.3.4'
6
+ spec.author = 'Daniel J. Berger'
7
+ spec.email = 'djberg96@gmail.com'
8
+ spec.homepage = 'http://www.rubyforge.org/projects/sysutils'
9
+ spec.platform = Gem::Platform::RUBY
10
+ spec.summary = 'A Ruby interface for getting file system information.'
11
+ spec.test_file = 'test/test_sys_filesystem.rb'
12
+ spec.has_rdoc = true
13
+ spec.files = Dir['**/*'].reject{ |f| f.include?('git') }
14
+ spec.license = 'Artistic 2.0'
15
15
 
16
- gem.extra_rdoc_files = ['CHANGES', 'README', 'MANIFEST']
17
- gem.rubyforge_project = 'sysutils'
16
+ spec.extra_rdoc_files = ['CHANGES', 'README', 'MANIFEST']
17
+ spec.rubyforge_project = 'sysutils'
18
18
 
19
- gem.add_development_dependency('test-unit', '>= 2.0.3')
19
+ spec.add_development_dependency('test-unit', '>= 2.1.1')
20
20
 
21
- gem.description = <<-EOF
21
+ spec.description = <<-EOF
22
22
  The sys-filesystem library provides an interface for gathering filesystem
23
23
  information, such as disk space and mount point data.
24
24
  EOF
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift File.dirname(File.expand_path(__FILE__))
3
3
  require 'rbconfig'
4
4
 
5
5
  if Config::CONFIG['host_os'] =~ /mswin32|mingw|cygwin|windows|dos/i
6
- require 'test_sys_filesystem_windows'
6
+ require 'test_sys_filesystem_windows'
7
7
  else
8
- require 'test_sys_filesystem_unix'
8
+ require 'test_sys_filesystem_unix'
9
9
  end
@@ -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.3', Filesystem::VERSION)
31
+ assert_equal('0.3.4', Filesystem::VERSION)
32
32
  end
33
33
 
34
34
  def test_stat_path
@@ -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.3', Filesystem::VERSION)
25
+ assert_equal('0.3.4', Filesystem::VERSION)
26
26
  end
27
27
 
28
28
  def test_stat_path
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sys-filesystem
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 27
4
5
  prerelease: false
5
6
  segments:
6
7
  - 0
7
8
  - 3
8
- - 3
9
- version: 0.3.3
9
+ - 4
10
+ version: 0.3.4
10
11
  platform: x86-mingw32
11
12
  authors:
12
13
  - Daniel J. Berger
@@ -14,30 +15,34 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2010-05-21 00:00:00 -06:00
18
+ date: 2010-11-18 00:00:00 -07:00
18
19
  default_executable:
19
20
  dependencies:
20
21
  - !ruby/object:Gem::Dependency
21
22
  name: test-unit
22
23
  prerelease: false
23
24
  requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
24
26
  requirements:
25
27
  - - ">="
26
28
  - !ruby/object:Gem::Version
29
+ hash: 9
27
30
  segments:
28
31
  - 2
29
- - 0
30
- - 3
31
- version: 2.0.3
32
+ - 1
33
+ - 1
34
+ version: 2.1.1
32
35
  type: :development
33
36
  version_requirements: *id001
34
37
  - !ruby/object:Gem::Dependency
35
38
  name: windows-pr
36
39
  prerelease: false
37
40
  requirement: &id002 !ruby/object:Gem::Requirement
41
+ none: false
38
42
  requirements:
39
43
  - - ">="
40
44
  - !ruby/object:Gem::Version
45
+ hash: 29
41
46
  segments:
42
47
  - 1
43
48
  - 0
@@ -76,25 +81,27 @@ rdoc_options: []
76
81
  require_paths:
77
82
  - lib
78
83
  required_ruby_version: !ruby/object:Gem::Requirement
84
+ none: false
79
85
  requirements:
80
86
  - - ">="
81
87
  - !ruby/object:Gem::Version
88
+ hash: 3
82
89
  segments:
83
- - 1
84
- - 8
85
- - 2
86
- version: 1.8.2
90
+ - 0
91
+ version: "0"
87
92
  required_rubygems_version: !ruby/object:Gem::Requirement
93
+ none: false
88
94
  requirements:
89
95
  - - ">="
90
96
  - !ruby/object:Gem::Version
97
+ hash: 3
91
98
  segments:
92
99
  - 0
93
100
  version: "0"
94
101
  requirements: []
95
102
 
96
103
  rubyforge_project: sysutils
97
- rubygems_version: 1.3.6
104
+ rubygems_version: 1.3.7
98
105
  signing_key:
99
106
  specification_version: 3
100
107
  summary: A Ruby interface for getting file system information.