grumlin 1.1.0 → 1.3.0

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: 27313f7516a4bcc6bfb1d7ec133faca0c0c091bbcb87b6e14a7b3883e115d103
4
- data.tar.gz: f711cd54afbf840ad783fe2d10c48b96ce1e63d571aef704d7929ab7cf9d8c7c
3
+ metadata.gz: 553507d5129346a6cfb4de0dc7a49c921bcc55fa66bcfb1b34977e2c5745c99d
4
+ data.tar.gz: 50bc26cc953f4c5ecf5a98113694e27222af024d1dc44caa9a4c67f7d25f1001
5
5
  SHA512:
6
- metadata.gz: 2ef4a63618eec2f7f8f6615f809141b9197647b984c0215090853a9b07a74c35f9ce93df1d5047aa02697ab8bff24cf061953efe310aaec38b6c1f98cd0c7ac8
7
- data.tar.gz: 8158dd69e67ca1e218c835360c02221cf5fb4f9428205d35be3e4b5ef1d57c3058e38ede2403937a0d2fa2ddef9ba961a61f02a2e561818a47a278a2ff6ee926
6
+ metadata.gz: fef41b400fac0f1a5630912c8dd28beac3741e5e90d22c60c20dc2bb9c7b5dba266a5ddaaf9a53fbf30f66c854a3a97dad8d61a96e3acc96edcf9bc41c5b0634
7
+ data.tar.gz: a45d7897f703eb52fb94e2d8e9375f9031f9ab2a5ef1c1f465d401a630a5f1831ca73819fee7c445d46bdad120687c64248d12e33874de4de74056e0d6bc8286
@@ -10,19 +10,16 @@ jobs:
10
10
 
11
11
  - uses: ruby/setup-ruby@v1
12
12
  with:
13
- ruby-version: "3.0"
14
13
  bundler-cache: true
15
14
 
16
- - name: Run the default task
17
- run: |
18
- gem install bundler -v 2.2.15
19
- bundle install
20
- bundle exec rubocop
15
+ - name: Run rubocop
16
+ run: bundle exec rubocop -f github
17
+
21
18
  test:
22
19
  runs-on: ubuntu-latest
23
20
  strategy:
24
21
  matrix:
25
- ruby: ["3.0", "3.1", "3.2"]
22
+ ruby: ["3.1", "3.2", "3.3"]
26
23
  steps:
27
24
  - uses: actions/checkout@v2
28
25
 
@@ -43,6 +40,7 @@ jobs:
43
40
 
44
41
  - name: Run tests
45
42
  run: bundle exec rspec
43
+
46
44
  publish:
47
45
  runs-on: ubuntu-latest
48
46
  needs:
@@ -54,7 +52,6 @@ jobs:
54
52
 
55
53
  - uses: ruby/setup-ruby@v1
56
54
  with:
57
- ruby-version: "3.0"
58
55
  bundler-cache: true
59
56
 
60
57
  - name: Build gem
data/.rubocop.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  AllCops:
2
- TargetRubyVersion: 3.0
2
+ TargetRubyVersion: 3.1
3
3
  NewCops: enable
4
4
  SuggestExtensions: false
5
5
 
@@ -89,3 +89,6 @@ Style/WordArray:
89
89
 
90
90
  Style/ClassAndModuleChildren:
91
91
  EnforcedStyle: compact
92
+
93
+ FactoryBot/IdSequence:
94
+ Enabled: false
data/.tool-versions CHANGED
@@ -1 +1 @@
1
- ruby 3.0.6
1
+ ruby 3.1.5
data/Gemfile.lock CHANGED
@@ -1,113 +1,133 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- grumlin (1.1.0)
5
- async-pool (~> 0.4.0)
6
- async-websocket (~> 0.25.0)
4
+ grumlin (1.3.0)
5
+ async (~> 2.11.0)
6
+ async-http (~> 0.66.0)
7
+ async-io (~> 1.43.0)
8
+ async-pool (~> 0.6.0)
9
+ async-websocket (~> 0.26.0)
10
+ console (~> 1.25.0)
7
11
  ibsciss-middleware (~> 0.4.0)
8
- oj (~> 3.15.0)
12
+ oj (~> 3.16.0)
9
13
  retryable (~> 3.0.0)
10
14
  zeitwerk (~> 2.6.0)
11
15
 
12
16
  GEM
13
17
  remote: https://rubygems.org/
14
18
  specs:
15
- activesupport (7.0.7)
19
+ activesupport (7.1.2)
20
+ base64
21
+ bigdecimal
16
22
  concurrent-ruby (~> 1.0, >= 1.0.2)
23
+ connection_pool (>= 2.2.5)
24
+ drb
17
25
  i18n (>= 1.6, < 2)
18
26
  minitest (>= 5.1)
27
+ mutex_m
19
28
  tzinfo (~> 2.0)
20
29
  ast (2.4.2)
21
- async (1.31.0)
22
- console (~> 1.10)
23
- nio4r (~> 2.3)
30
+ async (2.11.0)
31
+ console (~> 1.25, >= 1.25.2)
32
+ fiber-annotation
33
+ io-event (~> 1.5, >= 1.5.1)
24
34
  timers (~> 4.1)
25
- async-http (0.60.2)
26
- async (>= 1.25)
27
- async-io (>= 1.28)
28
- async-pool (>= 0.2)
29
- protocol-http (~> 0.24.0)
30
- protocol-http1 (~> 0.15.0)
31
- protocol-http2 (~> 0.15.0)
35
+ async-http (0.66.3)
36
+ async (>= 2.10.2)
37
+ async-pool (>= 0.6.1)
38
+ io-endpoint (~> 0.10, >= 0.10.3)
39
+ io-stream (~> 0.4)
40
+ protocol-http (~> 0.26.0)
41
+ protocol-http1 (~> 0.19.0)
42
+ protocol-http2 (~> 0.17.0)
32
43
  traces (>= 0.10.0)
33
- async-io (1.35.0)
44
+ async-io (1.43.2)
34
45
  async
35
- async-pool (0.4.0)
46
+ async-pool (0.6.1)
36
47
  async (>= 1.25)
37
48
  async-rspec (1.17.0)
38
49
  rspec (~> 3.0)
39
50
  rspec-files (~> 1.0)
40
51
  rspec-memory (~> 1.0)
41
- async-websocket (0.25.1)
52
+ async-websocket (0.26.1)
42
53
  async-http (~> 0.54)
43
- async-io (~> 1.23)
44
- protocol-rack (~> 0.1)
54
+ protocol-rack (~> 0.5)
45
55
  protocol-websocket (~> 0.11)
46
56
  backport (1.2.0)
47
- base64 (0.1.1)
48
- benchmark (0.2.1)
49
- benchmark-ips (2.12.0)
57
+ base64 (0.2.0)
58
+ benchmark (0.3.0)
59
+ benchmark-ips (2.13.0)
60
+ bigdecimal (3.1.5)
50
61
  childprocess (4.1.0)
51
62
  concurrent-ruby (1.2.2)
52
- console (1.23.2)
63
+ connection_pool (2.4.1)
64
+ console (1.25.2)
53
65
  fiber-annotation
54
- fiber-local
66
+ fiber-local (~> 1.1)
67
+ json
55
68
  dead_end (4.0.0)
56
69
  diff-lcs (1.5.0)
57
70
  docile (1.4.0)
71
+ drb (2.2.0)
72
+ ruby2_keywords
58
73
  e2mmap (0.1.0)
59
- factory_bot (6.2.1)
74
+ factory_bot (6.4.5)
60
75
  activesupport (>= 5.0.0)
61
76
  fiber-annotation (0.2.0)
62
- fiber-local (1.0.0)
77
+ fiber-local (1.1.0)
78
+ fiber-storage
79
+ fiber-storage (0.1.0)
63
80
  i18n (1.14.1)
64
81
  concurrent-ruby (~> 1.0)
65
- ibsciss-middleware (0.4.2)
82
+ ibsciss-middleware (0.4.3)
66
83
  iniparse (1.5.0)
84
+ io-endpoint (0.10.3)
85
+ io-event (1.5.1)
86
+ io-stream (0.4.0)
67
87
  jaro_winkler (1.5.6)
68
- json (2.6.3)
88
+ json (2.7.1)
69
89
  kramdown (2.4.0)
70
90
  rexml
71
91
  kramdown-parser-gfm (1.1.0)
72
92
  kramdown (~> 2.0)
73
93
  language_server-protocol (3.17.0.3)
74
94
  memory_profiler (1.0.1)
75
- mini_portile2 (2.8.4)
76
- minitest (5.19.0)
77
- nio4r (2.5.9)
78
- nokogiri (1.15.4)
95
+ mini_portile2 (2.8.5)
96
+ minitest (5.20.0)
97
+ mutex_m (0.2.0)
98
+ nokogiri (1.16.0)
79
99
  mini_portile2 (~> 2.8.2)
80
100
  racc (~> 1.4)
81
- nokogiri (1.15.4-x86_64-linux)
101
+ nokogiri (1.16.0-x86_64-linux)
82
102
  racc (~> 1.4)
83
- oj (3.15.1)
84
- overcommit (0.60.0)
103
+ oj (3.16.3)
104
+ bigdecimal (>= 3.0)
105
+ overcommit (0.61.0)
85
106
  childprocess (>= 0.6.3, < 5)
86
107
  iniparse (~> 1.4)
87
108
  rexml (~> 3.2)
88
- parallel (1.23.0)
89
- parser (3.2.2.3)
109
+ parallel (1.24.0)
110
+ parser (3.2.2.4)
90
111
  ast (~> 2.4.1)
91
112
  racc
92
- protocol-hpack (1.4.2)
93
- protocol-http (0.24.7)
94
- protocol-http1 (0.15.1)
113
+ protocol-hpack (1.4.3)
114
+ protocol-http (0.26.5)
115
+ protocol-http1 (0.19.1)
95
116
  protocol-http (~> 0.22)
96
- protocol-http2 (0.15.1)
117
+ protocol-http2 (0.17.0)
97
118
  protocol-hpack (~> 1.4)
98
119
  protocol-http (~> 0.18)
99
- protocol-rack (0.2.6)
120
+ protocol-rack (0.5.1)
100
121
  protocol-http (~> 0.23)
101
122
  rack (>= 1.0)
102
- protocol-websocket (0.12.0)
123
+ protocol-websocket (0.12.1)
103
124
  protocol-http (~> 0.2)
104
- protocol-http1 (~> 0.2)
105
- racc (1.7.1)
106
- rack (3.0.8)
125
+ racc (1.7.3)
126
+ rack (3.0.11)
107
127
  rainbow (3.1.1)
108
- rake (13.0.6)
128
+ rake (13.1.0)
109
129
  rbs (2.8.4)
110
- regexp_parser (2.8.1)
130
+ regexp_parser (2.8.3)
111
131
  retryable (3.0.5)
112
132
  reverse_markdown (2.1.1)
113
133
  nokogiri
@@ -129,40 +149,40 @@ GEM
129
149
  diff-lcs (>= 1.2.0, < 2.0)
130
150
  rspec-support (~> 3.12.0)
131
151
  rspec-support (3.12.1)
132
- rubocop (1.56.0)
133
- base64 (~> 0.1.1)
152
+ rubocop (1.59.0)
134
153
  json (~> 2.3)
135
154
  language_server-protocol (>= 3.17.0)
136
155
  parallel (~> 1.10)
137
- parser (>= 3.2.2.3)
156
+ parser (>= 3.2.2.4)
138
157
  rainbow (>= 2.2.2, < 4.0)
139
158
  regexp_parser (>= 1.8, < 3.0)
140
159
  rexml (>= 3.2.5, < 4.0)
141
- rubocop-ast (>= 1.28.1, < 2.0)
160
+ rubocop-ast (>= 1.30.0, < 2.0)
142
161
  ruby-progressbar (~> 1.7)
143
162
  unicode-display_width (>= 2.4.0, < 3.0)
144
- rubocop-ast (1.29.0)
163
+ rubocop-ast (1.30.0)
145
164
  parser (>= 3.2.1.0)
146
- rubocop-capybara (2.18.0)
165
+ rubocop-capybara (2.19.0)
147
166
  rubocop (~> 1.41)
148
- rubocop-factory_bot (2.23.1)
149
- rubocop (~> 1.33)
150
- rubocop-performance (1.19.0)
151
- rubocop (>= 1.7.0, < 2.0)
152
- rubocop-ast (>= 0.4.0)
153
- rubocop-rspec (2.23.2)
167
+ rubocop-factory_bot (2.24.0)
154
168
  rubocop (~> 1.33)
169
+ rubocop-performance (1.20.1)
170
+ rubocop (>= 1.48.1, < 2.0)
171
+ rubocop-ast (>= 1.30.0, < 2.0)
172
+ rubocop-rspec (2.25.0)
173
+ rubocop (~> 1.40)
155
174
  rubocop-capybara (~> 2.17)
156
175
  rubocop-factory_bot (~> 2.22)
157
176
  ruby-prof (1.6.3)
158
177
  ruby-progressbar (1.13.0)
178
+ ruby2_keywords (0.0.5)
159
179
  simplecov (0.22.0)
160
180
  docile (~> 1.1)
161
181
  simplecov-html (~> 0.11)
162
182
  simplecov_json_formatter (~> 0.1)
163
183
  simplecov-html (0.12.3)
164
184
  simplecov_json_formatter (0.1.4)
165
- solargraph (0.49.0)
185
+ solargraph (0.50.0)
166
186
  backport (~> 1.2)
167
187
  benchmark
168
188
  bundler (~> 2.0)
@@ -178,15 +198,15 @@ GEM
178
198
  thor (~> 1.0)
179
199
  tilt (~> 2.0)
180
200
  yard (~> 0.9, >= 0.9.24)
181
- thor (1.2.2)
182
- tilt (2.2.0)
201
+ thor (1.3.0)
202
+ tilt (2.3.0)
183
203
  timers (4.3.5)
184
204
  traces (0.11.1)
185
205
  tzinfo (2.0.6)
186
206
  concurrent-ruby (~> 1.0)
187
- unicode-display_width (2.4.2)
207
+ unicode-display_width (2.5.0)
188
208
  yard (0.9.34)
189
- zeitwerk (2.6.11)
209
+ zeitwerk (2.6.14)
190
210
 
191
211
  PLATFORMS
192
212
  ruby
data/README.md CHANGED
@@ -27,7 +27,7 @@ event loop.
27
27
 
28
28
  ## Dependencies
29
29
 
30
- Grumlin works with ruby >= 3.0, but it's recommended to use 3.1 due to [zlib warnings](https://github.com/socketry/async-websocket/issues/42).
30
+ Grumlin works with ruby >= 3.1.
31
31
 
32
32
  ## Install
33
33
 
data/grumlin.gemspec CHANGED
@@ -16,7 +16,7 @@ Gem::Specification.new do |spec|
16
16
 
17
17
  spec.homepage = "https://github.com/babbel/grumlin"
18
18
  spec.license = "MIT"
19
- spec.required_ruby_version = Gem::Requirement.new(">= 3.0")
19
+ spec.required_ruby_version = Gem::Requirement.new(">= 3.1")
20
20
 
21
21
  spec.metadata["homepage_uri"] = spec.homepage
22
22
  spec.metadata["source_code_uri"] = "https://github.com/babbel/grumlin"
@@ -28,10 +28,14 @@ Gem::Specification.new do |spec|
28
28
  end
29
29
  spec.require_paths = ["lib"]
30
30
 
31
- spec.add_dependency "async-pool", "~> 0.4.0"
32
- spec.add_dependency "async-websocket", "~> 0.25.0"
31
+ spec.add_dependency "async", "~> 2.11.0"
32
+ spec.add_dependency "async-http", "~> 0.66.0"
33
+ spec.add_dependency "async-io", "~> 1.43.0"
34
+ spec.add_dependency "async-pool", "~> 0.6.0"
35
+ spec.add_dependency "async-websocket", "~> 0.26.0"
36
+ spec.add_dependency "console", "~> 1.25.0"
33
37
  spec.add_dependency "ibsciss-middleware", "~> 0.4.0"
34
- spec.add_dependency "oj", "~> 3.15.0"
38
+ spec.add_dependency "oj", "~> 3.16.0"
35
39
  spec.add_dependency "retryable", "~> 3.0.0"
36
40
  spec.add_dependency "zeitwerk", "~> 2.6.0"
37
41
  end
@@ -38,8 +38,6 @@ class Grumlin::Client
38
38
  end
39
39
  end
40
40
 
41
- include Console
42
-
43
41
  # Client is not reusable. Once closed should be recreated.
44
42
  def initialize(url, parent: Async::Task.current, **client_options)
45
43
  @url = url
@@ -62,7 +60,7 @@ class Grumlin::Client
62
60
  rescue Async::Stop, Async::TimeoutError, StandardError
63
61
  close(check_requests: false)
64
62
  end
65
- logger.debug(self, "Connected")
63
+ Console.debug(self, "Connected")
66
64
  end
67
65
 
68
66
  # Before calling close the user must ensure that:
@@ -85,7 +83,7 @@ class Grumlin::Client
85
83
 
86
84
  raise Grumlin::ResourceLeakError, "Request list is not empty: #{@request_dispatcher.requests}" if check_requests
87
85
  ensure
88
- logger.debug(self, "Closed")
86
+ Console.debug(self, "Closed")
89
87
  end
90
88
 
91
89
  def connected?
@@ -22,7 +22,7 @@ class Grumlin::Config
22
22
  @pool_size = 10
23
23
  @client_concurrency = 5
24
24
  @provider = :tinkergraph
25
- @client_factory = ->(url, parent) { Grumlin::Client.new(url, parent: parent) }
25
+ @client_factory = ->(url, parent) { Grumlin::Client.new(url, parent:) }
26
26
  end
27
27
 
28
28
  def middlewares
@@ -3,13 +3,11 @@
3
3
  class Grumlin::DummyTransaction < Grumlin::Transaction
4
4
  attr_reader :uuid
5
5
 
6
- include Console
7
-
8
6
  def initialize(traversal_start_class, middlewares:, pool:)
9
7
  super
10
8
  @session_id = nil
11
9
 
12
- logger.info(self) do
10
+ Console.info(self) do
13
11
  "#{Grumlin.config.provider} does not support transactions. commit and rollback are ignored, data will be saved"
14
12
  end
15
13
  end
@@ -19,11 +19,11 @@ class Grumlin::Repository::ErrorHandlingStrategy
19
19
  @mode == :retry
20
20
  end
21
21
 
22
- def apply!(&block)
22
+ def apply!(&)
23
23
  return yield if raise?
24
- return ignore_errors!(&block) if ignore?
24
+ return ignore_errors!(&) if ignore?
25
25
 
26
- retry_errors!(&block)
26
+ retry_errors!(&)
27
27
  end
28
28
 
29
29
  private
@@ -34,7 +34,7 @@ class Grumlin::Repository::ErrorHandlingStrategy
34
34
  # ignore errors
35
35
  end
36
36
 
37
- def retry_errors!(&block)
38
- Retryable.retryable(**@params, &block)
37
+ def retry_errors!(&)
38
+ Retryable.retryable(**@params, &)
39
39
  end
40
40
  end
@@ -42,7 +42,7 @@ module Grumlin::Repository::InstanceMethods # rubocop:disable Metrics/ModuleLeng
42
42
 
43
43
  return if traversal.count.next.zero?
44
44
 
45
- drop_in_batches(traversal, batch_size: batch_size)
45
+ drop_in_batches(traversal, batch_size:)
46
46
 
47
47
  Console.logger.info(self) { "drop_in_batches: finished." }
48
48
  end
@@ -123,17 +123,17 @@ module Grumlin::Repository::InstanceMethods # rubocop:disable Metrics/ModuleLeng
123
123
 
124
124
  private
125
125
 
126
- def with_upsert_error_handling(on_failure, params, &block)
126
+ def with_upsert_error_handling(on_failure, params, &)
127
127
  if params.any?
128
128
  Grumlin::Repository::ErrorHandlingStrategy.new(mode: on_failure, **UPSERT_RETRY_PARAMS.merge(params))
129
129
  else
130
130
  DEFAULT_ERROR_HANDLING_STRATEGY
131
- end.apply!(&block)
131
+ end.apply!(&)
132
132
  end
133
133
 
134
- def with_upsert_retry(retry_params, &block)
134
+ def with_upsert_retry(retry_params, &)
135
135
  retry_params = UPSERT_RETRY_PARAMS.merge(retry_params)
136
- Retryable.retryable(**retry_params, &block)
136
+ Retryable.retryable(**retry_params, &)
137
137
  end
138
138
 
139
139
  def cleanup_properties(create_properties, update_properties, *props_to_cleanup)
@@ -23,7 +23,7 @@ class Grumlin::RequestDispatcher
23
23
  raise RequestAlreadyAddedError if @requests.include?(request[:requestId])
24
24
 
25
25
  Async::Channel.new.tap do |channel|
26
- @requests[request[:requestId]] = { request: request, result: [], channel: channel }
26
+ @requests[request[:requestId]] = { request:, result: [], channel: }
27
27
  end
28
28
  end
29
29
 
@@ -61,7 +61,7 @@ class Grumlin::RequestDispatcher
61
61
  end
62
62
 
63
63
  def clear
64
- @requests.each do |_id, request|
64
+ @requests.each_value do |request|
65
65
  request[:channel].close!
66
66
  end
67
67
  @requests.clear
@@ -35,7 +35,7 @@ class Grumlin::Shortcuts::Storage
35
35
  sc = step_class
36
36
 
37
37
  shortcut_methods_module.define_method(name) do |*args, **params|
38
- next sc.new(name, args: args, params: params, previous_step: self, pool: pool)
38
+ next sc.new(name, args:, params:, previous_step: self, pool:)
39
39
  end
40
40
  extend_traversal_classes(shortcut) unless shortcut.lazy?
41
41
  end
@@ -47,7 +47,7 @@ class Grumlin::Shortcuts::Storage
47
47
  end
48
48
 
49
49
  def g(middlewares: Grumlin.default_middlewares)
50
- traversal_start_class.new(pool: Grumlin.default_pool, middlewares: middlewares)
50
+ traversal_start_class.new(pool: Grumlin.default_pool, middlewares:)
51
51
  end
52
52
 
53
53
  def __
@@ -21,7 +21,7 @@ module Grumlin::Shortcuts
21
21
 
22
22
  raise ArgumentError, "either shortcut or block must be passed" if [shortcut, block].count(&:nil?) != 1
23
23
 
24
- shortcuts.add(name, shortcut || Grumlin::Shortcut.new(name, lazy: lazy, &block))
24
+ shortcuts.add(name, shortcut || Grumlin::Shortcut.new(name, lazy:, &block))
25
25
  end
26
26
 
27
27
  def shortcuts_from(other_shortcuts)
@@ -26,7 +26,7 @@ class Grumlin::ShortcutsApplyer
26
26
  args = step.args.map { |arg| call(arg) }
27
27
 
28
28
  shortcut = shortcuts[step.name]
29
- next result << Grumlin::StepData.new(step.name, args: args, params: step.params) unless shortcut&.lazy?
29
+ next result << Grumlin::StepData.new(step.name, args:, params: step.params) unless shortcut&.lazy?
30
30
 
31
31
  t = shortcuts.__
32
32
  step = shortcut.apply(t, *args, **step.params)
data/lib/grumlin/step.rb CHANGED
@@ -6,7 +6,7 @@ class Grumlin::Step < Grumlin::Steppable
6
6
  # TODO: replace pool, session_id and middlewares with a context?
7
7
  def initialize(name, args: [], params: {}, previous_step: nil, pool: nil, session_id: nil, # rubocop:disable Metrics/ParameterLists
8
8
  middlewares: Grumlin.default_middlewares)
9
- super(pool: pool, session_id: session_id, middlewares: middlewares)
9
+ super(pool:, session_id:, middlewares:)
10
10
 
11
11
  @name = name.to_sym
12
12
  @args = args # TODO: add recursive validation: only json types or Step
@@ -55,7 +55,7 @@ class Grumlin::Step < Grumlin::Steppable
55
55
  end
56
56
 
57
57
  def bytecode(no_return: false)
58
- Grumlin::StepsSerializers::Bytecode.new(steps, no_return: no_return)
58
+ Grumlin::StepsSerializers::Bytecode.new(steps, no_return:)
59
59
  end
60
60
 
61
61
  def next
@@ -85,7 +85,7 @@ class Grumlin::Step < Grumlin::Steppable
85
85
 
86
86
  def send_query(need_results:)
87
87
  @middlewares.call(traversal: self,
88
- need_results: need_results,
88
+ need_results:,
89
89
  session_id: @session_id,
90
90
  pool: @pool)
91
91
  end
@@ -23,13 +23,13 @@ class Grumlin::Steppable
23
23
 
24
24
  ALL_STEPS.each do |step|
25
25
  define_method step do |*args, **params|
26
- shortcuts.step_class.new(step, args: args, params: params, previous_step: self,
26
+ shortcuts.step_class.new(step, args:, params:, previous_step: self,
27
27
  session_id: @session_id, pool: @pool, middlewares: @middlewares)
28
28
  end
29
29
  end
30
30
 
31
31
  def step(name, *args, **params)
32
- shortcuts.step_class.new(name, args: args, params: params, previous_step: self,
32
+ shortcuts.step_class.new(name, args:, params:, previous_step: self,
33
33
  session_id: @session_id, pool: @pool, middlewares: @middlewares)
34
34
  end
35
35
 
data/lib/grumlin/steps.rb CHANGED
@@ -24,11 +24,9 @@ class Grumlin::Steps
24
24
  end
25
25
 
26
26
  def add(name, args: [], params: {}, to: :end)
27
- if CONFIGURATION_STEPS.include?(name) || name.to_sym == :tx
28
- return add_configuration_step(name, args: args, params: params, to: to)
29
- end
27
+ return add_configuration_step(name, args:, params:, to:) if CONFIGURATION_STEPS.include?(name) || name.to_sym == :tx
30
28
 
31
- Grumlin::StepData.new(name, args: cast_arguments(args), params: params).tap do |step|
29
+ Grumlin::StepData.new(name, args: cast_arguments(args), params:).tap do |step|
32
30
  next @steps << step if to == :end
33
31
  next @steps.unshift(step) if to == :begin
34
32
 
@@ -62,7 +60,7 @@ class Grumlin::Steps
62
60
  def add_configuration_step(name, args: [], params: {}, to: :end)
63
61
  raise ArgumentError, "cannot use configuration steps after start step was used" if @steps.any? && to == :end
64
62
 
65
- Grumlin::StepData.new(name, args: cast_arguments(args), params: params).tap do |step|
63
+ Grumlin::StepData.new(name, args: cast_arguments(args), params:).tap do |step|
66
64
  next @configuration_steps << step if to == :end
67
65
  next @configuration_steps.unshift(step) if to == :begin
68
66
 
@@ -3,8 +3,6 @@
3
3
  class Grumlin::Transaction
4
4
  attr_reader :session_id, :pool
5
5
 
6
- include Console
7
-
8
6
  COMMIT = Grumlin::Repository.new.g.step(:tx, :commit)
9
7
  ROLLBACK = Grumlin::Repository.new.g.step(:tx, :rollback)
10
8
 
@@ -4,8 +4,6 @@ class Grumlin::Transport
4
4
  # A transport based on https://github.com/socketry/async
5
5
  # and https://github.com/socketry/async-websocket
6
6
 
7
- include Console
8
-
9
7
  attr_reader :url
10
8
 
11
9
  # Transport is not reusable. Once closed should be recreated.
@@ -26,7 +24,7 @@ class Grumlin::Transport
26
24
  raise AlreadyConnectedError if connected?
27
25
 
28
26
  @connection = Async::WebSocket::Client.connect(Async::HTTP::Endpoint.parse(@url), **@client_options)
29
- logger.debug(self) { "Connected to #{@url}." }
27
+ Console.debug(self) { "Connected to #{@url}." }
30
28
 
31
29
  @response_task = @parent.async { run_response_task }
32
30
 
@@ -88,7 +86,7 @@ class Grumlin::Transport
88
86
  def with_guard
89
87
  yield
90
88
  rescue Async::Stop, Async::TimeoutError, StandardError => e
91
- logger.debug(self) { "Guard error, closing." }
89
+ Console.debug(self) { "Guard error, closing." }
92
90
  begin
93
91
  @response_channel.exception(e)
94
92
  rescue Async::Channel::ChannelClosedError
@@ -12,7 +12,7 @@ class Grumlin::TraversalStart < Grumlin::Steppable
12
12
  # Pool should have size of 1 when working with session
13
13
  pool = Async::Pool::Controller.new(Grumlin::Client::PoolResource, limit: 1)
14
14
 
15
- transaction = tx_class.new(self.class, pool: pool, middlewares: @middlewares)
15
+ transaction = tx_class.new(self.class, pool:, middlewares: @middlewares)
16
16
  return transaction unless block_given?
17
17
 
18
18
  result = nil
@@ -2,6 +2,6 @@
2
2
 
3
3
  class Grumlin::TraversalStrategies::OptionsStrategy < Grumlin::TypedValue
4
4
  def initialize(value)
5
- super(type: "OptionsStrategy", value: value)
5
+ super(type: "OptionsStrategy", value:)
6
6
  end
7
7
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Grumlin
4
- VERSION = "1.1.0"
4
+ VERSION = "1.3.0"
5
5
  end
metadata CHANGED
@@ -1,43 +1,99 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grumlin
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gleb Sinyavskiy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-08-15 00:00:00.000000000 Z
11
+ date: 2024-05-16 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: async
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 2.11.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 2.11.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: async-http
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 0.66.0
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 0.66.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: async-io
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 1.43.0
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 1.43.0
13
55
  - !ruby/object:Gem::Dependency
14
56
  name: async-pool
15
57
  requirement: !ruby/object:Gem::Requirement
16
58
  requirements:
17
59
  - - "~>"
18
60
  - !ruby/object:Gem::Version
19
- version: 0.4.0
61
+ version: 0.6.0
20
62
  type: :runtime
21
63
  prerelease: false
22
64
  version_requirements: !ruby/object:Gem::Requirement
23
65
  requirements:
24
66
  - - "~>"
25
67
  - !ruby/object:Gem::Version
26
- version: 0.4.0
68
+ version: 0.6.0
27
69
  - !ruby/object:Gem::Dependency
28
70
  name: async-websocket
29
71
  requirement: !ruby/object:Gem::Requirement
30
72
  requirements:
31
73
  - - "~>"
32
74
  - !ruby/object:Gem::Version
33
- version: 0.25.0
75
+ version: 0.26.0
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 0.26.0
83
+ - !ruby/object:Gem::Dependency
84
+ name: console
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: 1.25.0
34
90
  type: :runtime
35
91
  prerelease: false
36
92
  version_requirements: !ruby/object:Gem::Requirement
37
93
  requirements:
38
94
  - - "~>"
39
95
  - !ruby/object:Gem::Version
40
- version: 0.25.0
96
+ version: 1.25.0
41
97
  - !ruby/object:Gem::Dependency
42
98
  name: ibsciss-middleware
43
99
  requirement: !ruby/object:Gem::Requirement
@@ -58,14 +114,14 @@ dependencies:
58
114
  requirements:
59
115
  - - "~>"
60
116
  - !ruby/object:Gem::Version
61
- version: 3.15.0
117
+ version: 3.16.0
62
118
  type: :runtime
63
119
  prerelease: false
64
120
  version_requirements: !ruby/object:Gem::Requirement
65
121
  requirements:
66
122
  - - "~>"
67
123
  - !ruby/object:Gem::Version
68
- version: 3.15.0
124
+ version: 3.16.0
69
125
  - !ruby/object:Gem::Dependency
70
126
  name: retryable
71
127
  requirement: !ruby/object:Gem::Requirement
@@ -213,14 +269,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
213
269
  requirements:
214
270
  - - ">="
215
271
  - !ruby/object:Gem::Version
216
- version: '3.0'
272
+ version: '3.1'
217
273
  required_rubygems_version: !ruby/object:Gem::Requirement
218
274
  requirements:
219
275
  - - ">="
220
276
  - !ruby/object:Gem::Version
221
277
  version: '0'
222
278
  requirements: []
223
- rubygems_version: 3.2.33
279
+ rubygems_version: 3.3.27
224
280
  signing_key:
225
281
  specification_version: 4
226
282
  summary: Gremlin graph traversal language DSL and client for Ruby.