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.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/History.txt +4 -0
  3. data/lib/dir_r.rb +5 -3
  4. data/version +1 -1
  5. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9d33dbcd163e86efcee3e334d6ee0d3ba31e4360d93b4318a807c941bab72a56
4
- data.tar.gz: f8e68a793609862438eddec5f850167de8faa4c32603a594926617c8cb207b32
3
+ metadata.gz: 5f1cbf722d93945890911ddb4c61451b9f3fb2466d04b54e59f4cf967c38fd74
4
+ data.tar.gz: dfa34e7bd056af7a19198d2ac20eedb80776a9c2a9826c29186939f28e01f0bf
5
5
  SHA512:
6
- metadata.gz: ea6e168330a387413e89aba6873940952d37d59110190586fb68c74f09e7ecc57477e73e0112aecb2eb3fdf833d23a89c5cbac9a302c8a941f0bb973a0eb0c0c
7
- data.tar.gz: fa3b30de105b8c769f964c46caa77a90b17a81810d80223aed2eb42849b115292eb4bc1f86c6fa90e897c453e5963e40e2772e91a1d69904903f3da888ffc869
6
+ metadata.gz: 2ea7e13bd5a59a630c997abbabd008330b81aa44dd03ea153f2393ce777e3c16c38e951291ee66f3254a25453753f579a02942cc3f5de8363699112789ab890e
7
+ data.tar.gz: 2a8813eefed7a93847fde133420c50f501b7ae34ba1328c4d9e4d3b2c684684451774d57857f3c45d7db17dbad0fc113cb71c685273d3b13315f2d238afd69d4
@@ -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
@@ -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.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 !link || (link && !ignore_symlinks)
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.0"
2
+ VERSION="1.0.1"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dir_r
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rob Burrowes