tangle 0.10.0 → 0.10.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +0 -5
- data/bin/console +4 -4
- data/lib/tangle/base_graph.rb +1 -0
- data/lib/tangle/base_graph_protected.rb +1 -0
- data/lib/tangle/currify.rb +1 -0
- data/lib/tangle/directed/acyclic/graph.rb +1 -0
- data/lib/tangle/directed/acyclic/partial_order.rb +1 -0
- data/lib/tangle/mixin/directory.rb +17 -1
- data/lib/tangle/undirected/simple/graph.rb +1 -0
- data/tangle.gemspec +2 -1
- metadata +18 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d5878dbe50fd2315ccbdb40dcd43d2e3989c00a1d0305c523d1e6e77eacaf2d1
|
4
|
+
data.tar.gz: 5ebbdbaa654e75390364be31c496fa0d2577df1c62a35dff4c8107f39078a61f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d71c5d10cccb476903f7a380fdf06032253ed39f5b6870553f3ed7aaf9c6fb09b1319974262aa52d6eb5ff3a15841c65ebbced0bab38dece58bc6b564830c884
|
7
|
+
data.tar.gz: ffae0d09c0a98e225c91c786ea800674d1904e3e4f76056bb0fd515366faf785e9825b7406ddc64f3891d21c7feead28bf6f9caf71d49b2180f567203a79c76c
|
data/.rubocop.yml
CHANGED
data/bin/console
CHANGED
@@ -8,8 +8,8 @@ require 'tangle'
|
|
8
8
|
# with your gem easier. You can also use a different console, if you like.
|
9
9
|
|
10
10
|
# (If you use this, don't forget to add pry to your Gemfile!)
|
11
|
-
|
12
|
-
|
11
|
+
require 'pry'
|
12
|
+
Pry.start
|
13
13
|
|
14
|
-
require 'irb'
|
15
|
-
IRB.start(__FILE__)
|
14
|
+
# require 'irb'
|
15
|
+
# IRB.start(__FILE__)
|
data/lib/tangle/base_graph.rb
CHANGED
data/lib/tangle/currify.rb
CHANGED
@@ -11,7 +11,9 @@ module Tangle
|
|
11
11
|
# loaders: list of object loader lambdas (mandatory)
|
12
12
|
# ->(graph, **) { ... } => finished?
|
13
13
|
# follow_links: bool for following symlinks to directories
|
14
|
-
#
|
14
|
+
# exclude_root: bool for excluding the root directory
|
15
|
+
#
|
16
|
+
# All bool options default to false.
|
15
17
|
#
|
16
18
|
# A loader lambda is called with the graph as only positional
|
17
19
|
# argument, and a number of keyword arguments:
|
@@ -42,6 +44,7 @@ module Tangle
|
|
42
44
|
@root_directory = options.fetch(:root)
|
43
45
|
@directory_loaders = options.fetch(:loaders)
|
44
46
|
@follow_directory_links = options[:follow_links]
|
47
|
+
@exclude_root = options[:exclude_root]
|
45
48
|
load_directory_graph(@root_directory)
|
46
49
|
end
|
47
50
|
|
@@ -57,6 +60,18 @@ module Tangle
|
|
57
60
|
# +true+ if the object was a directory (or link to one,
|
58
61
|
# and we're following links).
|
59
62
|
def load_directory_object(path, parent = nil)
|
63
|
+
if @exclude_root
|
64
|
+
return true if path == @root_directory
|
65
|
+
|
66
|
+
parent = nil if parent == @root_directory
|
67
|
+
end
|
68
|
+
|
69
|
+
try_directory_loaders(path, parent)
|
70
|
+
end
|
71
|
+
|
72
|
+
# Try each directory loader, returning true if the object has
|
73
|
+
# children to follow
|
74
|
+
def try_directory_loaders(path, parent)
|
60
75
|
stat = lstat = File.lstat(path)
|
61
76
|
stat = File.stat(path) if lstat.symlink?
|
62
77
|
|
@@ -66,6 +81,7 @@ module Tangle
|
|
66
81
|
end
|
67
82
|
|
68
83
|
return if lstat.symlink? && !@follow_directory_links
|
84
|
+
|
69
85
|
stat.directory?
|
70
86
|
end
|
71
87
|
end
|
data/tangle.gemspec
CHANGED
@@ -29,8 +29,9 @@ Gem::Specification.new do |spec|
|
|
29
29
|
|
30
30
|
spec.add_development_dependency 'bundler', '~> 1.16'
|
31
31
|
spec.add_development_dependency 'fasterer', '~> 0.4'
|
32
|
+
spec.add_development_dependency 'pry', '~> 0.11'
|
32
33
|
spec.add_development_dependency 'rake', '~> 10.0'
|
33
34
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
34
|
-
spec.add_development_dependency 'rubocop', '~> 0.
|
35
|
+
spec.add_development_dependency 'rubocop', '~> 0.57'
|
35
36
|
spec.add_development_dependency 'simplecov', '~> 0.16'
|
36
37
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tangle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Calle Englund
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-10-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: git-version-bump
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0.4'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: pry
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0.11'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0.11'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: rake
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -86,14 +100,14 @@ dependencies:
|
|
86
100
|
requirements:
|
87
101
|
- - "~>"
|
88
102
|
- !ruby/object:Gem::Version
|
89
|
-
version: '0.
|
103
|
+
version: '0.57'
|
90
104
|
type: :development
|
91
105
|
prerelease: false
|
92
106
|
version_requirements: !ruby/object:Gem::Requirement
|
93
107
|
requirements:
|
94
108
|
- - "~>"
|
95
109
|
- !ruby/object:Gem::Version
|
96
|
-
version: '0.
|
110
|
+
version: '0.57'
|
97
111
|
- !ruby/object:Gem::Dependency
|
98
112
|
name: simplecov
|
99
113
|
requirement: !ruby/object:Gem::Requirement
|