grumlin 1.0.4 → 1.1.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: 37a377cb78a69351a6b8dec3dd7a0cfe1e26798050a63e2a1d06ae6f98ef1685
4
- data.tar.gz: 59fb7208327b03c9977c7926b877a7901df018ae7d5cf3f6826dbce991e51134
3
+ metadata.gz: 27313f7516a4bcc6bfb1d7ec133faca0c0c091bbcb87b6e14a7b3883e115d103
4
+ data.tar.gz: f711cd54afbf840ad783fe2d10c48b96ce1e63d571aef704d7929ab7cf9d8c7c
5
5
  SHA512:
6
- metadata.gz: 7131525255531d09a5d01c9dfdd7e39a2b9be0f17861f13852a405b7469f72143ff456a0dd993d57c64f1d5ef3448261332db476f52580e2272fb1e70869f074
7
- data.tar.gz: 208349b5295e788c7b179950a5efccca28b50622d0f642066fcbd6da75d5557d0560b044d9b9431de105ff11837b39e1e5bccd4b872bafd78b8bcef283b7ea4f
6
+ metadata.gz: 2ef4a63618eec2f7f8f6615f809141b9197647b984c0215090853a9b07a74c35f9ce93df1d5047aa02697ab8bff24cf061953efe310aaec38b6c1f98cd0c7ac8
7
+ data.tar.gz: 8158dd69e67ca1e218c835360c02221cf5fb4f9428205d35be3e4b5ef1d57c3058e38ede2403937a0d2fa2ddef9ba961a61f02a2e561818a47a278a2ff6ee926
@@ -22,7 +22,7 @@ jobs:
22
22
  runs-on: ubuntu-latest
23
23
  strategy:
24
24
  matrix:
25
- ruby: ["2.7", "3.0", "3.1"]
25
+ ruby: ["3.0", "3.1", "3.2"]
26
26
  steps:
27
27
  - uses: actions/checkout@v2
28
28
 
data/.rubocop.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  AllCops:
2
- TargetRubyVersion: 2.7
2
+ TargetRubyVersion: 3.0
3
3
  NewCops: enable
4
4
  SuggestExtensions: false
5
5
 
data/.tool-versions CHANGED
@@ -1 +1 @@
1
- ruby 2.7.5
1
+ ruby 3.0.6
data/Gemfile.lock CHANGED
@@ -1,54 +1,56 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- grumlin (1.0.4)
5
- async-pool (~> 0.3.0)
6
- async-websocket (~> 0.22.0)
4
+ grumlin (1.1.0)
5
+ async-pool (~> 0.4.0)
6
+ async-websocket (~> 0.25.0)
7
7
  ibsciss-middleware (~> 0.4.0)
8
- oj (~> 3.13.0)
8
+ oj (~> 3.15.0)
9
9
  retryable (~> 3.0.0)
10
10
  zeitwerk (~> 2.6.0)
11
11
 
12
12
  GEM
13
13
  remote: https://rubygems.org/
14
14
  specs:
15
- activesupport (7.0.4)
15
+ activesupport (7.0.7)
16
16
  concurrent-ruby (~> 1.0, >= 1.0.2)
17
17
  i18n (>= 1.6, < 2)
18
18
  minitest (>= 5.1)
19
19
  tzinfo (~> 2.0)
20
20
  ast (2.4.2)
21
- async (1.30.3)
21
+ async (1.31.0)
22
22
  console (~> 1.10)
23
23
  nio4r (~> 2.3)
24
24
  timers (~> 4.1)
25
- async-http (0.59.3)
25
+ async-http (0.60.2)
26
26
  async (>= 1.25)
27
27
  async-io (>= 1.28)
28
28
  async-pool (>= 0.2)
29
- protocol-http (~> 0.23.1)
30
- protocol-http1 (~> 0.14.0)
31
- protocol-http2 (~> 0.14.0)
32
- traces (>= 0.8.0)
33
- async-io (1.34.0)
29
+ protocol-http (~> 0.24.0)
30
+ protocol-http1 (~> 0.15.0)
31
+ protocol-http2 (~> 0.15.0)
32
+ traces (>= 0.10.0)
33
+ async-io (1.35.0)
34
34
  async
35
- async-pool (0.3.12)
35
+ async-pool (0.4.0)
36
36
  async (>= 1.25)
37
- async-rspec (1.16.1)
37
+ async-rspec (1.17.0)
38
38
  rspec (~> 3.0)
39
39
  rspec-files (~> 1.0)
40
40
  rspec-memory (~> 1.0)
41
- async-websocket (0.22.1)
41
+ async-websocket (0.25.1)
42
42
  async-http (~> 0.54)
43
43
  async-io (~> 1.23)
44
44
  protocol-rack (~> 0.1)
45
- protocol-websocket (~> 0.9.1)
45
+ protocol-websocket (~> 0.11)
46
46
  backport (1.2.0)
47
- benchmark (0.2.0)
48
- benchmark-ips (2.10.0)
47
+ base64 (0.1.1)
48
+ benchmark (0.2.1)
49
+ benchmark-ips (2.12.0)
49
50
  childprocess (4.1.0)
50
- concurrent-ruby (1.1.10)
51
- console (1.16.2)
51
+ concurrent-ruby (1.2.2)
52
+ console (1.23.2)
53
+ fiber-annotation
52
54
  fiber-local
53
55
  dead_end (4.0.0)
54
56
  diff-lcs (1.5.0)
@@ -56,122 +58,135 @@ GEM
56
58
  e2mmap (0.1.0)
57
59
  factory_bot (6.2.1)
58
60
  activesupport (>= 5.0.0)
61
+ fiber-annotation (0.2.0)
59
62
  fiber-local (1.0.0)
60
- i18n (1.12.0)
63
+ i18n (1.14.1)
61
64
  concurrent-ruby (~> 1.0)
62
65
  ibsciss-middleware (0.4.2)
63
66
  iniparse (1.5.0)
64
- jaro_winkler (1.5.4)
65
- json (2.6.2)
67
+ jaro_winkler (1.5.6)
68
+ json (2.6.3)
66
69
  kramdown (2.4.0)
67
70
  rexml
68
71
  kramdown-parser-gfm (1.1.0)
69
72
  kramdown (~> 2.0)
73
+ language_server-protocol (3.17.0.3)
70
74
  memory_profiler (1.0.1)
71
- mini_portile2 (2.8.0)
72
- minitest (5.16.3)
73
- nio4r (2.5.8)
74
- nokogiri (1.13.9)
75
- mini_portile2 (~> 2.8.0)
75
+ mini_portile2 (2.8.4)
76
+ minitest (5.19.0)
77
+ nio4r (2.5.9)
78
+ nokogiri (1.15.4)
79
+ mini_portile2 (~> 2.8.2)
76
80
  racc (~> 1.4)
77
- oj (3.13.23)
78
- overcommit (0.59.1)
81
+ nokogiri (1.15.4-x86_64-linux)
82
+ racc (~> 1.4)
83
+ oj (3.15.1)
84
+ overcommit (0.60.0)
79
85
  childprocess (>= 0.6.3, < 5)
80
86
  iniparse (~> 1.4)
81
87
  rexml (~> 3.2)
82
- parallel (1.22.1)
83
- parser (3.1.2.1)
88
+ parallel (1.23.0)
89
+ parser (3.2.2.3)
84
90
  ast (~> 2.4.1)
91
+ racc
85
92
  protocol-hpack (1.4.2)
86
- protocol-http (0.23.12)
87
- protocol-http1 (0.14.6)
93
+ protocol-http (0.24.7)
94
+ protocol-http1 (0.15.1)
88
95
  protocol-http (~> 0.22)
89
- protocol-http2 (0.14.2)
96
+ protocol-http2 (0.15.1)
90
97
  protocol-hpack (~> 1.4)
91
98
  protocol-http (~> 0.18)
92
- protocol-rack (0.2.4)
99
+ protocol-rack (0.2.6)
93
100
  protocol-http (~> 0.23)
94
101
  rack (>= 1.0)
95
- protocol-websocket (0.9.1)
102
+ protocol-websocket (0.12.0)
96
103
  protocol-http (~> 0.2)
97
104
  protocol-http1 (~> 0.2)
98
- racc (1.6.0)
99
- rack (3.0.1)
105
+ racc (1.7.1)
106
+ rack (3.0.8)
100
107
  rainbow (3.1.1)
101
108
  rake (13.0.6)
102
- regexp_parser (2.6.0)
109
+ rbs (2.8.4)
110
+ regexp_parser (2.8.1)
103
111
  retryable (3.0.5)
104
112
  reverse_markdown (2.1.1)
105
113
  nokogiri
106
- rexml (3.2.5)
114
+ rexml (3.2.6)
107
115
  rspec (3.12.0)
108
116
  rspec-core (~> 3.12.0)
109
117
  rspec-expectations (~> 3.12.0)
110
118
  rspec-mocks (~> 3.12.0)
111
- rspec-core (3.12.0)
119
+ rspec-core (3.12.2)
112
120
  rspec-support (~> 3.12.0)
113
- rspec-expectations (3.12.0)
121
+ rspec-expectations (3.12.3)
114
122
  diff-lcs (>= 1.2.0, < 2.0)
115
123
  rspec-support (~> 3.12.0)
116
124
  rspec-files (1.1.3)
117
125
  rspec (~> 3.0)
118
- rspec-memory (1.0.3)
126
+ rspec-memory (1.0.4)
119
127
  rspec (~> 3.0)
120
- rspec-mocks (3.12.0)
128
+ rspec-mocks (3.12.6)
121
129
  diff-lcs (>= 1.2.0, < 2.0)
122
130
  rspec-support (~> 3.12.0)
123
- rspec-support (3.12.0)
124
- rubocop (1.38.0)
131
+ rspec-support (3.12.1)
132
+ rubocop (1.56.0)
133
+ base64 (~> 0.1.1)
125
134
  json (~> 2.3)
135
+ language_server-protocol (>= 3.17.0)
126
136
  parallel (~> 1.10)
127
- parser (>= 3.1.2.1)
137
+ parser (>= 3.2.2.3)
128
138
  rainbow (>= 2.2.2, < 4.0)
129
139
  regexp_parser (>= 1.8, < 3.0)
130
140
  rexml (>= 3.2.5, < 4.0)
131
- rubocop-ast (>= 1.23.0, < 2.0)
141
+ rubocop-ast (>= 1.28.1, < 2.0)
132
142
  ruby-progressbar (~> 1.7)
133
- unicode-display_width (>= 1.4.0, < 3.0)
134
- rubocop-ast (1.23.0)
135
- parser (>= 3.1.1.0)
136
- rubocop-performance (1.15.0)
143
+ unicode-display_width (>= 2.4.0, < 3.0)
144
+ rubocop-ast (1.29.0)
145
+ parser (>= 3.2.1.0)
146
+ rubocop-capybara (2.18.0)
147
+ rubocop (~> 1.41)
148
+ rubocop-factory_bot (2.23.1)
149
+ rubocop (~> 1.33)
150
+ rubocop-performance (1.19.0)
137
151
  rubocop (>= 1.7.0, < 2.0)
138
152
  rubocop-ast (>= 0.4.0)
139
- rubocop-rspec (2.15.0)
153
+ rubocop-rspec (2.23.2)
140
154
  rubocop (~> 1.33)
141
- ruby-prof (1.4.3)
142
- ruby-progressbar (1.11.0)
143
- simplecov (0.21.2)
155
+ rubocop-capybara (~> 2.17)
156
+ rubocop-factory_bot (~> 2.22)
157
+ ruby-prof (1.6.3)
158
+ ruby-progressbar (1.13.0)
159
+ simplecov (0.22.0)
144
160
  docile (~> 1.1)
145
161
  simplecov-html (~> 0.11)
146
162
  simplecov_json_formatter (~> 0.1)
147
163
  simplecov-html (0.12.3)
148
164
  simplecov_json_formatter (0.1.4)
149
- solargraph (0.47.2)
165
+ solargraph (0.49.0)
150
166
  backport (~> 1.2)
151
167
  benchmark
152
- bundler (>= 1.17.2)
168
+ bundler (~> 2.0)
153
169
  diff-lcs (~> 1.4)
154
170
  e2mmap
155
171
  jaro_winkler (~> 1.5)
156
172
  kramdown (~> 2.3)
157
173
  kramdown-parser-gfm (~> 1.1)
158
174
  parser (~> 3.0)
159
- reverse_markdown (>= 1.0.5, < 3)
160
- rubocop (>= 0.52)
175
+ rbs (~> 2.0)
176
+ reverse_markdown (~> 2.0)
177
+ rubocop (~> 1.38)
161
178
  thor (~> 1.0)
162
179
  tilt (~> 2.0)
163
180
  yard (~> 0.9, >= 0.9.24)
164
- thor (1.2.1)
165
- tilt (2.0.11)
181
+ thor (1.2.2)
182
+ tilt (2.2.0)
166
183
  timers (4.3.5)
167
- traces (0.8.0)
168
- tzinfo (2.0.5)
184
+ traces (0.11.1)
185
+ tzinfo (2.0.6)
169
186
  concurrent-ruby (~> 1.0)
170
- unicode-display_width (2.3.0)
171
- webrick (1.7.0)
172
- yard (0.9.28)
173
- webrick (~> 1.7.0)
174
- zeitwerk (2.6.6)
187
+ unicode-display_width (2.4.2)
188
+ yard (0.9.34)
189
+ zeitwerk (2.6.11)
175
190
 
176
191
  PLATFORMS
177
192
  ruby
@@ -197,4 +212,4 @@ DEPENDENCIES
197
212
  solargraph
198
213
 
199
214
  BUNDLED WITH
200
- 2.2.26
215
+ 2.2.33
data/README.md CHANGED
@@ -27,7 +27,7 @@ event loop.
27
27
 
28
28
  ## Dependencies
29
29
 
30
- Grumlin works with ruby >= 2.7, 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.0, but it's recommended to use 3.1 due to [zlib warnings](https://github.com/socketry/async-websocket/issues/42).
31
31
 
32
32
  ## Install
33
33
 
data/Rakefile CHANGED
@@ -15,7 +15,7 @@ namespace :definitions do
15
15
  desc "Format definitions.yml"
16
16
  task :format do
17
17
  path = File.join(__dir__, "lib", "definitions.yml")
18
- definitions = YAML.safe_load(File.read(path))
18
+ definitions = YAML.safe_load_file(path)
19
19
 
20
20
  definitions.each_value do |kind|
21
21
  kind.each do |name, list|
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(">= 2.7.0")
19
+ spec.required_ruby_version = Gem::Requirement.new(">= 3.0")
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,10 @@ Gem::Specification.new do |spec|
28
28
  end
29
29
  spec.require_paths = ["lib"]
30
30
 
31
- spec.add_dependency "async-pool", "~> 0.3.0"
32
- spec.add_dependency "async-websocket", "~> 0.22.0"
31
+ spec.add_dependency "async-pool", "~> 0.4.0"
32
+ spec.add_dependency "async-websocket", "~> 0.25.0"
33
33
  spec.add_dependency "ibsciss-middleware", "~> 0.4.0"
34
- spec.add_dependency "oj", "~> 3.13.0"
34
+ spec.add_dependency "oj", "~> 3.15.0"
35
35
  spec.add_dependency "retryable", "~> 3.0.0"
36
36
  spec.add_dependency "zeitwerk", "~> 2.6.0"
37
37
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class Grumlin::Middlewares::Builder < ::Middleware::Builder
3
+ class Grumlin::Middlewares::Builder < Middleware::Builder
4
4
  def similar?(other)
5
5
  stack == other.stack
6
6
  end
@@ -58,7 +58,7 @@ module Grumlin::Repository::InstanceMethods # rubocop:disable Metrics/ModuleLeng
58
58
 
59
59
  def add_vertex(label, id = nil, start: g, **properties)
60
60
  id ||= properties[T.id]
61
- properties = except(properties, T.id)
61
+ properties = properties.except(T.id)
62
62
 
63
63
  t = start.addV(label)
64
64
  t = t.props(T.id => id) unless id.nil?
@@ -67,7 +67,7 @@ module Grumlin::Repository::InstanceMethods # rubocop:disable Metrics/ModuleLeng
67
67
 
68
68
  def add_edge(label, id = nil, from:, to:, start: g, **properties)
69
69
  id ||= properties[T.id]
70
- properties = except(properties, T.label)
70
+ properties = properties.except(T.label)
71
71
  properties[T.id] = id
72
72
 
73
73
  start.addE(label).from(__.V(from)).to(__.V(to)).props(**properties).next
@@ -132,24 +132,14 @@ module Grumlin::Repository::InstanceMethods # rubocop:disable Metrics/ModuleLeng
132
132
  end
133
133
 
134
134
  def with_upsert_retry(retry_params, &block)
135
- retry_params = UPSERT_RETRY_PARAMS.merge((retry_params))
135
+ retry_params = UPSERT_RETRY_PARAMS.merge(retry_params)
136
136
  Retryable.retryable(**retry_params, &block)
137
137
  end
138
138
 
139
- # A polyfill for Hash#except for ruby 2.x environments without ActiveSupport
140
- # TODO: delete and use native Hash#except after ruby 2.7 is deprecated.
141
- def except(hash, *keys)
142
- return hash.except(*keys) if hash.respond_to?(:except)
143
-
144
- hash.each_with_object({}) do |(k, v), res|
145
- res[k] = v unless keys.include?(k)
146
- end
147
- end
148
-
149
139
  def cleanup_properties(create_properties, update_properties, *props_to_cleanup)
150
140
  props_to_cleanup = [T.id, T.label] if props_to_cleanup.empty?
151
141
  [create_properties, update_properties].map do |props|
152
- except(props, props_to_cleanup)
142
+ props.except(props_to_cleanup)
153
143
  end
154
144
  end
155
145
  end
@@ -81,7 +81,7 @@ module Grumlin::Repository
81
81
 
82
82
  def default_edge_properties(&block)
83
83
  shortcut :addE, override: true do |*args|
84
- super(*args).props(**block.call(*args)) # rubocop:disable Performance/RedundantBlockCall
84
+ super(*args).props(**block.call(*args)) # rubocop:disable Performance/RedundantBlockCall
85
85
  end
86
86
  end
87
87
 
@@ -54,7 +54,8 @@ class Grumlin::RequestErrorFactory
54
54
 
55
55
  def already_exists_error(status)
56
56
  return Grumlin::VertexAlreadyExistsError if status[:message]&.include?(VERTEX_ALREADY_EXISTS)
57
- return Grumlin::EdgeAlreadyExistsError if status[:message]&.include?(EDGE_ALREADY_EXISTS)
57
+
58
+ Grumlin::EdgeAlreadyExistsError if status[:message]&.include?(EDGE_ALREADY_EXISTS)
58
59
  end
59
60
 
60
61
  def concurrent_modification_error(status) # rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
@@ -66,7 +67,8 @@ class Grumlin::RequestErrorFactory
66
67
  if status[:message]&.include?(CONCURRENT_EDGE_PROPERTY_INSERT_FAILED)
67
68
  return Grumlin::ConcurrentEdgePropertyInsertFailedError
68
69
  end
69
- return Grumlin::ConcurrentModificationError if status[:message]&.include?(CONCURRENCT_MODIFICATION_FAILED)
70
+
71
+ Grumlin::ConcurrentModificationError if status[:message]&.include?(CONCURRENCT_MODIFICATION_FAILED)
70
72
  end
71
73
  end
72
74
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Grumlin
4
- VERSION = "1.0.4"
4
+ VERSION = "1.1.0"
5
5
  end
data/lib/grumlin.rb CHANGED
@@ -181,7 +181,7 @@ module Grumlin
181
181
  end
182
182
 
183
183
  def definitions
184
- @definitions ||= YAML.safe_load(File.read(File.join(__dir__, "definitions.yml")), symbolize_names: true)
184
+ @definitions ||= YAML.safe_load_file(File.join(__dir__, "definitions.yml"), symbolize_names: true)
185
185
  end
186
186
 
187
187
  def fake_uuid(*parts, separator: "->")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grumlin
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gleb Sinyavskiy
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.3.0
19
+ version: 0.4.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.3.0
26
+ version: 0.4.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: async-websocket
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.22.0
33
+ version: 0.25.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.22.0
40
+ version: 0.25.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: ibsciss-middleware
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 3.13.0
61
+ version: 3.15.0
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 3.13.0
68
+ version: 3.15.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: retryable
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -213,7 +213,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
213
213
  requirements:
214
214
  - - ">="
215
215
  - !ruby/object:Gem::Version
216
- version: 2.7.0
216
+ version: '3.0'
217
217
  required_rubygems_version: !ruby/object:Gem::Requirement
218
218
  requirements:
219
219
  - - ">="