win32-file 0.6.7 → 0.6.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -19,6 +19,8 @@ class TC_Win32_File_Stat < Test::Unit::TestCase
19
19
  @@file = File.join(Dir.pwd, 'stat_test.txt')
20
20
  File.open(@@file, 'w'){ |fh| fh.puts "This is a test." }
21
21
 
22
+ @@block_dev = nil
23
+
22
24
  # Find a block device
23
25
  'A'.upto('Z'){ |volume|
24
26
  volume += ":\\"
@@ -35,7 +37,7 @@ class TC_Win32_File_Stat < Test::Unit::TestCase
35
37
  assert_respond_to(File, :size)
36
38
  assert_equal(17, File.size(@@file))
37
39
  end
38
-
40
+
39
41
  def test_blksize
40
42
  msg = "+The blksize may be different - ignore+"
41
43
  assert_respond_to(File, :blksize)
@@ -43,58 +45,59 @@ class TC_Win32_File_Stat < Test::Unit::TestCase
43
45
  assert_kind_of(Fixnum, File.blksize(@@file))
44
46
  assert_equal(4096, File.blksize(@@file), msg)
45
47
  end
46
-
48
+
47
49
  def test_blksize_expected_errors
48
50
  assert_raises(ArgumentError){ File.blksize }
49
51
  assert_raises(ArgumentError){ File.blksize(@@file, "foo") }
50
52
  end
51
-
53
+
52
54
  # The test for a block device will fail unless the D: drive is a CDROM.
53
55
  def test_blockdev
54
56
  assert_respond_to(File, :blockdev?)
55
- assert_nothing_raised{ File.blockdev?("C:\\") }
57
+ assert_nothing_raised{ File.blockdev?("C:\\") }
56
58
  assert_equal(false, File.blockdev?("NUL"))
57
59
 
60
+ omit_unless(@@block_dev, "Could not find block device")
58
61
  omit_unless(File.exists?(@@block_dev), "No media in device - skipping")
59
62
  assert_equal(true, File.blockdev?(@@block_dev))
60
63
  end
61
-
64
+
62
65
  def test_blockdev_expected_errors
63
66
  assert_raises(ArgumentError){ File.blockdev? }
64
67
  assert_raises(ArgumentError){ File.blockdev?(@@file, "foo") }
65
68
  end
66
-
69
+
67
70
  def test_chardev
68
71
  assert_respond_to(File, :chardev?)
69
- assert_nothing_raised{ File.chardev?("NUL") }
72
+ assert_nothing_raised{ File.chardev?("NUL") }
70
73
  assert_equal(true, File.chardev?("NUL"))
71
74
  assert_equal(false, File.chardev?(@@file))
72
75
  end
73
-
76
+
74
77
  def test_chardev_expected_errors
75
78
  assert_raises(ArgumentError){ File.chardev? }
76
79
  assert_raises(ArgumentError){ File.chardev?(@@file, "foo") }
77
80
  end
78
-
81
+
79
82
  # Ensure that not only does the File class respond to the stat method,
80
83
  # but also that it's returning the File::Stat class from the
81
84
  # win32-file-stat package.
82
- #
85
+ #
83
86
  def test_stat_class
84
87
  assert_respond_to(File, :stat)
85
88
  assert_kind_of(File::Stat, File.stat(@@file))
86
89
  assert_equal(false, File.stat(@@file).hidden?)
87
90
  end
88
-
91
+
89
92
  # This was added after it was discovered that lstat is not aliased
90
93
  # to stat automatically on Windows.
91
- #
94
+ #
92
95
  def test_lstat_class
93
96
  assert_respond_to(File, :lstat)
94
97
  assert_kind_of(File::Stat, File.lstat(@@file))
95
98
  assert_equal(false, File.stat(@@file).hidden?)
96
99
  end
97
-
100
+
98
101
  def test_stat_instance
99
102
  File.open(@@file){ |f|
100
103
  assert_respond_to(f, :stat)
@@ -102,7 +105,7 @@ class TC_Win32_File_Stat < Test::Unit::TestCase
102
105
  assert_equal(false, f.stat.hidden?)
103
106
  }
104
107
  end
105
-
108
+
106
109
  def self.shutdown
107
110
  File.delete(@@file) if File.exists?(@@file)
108
111
  @@file = nil
data/win32-file.gemspec CHANGED
@@ -2,12 +2,11 @@ require 'rubygems'
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = 'win32-file'
5
- spec.version = '0.6.7'
5
+ spec.version = '0.6.8'
6
6
  spec.authors = ['Daniel J. Berger', 'Park Heesob']
7
7
  spec.license = 'Artistic 2.0'
8
8
  spec.email = 'djberg96@gmail.com'
9
- spec.homepage = 'http://www.rubyforge.org/projects/win32utils'
10
- spec.platform = Gem::Platform::RUBY
9
+ spec.homepage = 'http://github.com/djberg96/win32-file'
11
10
  spec.summary = 'Extra or redefined methods for the File class on Windows.'
12
11
  spec.test_files = Dir['test/test*']
13
12
  spec.files = Dir['**/*'].reject{ |f| f.include?('git') }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: win32-file
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.7
4
+ version: 0.6.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,11 +10,11 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2011-11-23 00:00:00.000000000Z
13
+ date: 2012-04-06 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: win32-api
17
- requirement: &19820904 !ruby/object:Gem::Requirement
17
+ requirement: &22484120 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: 1.2.1
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *19820904
25
+ version_requirements: *22484120
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: win32-file-stat
28
- requirement: &19460016 !ruby/object:Gem::Requirement
28
+ requirement: &22483860 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ! '>='
@@ -33,10 +33,10 @@ dependencies:
33
33
  version: 1.3.2
34
34
  type: :runtime
35
35
  prerelease: false
36
- version_requirements: *19460016
36
+ version_requirements: *22483860
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: windows-pr
39
- requirement: &19454796 !ruby/object:Gem::Requirement
39
+ requirement: &22483570 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
42
  - - ! '>='
@@ -44,10 +44,10 @@ dependencies:
44
44
  version: 1.0.8
45
45
  type: :runtime
46
46
  prerelease: false
47
- version_requirements: *19454796
47
+ version_requirements: *22483570
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: test-unit
50
- requirement: &19452456 !ruby/object:Gem::Requirement
50
+ requirement: &22483320 !ruby/object:Gem::Requirement
51
51
  none: false
52
52
  requirements:
53
53
  - - ! '>='
@@ -55,7 +55,7 @@ dependencies:
55
55
  version: '0'
56
56
  type: :development
57
57
  prerelease: false
58
- version_requirements: *19452456
58
+ version_requirements: *22483320
59
59
  description: ! " The win32-file library adds several methods to the core File class
60
60
  which\n are specific to MS Windows, such as the ability to set and retrieve file\n
61
61
  \ attributes. In addition, several core methods have been redefined in\n order
@@ -81,7 +81,7 @@ files:
81
81
  - test/test_win32_file_security.rb
82
82
  - test/test_win32_file_stat.rb
83
83
  - win32-file.gemspec
84
- homepage: http://www.rubyforge.org/projects/win32utils
84
+ homepage: http://github.com/djberg96/win32-file
85
85
  licenses:
86
86
  - Artistic 2.0
87
87
  post_install_message:
@@ -102,7 +102,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
102
102
  version: '0'
103
103
  requirements: []
104
104
  rubyforge_project: win32utils
105
- rubygems_version: 1.8.10
105
+ rubygems_version: 1.8.11
106
106
  signing_key:
107
107
  specification_version: 3
108
108
  summary: Extra or redefined methods for the File class on Windows.