grumlin 0.1.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -10,11 +10,11 @@ module Grumlin
10
10
  end
11
11
 
12
12
  def ==(other)
13
- @label == other.label && @id == other.id
13
+ self.class == other.class && @label == other.label && @id == other.id
14
14
  end
15
15
 
16
16
  def inspect
17
- "<V #{@label}(#{@id})>"
17
+ "v[#{@id}]"
18
18
  end
19
19
  alias to_s inspect
20
20
  end
metadata CHANGED
@@ -1,30 +1,44 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grumlin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gleb Sinyavskiy
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-27 00:00:00.000000000 Z
11
+ date: 2021-07-29 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: async-pool
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0.3'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '0.3'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: async-websocket
15
29
  requirement: !ruby/object:Gem::Requirement
16
30
  requirements:
17
31
  - - "~>"
18
32
  - !ruby/object:Gem::Version
19
- version: '0.18'
33
+ version: '0.19'
20
34
  type: :runtime
21
35
  prerelease: false
22
36
  version_requirements: !ruby/object:Gem::Requirement
23
37
  requirements:
24
38
  - - "~>"
25
39
  - !ruby/object:Gem::Version
26
- version: '0.18'
27
- description: A ruby client for Gremlin query language.
40
+ version: '0.19'
41
+ description: Gremlin query language DSL for Ruby.
28
42
  email:
29
43
  - zhulik.gleb@gmail.com
30
44
  executables: []
@@ -33,6 +47,7 @@ extra_rdoc_files: []
33
47
  files:
34
48
  - ".github/workflows/main.yml"
35
49
  - ".gitignore"
50
+ - ".overcommit.yml"
36
51
  - ".rspec"
37
52
  - ".rubocop.yml"
38
53
  - CHANGELOG.md
@@ -41,20 +56,33 @@ files:
41
56
  - Gemfile.lock
42
57
  - LICENSE.txt
43
58
  - README.md
44
- - Rakefile
45
59
  - bin/console
46
60
  - bin/setup
47
- - bin/stress
61
+ - docker-compose.yml
62
+ - gremlin_server/Dockerfile
63
+ - gremlin_server/tinkergraph-empty.properties
48
64
  - grumlin.gemspec
49
65
  - lib/grumlin.rb
66
+ - lib/grumlin/anonymous_step.rb
50
67
  - lib/grumlin/client.rb
51
68
  - lib/grumlin/edge.rb
52
69
  - lib/grumlin/exceptions.rb
70
+ - lib/grumlin/order.rb
71
+ - lib/grumlin/p.rb
72
+ - lib/grumlin/path.rb
73
+ - lib/grumlin/pop.rb
74
+ - lib/grumlin/request_dispatcher.rb
53
75
  - lib/grumlin/step.rb
76
+ - lib/grumlin/sugar.rb
77
+ - lib/grumlin/t.rb
78
+ - lib/grumlin/test/rspec.rb
79
+ - lib/grumlin/test/rspec/db_cleaner_context.rb
80
+ - lib/grumlin/test/rspec/gremlin_context.rb
54
81
  - lib/grumlin/translator.rb
82
+ - lib/grumlin/transport.rb
55
83
  - lib/grumlin/traversal.rb
56
- - lib/grumlin/traversing_context.rb
57
84
  - lib/grumlin/typing.rb
85
+ - lib/grumlin/u.rb
58
86
  - lib/grumlin/version.rb
59
87
  - lib/grumlin/vertex.rb
60
88
  homepage: https://github.com/zhulik/grumlin
@@ -64,7 +92,7 @@ metadata:
64
92
  homepage_uri: https://github.com/zhulik/grumlin
65
93
  source_code_uri: https://github.com/zhulik/grumlin
66
94
  changelog_uri: https://github.com/zhulik/grumlin/blob/master/CHANGELOG.md
67
- post_install_message:
95
+ post_install_message:
68
96
  rdoc_options: []
69
97
  require_paths:
70
98
  - lib
@@ -79,8 +107,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
79
107
  - !ruby/object:Gem::Version
80
108
  version: '0'
81
109
  requirements: []
82
- rubygems_version: 3.2.15
83
- signing_key:
110
+ rubygems_version: 3.2.22
111
+ signing_key:
84
112
  specification_version: 4
85
- summary: A ruby client for Gremlin query language.
113
+ summary: Gremlin query language DSL for Ruby.
86
114
  test_files: []
data/Rakefile DELETED
@@ -1,12 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "bundler/gem_tasks"
4
- require "rspec/core/rake_task"
5
-
6
- RSpec::Core::RakeTask.new(:spec)
7
-
8
- require "rubocop/rake_task"
9
-
10
- RuboCop::RakeTask.new
11
-
12
- task default: %i[spec rubocop]
data/bin/stress DELETED
@@ -1,51 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- require "bundler/setup"
5
- require "grumlin"
6
- require "irb"
7
-
8
- def queries(client, uuids)
9
- total = 0
10
- g = Grumlin::Traversal.new(client)
11
-
12
- loop do
13
- uuid = uuids.sample
14
- result = g.V(uuid).toList[0]
15
- raise "!!!" if result.id != uuid
16
-
17
- total += 1
18
- end
19
- rescue Async::Stop
20
- total
21
- end
22
-
23
- def prepare_dataset(client)
24
- uuids = Array.new(1000) { SecureRandom.uuid }
25
-
26
- Grumlin::Traversal.new(client) do
27
- g.V().drop
28
-
29
- uuids.each do |uuid|
30
- g.addV("test_vertex").property(id, uuid).toList
31
- end
32
- end
33
-
34
- uuids
35
- end
36
-
37
- Async do |task|
38
- client = Grumlin::Client.new("ws://localhost:8182/gremlin", mode: :bytecode)
39
-
40
- uuids = prepare_dataset(client)
41
- tasks = Array.new(20) { task.async { queries(client, uuids) } }
42
-
43
- task.sleep(60)
44
-
45
- tasks.each(&:stop)
46
- total = tasks.sum(&:wait)
47
-
48
- p("#{total} requests performed")
49
- ensure
50
- client.disconnect
51
- end
@@ -1,17 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Grumlin
4
- class TraversingContext
5
- ID = { :@type => "g:T", :@value => "id" }.freeze
6
-
7
- attr_reader :g
8
-
9
- def initialize(traversal)
10
- @g = traversal
11
- end
12
-
13
- def id
14
- ID
15
- end
16
- end
17
- end