Skip to content

Commit b3e3ab8

Browse files
committed
Merge branch 'release/0.22.0'
2 parents 12f27d6 + e48eb62 commit b3e3ab8

44 files changed

Lines changed: 598 additions & 548 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# graph-dsl
22

3-
A groovy dsl for creating and traversing graphs. Graphs can be extended with plugins and traits which
4-
allow developers to create a graph with the desired behavior and values for their algorithm.
3+
A groovy dsl for creating and traversing graphs. Graphs can be extended with types which allows developers to create a
4+
graph with the desired behavior and values for their algorithm.
55

66
[![Build Status](https://travis-ci.org/moaxcp/graph-dsl.svg?branch=master)](https://travis-ci.org/moaxcp/graph-dsl)
77

@@ -17,6 +17,7 @@ changing the script to `DslScript` a new `Graph` becomes the delegate of the scr
1717
```groovy
1818
#!/usr/bin/env groovy
1919
@Grab(group='com.github.moaxcp', module='graph-dsl', version='latest.revision')
20+
import graph.*
2021
@groovy.transform.BaseScript DslScript graph
2122
edge step1, step2
2223
assert graph.vertices.keySet() == ['step1', 'step2'] as Set //vertices were created!
@@ -156,7 +157,13 @@ Calling `classifyEdges` on an undirected graph will result in two classification
156157
is what the edge would be in a directed graph. The second classification is always back-edge. This is because edges in
157158
an undirected graph are considered bi-directional in `classifyEdges`.
158159

159-
# Edge and Vertex Properties
160+
# Edge and Vertex
161+
162+
## Vertex keys
163+
164+
Vertex keys are used to refer to a Vertex in the dsl. Keys can be any object which implements equals and hashCode.
165+
166+
## Properties
160167

161168
Properties can be added to Edge and Vertex dynamically simply by assigning them.
162169

@@ -295,6 +302,11 @@ If there are any issues contact me moaxcp@gmail.com.
295302

296303
# Releases
297304

305+
## 0.22.0
306+
307+
In this release Vertex.name has been repalced with Vertex.key. The key may be any object that implements equals and
308+
hashCode.
309+
298310
## 0.21.0
299311

300312
This release represents a major change in how graphs are typed. Additional functionality is no only added through a

default.nix

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
with import <nixpkgs> {};
2+
stdenv.mkDerivation rec {
3+
name = "graph-dsl-env";
4+
env = buildEnv { name = name; paths = buildInputs; };
5+
buildInputs = [
6+
git
7+
gitAndTools.gitflow
8+
jetbrains.idea-community
9+
openjdk
10+
groovy
11+
gradle
12+
];
13+
}

src/main/groovy/graph/Edge.groovy

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@ import groovy.transform.ToString
1212
*/
1313
@ToString(includeNames=true)
1414
class Edge extends PropertyDelegator {
15-
String one
16-
String two
15+
Object one
16+
Object two
1717

1818
@PackageScope
19-
void setOne(String one) {
19+
void setOne(Object one) {
2020
this.one = one
2121
}
2222

2323
@PackageScope
24-
void setTwo(String two) {
24+
void setTwo(Object two) {
2525
this.two = two
2626
}
2727

0 commit comments

Comments
 (0)