dsl-graph 0.2.0 → 0.2.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: 15f6e7b0b4ee9295d215a4756c95a7c917e1f9fc708826fb4df7e815fa05f055
4
- data.tar.gz: c0214d18168d4e8e9ba1f1522e0553608cf51d1a9736048aa38f8aab067b22b6
3
+ metadata.gz: d2ad07093b0978c8911617d40faf07651f8556ca536f413166e929d758036584
4
+ data.tar.gz: a45c34a55293913badca3f7b26006a88c187a090ee65bc0a9476531a31460a72
5
5
  SHA512:
6
- metadata.gz: bf4a00bf704d9ddcbe77021cbeb3c7e138af271e02accd01aa35f6980af32ff393135723ee4695737c99059de3b3d509fd112aeab5fa5de35613ee130478aea6
7
- data.tar.gz: 1a10df96eaf114ea84b4f301c6499ac720e974add568fede6d41e4a5d24aee695538172bd0c71a32080f82f2bead02c3604edc8387ad6fba5212a28acd693921
6
+ metadata.gz: 1abcd7a860d7bc423f8f0174089aea061c155507218b6b3809df9b838ebf596b5c3f025c0bb2b55ecc69d45e3b332ee9e5ecb2fce5f49719dbee1f13f0f9fbfa
7
+ data.tar.gz: 938bf59724dd6667d8062b7c31497075cb432346ce4b08cf622cdc34805d7c9fc3134a2c1d8ccfb6cb2f468293fb76240f4dcc453453f7a9086e018a3b00bec3
data/README.md CHANGED
@@ -10,7 +10,33 @@ DSL para crear grafos.
10
10
 
11
11
  ## Modo de uso
12
12
 
13
- > Consultar los [ejemplos](./examples/)
13
+ Ejemplo:
14
+
15
+ ```ruby
16
+ require "dsl/graph"
17
+
18
+ graph do
19
+ n1 = add_node("Obiwan")
20
+ n2 = add_node("Anakin")
21
+
22
+ add_edge(n1, n2, "maestro_de")
23
+ end
24
+
25
+ graph.export("starwars.pdf")
26
+ ```
27
+
28
+ > Consultar más [ejemplos](./examples/)
29
+
30
+ ## Funciones disponibles
31
+
32
+ * Crear un grafo (nodos y aristas) a partir del DSL.
33
+ * Exportar (`export`) los datos a un YAML, o generar un gráfico en PDF.
34
+ * Cargar (`load`) datos desde un YAML.
35
+
36
+ Pendiente:
37
+
38
+ - Añadir metadatos a los nodos y aristas.
39
+ - Mostrar (`render`) el gráfico del grafo en pantalla.
14
40
 
15
41
  ## Contributing
16
42
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Dsl
4
4
  module Graph
5
- VERSION = "0.2.0"
5
+ VERSION = "0.2.1"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,11 +1,11 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dsl-graph
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Vargas Ruiz
8
- bindir: exe
8
+ bindir: bin
9
9
  cert_chain: []
10
10
  date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
@@ -28,17 +28,12 @@ email:
28
28
  - dvarrui@proton.me
29
29
  executables: []
30
30
  extensions: []
31
- extra_rdoc_files: []
31
+ extra_rdoc_files:
32
+ - LICENSE
33
+ - README.md
32
34
  files:
33
- - CHANGELOG.md
34
35
  - LICENSE
35
36
  - README.md
36
- - Rakefile
37
- - data/.gitkeep
38
- - docs/graphviz-example.rb
39
- - examples/1-create.rb
40
- - examples/2-export.rb
41
- - examples/3.load.rb
42
37
  - lib/dsl/graph.rb
43
38
  - lib/dsl/graph/edge.rb
44
39
  - lib/dsl/graph/export.rb
@@ -46,9 +41,9 @@ files:
46
41
  - lib/dsl/graph/load.rb
47
42
  - lib/dsl/graph/node.rb
48
43
  - lib/dsl/graph/version.rb
49
- - sig/dsl/graph.rbs
50
44
  homepage: https://github.com/dvarrui/dsl-graph
51
- licenses: []
45
+ licenses:
46
+ - MPL-2.0
52
47
  metadata:
53
48
  homepage_uri: https://github.com/dvarrui/dsl-graph
54
49
  source_code_uri: https://github.com/dvarrui/dsl-graph
data/CHANGELOG.md DELETED
@@ -1,10 +0,0 @@
1
- ## [Unreleased]
2
-
3
- ## [0.2.0] - 2026-04-21
4
-
5
- - Add features: export (pdf, yaml), load (yaml)
6
-
7
- ## [0.1.0] - 2026-04-19
8
-
9
- - Initial release
10
- - Add features: create, debug
data/Rakefile DELETED
@@ -1,14 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "bundler/gem_tasks"
4
- require "rake/testtask"
5
-
6
- Rake::TestTask.new(:test) do |t|
7
- t.libs << "test"
8
- t.libs << "lib"
9
- t.test_files = FileList["test/**/*_test.rb"]
10
- end
11
-
12
- require "standard/rake"
13
-
14
- task default: %i[test standard]
data/data/.gitkeep DELETED
File without changes
@@ -1,23 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "graphviz"
4
-
5
- # Jedi
6
- # / | \
7
- # Yoda Obiwan Ankin
8
-
9
- # Crear los nodos
10
- graph = Graphviz::Graph.new("Jedi")
11
-
12
- n0 = graph.add_node("Jedi")
13
- n1 = graph.add_node("Yoda")
14
- n2 = graph.add_node("Obiwan")
15
- n3 = graph.add_node("Anakin")
16
-
17
- # Conectar los nodos
18
- e1 = n0.connect(n1)
19
- e2 = n0.connect(n2)
20
- e3 = n0.connect(n3)
21
-
22
- # Crear pdf
23
- Graphviz::output(graph, :path => "data/test.pdf")
data/examples/1-create.rb DELETED
@@ -1,16 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require_relative "../lib/dsl/graph"
3
-
4
- puts "==> Create"
5
-
6
- graph do
7
- n1 = add_node("Obiwan")
8
- n2 = add_node("Anakin")
9
- n3 = add_node("Yoda")
10
-
11
- add_edge(n1, n2, "maestro_de")
12
- add_edge(n3, n1, "maestro_de")
13
- end
14
-
15
- puts "==> Debug"
16
- graph.debug
data/examples/2-export.rb DELETED
@@ -1,16 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require_relative "../lib/dsl/graph"
3
-
4
- graph do
5
- n1 = add_node("Obiwan")
6
- n2 = add_node("Anakin")
7
- n3 = add_node("Yoda")
8
-
9
- add_edge(n1, n2, "maestro_de")
10
- add_edge(n3, n1, "maestro_de")
11
- end
12
-
13
- puts "==> Export"
14
-
15
- graph.export("data/2-graph.pdf")
16
- graph.export("data/2-graph.yaml")
data/examples/3.load.rb DELETED
@@ -1,22 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require_relative "../lib/dsl/graph"
3
-
4
- puts "==> Create"
5
-
6
- g1 = graph "demo1" do
7
- n1 = add_node("Obiwan")
8
- n2 = add_node("Anakin")
9
- n3 = add_node("Yoda")
10
-
11
- add_edge(n1, n2, "maestro_de")
12
- add_edge(n3, n1, "maestro_de")
13
- end
14
-
15
- g1.debug
16
- puts "==> Export"
17
- g1.export("data/3-graph.yaml")
18
-
19
- puts "==> Load"
20
- g2 = graph.load("data/3-graph.yaml")
21
- g2.label = "demo2"
22
- g2.debug
data/sig/dsl/graph.rbs DELETED
@@ -1,6 +0,0 @@
1
- module Dsl
2
- module Graph
3
- VERSION: String
4
- # See the writing guide of rbs: https://github.com/ruby/rbs#guides
5
- end
6
- end