win32-file-stat 1.3.0 → 1.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 +4 -0
- data/README +3 -0
- data/lib/win32/file/stat.rb +4 -3
- data/test/sometestfile.txt +2 -1
- data/test/test_file_stat.rb +7 -6
- data/win32-file-stat.gemspec +1 -1
- metadata +2 -2
data/CHANGES
CHANGED
data/README
CHANGED
@@ -58,6 +58,9 @@ I had to require 'pp' explicitly in order to deal with the fact that pp.rb
|
|
58
58
|
has a builtin pretty_print method for File::Stat. If I didn't do this
|
59
59
|
you would end up using the pretty_print in pp.rb, which would break.
|
60
60
|
|
61
|
+
= Future Plans
|
62
|
+
This library will eventually be merged with the win32-file library.
|
63
|
+
|
61
64
|
= License
|
62
65
|
Ruby's
|
63
66
|
|
data/lib/win32/file/stat.rb
CHANGED
@@ -21,7 +21,7 @@ class File::Stat
|
|
21
21
|
include Windows::Volume
|
22
22
|
include Comparable
|
23
23
|
|
24
|
-
VERSION = '1.3.
|
24
|
+
VERSION = '1.3.1'
|
25
25
|
|
26
26
|
private
|
27
27
|
|
@@ -65,7 +65,8 @@ class File::Stat
|
|
65
65
|
@blockdev = false
|
66
66
|
end
|
67
67
|
|
68
|
-
|
68
|
+
# The stat struct in stat.h only has 11 members on Windows
|
69
|
+
stat_buf = [0,0,0,0,0,0,0,0,0,0,0].pack('ISSsssIQQQQ')
|
69
70
|
|
70
71
|
# The stat64 function doesn't seem to like character devices
|
71
72
|
if wstat64(@file, stat_buf) != 0
|
@@ -603,4 +604,4 @@ class File::Stat
|
|
603
604
|
def check_bool(val)
|
604
605
|
raise TypeError unless val == true || val == false
|
605
606
|
end
|
606
|
-
end
|
607
|
+
end
|
data/test/sometestfile.txt
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
This is a test
|
1
|
+
This is a test
|
2
|
+
Hello
|
data/test/test_file_stat.rb
CHANGED
@@ -26,11 +26,12 @@ class TC_Win32_File_Stat < Test::Unit::TestCase
|
|
26
26
|
@file = 'sometestfile.txt'
|
27
27
|
@exe = 'sometestfile.exe'
|
28
28
|
@dir = Dir.pwd
|
29
|
-
@stat = File::Stat.new(@file)
|
29
|
+
@stat = File::Stat.new(@file)
|
30
|
+
@attr = GetFileAttributes(@file)
|
30
31
|
end
|
31
32
|
|
32
33
|
def test_version
|
33
|
-
assert_equal('1.3.
|
34
|
+
assert_equal('1.3.1', File::Stat::VERSION)
|
34
35
|
end
|
35
36
|
|
36
37
|
# One or more tests will fail if the archive attribute on @file is not set.
|
@@ -195,7 +196,7 @@ class TC_Win32_File_Stat < Test::Unit::TestCase
|
|
195
196
|
def test_normal
|
196
197
|
assert_respond_to(@stat, :normal?)
|
197
198
|
assert_nothing_raised{ @stat.normal? }
|
198
|
-
|
199
|
+
assert_equal(false, @stat.normal?)
|
199
200
|
end
|
200
201
|
|
201
202
|
def test_offline
|
@@ -250,12 +251,12 @@ class TC_Win32_File_Stat < Test::Unit::TestCase
|
|
250
251
|
|
251
252
|
def test_size
|
252
253
|
assert_respond_to(@stat, :size)
|
253
|
-
assert_equal(
|
254
|
+
assert_equal(20, @stat.size)
|
254
255
|
end
|
255
256
|
|
256
257
|
def test_size_bool
|
257
258
|
assert_respond_to(@stat, :size?)
|
258
|
-
assert_equal(
|
259
|
+
assert_equal(20, @stat.size?)
|
259
260
|
end
|
260
261
|
|
261
262
|
def test_socket
|
@@ -312,7 +313,7 @@ class TC_Win32_File_Stat < Test::Unit::TestCase
|
|
312
313
|
end
|
313
314
|
|
314
315
|
def teardown
|
315
|
-
SetFileAttributes(@file,
|
316
|
+
SetFileAttributes(@file, @attr) # Set file back to normal
|
316
317
|
@file = nil
|
317
318
|
@exe = nil
|
318
319
|
@dir = nil
|
data/win32-file-stat.gemspec
CHANGED
@@ -2,7 +2,7 @@ require "rubygems"
|
|
2
2
|
|
3
3
|
spec = Gem::Specification.new do |gem|
|
4
4
|
gem.name = "win32-file-stat"
|
5
|
-
gem.version = "1.3.
|
5
|
+
gem.version = "1.3.1"
|
6
6
|
gem.authors = ["Daniel J. Berger", "Park Heesob"]
|
7
7
|
gem.email = "djberg96@gmail.com"
|
8
8
|
gem.homepage = "http://www.rubyforge.org/projects/win32utils"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: win32-file-stat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel J. Berger
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2008-08-
|
13
|
+
date: 2008-08-09 00:00:00 -06:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|