gremlin2dot 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +32 -0
  3. data/bin/gremlin2dot +35 -0
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 329541aa877df7ee19cd655d44becf877b32739d76b41dfd1b5a97b3aad1f619
4
- data.tar.gz: 074615b05287eda09c507586b86891bf30d1f34cf113e6b031ae7906550fe60c
3
+ metadata.gz: 0a1c658eedf3c5ff39c687cbe21b3fd7e407a7285b67e720a46ef010b9796683
4
+ data.tar.gz: f88dfd7d98dbd4a0ae5c866c20709bc5098191a1369379b56943e3e279e8358a
5
5
  SHA512:
6
- metadata.gz: 51e50cc7cd8e90042a07beb665665073f9aa626056c52b40865eb92b1fbdd1e1c57a8dfaa3bf0eec7ea77fe68caf4c260b711e2f6e94a5096b8336145f1f64b6
7
- data.tar.gz: 77e8a9450f43d4b50a0540c18695991b7b4a319b7a9efb0d23bd987c71034572518c04679f7347de8e4e7ded6b50da315b9e204f887f8536b99c9c13e36b729f
6
+ metadata.gz: 11d45d23294c8dbfaa5e590b06d38f920a9bf623c5d03080c907dea4b6341ca6e8c154e0d3bd6759c63b3448aa3b38011d7a9fb5359ff620771d308fae0caff9
7
+ data.tar.gz: d8cbc265a3cb5ad24de2f6abfc4c73a995d9a3c92d09ba9547feed8fae4cdca60f1f3a89e796de7b2ecd088334b4980b833c058bc0bbb6702aa00a9bbae21c36
data/README.md CHANGED
@@ -4,3 +4,35 @@ gremlin2dot
4
4
  Run a Gremlin query (e.g. against AWS Neptune), and visualise the results
5
5
  using GraphViz.
6
6
 
7
+ ```
8
+ Usage: gremlin2dot [options]
9
+ -e, --endpoint URL The URL of the Gremlin endpoint
10
+ -q, --query QUERY The Gremlin query to run
11
+ --stdin Read Gremlin results as JSON from standard input
12
+ --save-json FILE Save the JSON to FILE
13
+ --canon FILE Write the results as canonical DOT to FILE
14
+ --dot FILE Write the results as placed DOT to FILE
15
+ --png FILE Write the results as PNG to FILE
16
+ --svg FILE Write the results as SVG to FILE
17
+
18
+ gremlin2dot turns the results of a Gremlin query into a GraphViz graph, so
19
+ that they can be visualised.
20
+
21
+ It can either fetch the results as JSON from a Gremlin endpoint (--endpoint
22
+ URL --query QUERY), or it can read some results from standard input (--stdin).
23
+
24
+ The JSON can then be saved as-is (--save-json FILE). Obviously this is most
25
+ useful with --endpoint/--query.
26
+
27
+ The graph is then generated, in one or more of the following forms:
28
+
29
+ * as "canonical" DOT (--canon FILE)
30
+ * as "placed" DOT (--dot FILE)
31
+ * as PNG (--png FILE)
32
+ * as SVG (--svg FILE)
33
+
34
+ If none of --canon/--dot/--png/--svg are specified, then "--canon /dev/stdout"
35
+ is assumed.
36
+
37
+ If no options are specified at all, then this help is shown.
38
+ ```
data/bin/gremlin2dot CHANGED
@@ -19,7 +19,12 @@ dot_file = nil
19
19
  png_file = nil
20
20
  svg_file = nil
21
21
 
22
+ if ARGV.empty?
23
+ ARGV << "--help"
24
+ end
25
+
22
26
  opts = OptionParser.new
27
+
23
28
  opts.on('-e', '--endpoint URL', 'The URL of the Gremlin endpoint') {|v| endpoint = v }
24
29
  opts.on('-q', '--query QUERY', 'The Gremlin query to run') {|v| query = v }
25
30
  opts.on('--stdin', 'Read Gremlin results as JSON from standard input') { use_stdin = true }
@@ -28,12 +33,42 @@ opts.on('--canon FILE', 'Write the results as canonical DOT to FILE') {|v| canon
28
33
  opts.on('--dot FILE', 'Write the results as placed DOT to FILE') {|v| dot_file = v }
29
34
  opts.on('--png FILE', 'Write the results as PNG to FILE') {|v| png_file = v }
30
35
  opts.on('--svg FILE', 'Write the results as SVG to FILE') {|v| svg_file = v }
36
+
37
+ opts.separator <<EOF
38
+
39
+ gremlin2dot turns the results of a Gremlin query into a GraphViz graph, so
40
+ that they can be visualised.
41
+
42
+ It can either fetch the results as JSON from a Gremlin endpoint (--endpoint
43
+ URL --query QUERY), or it can read some results from standard input (--stdin).
44
+
45
+ The JSON can then be saved as-is (--save-json FILE). Obviously this is most
46
+ useful with --endpoint/--query.
47
+
48
+ The graph is then generated, in one or more of the following forms:
49
+
50
+ * as "canonical" DOT (--canon FILE)
51
+ * as "placed" DOT (--dot FILE)
52
+ * as PNG (--png FILE)
53
+ * as SVG (--svg FILE)
54
+
55
+ If none of --canon/--dot/--png/--svg are specified, then "--canon /dev/stdout"
56
+ is assumed.
57
+
58
+ If no options are specified at all, then this help is shown.
59
+
60
+ EOF
61
+
31
62
  opts.order!
32
63
 
33
64
  if !canon_file and !dot_file and !png_file and !svg_file
34
65
  canon_file = "/dev/stdout"
35
66
  end
36
67
 
68
+ unless ARGV.empty?
69
+ error "No arguments accepted. See --help (or run with no arguments) for usage."
70
+ end
71
+
37
72
  if endpoint.nil? != query.nil?
38
73
  error "Either specify both --endpoint and --query, or specify --stdin 1"
39
74
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gremlin2dot
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
  - Rachel Evans