grumlin 0.22.2 → 0.22.5

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: 23a0ce8dacaf7c4add38674353e6aa69e51ebd9865ed83c3112f62ad96a5d213
4
- data.tar.gz: 775c7c6009e6969d9a2b060772dc5d6caf9846267050509a5aeccf1bd5050e0c
3
+ metadata.gz: 88898067f66c807c685077f768ca71db95d7b246540764334b421f0c86fe92cc
4
+ data.tar.gz: 5801ac047063d58395e36e194f961ccb2abce3eb772a0b7648c3f35434700c53
5
5
  SHA512:
6
- metadata.gz: 6b9a820912679a67ca1be3545130ee3affcf89bea1bd9085a47f18d4b0c2ed6583ebfe5e7c52c339d93efe672d7ec7d5e604a68681581a4c57f6b21d8dce9e21
7
- data.tar.gz: a5d371995de61123f954361143f98427af0109831c189bb1ad60cdf722109c72749872478096aa60de22bc7d3139825fdf1ed07c8cce2330eca51cb5865fc6f9
6
+ metadata.gz: b6377eb1c36a2caf2536f92574d17a57e7da76f8f8cb7995280aabcde1412fc84e214cdb8a296a3d61d6736efd073e09c415b7a34bdf686567b427eb434ca21e
7
+ data.tar.gz: 172be358c5882da351e2d12db7688a2521808becf0a027c870fa38b27836e76b82b7a995ddf880f4cc205639dba92dfdc771908450891ac6117f241617969c6a
data/Gemfile.lock CHANGED
@@ -1,9 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- grumlin (0.22.2)
4
+ grumlin (0.22.5)
5
5
  async-pool (~> 0.3)
6
- async-websocket (~> 0.19)
6
+ async-websocket (>= 0.19, < 0.20)
7
7
  oj (~> 3.13)
8
8
  retryable (~> 3.0)
9
9
  zeitwerk (~> 2.6)
@@ -11,7 +11,7 @@ PATH
11
11
  GEM
12
12
  remote: https://rubygems.org/
13
13
  specs:
14
- activesupport (7.0.3)
14
+ activesupport (7.0.3.1)
15
15
  concurrent-ruby (~> 1.0, >= 1.0.2)
16
16
  i18n (>= 1.6, < 2)
17
17
  minitest (>= 5.1)
@@ -21,7 +21,7 @@ GEM
21
21
  console (~> 1.10)
22
22
  nio4r (~> 2.3)
23
23
  timers (~> 4.1)
24
- async-http (0.58.0)
24
+ async-http (0.59.1)
25
25
  async (>= 1.25)
26
26
  async-io (>= 1.28)
27
27
  async-pool (>= 0.2)
@@ -31,7 +31,7 @@ GEM
31
31
  traces (>= 0.4.0)
32
32
  async-io (1.33.0)
33
33
  async
34
- async-pool (0.3.10)
34
+ async-pool (0.3.11)
35
35
  async (>= 1.25)
36
36
  async-rspec (1.16.1)
37
37
  rspec (~> 3.0)
@@ -55,33 +55,30 @@ GEM
55
55
  factory_bot (6.2.1)
56
56
  activesupport (>= 5.0.0)
57
57
  fiber-local (1.0.0)
58
- i18n (1.10.0)
58
+ i18n (1.12.0)
59
59
  concurrent-ruby (~> 1.0)
60
60
  iniparse (1.5.0)
61
61
  jaro_winkler (1.5.4)
62
+ json (2.6.2)
62
63
  kramdown (2.4.0)
63
64
  rexml
64
65
  kramdown-parser-gfm (1.1.0)
65
66
  kramdown (~> 2.0)
66
67
  memory_profiler (1.0.0)
67
- mini_portile2 (2.8.0)
68
- minitest (5.15.0)
68
+ minitest (5.16.3)
69
69
  nio4r (2.5.8)
70
- nokogiri (1.13.6)
71
- mini_portile2 (~> 2.8.0)
70
+ nokogiri (1.13.8-x86_64-linux)
72
71
  racc (~> 1.4)
73
- nokogiri (1.13.6-x86_64-linux)
74
- racc (~> 1.4)
75
- oj (3.13.20)
72
+ oj (3.13.21)
76
73
  overcommit (0.59.1)
77
74
  childprocess (>= 0.6.3, < 5)
78
75
  iniparse (~> 1.4)
79
76
  rexml (~> 3.2)
80
77
  parallel (1.22.1)
81
- parser (3.1.2.0)
78
+ parser (3.1.2.1)
82
79
  ast (~> 2.4.1)
83
80
  protocol-hpack (1.4.2)
84
- protocol-http (0.23.4)
81
+ protocol-http (0.23.5)
85
82
  protocol-http1 (0.14.4)
86
83
  protocol-http (~> 0.22)
87
84
  protocol-http2 (0.14.2)
@@ -115,22 +112,23 @@ GEM
115
112
  diff-lcs (>= 1.2.0, < 2.0)
116
113
  rspec-support (~> 3.11.0)
117
114
  rspec-support (3.11.0)
118
- rubocop (1.30.1)
115
+ rubocop (1.35.1)
116
+ json (~> 2.3)
119
117
  parallel (~> 1.10)
120
- parser (>= 3.1.0.0)
118
+ parser (>= 3.1.2.1)
121
119
  rainbow (>= 2.2.2, < 4.0)
122
120
  regexp_parser (>= 1.8, < 3.0)
123
121
  rexml (>= 3.2.5, < 4.0)
124
- rubocop-ast (>= 1.18.0, < 2.0)
122
+ rubocop-ast (>= 1.20.1, < 2.0)
125
123
  ruby-progressbar (~> 1.7)
126
124
  unicode-display_width (>= 1.4.0, < 3.0)
127
- rubocop-ast (1.18.0)
125
+ rubocop-ast (1.21.0)
128
126
  parser (>= 3.1.1.0)
129
- rubocop-performance (1.14.2)
127
+ rubocop-performance (1.14.3)
130
128
  rubocop (>= 1.7.0, < 2.0)
131
129
  rubocop-ast (>= 0.4.0)
132
- rubocop-rspec (2.11.1)
133
- rubocop (~> 1.19)
130
+ rubocop-rspec (2.12.1)
131
+ rubocop (~> 1.31)
134
132
  ruby-prof (1.4.3)
135
133
  ruby-progressbar (1.11.0)
136
134
  simplecov (0.21.2)
@@ -139,7 +137,7 @@ GEM
139
137
  simplecov_json_formatter (~> 0.1)
140
138
  simplecov-html (0.12.3)
141
139
  simplecov_json_formatter (0.1.4)
142
- solargraph (0.45.0)
140
+ solargraph (0.46.0)
143
141
  backport (~> 1.2)
144
142
  benchmark
145
143
  bundler (>= 1.17.2)
@@ -155,19 +153,18 @@ GEM
155
153
  tilt (~> 2.0)
156
154
  yard (~> 0.9, >= 0.9.24)
157
155
  thor (1.2.1)
158
- tilt (2.0.10)
156
+ tilt (2.0.11)
159
157
  timers (4.3.3)
160
- traces (0.6.0)
161
- tzinfo (2.0.4)
158
+ traces (0.6.1)
159
+ tzinfo (2.0.5)
162
160
  concurrent-ruby (~> 1.0)
163
- unicode-display_width (2.1.0)
161
+ unicode-display_width (2.2.0)
164
162
  webrick (1.7.0)
165
163
  yard (0.9.28)
166
164
  webrick (~> 1.7.0)
167
165
  zeitwerk (2.6.0)
168
166
 
169
167
  PLATFORMS
170
- ruby
171
168
  x86_64-linux
172
169
 
173
170
  DEPENDENCIES
data/grumlin.gemspec CHANGED
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
29
29
  spec.require_paths = ["lib"]
30
30
 
31
31
  spec.add_dependency "async-pool", "~> 0.3"
32
- spec.add_dependency "async-websocket", "~> 0.19"
32
+ spec.add_dependency "async-websocket", ">= 0.19", "< 0.20"
33
33
  spec.add_dependency "oj", "~> 3.13"
34
34
  spec.add_dependency "retryable", "~> 3.0"
35
35
  spec.add_dependency "zeitwerk", "~> 2.6"
data/lib/definitions.yml CHANGED
@@ -69,6 +69,7 @@ steps:
69
69
  - unfold
70
70
  - union
71
71
  - until
72
+ - value
72
73
  - valueMap
73
74
  - values
74
75
  - where
@@ -5,7 +5,7 @@ module Grumlin
5
5
  attr_reader :name, :args, :params, :next_step, :configuration_steps, :previous_step, :shortcut
6
6
 
7
7
  # client is only used when a traversal is a part of transaction
8
- def initialize(name, args: [], params: {}, previous_step: nil, pool: Grumlin.default_pool, session_id: nil)
8
+ def initialize(name, args: [], params: {}, previous_step: nil, pool: nil, session_id: nil)
9
9
  super(pool: pool, session_id: session_id)
10
10
 
11
11
  @name = name.to_sym
@@ -6,7 +6,7 @@ module Grumlin
6
6
 
7
7
  include Console
8
8
 
9
- def initialize(traversal_start_class, pool: Grumlin.default_pool) # rubocop:disable Lint/MissingSuper, Lint/UnusedMethodArgument
9
+ def initialize(traversal_start_class, pool: nil) # rubocop:disable Lint/MissingSuper, Lint/UnusedMethodArgument
10
10
  @traversal_start_class = traversal_start_class
11
11
 
12
12
  logger.info(self) do
@@ -10,7 +10,7 @@ module Grumlin
10
10
  UPSERT_RETRY_PARAMS = {
11
11
  on: [Grumlin::AlreadyExistsError, Grumlin::ConcurrentModificationError],
12
12
  sleep_method: ->(n) { Async::Task.current.sleep(n) },
13
- tries: 3,
13
+ tries: 5,
14
14
  sleep: ->(n) { (n**2) + 1 + rand }
15
15
  }.freeze
16
16
 
@@ -36,7 +36,7 @@ module Grumlin
36
36
  ac = action_class
37
37
 
38
38
  shortcut_methods_module.define_method(name) do |*args, **params|
39
- next ac.new(name, args: args, params: params, previous_step: self)
39
+ next ac.new(name, args: args, params: params, previous_step: self, pool: Grumlin.default_pool)
40
40
  end
41
41
  extend_traversal_classes(shortcut) unless shortcut.lazy?
42
42
  end
@@ -52,7 +52,7 @@ module Grumlin
52
52
  end
53
53
 
54
54
  def __
55
- @__ ||= traversal_start_class.new
55
+ traversal_start_class.new(pool: Grumlin.default_pool)
56
56
  end
57
57
 
58
58
  def traversal_start_class
@@ -12,7 +12,7 @@ module Grumlin
12
12
 
13
13
  ALL_STEPS = START_STEPS + CONFIGURATION_STEPS + REGULAR_STEPS
14
14
 
15
- def initialize(pool: Grumlin.default_pool, session_id: nil)
15
+ def initialize(pool: nil, session_id: nil)
16
16
  @pool = pool
17
17
  @session_id = session_id
18
18
 
@@ -23,12 +23,14 @@ module Grumlin
23
23
 
24
24
  ALL_STEPS.each do |step|
25
25
  define_method step do |*args, **params|
26
- shortcuts.action_class.new(step, args: args, params: params, previous_step: self, session_id: @session_id)
26
+ shortcuts.action_class.new(step, args: args, params: params, previous_step: self,
27
+ session_id: @session_id, pool: @pool)
27
28
  end
28
29
  end
29
30
 
30
31
  def step(name, *args, **params)
31
- shortcuts.action_class.new(name, args: args, params: params, previous_step: self, session_id: @session_id)
32
+ shortcuts.action_class.new(name, args: args, params: params, previous_step: self,
33
+ session_id: @session_id, pool: @pool)
32
34
  end
33
35
 
34
36
  def_delegator :shortcuts, :__
@@ -9,7 +9,7 @@ module Grumlin
9
9
  COMMIT = Grumlin::Repository.new.g.step(:tx, :commit).bytecode
10
10
  ROLLBACK = Grumlin::Repository.new.g.step(:tx, :rollback).bytecode
11
11
 
12
- def initialize(traversal_start_class, pool: Grumlin.default_pool)
12
+ def initialize(traversal_start_class, pool:)
13
13
  @traversal_start_class = traversal_start_class
14
14
  @pool = pool
15
15
 
@@ -9,13 +9,13 @@ module Grumlin
9
9
  "g:Vertex" => ->(value) { cast_entity(Grumlin::Vertex, value) },
10
10
  "g:Edge" => ->(value) { cast_entity(Grumlin::Edge, value) },
11
11
  "g:Path" => ->(value) { cast_entity(Grumlin::Path, value) },
12
- "g:Traverser" => ->(value) { cast_entity(Traverser, value) },
13
- "g:Property" => ->(value) { cast_entity(Property, value) },
12
+ "g:Traverser" => ->(value) { cast_entity(Grumlin::Traverser, value) },
13
+ "g:Property" => ->(value) { cast_entity(Grumlin::Property, value) },
14
14
  "g:Int64" => ->(value) { cast_int(value) },
15
15
  "g:Int32" => ->(value) { cast_int(value) },
16
16
  "g:Double" => ->(value) { cast_double(value) },
17
17
  "g:Direction" => ->(value) { value },
18
- # "g:VertexProperty"=> ->(value) { value }, # TODO: implement me
18
+ "g:VertexProperty" => ->(value) { cast_entity(Grumlin::VertexProperty, value) },
19
19
  "g:TraversalMetrics" => ->(value) { cast_map(value[:@value]) },
20
20
  "g:Metrics" => ->(value) { cast_map(value[:@value]) },
21
21
  "g:T" => ->(value) { Grumlin::Expressions::T.public_send(value) }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Grumlin
4
- VERSION = "0.22.2"
4
+ VERSION = "0.22.5"
5
5
  end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Grumlin
4
+ class VertexProperty
5
+ attr_reader :label, :value
6
+
7
+ def initialize(value)
8
+ @label = value[:label]
9
+ @value = Typing.cast(value[:value])
10
+ end
11
+
12
+ def inspect
13
+ "vp[#{label}->#{value}]"
14
+ end
15
+
16
+ def to_s
17
+ inspect
18
+ end
19
+
20
+ def ==(other)
21
+ self.class == other.class && @label == other.label && @value == other.value
22
+ end
23
+ end
24
+ 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.22.2
4
+ version: 0.22.5
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-08-15 00:00:00.000000000 Z
11
+ date: 2022-08-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: async-pool
@@ -28,16 +28,22 @@ dependencies:
28
28
  name: async-websocket
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0.19'
34
+ - - "<"
35
+ - !ruby/object:Gem::Version
36
+ version: '0.20'
34
37
  type: :runtime
35
38
  prerelease: false
36
39
  version_requirements: !ruby/object:Gem::Requirement
37
40
  requirements:
38
- - - "~>"
41
+ - - ">="
39
42
  - !ruby/object:Gem::Version
40
43
  version: '0.19'
44
+ - - "<"
45
+ - !ruby/object:Gem::Version
46
+ version: '0.20'
41
47
  - !ruby/object:Gem::Dependency
42
48
  name: oj
43
49
  requirement: !ruby/object:Gem::Requirement
@@ -167,6 +173,7 @@ files:
167
173
  - lib/grumlin/typing.rb
168
174
  - lib/grumlin/version.rb
169
175
  - lib/grumlin/vertex.rb
176
+ - lib/grumlin/vertex_property.rb
170
177
  - lib/grumlin/with_extension.rb
171
178
  - lib/tasks/benchmark.rake
172
179
  homepage: https://github.com/zhulik/grumlin