dire 0.1.0 → 0.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e906e8fff287d41ee5dd703c581b631ab621fdff3a7756dcd42cea4b1c533866
4
- data.tar.gz: 51e92742b580410563a5860dbcbad8dde8a257a5a5520a88bbdb3cb15b53f48d
3
+ metadata.gz: 4ce56a38011061077ffc3a256d72050176ab80382ecaf6ac3febfac060cee877
4
+ data.tar.gz: e19678d4c894844c7f46df26aa89bce0bf7629160ba86a636f569183afbcd9db
5
5
  SHA512:
6
- metadata.gz: cceb3d5d623e467593dd395b302116d0e95a89ccc69908434c7cd1dc74af57d6eef4de4b34e3a6e44d1a2b1d8170d0a03a657e17b7557b3936fe79951ca6176a
7
- data.tar.gz: 568fdf77d605419283ebb50ce7da44e35aa4af773ed01facb02319369e1fb641d54c582497847b23825bb71262f741d648d790fee2fd7f05f7b54bede11650ea
6
+ metadata.gz: df15ddb2eb3edf5f31865a338672ba4e1a710224920cfe4dab1f51d125cd459da816a09cef3dab076af8ca51c47ae59c4cba96a5d6ab05a0f419eb33d2306fb6
7
+ data.tar.gz: 378045dc2b030912a0b5bf1ae42771c5e46786cf09614aaffc8b53ff62a8aca7e91a893b5b6a6ebc267d5542e07f063f3d6bf6a1bef2894723654f881b8818c5
data/lib/dire/dir.rb CHANGED
@@ -1,12 +1,12 @@
1
1
  module Dire
2
2
  class Dir < Node
3
- @@invalid_link_handler = -> (path) {}
3
+ @@invalid_link_handler = -> (nodes, path) {}
4
4
 
5
5
  def self.invalid_link_handler= lambda
6
6
  @@invalid_link_handler = lambda
7
7
  end
8
8
 
9
- @@invalid_path_handler = -> (path) {}
9
+ @@invalid_path_handler = -> (nodes, path) {}
10
10
 
11
11
  def self.invalid_path_handler= lambda
12
12
  @@invalid_path_handler = lambda
@@ -38,16 +38,16 @@ module Dire
38
38
  return @nodes if @nodes
39
39
 
40
40
  @nodes = absolute_path.glob '*', ::File::FNM_DOTMATCH
41
- @nodes = @nodes.filter_map do |node|
41
+ @nodes = @nodes.each_with_object(Array.new) do |node, nodes|
42
42
  next if ignore? node
43
43
 
44
44
  if absolute_path.to_s < node.to_s
45
45
  begin
46
- get node
46
+ nodes.push get(node)
47
47
  rescue Dire::Error::InvalidLink
48
- @@invalid_link_handler.(node)
48
+ @@invalid_link_handler.(nodes, node)
49
49
  rescue Dire::Error::InvalidPath
50
- @@invalid_path_handler.(node)
50
+ @@invalid_path_handler.(nodes, node)
51
51
  end
52
52
  end
53
53
  end
data/lib/dire/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Dire
2
- VERSION = "0.1.0"
2
+ VERSION = '0.1.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dire
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Filip Pyda
@@ -52,7 +52,7 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: 5.14.4
55
- description: Personal
55
+ description: Pathname wrapper for safe and convenient filesystem traversal.
56
56
  email:
57
57
  - filip.pyda@gmail.com
58
58
  executables: []
@@ -98,5 +98,5 @@ requirements: []
98
98
  rubygems_version: 3.2.22
99
99
  signing_key:
100
100
  specification_version: 4
101
- summary: Filesystem Browser
101
+ summary: File Browser
102
102
  test_files: []