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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0ab9e228cb2cd8ecc761136dab0e92a42aae268708aecf5784aac670a4404ecb
4
- data.tar.gz: 984d2323e97056291370c37dadc2cf90d694f27caa753053a110165985dc067b
3
+ metadata.gz: f1f9f9d0ec31cd18d6852dc7920ee15de0d4799d229ed7bfa92ee1dccfe48d9d
4
+ data.tar.gz: 0fb3bd378cb520ef310c4926c914fd2ddb4dbc1d674ef245a727d4bb776c5164
5
5
  SHA512:
6
- metadata.gz: 27a73c8e77850b99e030c129f8df2e30fc6933ad4da29e5a205b7812c64c88f24d7aceb2128af6687fc4bf35056509421989d2cae5a51c5db6f53c18f735fe97
7
- data.tar.gz: adf371f27c60f2c0e70feaafcfede32dc64beef09b098bf35f01270b37049ee5ce76a68c184bf80abe33c7069ca8b947bbd54ecdcab42fd461a8bb09c270b1b1
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.0)
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.16)
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. You cannot override supported by Grumlin steps with shortcuts,
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", "id", {create: :properties}, {update: properties}]]
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Grumlin
4
- VERSION = "0.20.0"
4
+ VERSION = "0.20.1"
5
5
  end
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.0
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-14 00:00:00.000000000 Z
11
+ date: 2022-07-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: async-pool