graph 2.9.1 → 2.10.0
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
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/History.txt +8 -0
- data/gallery/ruby_exceptions.rb +1 -2
- data/lib/graph.rb +17 -1
- data/lib/homebrew_analyzer.rb +29 -3
- data/lib/rake_analyzer.rb +1 -2
- data/test/test_graph.rb +4 -0
- metadata +4 -4
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6a2c55cdc8067ac15364fb4e15fa932fc9f5817df6312e16f429b2e608be5d11
|
4
|
+
data.tar.gz: b7b2f117ffe778de6b9a7e7b10b0ac9ef17e414ce47ab0bc2d134ee42e589e12
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 582deb9ceb20d0aaba280a2fcde293a727bee802850f02da4678e8993c50586d8de3a9b21216b56cbe2774833c4a5cfc9a87118b5f989a918b6cfabfe2e61d67
|
7
|
+
data.tar.gz: 15b572f55a752e17bc01469ca24bf13ffb63a906aead7f653cd3bcb7135e51a9f2bb860e2d04fbcadcc783f830fb21dd1cf0eb1aae532bd13e883e5848774384
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/History.txt
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
=== 2.10.0 / 2020-02-09
|
2
|
+
|
3
|
+
* 3 minor enhancements:
|
4
|
+
|
5
|
+
* Added compact! shortcut (rotate + boxes--good for code/text graphs).
|
6
|
+
* Added fontcolor shortcut.
|
7
|
+
* Improved homebrew analyzer to include outdated casks & added caching.
|
8
|
+
|
1
9
|
=== 2.9.1 / 2019-12-14
|
2
10
|
|
3
11
|
* 1 bug fix:
|
data/gallery/ruby_exceptions.rb
CHANGED
data/lib/graph.rb
CHANGED
@@ -7,7 +7,7 @@ require "enumerator"
|
|
7
7
|
# dot format.
|
8
8
|
|
9
9
|
class Graph
|
10
|
-
VERSION = "2.
|
10
|
+
VERSION = "2.10.0" # :nodoc:
|
11
11
|
|
12
12
|
# :stopdoc:
|
13
13
|
|
@@ -292,6 +292,13 @@ class Graph
|
|
292
292
|
Attribute.new "fontname = %p" % [name]
|
293
293
|
end
|
294
294
|
|
295
|
+
##
|
296
|
+
# Shortcut method to create a new fontcolor Attribute instance.
|
297
|
+
|
298
|
+
def fontcolor name
|
299
|
+
Attribute.new "fontcolor = %p" % [name]
|
300
|
+
end
|
301
|
+
|
295
302
|
##
|
296
303
|
# Shortcut method to create a new fontsize Attribute instance.
|
297
304
|
|
@@ -339,6 +346,15 @@ class Graph
|
|
339
346
|
orient dir
|
340
347
|
end
|
341
348
|
|
349
|
+
##
|
350
|
+
# Shortcut method to rotate and use boxes. Helps compact when there
|
351
|
+
# is lots of long text nodes.
|
352
|
+
|
353
|
+
def compact!
|
354
|
+
rotate
|
355
|
+
boxes
|
356
|
+
end
|
357
|
+
|
342
358
|
##
|
343
359
|
# Saves out both a dot file to path and an image for the specified type.
|
344
360
|
# Specify type as nil to skip exporting an image.
|
data/lib/homebrew_analyzer.rb
CHANGED
@@ -3,19 +3,45 @@ require 'dep_analyzer'
|
|
3
3
|
# :stopdoc:
|
4
4
|
|
5
5
|
class HomebrewAnalyzer < DepAnalyzer
|
6
|
+
SHH = "2> /dev/null"
|
7
|
+
|
8
|
+
attr_accessor :casks
|
9
|
+
|
6
10
|
def installed
|
7
11
|
# don't cache so it updates every delete
|
8
12
|
puts "scanning installed ports"
|
9
|
-
`brew list
|
13
|
+
ports = normal `brew list #{SHH}`
|
14
|
+
puts "scanning installed casks"
|
15
|
+
self.casks = normal `brew cask list #{SHH}`
|
16
|
+
ports + casks
|
10
17
|
end
|
11
18
|
|
12
19
|
def outdated
|
13
20
|
# don't cache so it updates every delete
|
14
21
|
puts "scanning outdated ports"
|
15
|
-
`brew outdated
|
22
|
+
ports = normal `brew outdated #{SHH}`
|
23
|
+
puts "scanning outdated casks"
|
24
|
+
casks = normal `brew cask outdated #{SHH}`
|
25
|
+
ports + casks
|
26
|
+
end
|
27
|
+
|
28
|
+
def alldeps
|
29
|
+
@alldeps ||= `brew deps --installed`
|
30
|
+
.lines
|
31
|
+
.map { |l| k, *v = l.delete(":").split; [clean(k), v] }
|
32
|
+
.to_h
|
16
33
|
end
|
17
34
|
|
18
35
|
def deps port
|
19
|
-
|
36
|
+
return [] if @casks.include? port
|
37
|
+
alldeps[port] ||= `brew deps #{port}`.scan(/\S+/)
|
38
|
+
end
|
39
|
+
|
40
|
+
def normal lines
|
41
|
+
lines.split(/\n/).map { |s| clean s }
|
42
|
+
end
|
43
|
+
|
44
|
+
def clean name
|
45
|
+
name.split("/").last
|
20
46
|
end
|
21
47
|
end
|
data/lib/rake_analyzer.rb
CHANGED
data/test/test_graph.rb
CHANGED
@@ -69,6 +69,10 @@ class TestGraph < Minitest::Test
|
|
69
69
|
assert_attribute "fontsize", 12, graph.fontsize(12)
|
70
70
|
end
|
71
71
|
|
72
|
+
def test_font_color
|
73
|
+
assert_attribute "fontcolor", "white", graph.fontcolor("white")
|
74
|
+
end
|
75
|
+
|
72
76
|
def test_digraph
|
73
77
|
g = digraph do
|
74
78
|
edge "a", "b", "c"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: graph
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Davis
|
@@ -29,7 +29,7 @@ cert_chain:
|
|
29
29
|
m5x9IDiApM+vCELNwDXXGNFEnQBBK+wAe4Pek8o1V1TTOxL1kGPewVOitX1p3xoN
|
30
30
|
h7iEjga8iM1LbZUfiISZ+WrB
|
31
31
|
-----END CERTIFICATE-----
|
32
|
-
date:
|
32
|
+
date: 2020-02-10 00:00:00.000000000 Z
|
33
33
|
dependencies:
|
34
34
|
- !ruby/object:Gem::Dependency
|
35
35
|
name: rdoc
|
@@ -57,14 +57,14 @@ dependencies:
|
|
57
57
|
requirements:
|
58
58
|
- - "~>"
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version: '3.
|
60
|
+
version: '3.22'
|
61
61
|
type: :development
|
62
62
|
prerelease: false
|
63
63
|
version_requirements: !ruby/object:Gem::Requirement
|
64
64
|
requirements:
|
65
65
|
- - "~>"
|
66
66
|
- !ruby/object:Gem::Version
|
67
|
-
version: '3.
|
67
|
+
version: '3.22'
|
68
68
|
description: "Graph is a type of hash that outputs in graphviz's dot format. It\ncomes
|
69
69
|
with a command-line interface that is easily pluggable.\n\nIt ships with plugins
|
70
70
|
to graph dependencies and status of installed\nrubygems, rake tasks, homebrew ports,
|
metadata.gz.sig
CHANGED
Binary file
|