grumlin 0.20.0 → 0.20.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/README.md +4 -3
- data/lib/grumlin/repository/instance_methods.rb +1 -1
- data/lib/grumlin/shortcuts/storage.rb +0 -6
- data/lib/grumlin/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f1f9f9d0ec31cd18d6852dc7920ee15de0d4799d229ed7bfa92ee1dccfe48d9d
|
4
|
+
data.tar.gz: 0fb3bd378cb520ef310c4926c914fd2ddb4dbc1d674ef245a727d4bb776c5164
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aaf7fcc34cb5c14705e72fea99cf013bbebcec4c06b2c5bd39d863a97ca13a14ff3c87ec70f209752f9e09c5964f49b4447bb66c5420405b9b6a61660d807f81
|
7
|
+
data.tar.gz: 5626a23f9279d2989ce781141a388ac97e6f1f1cedcfe9b7b9f7b91e5455dc4c8f98c913575901ee3d94cecfce11c437abd28918cdde9544eb9564fa175fb450
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
grumlin (0.20.
|
4
|
+
grumlin (0.20.1)
|
5
5
|
async-pool (~> 0.3)
|
6
6
|
async-websocket (~> 0.19)
|
7
7
|
oj (~> 3.13)
|
@@ -72,7 +72,7 @@ GEM
|
|
72
72
|
racc (~> 1.4)
|
73
73
|
nokogiri (1.13.6-x86_64-linux)
|
74
74
|
racc (~> 1.4)
|
75
|
-
oj (3.13.
|
75
|
+
oj (3.13.17)
|
76
76
|
overcommit (0.59.1)
|
77
77
|
childprocess (>= 0.6.3, < 5)
|
78
78
|
iniparse (~> 1.4)
|
data/README.md
CHANGED
@@ -80,8 +80,7 @@ sequences of standard gremlin steps, other shortcuts and even add new initially
|
|
80
80
|
Remember ActiveRecord scopes? Shortcuts are very similar.
|
81
81
|
|
82
82
|
**Important**: if a shortcut's name matches a name of a method defined on the wrapped object, this shortcut will be
|
83
|
-
be ignored because methods have higher priority.
|
84
|
-
`Grumlin::Shortcuts.shortcut` will raise an `ArgumentError`. Please carefully choose names for your shortcuts.
|
83
|
+
be ignored because methods have higher priority.
|
85
84
|
|
86
85
|
Shortcuts are designed to be used with `Grumlin::Repository` but still can be used separately, with `Grumlin::Sugar`
|
87
86
|
for example.
|
@@ -143,7 +142,7 @@ class MyRepository
|
|
143
142
|
end
|
144
143
|
```
|
145
144
|
|
146
|
-
##### Overriding standard steps
|
145
|
+
##### Overriding standard steps and shortcuts
|
147
146
|
|
148
147
|
Sometimes it may be useful to override standard steps. Grumlin does not allow it by default, but one
|
149
148
|
is still able to override standard steps if they know what they are doing:
|
@@ -157,6 +156,8 @@ end
|
|
157
156
|
This will create a new shortcut that overrides the standard step `addV` and adds default properties to all vertices
|
158
157
|
created by the repository that uses this shortcut.
|
159
158
|
|
159
|
+
Shortcuts also can be overridden, but super() is not available.
|
160
|
+
|
160
161
|
#### Grumlin::Repository
|
161
162
|
`Grumlin::Repository` combines functionality of `Grumlin::Sugar` and `Grumlin::Shortcuts` as well as adds a few useful
|
162
163
|
shortcuts to make gremlin code more rubyish. Can be used as a drop in replacement for `Grumlin::Sugar`. Remember that
|
@@ -85,7 +85,7 @@ module Grumlin
|
|
85
85
|
end
|
86
86
|
|
87
87
|
# edges:
|
88
|
-
# [["label", "
|
88
|
+
# [["label", "from", "to", {create: :properties}, {update: properties}]]
|
89
89
|
# params can override Retryable config from UPSERT_RETRY_PARAMS
|
90
90
|
def upsert_edges(edges, batch_size: 100, on_failure: :retry, **params)
|
91
91
|
edges.each_slice(batch_size) do |slice|
|
@@ -31,12 +31,6 @@ module Grumlin
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def add(name, shortcut)
|
34
|
-
# not lazy shortcuts are allowed to be overridden
|
35
|
-
if known?(name) && @storage[name] != shortcut && shortcut.lazy?
|
36
|
-
raise ArgumentError,
|
37
|
-
"shortcut '#{name}' already exists"
|
38
|
-
end
|
39
|
-
|
40
34
|
@storage[name] = shortcut
|
41
35
|
|
42
36
|
ac = action_class
|
data/lib/grumlin/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: grumlin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.20.
|
4
|
+
version: 0.20.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gleb Sinyavskiy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-07-
|
11
|
+
date: 2022-07-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async-pool
|