win32-file-stat 1.4.0 → 1.4.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.
- checksums.yaml +4 -4
- data/CHANGES +5 -0
- data/README +1 -1
- data/lib/win32/file/stat.rb +10 -10
- data/test/test_file_stat.rb +9 -2
- data/win32-file-stat.gemspec +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8bd37a04637609ed685cbbcc71a621b2660169e4
|
4
|
+
data.tar.gz: 9123576b418e37ecfe320c96e35c42b6c60f9bba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 715f01129adafd4c12b71ba8db1ea9c52f6a45e566cfad6427df6ed74c453f5cd43905c3cd2a044ec454dafbc2a8741c6d414a8bde2e2e1f8e46ffb9a6869685
|
7
|
+
data.tar.gz: 6f5b6e59efa693919ad1268cdc01acd8e978d9a82b36263d4c73a58049bed44cdcd98ef080ab14c860411eb8ef6d9b7bb80f4a308a45ed403de7a6bc6b130b7b
|
data/CHANGES
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
== 1.4.1 - 12-Feb-2014
|
2
|
+
* The #writable and #writable_real methods now always return fals if the file
|
3
|
+
has been marked readonly.
|
4
|
+
* Fixed an rdev test and added a writable test.
|
5
|
+
|
1
6
|
== 1.4.0 - 16-Dec-2013
|
2
7
|
* Conversion to FFI.
|
3
8
|
* Now requires Ruby 1.9 or later.
|
data/README
CHANGED
data/lib/win32/file/stat.rb
CHANGED
@@ -55,7 +55,7 @@ class File::Stat
|
|
55
55
|
attr_reader :dev_major, :dev_minor, :rdev_major, :rdev_minor
|
56
56
|
|
57
57
|
# The version of the win32-file-stat library
|
58
|
-
WIN32_FILE_STAT_VERSION = '1.4.
|
58
|
+
WIN32_FILE_STAT_VERSION = '1.4.1'
|
59
59
|
|
60
60
|
# Creates and returns a File::Stat object, which encapsulate common status
|
61
61
|
# information for File objects on MS Windows sytems. The information is
|
@@ -125,15 +125,6 @@ class File::Stat
|
|
125
125
|
@rdev = data[:dwVolumeSerialNumber]
|
126
126
|
end
|
127
127
|
|
128
|
-
@readable = access_check(path, GENERIC_READ)
|
129
|
-
@readable_real = @readable
|
130
|
-
|
131
|
-
@writable = access_check(path, GENERIC_WRITE)
|
132
|
-
@writable_real = @writable
|
133
|
-
|
134
|
-
@world_readable = access_check_world(path, FILE_READ_DATA)
|
135
|
-
@world_writable = access_check_world(path, FILE_WRITE_DATA)
|
136
|
-
|
137
128
|
# Not supported and/or meaningless on MS Windows
|
138
129
|
@dev_major = nil
|
139
130
|
@dev_minor = nil
|
@@ -179,6 +170,15 @@ class File::Stat
|
|
179
170
|
|
180
171
|
@mode = get_mode
|
181
172
|
|
173
|
+
@readable = access_check(path, GENERIC_READ)
|
174
|
+
@readable_real = @readable
|
175
|
+
|
176
|
+
@writable = access_check(path, GENERIC_WRITE) && !@readonly
|
177
|
+
@writable_real = @writable
|
178
|
+
|
179
|
+
@world_readable = access_check_world(path, FILE_READ_DATA)
|
180
|
+
@world_writable = access_check_world(path, FILE_WRITE_DATA) && !@readonly
|
181
|
+
|
182
182
|
if @reparse_point
|
183
183
|
@symlink = get_symlink(path)
|
184
184
|
else
|
data/test/test_file_stat.rb
CHANGED
@@ -53,7 +53,7 @@ class TC_Win32_File_Stat < Test::Unit::TestCase
|
|
53
53
|
end
|
54
54
|
|
55
55
|
test "version is set to expected value" do
|
56
|
-
assert_equal('1.4.
|
56
|
+
assert_equal('1.4.1', File::Stat::WIN32_FILE_STAT_VERSION)
|
57
57
|
end
|
58
58
|
|
59
59
|
test "constructor does not modify argument" do
|
@@ -166,7 +166,7 @@ class TC_Win32_File_Stat < Test::Unit::TestCase
|
|
166
166
|
|
167
167
|
test "dev custom method basic functionality" do
|
168
168
|
assert_respond_to(@stat, :rdev)
|
169
|
-
assert_kind_of(
|
169
|
+
assert_kind_of(Numeric, @stat.rdev)
|
170
170
|
end
|
171
171
|
|
172
172
|
test "dev custom method returns expected value" do
|
@@ -599,6 +599,13 @@ class TC_Win32_File_Stat < Test::Unit::TestCase
|
|
599
599
|
assert_false(File::Stat.new(@@sys_file).writable?)
|
600
600
|
end
|
601
601
|
|
602
|
+
test "a file marked as readonly is not considered writable" do
|
603
|
+
File.chmod(0644, @@txt_file)
|
604
|
+
assert_true(File::Stat.new(@@txt_file).writable?)
|
605
|
+
File.chmod(0444, @@txt_file)
|
606
|
+
assert_false(File::Stat.new(@@txt_file).writable?)
|
607
|
+
end
|
608
|
+
|
602
609
|
test "writable_real? basic functionality" do
|
603
610
|
assert_respond_to(@stat, :writable_real?)
|
604
611
|
assert_boolean(@stat.writable_real?)
|
data/win32-file-stat.gemspec
CHANGED
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.4.
|
4
|
+
version: 1.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel J. Berger
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2014-02-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: ffi
|
@@ -82,14 +82,14 @@ extra_rdoc_files:
|
|
82
82
|
- MANIFEST
|
83
83
|
files:
|
84
84
|
- CHANGES
|
85
|
+
- MANIFEST
|
86
|
+
- README
|
87
|
+
- Rakefile
|
85
88
|
- lib/win32/file/stat.rb
|
86
89
|
- lib/win32/file/windows/constants.rb
|
87
90
|
- lib/win32/file/windows/functions.rb
|
88
91
|
- lib/win32/file/windows/helper.rb
|
89
92
|
- lib/win32/file/windows/structs.rb
|
90
|
-
- MANIFEST
|
91
|
-
- Rakefile
|
92
|
-
- README
|
93
93
|
- test/test_file_stat.rb
|
94
94
|
- win32-file-stat.gemspec
|
95
95
|
homepage: http://www.github.com/djberg96/win32-file-stat
|
@@ -112,7 +112,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
112
112
|
version: '0'
|
113
113
|
requirements: []
|
114
114
|
rubyforge_project: Win32Utils
|
115
|
-
rubygems_version: 2.
|
115
|
+
rubygems_version: 2.2.2
|
116
116
|
signing_key:
|
117
117
|
specification_version: 4
|
118
118
|
summary: A File::Stat class tailored to MS Windows
|