dogviz 0.0.19 → 0.0.20
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/lib/dogviz/container.rb +4 -0
- data/lib/dogviz/nominator.rb +9 -1
- data/lib/dogviz/parent.rb +1 -0
- data/lib/dogviz/system.rb +6 -0
- data/lib/dogviz/version.rb +1 -1
- data/tests/test_dogviz_graph.rb +30 -0
- data/todo.txt +11 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 70929d265912c9efb77184eda0a3ec2267335c41
|
4
|
+
data.tar.gz: e32c035024100f2b2c235e1edd0f58b266628ee3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 59624e07053eb20c432314cd6c856bc60cec1ab4d08d880536e905a64f47b5b3824ccbf2a00cb9fc2f57bb74e0a351287c92d2d9967b476538237a9ba4caaa09
|
7
|
+
data.tar.gz: c3ba4748897a0a22688a1041707a798b067dc44efd7d3fc3a689f1cdb406f54501279ce632407f4d638a98a61ad1a4b9a1d5430ea7595359b4e43364b1e94c6a
|
data/lib/dogviz/container.rb
CHANGED
data/lib/dogviz/nominator.rb
CHANGED
@@ -2,7 +2,7 @@ module Dogviz
|
|
2
2
|
module Nominator
|
3
3
|
def nominate(names_to_nominees)
|
4
4
|
names_to_nominees.each { |name, nominee|
|
5
|
-
define_singleton_method name do
|
5
|
+
define_singleton_method sanitized_name(name) do
|
6
6
|
nominee
|
7
7
|
end
|
8
8
|
}
|
@@ -14,5 +14,13 @@ module Dogviz
|
|
14
14
|
nominate accessor_sym => nominee_nominator.send(accessor_sym)
|
15
15
|
}
|
16
16
|
end
|
17
|
+
|
18
|
+
private
|
19
|
+
|
20
|
+
def sanitized_name(name)
|
21
|
+
return name if name.is_a?(Symbol)
|
22
|
+
name.to_s.gsub(/\s/, '_').downcase
|
23
|
+
end
|
24
|
+
|
17
25
|
end
|
18
26
|
end
|
data/lib/dogviz/parent.rb
CHANGED
data/lib/dogviz/system.rb
CHANGED
data/lib/dogviz/version.rb
CHANGED
data/tests/test_dogviz_graph.rb
CHANGED
@@ -168,4 +168,34 @@ class TestDogvizGraph < Test::Unit::TestCase
|
|
168
168
|
assert_equal sys, thing1.root
|
169
169
|
end
|
170
170
|
|
171
|
+
def test_auto_nominate_automatically_creates_container_methods_based_on_containee_names
|
172
|
+
autosys = system_with_auto_nominate
|
173
|
+
|
174
|
+
group = autosys.group 'g'
|
175
|
+
a = group.thing 'a'
|
176
|
+
|
177
|
+
assert_equal a, group.a
|
178
|
+
assert_equal a, autosys.g.a
|
179
|
+
end
|
180
|
+
|
181
|
+
def test_auto_nominate_uses_underscores_for_whitespace
|
182
|
+
autosys = system_with_auto_nominate
|
183
|
+
|
184
|
+
ab = autosys.thing 'a or b'
|
185
|
+
|
186
|
+
assert_equal ab, autosys.a_or_b
|
187
|
+
end
|
188
|
+
|
189
|
+
def test_auto_nominate_downcases
|
190
|
+
autosys = system_with_auto_nominate
|
191
|
+
|
192
|
+
allcaps = autosys.thing 'ALLCAPS'
|
193
|
+
|
194
|
+
assert_equal allcaps, autosys.allcaps
|
195
|
+
end
|
196
|
+
|
197
|
+
def system_with_auto_nominate
|
198
|
+
Dogviz::System.new 'test', auto_nominate: true
|
199
|
+
end
|
200
|
+
|
171
201
|
end
|
data/todo.txt
CHANGED
@@ -5,5 +5,16 @@
|
|
5
5
|
* clean up init options + render attributes - not v clear / overlapping
|
6
6
|
* make style attributes well defined -> less leaky + explicit graphviz passthroughs
|
7
7
|
* separate style from domain-specific elements (can use same view-manipulation selection mechanisms)
|
8
|
+
- info holds all real / domain attributes
|
9
|
+
- style holds all view / representation attributes
|
8
10
|
* move out any graphviz specifics from main models, e.g. colorize
|
9
11
|
* move from inheritance -> better encaps
|
12
|
+
* make everything a thing:
|
13
|
+
- things become containers when have other things
|
14
|
+
- gets away from "container" which is a bit confusing inline in infra description
|
15
|
+
- maybe makes more seamless when collapsing/hiding for different views?
|
16
|
+
* add sankey diagrams?
|
17
|
+
* other renderer integrations:
|
18
|
+
- plantuml?
|
19
|
+
- cyctoscape?
|
20
|
+
* switch to proper graph lib under covers - this is just a builder + view wrapper...
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dogviz
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.20
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- damned
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-04-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|