very_safe_rm 0.2.5 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/very_safe_rm/rm_one.rb +2 -1
- data/lib/very_safe_rm/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8242f26620b7c9650da6ad127f77ecd3e52992d0
|
4
|
+
data.tar.gz: 3bc08c375cce30f9a395395616c02d5c9e93b8ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e498cff33226dd84da0e3b231751892c526665364a2e8909d14f0b6399508549c123312376889fb1ce778b7ab911f74d31dbd9e2dbd648b86bfc58e38c25734e
|
7
|
+
data.tar.gz: 346283fae911a0b950d0a35054cf5a4ab3a30d0da04a9dd60b80e5e5d04ea69323f0e5eb9ee6b8ccfdc86d2915e2e1af3fe11a12e462d8e8040d42777638c63d
|
data/lib/very_safe_rm/rm_one.rb
CHANGED
@@ -12,6 +12,7 @@ module VerySafeRm
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def self.rm_one(file, args)
|
15
|
+
return RM.rm file, [] unless File.exist? file
|
15
16
|
filesystem = `stat -fc %T #{file}`
|
16
17
|
if filesystem == 'nilfs' then RM.rm file, ['-r', '-v', '-f']
|
17
18
|
elsif Dir.empty? file then RM.rm file, ['-r', '-f', '-v']
|
@@ -21,7 +22,7 @@ module VerySafeRm
|
|
21
22
|
end
|
22
23
|
end
|
23
24
|
|
24
|
-
def self.check_force_rm(file)
|
25
|
+
def self.check_force_rm?(file)
|
25
26
|
return false unless File.exist? \
|
26
27
|
File.expand_path("-#{file}.rm", File.dirname(file))
|
27
28
|
RM.rm "-#{file}.rm", ['-r', '-f']
|
data/lib/very_safe_rm/version.rb
CHANGED