grumlin 0.19.3 → 0.19.6

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: 7ce013b3f95a61f038a3dd646c4f47de81026bf9ec396467a0500f2fc7c055e3
4
- data.tar.gz: 78cd3caf0ce18bce7741236cf9f232b58eb0b675492102826635ccc441f98cec
3
+ metadata.gz: f2765e4dfacbbe6e54cbcf07768a2834f42101866c3c448ba218425682fa285e
4
+ data.tar.gz: 0bae4cc9ca063e09df152a3de1a5ad602561870ded4c1628486f45fc613bed0e
5
5
  SHA512:
6
- metadata.gz: 3f49d27bc55301991f4eff5935eb90d1a3dff873551466ffcbf6ecc978d25149eba939a45b2e9e966b706470a7c47496e575f51ba2fab26ebb96e9deb9d31bcd
7
- data.tar.gz: 656e68d9d2ba385d0e2c17d4e28658f15b2d224338e9e3d0bc93b2336bcfe4c4d30226f2efb653e21678c0131f79c9a3d3043e1ac8b1a0b9489e12606c65d425
6
+ metadata.gz: 196703410673b311e1c7054ea0f88b1dfab59a495d240e5b2fe98afe24252050bee1247c6349ee0dc1343b408bf8d380790f0f2fbe4f139b8afbffae1dd86236
7
+ data.tar.gz: 7c43b9bc02172d8d00be62d35182a5c0d9f921a84289dbbdd4c20c16cd3fa9a06c6ed68ac84732cdfccba6864fb7aece6278581211c308e2487364e217907b9d
data/.rubocop.yml CHANGED
@@ -24,7 +24,7 @@ Metrics/ParameterLists:
24
24
  Max: 6
25
25
 
26
26
  Naming/MethodName:
27
- IgnoredPatterns:
27
+ AllowedPatterns:
28
28
  - toList
29
29
  - inVLabel
30
30
  - outVLabel
data/Gemfile CHANGED
@@ -5,19 +5,23 @@ source "https://rubygems.org"
5
5
  gemspec
6
6
 
7
7
  gem "nokogiri"
8
- gem "rubocop"
9
- gem "rubocop-performance"
10
- gem "rubocop-rspec"
8
+ gem "parallel"
11
9
 
12
10
  gem "solargraph"
13
11
 
14
- gem "async-rspec"
15
- gem "factory_bot"
16
12
  gem "overcommit"
17
13
  gem "rake"
14
+
15
+ gem "async-rspec"
16
+ gem "factory_bot"
18
17
  gem "rspec"
18
+
19
19
  gem "simplecov"
20
20
 
21
21
  gem "benchmark-ips"
22
22
  gem "memory_profiler"
23
23
  gem "ruby-prof"
24
+
25
+ gem "rubocop"
26
+ gem "rubocop-performance"
27
+ gem "rubocop-rspec"
data/Gemfile.lock CHANGED
@@ -1,24 +1,23 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- grumlin (0.19.3)
4
+ grumlin (0.19.6)
5
5
  async-pool (~> 0.3)
6
6
  async-websocket (~> 0.19)
7
- oj (~> 3.12)
7
+ oj (~> 3.13)
8
8
  retryable (~> 3.0)
9
- zeitwerk (~> 2.4)
9
+ zeitwerk (~> 2.6)
10
10
 
11
11
  GEM
12
12
  remote: https://rubygems.org/
13
13
  specs:
14
- activesupport (6.1.3.2)
14
+ activesupport (7.0.3)
15
15
  concurrent-ruby (~> 1.0, >= 1.0.2)
16
16
  i18n (>= 1.6, < 2)
17
17
  minitest (>= 5.1)
18
18
  tzinfo (~> 2.0)
19
- zeitwerk (~> 2.3)
20
19
  ast (2.4.2)
21
- async (1.30.2)
20
+ async (1.30.3)
22
21
  console (~> 1.10)
23
22
  nio4r (~> 2.3)
24
23
  timers (~> 4.1)
@@ -34,7 +33,7 @@ GEM
34
33
  async
35
34
  async-pool (0.3.10)
36
35
  async (>= 1.25)
37
- async-rspec (1.16.0)
36
+ async-rspec (1.16.1)
38
37
  rspec (~> 3.0)
39
38
  rspec-files (~> 1.0)
40
39
  rspec-memory (~> 1.0)
@@ -43,41 +42,42 @@ GEM
43
42
  async-io (~> 1.23)
44
43
  protocol-websocket (~> 0.7.0)
45
44
  backport (1.2.0)
46
- benchmark (0.1.1)
45
+ benchmark (0.2.0)
47
46
  benchmark-ips (2.10.0)
48
- childprocess (4.0.0)
49
- concurrent-ruby (1.1.8)
50
- console (1.15.0)
47
+ childprocess (4.1.0)
48
+ concurrent-ruby (1.1.10)
49
+ console (1.15.3)
51
50
  fiber-local
52
- diff-lcs (1.4.4)
51
+ diff-lcs (1.5.0)
53
52
  docile (1.4.0)
54
53
  e2mmap (0.1.0)
55
- factory_bot (6.2.0)
54
+ factory_bot (6.2.1)
56
55
  activesupport (>= 5.0.0)
57
56
  fiber-local (1.0.0)
58
- i18n (1.8.10)
57
+ i18n (1.10.0)
59
58
  concurrent-ruby (~> 1.0)
60
59
  iniparse (1.5.0)
61
60
  jaro_winkler (1.5.4)
62
- kramdown (2.3.1)
61
+ kramdown (2.4.0)
63
62
  rexml
64
63
  kramdown-parser-gfm (1.1.0)
65
64
  kramdown (~> 2.0)
66
65
  memory_profiler (1.0.0)
67
- mini_portile2 (2.7.1)
68
- minitest (5.14.4)
66
+ mini_portile2 (2.8.0)
67
+ minitest (5.15.0)
69
68
  nio4r (2.5.8)
70
- nokogiri (1.13.1)
71
- mini_portile2 (~> 2.7.0)
69
+ nokogiri (1.13.6)
70
+ mini_portile2 (~> 2.8.0)
72
71
  racc (~> 1.4)
73
- nokogiri (1.13.1-x86_64-linux)
72
+ nokogiri (1.13.6-x86_64-linux)
74
73
  racc (~> 1.4)
75
- oj (3.13.11)
76
- overcommit (0.57.0)
74
+ oj (3.13.14)
75
+ overcommit (0.59.1)
77
76
  childprocess (>= 0.6.3, < 5)
78
77
  iniparse (~> 1.4)
79
- parallel (1.21.0)
80
- parser (3.0.3.2)
78
+ rexml (~> 3.2)
79
+ parallel (1.22.1)
80
+ parser (3.1.2.0)
81
81
  ast (~> 2.4.1)
82
82
  protocol-hpack (1.4.2)
83
83
  protocol-http (0.22.6)
@@ -90,45 +90,45 @@ GEM
90
90
  protocol-http (~> 0.2)
91
91
  protocol-http1 (~> 0.2)
92
92
  racc (1.6.0)
93
- rainbow (3.0.0)
94
- rake (13.0.3)
95
- regexp_parser (2.2.0)
93
+ rainbow (3.1.1)
94
+ rake (13.0.6)
95
+ regexp_parser (2.5.0)
96
96
  retryable (3.0.5)
97
- reverse_markdown (2.0.0)
97
+ reverse_markdown (2.1.1)
98
98
  nokogiri
99
99
  rexml (3.2.5)
100
- rspec (3.10.0)
101
- rspec-core (~> 3.10.0)
102
- rspec-expectations (~> 3.10.0)
103
- rspec-mocks (~> 3.10.0)
104
- rspec-core (3.10.1)
105
- rspec-support (~> 3.10.0)
106
- rspec-expectations (3.10.1)
100
+ rspec (3.11.0)
101
+ rspec-core (~> 3.11.0)
102
+ rspec-expectations (~> 3.11.0)
103
+ rspec-mocks (~> 3.11.0)
104
+ rspec-core (3.11.0)
105
+ rspec-support (~> 3.11.0)
106
+ rspec-expectations (3.11.0)
107
107
  diff-lcs (>= 1.2.0, < 2.0)
108
- rspec-support (~> 3.10.0)
109
- rspec-files (1.1.1)
108
+ rspec-support (~> 3.11.0)
109
+ rspec-files (1.1.2)
110
110
  rspec (~> 3.0)
111
- rspec-memory (1.0.2)
111
+ rspec-memory (1.0.3)
112
112
  rspec (~> 3.0)
113
- rspec-mocks (3.10.2)
113
+ rspec-mocks (3.11.1)
114
114
  diff-lcs (>= 1.2.0, < 2.0)
115
- rspec-support (~> 3.10.0)
116
- rspec-support (3.10.2)
117
- rubocop (1.23.0)
115
+ rspec-support (~> 3.11.0)
116
+ rspec-support (3.11.0)
117
+ rubocop (1.30.1)
118
118
  parallel (~> 1.10)
119
- parser (>= 3.0.0.0)
119
+ parser (>= 3.1.0.0)
120
120
  rainbow (>= 2.2.2, < 4.0)
121
121
  regexp_parser (>= 1.8, < 3.0)
122
- rexml
123
- rubocop-ast (>= 1.12.0, < 2.0)
122
+ rexml (>= 3.2.5, < 4.0)
123
+ rubocop-ast (>= 1.18.0, < 2.0)
124
124
  ruby-progressbar (~> 1.7)
125
125
  unicode-display_width (>= 1.4.0, < 3.0)
126
- rubocop-ast (1.14.0)
127
- parser (>= 3.0.1.1)
128
- rubocop-performance (1.12.0)
126
+ rubocop-ast (1.18.0)
127
+ parser (>= 3.1.1.0)
128
+ rubocop-performance (1.14.2)
129
129
  rubocop (>= 1.7.0, < 2.0)
130
130
  rubocop-ast (>= 0.4.0)
131
- rubocop-rspec (2.6.0)
131
+ rubocop-rspec (2.11.1)
132
132
  rubocop (~> 1.19)
133
133
  ruby-prof (1.4.3)
134
134
  ruby-progressbar (1.11.0)
@@ -137,8 +137,8 @@ GEM
137
137
  simplecov-html (~> 0.11)
138
138
  simplecov_json_formatter (~> 0.1)
139
139
  simplecov-html (0.12.3)
140
- simplecov_json_formatter (0.1.3)
141
- solargraph (0.43.0)
140
+ simplecov_json_formatter (0.1.4)
141
+ solargraph (0.45.0)
142
142
  backport (~> 1.2)
143
143
  benchmark
144
144
  bundler (>= 1.17.2)
@@ -153,15 +153,17 @@ GEM
153
153
  thor (~> 1.0)
154
154
  tilt (~> 2.0)
155
155
  yard (~> 0.9, >= 0.9.24)
156
- thor (1.1.0)
156
+ thor (1.2.1)
157
157
  tilt (2.0.10)
158
158
  timers (4.3.3)
159
159
  traces (0.4.1)
160
160
  tzinfo (2.0.4)
161
161
  concurrent-ruby (~> 1.0)
162
162
  unicode-display_width (2.1.0)
163
- yard (0.9.26)
164
- zeitwerk (2.4.2)
163
+ webrick (1.7.0)
164
+ yard (0.9.28)
165
+ webrick (~> 1.7.0)
166
+ zeitwerk (2.6.0)
165
167
 
166
168
  PLATFORMS
167
169
  ruby
@@ -175,6 +177,7 @@ DEPENDENCIES
175
177
  memory_profiler
176
178
  nokogiri
177
179
  overcommit
180
+ parallel
178
181
  rake
179
182
  rspec
180
183
  rubocop
data/Rakefile CHANGED
@@ -28,3 +28,5 @@ namespace :definitions do
28
28
  File.write(path, YAML.dump(definitions))
29
29
  end
30
30
  end
31
+
32
+ Dir.glob(File.join("lib/tasks/**/*.rake")).each { |file| load file }
data/bin/console CHANGED
@@ -8,7 +8,7 @@ require "irb"
8
8
  require "irb/completion"
9
9
 
10
10
  Grumlin.configure do |config|
11
- config.url = ENV["GREMLIN_URL"] || "ws://localhost:8182/gremlin"
11
+ config.url = ENV.fetch("GREMLIN_URL", "ws://localhost:8182/gremlin")
12
12
  end
13
13
 
14
14
  Async do
@@ -1,3 +1,5 @@
1
1
  FROM tinkerpop/gremlin-server
2
2
 
3
+ ADD tinkergraph-gremlin /opt/gremlin-server/ext/tinkergraph-gremlin
4
+
3
5
  ADD tinkergraph-empty.properties /opt/gremlin-server/conf/
data/grumlin.gemspec CHANGED
@@ -21,6 +21,7 @@ Gem::Specification.new do |spec|
21
21
  spec.metadata["homepage_uri"] = spec.homepage
22
22
  spec.metadata["source_code_uri"] = "https://github.com/zhulik/grumlin"
23
23
  spec.metadata["changelog_uri"] = "https://github.com/zhulik/grumlin/blob/master/CHANGELOG.md"
24
+ spec.metadata["rubygems_mfa_required"] = "true"
24
25
 
25
26
  spec.files = Dir.chdir(File.expand_path(__dir__)) do
26
27
  `git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
@@ -29,10 +30,7 @@ Gem::Specification.new do |spec|
29
30
 
30
31
  spec.add_dependency "async-pool", "~> 0.3"
31
32
  spec.add_dependency "async-websocket", "~> 0.19"
32
- spec.add_dependency "oj", "~> 3.12"
33
+ spec.add_dependency "oj", "~> 3.13"
33
34
  spec.add_dependency "retryable", "~> 3.0"
34
- spec.add_dependency "zeitwerk", "~> 2.4"
35
- spec.metadata = {
36
- "rubygems_mfa_required" => "true"
37
- }
35
+ spec.add_dependency "zeitwerk", "~> 2.6"
38
36
  end
data/lib/definitions.yml CHANGED
@@ -11,6 +11,7 @@ steps:
11
11
  - both
12
12
  - bothE
13
13
  - by
14
+ - cap
14
15
  - choose
15
16
  - coalesce
16
17
  - constant
@@ -19,6 +20,7 @@ steps:
19
20
  - drop
20
21
  - elementMap
21
22
  - emit
23
+ - filter
22
24
  - fold
23
25
  - from
24
26
  - group
@@ -37,6 +39,7 @@ steps:
37
39
  - label
38
40
  - limit
39
41
  - map
42
+ - match
40
43
  - none
41
44
  - not
42
45
  - option
@@ -77,9 +80,13 @@ steps:
77
80
  - withSack
78
81
  - withSideEffect
79
82
  expressions:
83
+ cardinality:
84
+ - list
85
+ - set
86
+ - single
80
87
  column:
81
- - keys
82
- - values
88
+ - keys
89
+ - values
83
90
  operator:
84
91
  - addAll
85
92
  - and
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Grumlin
4
+ module Benchmark
5
+ class Repository
6
+ extend Grumlin::Repository
7
+
8
+ shortcut :simple_test do
9
+ self.V
10
+ end
11
+
12
+ def simple_test
13
+ g.V.bytecode.serialize
14
+ end
15
+
16
+ def simple_test_with_shortcut
17
+ g.simple_test.bytecode.serialize
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Grumlin
4
+ module Expressions
5
+ module Cardinality
6
+ SUPPORTED_STEPS = Grumlin.definitions.dig(:expressions, :cardinality).map(&:to_sym).freeze
7
+
8
+ class << self
9
+ extend Expression
10
+
11
+ define_steps(SUPPORTED_STEPS, "Cardinality")
12
+ end
13
+ end
14
+ end
15
+ end
@@ -107,13 +107,13 @@ module Grumlin
107
107
  end
108
108
 
109
109
  def already_exists_error(status)
110
- return VertexAlreadyExistsError if status[:message].include?(VERTEX_ALREADY_EXISTS)
111
- return EdgeAlreadyExistsError if status[:message].include?(EDGE_ALREADY_EXISTS)
110
+ return VertexAlreadyExistsError if status[:message]&.include?(VERTEX_ALREADY_EXISTS)
111
+ return EdgeAlreadyExistsError if status[:message]&.include?(EDGE_ALREADY_EXISTS)
112
112
  end
113
113
 
114
114
  def concurrent_insert_error(status)
115
- return ConcurrentVertexInsertFailedError if status[:message].include?(CONCURRENT_VERTEX_INSERT_FAILED)
116
- return ConcurrentEdgeInsertFailedError if status[:message].include?(CONCURRENT_EDGE_INSERT_FAILED)
115
+ return ConcurrentVertexInsertFailedError if status[:message]&.include?(CONCURRENT_VERTEX_INSERT_FAILED)
116
+ return ConcurrentEdgeInsertFailedError if status[:message]&.include?(CONCURRENT_EDGE_INSERT_FAILED)
117
117
  end
118
118
  end
119
119
  end
@@ -10,7 +10,8 @@ module Grumlin
10
10
  include DBCleanerContext
11
11
 
12
12
  before do
13
- g.V().drop.iterate
13
+ g.E.drop.iterate
14
+ g.V.drop.iterate
14
15
  end
15
16
  end
16
17
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Grumlin
4
- VERSION = "0.19.3"
4
+ VERSION = "0.19.6"
5
5
  end
data/lib/grumlin.rb CHANGED
@@ -21,14 +21,14 @@ require "retryable"
21
21
 
22
22
  require "zeitwerk"
23
23
 
24
- loader = Zeitwerk::Loader.for_gem
24
+ loader = Zeitwerk::Loader.for_gem(warn_on_extra_files: false)
25
25
  loader.inflector.inflect(
26
26
  "rspec" => "RSpec",
27
27
  "db_cleaner_context" => "DBCleanerContext"
28
28
  )
29
29
 
30
- db_adapters = "#{__dir__}/grumlin/test"
31
- loader.do_not_eager_load(db_adapters)
30
+ test_helpers = "#{__dir__}/grumlin/test"
31
+ loader.do_not_eager_load(test_helpers)
32
32
 
33
33
  module Grumlin
34
34
  class Error < StandardError; end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "grumlin"
4
+ require "benchmark/ips"
5
+
6
+ namespace :benchmark do
7
+ desc "Run serialization benchmarks"
8
+ task :serialization do
9
+ repo = Grumlin::Benchmark::Repository.new
10
+
11
+ Benchmark.ips do |x|
12
+ x.time = 3
13
+ x.report("Simple") { repo.simple_test }
14
+ x.report("Simple shortcut") { repo.simple_test_with_shortcut }
15
+ end
16
+ end
17
+ 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.19.3
4
+ version: 0.19.6
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-05-11 00:00:00.000000000 Z
11
+ date: 2022-06-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: async-pool
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '3.12'
47
+ version: '3.13'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '3.12'
54
+ version: '3.13'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: retryable
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '2.4'
75
+ version: '2.6'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '2.4'
82
+ version: '2.6'
83
83
  description: 'Gremlin graph traversal language DSL and client for Ruby. Suitable and
84
84
  tested with gremlin-server and AWS Neptune.
85
85
 
@@ -108,13 +108,17 @@ files:
108
108
  - docker-compose.yml
109
109
  - gremlin_server/Dockerfile
110
110
  - gremlin_server/tinkergraph-empty.properties
111
+ - gremlin_server/tinkergraph-gremlin/lib/tinkergraph-gremlin-3.5.3.jar
112
+ - gremlin_server/tinkergraph-gremlin/plugin/tinkergraph-gremlin-3.5.3.jar
111
113
  - grumlin.gemspec
112
114
  - lib/async/channel.rb
113
115
  - lib/definitions.yml
114
116
  - lib/grumlin.rb
115
117
  - lib/grumlin/action.rb
118
+ - lib/grumlin/benchmark/repository.rb
116
119
  - lib/grumlin/client.rb
117
120
  - lib/grumlin/edge.rb
121
+ - lib/grumlin/expressions/cardinality.rb
118
122
  - lib/grumlin/expressions/column.rb
119
123
  - lib/grumlin/expressions/expression.rb
120
124
  - lib/grumlin/expressions/operator.rb
@@ -153,10 +157,14 @@ files:
153
157
  - lib/grumlin/typing.rb
154
158
  - lib/grumlin/version.rb
155
159
  - lib/grumlin/vertex.rb
160
+ - lib/tasks/benchmark.rake
156
161
  homepage: https://github.com/zhulik/grumlin
157
162
  licenses:
158
163
  - MIT
159
164
  metadata:
165
+ homepage_uri: https://github.com/zhulik/grumlin
166
+ source_code_uri: https://github.com/zhulik/grumlin
167
+ changelog_uri: https://github.com/zhulik/grumlin/blob/master/CHANGELOG.md
160
168
  rubygems_mfa_required: 'true'
161
169
  post_install_message:
162
170
  rdoc_options: []