fileutils 1.4.0 → 1.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fileutils.rb +7 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f47c53c2d9a6fda99262d100845964c266befafafc71a99395ee58a9baa5bd3d
|
4
|
+
data.tar.gz: 5d4447b7fb7c5011846de8585bc475cd233f1c27d8edff2329c27e011b549d14
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ba476a1a25da609ab2caea6a4ccfe436556c4b7f3b90721716694f76eb0a24618301a6ee8c8cf47bed164516c3ee2a4b29b206b0bc45fafc6b3e207e016eb5b
|
7
|
+
data.tar.gz: 86136905e49ab909fdbd70d91b49165e5be9fb1ccbd9aee7a2ace1255abc6c0eec3314bf27844f30438dc8f85b64eb333538833dd348ab94e2ac79aeb58ea448
|
data/lib/fileutils.rb
CHANGED
@@ -102,7 +102,7 @@ end
|
|
102
102
|
# <tt>:verbose</tt> flags to methods in FileUtils.
|
103
103
|
#
|
104
104
|
module FileUtils
|
105
|
-
VERSION = "1.4.
|
105
|
+
VERSION = "1.4.1"
|
106
106
|
|
107
107
|
def self.private_module_function(name) #:nodoc:
|
108
108
|
module_function name
|
@@ -917,8 +917,11 @@ module FileUtils
|
|
917
917
|
private_module_function :apply_mask
|
918
918
|
|
919
919
|
def symbolic_modes_to_i(mode_sym, path) #:nodoc:
|
920
|
-
|
921
|
-
|
920
|
+
mode = if File::Stat === path
|
921
|
+
path.mode
|
922
|
+
else
|
923
|
+
File.stat(path).mode
|
924
|
+
end
|
922
925
|
mode_sym.split(/,/).inject(mode & 07777) do |current_mode, clause|
|
923
926
|
target, *actions = clause.split(/([=+-])/)
|
924
927
|
raise ArgumentError, "invalid file mode: #{mode_sym}" if actions.empty?
|
@@ -935,7 +938,7 @@ module FileUtils
|
|
935
938
|
when "x"
|
936
939
|
mask | 0111
|
937
940
|
when "X"
|
938
|
-
if
|
941
|
+
if FileTest.directory? path
|
939
942
|
mask | 0111
|
940
943
|
else
|
941
944
|
mask
|