dir_r 1.0.0 → 1.0.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/History.txt +4 -0
- data/lib/dir_r.rb +5 -3
- data/version +1 -1
- 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: 5f1cbf722d93945890911ddb4c61451b9f3fb2466d04b54e59f4cf967c38fd74
|
4
|
+
data.tar.gz: dfa34e7bd056af7a19198d2ac20eedb80776a9c2a9826c29186939f28e01f0bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ea7e13bd5a59a630c997abbabd008330b81aa44dd03ea153f2393ce777e3c16c38e951291ee66f3254a25453753f579a02942cc3f5de8363699112789ab890e
|
7
|
+
data.tar.gz: 2a8813eefed7a93847fde133420c50f501b7ae34ba1328c4d9e4d3b2c684684451774d57857f3c45d7db17dbad0fc113cb71c685273d3b13315f2d238afd69d4
|
data/History.txt
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
robertburrowes Tue Nov 3 13:37:50 2020 +1300
|
2
|
+
only yield link, if we ask for it.
|
3
|
+
robertburrowes Tue Nov 3 13:25:48 2020 +1300
|
4
|
+
Change to testing against installed gem
|
1
5
|
robertburrowes Tue Nov 3 13:15:06 2020 +1300
|
2
6
|
completing for release
|
3
7
|
robertburrowes Tue Nov 3 13:14:38 2020 +1300
|
data/lib/dir_r.rb
CHANGED
@@ -7,13 +7,13 @@
|
|
7
7
|
# We also ignore special files (i.e. sockets, dev nodes, ...)
|
8
8
|
#
|
9
9
|
class DirR
|
10
|
-
VERSION = '1.0.
|
10
|
+
VERSION = '1.0.1'
|
11
11
|
# Directory listing. Ignoring symbolic links
|
12
12
|
#
|
13
13
|
# @param directory [String] directory to list
|
14
14
|
# @param walk_sub_directories [Boolean] Recurse through the subdirectories
|
15
15
|
# @param ignore_symlinks [Boolean] Skip over symbolic links to files
|
16
|
-
# @yield [String, String, Boolean] Directory path, Filename, Symbolic Link true/false
|
16
|
+
# @yield [String, String, Boolean] Directory path, Filename, Symbolic Link true/false (only if ! ignore_symlinks)
|
17
17
|
def self.walk_dir(directory:, walk_sub_directories: true, ignore_symlinks: true, debug: false, &block)
|
18
18
|
puts "In #{directory}" if debug
|
19
19
|
Dir.open(directory).each do |filename|
|
@@ -42,8 +42,10 @@ class DirR
|
|
42
42
|
end
|
43
43
|
elsif stat_record.file?
|
44
44
|
# Ordinary file and not a link, or we are accepting links
|
45
|
-
if !
|
45
|
+
if !ignore_symlinks
|
46
46
|
yield directory, filename, link
|
47
|
+
elsif !link
|
48
|
+
yield directory, filename
|
47
49
|
end
|
48
50
|
end
|
49
51
|
end
|
data/version
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
PROJECT="dir_r"
|
2
|
-
VERSION="1.0.
|
2
|
+
VERSION="1.0.1"
|