rubypitaya 3.17.2 → 3.19.0
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 +4 -4
- data/lib/rubypitaya/app-template/Gemfile +5 -5
- data/lib/rubypitaya/app-template/Gemfile.lock +59 -59
- data/lib/rubypitaya/app-template/app/migrations/1606736477_create_player_migration.rb +2 -4
- data/lib/rubypitaya/app-template/app/setup/rubypitaya.yml +1 -0
- data/lib/rubypitaya/app-template/features/player.feature +5 -5
- data/lib/rubypitaya/core/app/migrations/0000000001_create_user_migration.rb +1 -3
- data/lib/rubypitaya/core/nats_connector.rb +4 -4
- data/lib/rubypitaya/core/session.rb +3 -3
- data/lib/rubypitaya/core/spec-helpers/app_spec_helper.rb +4 -0
- data/lib/rubypitaya/core/templates/template_migration.rb.erb +1 -3
- data/lib/rubypitaya/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 641d9de9003c1bc448ba4305f85fcc19be032c92d57ca2be5404399c5a182f7f
|
4
|
+
data.tar.gz: 453fb2b595c049633f65a52e725f3330feec41dafdc2cd8bf9e71863a9755ddf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8f8dbf848550e217108f2478f4a614b12c42a147370131991518383a266f9ca76050d3a00aa8b1eef059b0721236a03a640f34c05b202d7ae4fababace4e33df
|
7
|
+
data.tar.gz: d458ef71fbffb2f949e0eff17583c1ef917d1d86dbf3eeef6383278efd52400a20f2cf6b786eba6c436155f7529014cac04f09f20335dcff5e10812e2e871e86
|
@@ -1,12 +1,12 @@
|
|
1
1
|
source "https://rubygems.org"
|
2
2
|
|
3
|
-
gem 'rubypitaya', '3.
|
3
|
+
gem 'rubypitaya', '3.19.0'
|
4
4
|
|
5
5
|
group :development do
|
6
6
|
gem 'pry', '0.14.2'
|
7
|
-
gem 'rspec', '3.
|
8
|
-
gem 'listen', '3.
|
9
|
-
gem 'bundler', '2.4.
|
10
|
-
gem 'cucumber', '9.
|
7
|
+
gem 'rspec', '3.13.0'
|
8
|
+
gem 'listen', '3.9.0'
|
9
|
+
gem 'bundler', '2.4.19'
|
10
|
+
gem 'cucumber', '9.2.0'
|
11
11
|
gem 'sinatra-contrib', '3.2.0'
|
12
12
|
end
|
@@ -1,13 +1,13 @@
|
|
1
1
|
GEM
|
2
2
|
remote: https://rubygems.org/
|
3
3
|
specs:
|
4
|
-
activemodel (7.1.2)
|
5
|
-
activesupport (= 7.1.2)
|
6
|
-
activerecord (7.1.2)
|
7
|
-
activemodel (= 7.1.2)
|
8
|
-
activesupport (= 7.1.2)
|
4
|
+
activemodel (7.1.3.2)
|
5
|
+
activesupport (= 7.1.3.2)
|
6
|
+
activerecord (7.1.3.2)
|
7
|
+
activemodel (= 7.1.3.2)
|
8
|
+
activesupport (= 7.1.3.2)
|
9
9
|
timeout (>= 0.4.0)
|
10
|
-
activesupport (7.1.2)
|
10
|
+
activesupport (7.1.3.2)
|
11
11
|
base64
|
12
12
|
bigdecimal
|
13
13
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
@@ -18,55 +18,55 @@ GEM
|
|
18
18
|
mutex_m
|
19
19
|
tzinfo (~> 2.0)
|
20
20
|
base64 (0.2.0)
|
21
|
-
bigdecimal (3.1.
|
21
|
+
bigdecimal (3.1.7)
|
22
22
|
builder (3.2.4)
|
23
23
|
coderay (1.1.3)
|
24
24
|
concurrent-ruby (1.2.3)
|
25
25
|
connection_pool (2.4.1)
|
26
|
-
cucumber (9.
|
27
|
-
builder (~> 3.2
|
28
|
-
cucumber-ci-environment (
|
29
|
-
cucumber-core (
|
26
|
+
cucumber (9.2.0)
|
27
|
+
builder (~> 3.2)
|
28
|
+
cucumber-ci-environment (> 9, < 11)
|
29
|
+
cucumber-core (> 13, < 14)
|
30
30
|
cucumber-cucumber-expressions (~> 17.0)
|
31
|
-
cucumber-gherkin (> 24, <
|
31
|
+
cucumber-gherkin (> 24, < 28)
|
32
32
|
cucumber-html-formatter (> 20.3, < 22)
|
33
33
|
cucumber-messages (> 19, < 25)
|
34
34
|
diff-lcs (~> 1.5)
|
35
|
-
mini_mime (~> 1.1
|
36
|
-
multi_test (~> 1.1
|
37
|
-
sys-uname (~> 1.2
|
38
|
-
cucumber-ci-environment (
|
39
|
-
cucumber-core (
|
40
|
-
cucumber-gherkin (>=
|
35
|
+
mini_mime (~> 1.1)
|
36
|
+
multi_test (~> 1.1)
|
37
|
+
sys-uname (~> 1.2)
|
38
|
+
cucumber-ci-environment (10.0.1)
|
39
|
+
cucumber-core (13.0.2)
|
40
|
+
cucumber-gherkin (>= 27, < 28)
|
41
41
|
cucumber-messages (>= 20, < 23)
|
42
|
-
cucumber-tag-expressions (
|
43
|
-
cucumber-cucumber-expressions (17.0
|
44
|
-
|
45
|
-
|
46
|
-
|
42
|
+
cucumber-tag-expressions (> 5, < 7)
|
43
|
+
cucumber-cucumber-expressions (17.1.0)
|
44
|
+
bigdecimal
|
45
|
+
cucumber-gherkin (27.0.0)
|
46
|
+
cucumber-messages (>= 19.1.4, < 23)
|
47
|
+
cucumber-html-formatter (21.3.1)
|
47
48
|
cucumber-messages (> 19, < 25)
|
48
49
|
cucumber-messages (22.0.0)
|
49
|
-
cucumber-tag-expressions (
|
50
|
-
diff-lcs (1.5.
|
51
|
-
drb (2.2.
|
52
|
-
ruby2_keywords
|
50
|
+
cucumber-tag-expressions (6.1.0)
|
51
|
+
diff-lcs (1.5.1)
|
52
|
+
drb (2.2.1)
|
53
53
|
etcdv3 (0.11.6)
|
54
54
|
grpc (~> 1.17)
|
55
55
|
ffi (1.16.3)
|
56
56
|
google-protobuf (3.25.2-x86_64-linux)
|
57
|
-
googleapis-common-protos-types (1.
|
57
|
+
googleapis-common-protos-types (1.14.0)
|
58
58
|
google-protobuf (~> 3.18)
|
59
|
-
grpc (1.
|
59
|
+
grpc (1.62.0-x86_64-linux)
|
60
60
|
google-protobuf (~> 3.25)
|
61
61
|
googleapis-common-protos-types (~> 1.0)
|
62
|
-
i18n (1.14.
|
62
|
+
i18n (1.14.4)
|
63
63
|
concurrent-ruby (~> 1.0)
|
64
|
-
listen (3.
|
64
|
+
listen (3.9.0)
|
65
65
|
rb-fsevent (~> 0.10, >= 0.10.3)
|
66
66
|
rb-inotify (~> 0.9, >= 0.9.10)
|
67
67
|
method_source (1.0.0)
|
68
68
|
mini_mime (1.1.5)
|
69
|
-
minitest (5.
|
69
|
+
minitest (5.22.3)
|
70
70
|
multi_json (1.15.0)
|
71
71
|
multi_test (1.1.0)
|
72
72
|
mustermann (3.0.0)
|
@@ -75,45 +75,45 @@ GEM
|
|
75
75
|
nats-pure (2.4.0)
|
76
76
|
concurrent-ruby (~> 1.0)
|
77
77
|
ostruct (0.6.0)
|
78
|
-
pg (1.5.
|
78
|
+
pg (1.5.6)
|
79
79
|
pry (0.14.2)
|
80
80
|
coderay (~> 1.1)
|
81
81
|
method_source (~> 1.0)
|
82
|
-
rack (2.2.
|
82
|
+
rack (2.2.9)
|
83
83
|
rack-protection (3.2.0)
|
84
84
|
base64 (>= 0.1.0)
|
85
85
|
rack (~> 2.2, >= 2.2.4)
|
86
|
-
rake (13.1
|
86
|
+
rake (13.2.1)
|
87
87
|
rb-fsevent (0.11.2)
|
88
88
|
rb-inotify (0.10.1)
|
89
89
|
ffi (~> 1.0)
|
90
|
-
redis (5.0
|
90
|
+
redis (5.1.0)
|
91
91
|
redis-client (>= 0.17.0)
|
92
|
-
redis-client (0.
|
92
|
+
redis-client (0.22.0)
|
93
93
|
connection_pool
|
94
|
-
rspec (3.
|
95
|
-
rspec-core (~> 3.
|
96
|
-
rspec-expectations (~> 3.
|
97
|
-
rspec-mocks (~> 3.
|
98
|
-
rspec-core (3.
|
99
|
-
rspec-support (~> 3.
|
100
|
-
rspec-expectations (3.
|
94
|
+
rspec (3.13.0)
|
95
|
+
rspec-core (~> 3.13.0)
|
96
|
+
rspec-expectations (~> 3.13.0)
|
97
|
+
rspec-mocks (~> 3.13.0)
|
98
|
+
rspec-core (3.13.0)
|
99
|
+
rspec-support (~> 3.13.0)
|
100
|
+
rspec-expectations (3.13.0)
|
101
101
|
diff-lcs (>= 1.2.0, < 2.0)
|
102
|
-
rspec-support (~> 3.
|
103
|
-
rspec-mocks (3.
|
102
|
+
rspec-support (~> 3.13.0)
|
103
|
+
rspec-mocks (3.13.0)
|
104
104
|
diff-lcs (>= 1.2.0, < 2.0)
|
105
|
-
rspec-support (~> 3.
|
106
|
-
rspec-support (3.
|
105
|
+
rspec-support (~> 3.13.0)
|
106
|
+
rspec-support (3.13.1)
|
107
107
|
ruby2_keywords (0.0.5)
|
108
|
-
rubypitaya (3.
|
109
|
-
activerecord (= 7.1.2)
|
108
|
+
rubypitaya (3.19.0)
|
109
|
+
activerecord (= 7.1.3.2)
|
110
110
|
etcdv3 (= 0.11.6)
|
111
111
|
google-protobuf (= 3.25.2)
|
112
112
|
nats-pure (= 2.4.0)
|
113
113
|
ostruct (= 0.6.0)
|
114
|
-
pg (= 1.5.
|
115
|
-
rake (= 13.1
|
116
|
-
redis (= 5.0
|
114
|
+
pg (= 1.5.6)
|
115
|
+
rake (= 13.2.1)
|
116
|
+
redis (= 5.1.0)
|
117
117
|
sinatra (= 3.2.0)
|
118
118
|
webrick (= 1.8.1)
|
119
119
|
sinatra (3.2.0)
|
@@ -139,13 +139,13 @@ PLATFORMS
|
|
139
139
|
x86_64-linux
|
140
140
|
|
141
141
|
DEPENDENCIES
|
142
|
-
bundler (= 2.4.
|
143
|
-
cucumber (= 9.
|
144
|
-
listen (= 3.
|
142
|
+
bundler (= 2.4.19)
|
143
|
+
cucumber (= 9.2.0)
|
144
|
+
listen (= 3.9.0)
|
145
145
|
pry (= 0.14.2)
|
146
|
-
rspec (= 3.
|
147
|
-
rubypitaya (= 3.
|
146
|
+
rspec (= 3.13.0)
|
147
|
+
rubypitaya (= 3.19.0)
|
148
148
|
sinatra-contrib (= 3.2.0)
|
149
149
|
|
150
150
|
BUNDLED WITH
|
151
|
-
2.4.
|
151
|
+
2.4.19
|
@@ -2,11 +2,9 @@ require 'active_record'
|
|
2
2
|
|
3
3
|
class CreatePlayerMigration < ActiveRecord::Migration[7.0]
|
4
4
|
|
5
|
-
enable_extension 'pgcrypto' unless extension_enabled?('pgcrypto')
|
6
|
-
|
7
5
|
def change
|
8
|
-
create_table :players
|
9
|
-
t.belongs_to :user,
|
6
|
+
create_table :players do |t|
|
7
|
+
t.belongs_to :user, foreing_key: true, index: { unique: true }
|
10
8
|
t.string :name, null: false
|
11
9
|
t.integer :gold, null: false
|
12
10
|
t.timestamps null: false
|
@@ -12,8 +12,8 @@ Feature: Player
|
|
12
12
|
|
13
13
|
Scenario: Get player info
|
14
14
|
Given the following Player
|
15
|
-
| name | gold | user_id
|
16
|
-
| Someone | 15 |
|
15
|
+
| name | gold | user_id |
|
16
|
+
| Someone | 15 | 1 |
|
17
17
|
And the Player 'Someone' is authenticated
|
18
18
|
When the client calls the route 'rubypitaya.playerHandler.getInfo'
|
19
19
|
Then the server response should be the following json
|
@@ -23,7 +23,7 @@ Feature: Player
|
|
23
23
|
"data": {
|
24
24
|
"name": "Someone",
|
25
25
|
"gold": 15,
|
26
|
-
"userId":
|
26
|
+
"userId": 1
|
27
27
|
}
|
28
28
|
}
|
29
29
|
"""
|
@@ -32,7 +32,7 @@ Feature: Player
|
|
32
32
|
{
|
33
33
|
"name": "Someone",
|
34
34
|
"gold": 15,
|
35
|
-
"userId":
|
35
|
+
"userId": 1
|
36
36
|
}
|
37
37
|
"""
|
38
38
|
And the server response should contains the following json
|
@@ -40,7 +40,7 @@ Feature: Player
|
|
40
40
|
{
|
41
41
|
"data": {
|
42
42
|
"gold": 15,
|
43
|
-
"userId":
|
43
|
+
"userId": 1
|
44
44
|
}
|
45
45
|
}
|
46
46
|
"""
|
@@ -2,10 +2,8 @@ require 'active_record'
|
|
2
2
|
|
3
3
|
class CreateUserMigration < ActiveRecord::Migration[6.1]
|
4
4
|
|
5
|
-
enable_extension 'pgcrypto' unless extension_enabled?('pgcrypto')
|
6
|
-
|
7
5
|
def change
|
8
|
-
create_table :users
|
6
|
+
create_table :users do |t|
|
9
7
|
t.timestamps
|
10
8
|
end
|
11
9
|
end
|
@@ -65,15 +65,15 @@ module RubyPitaya
|
|
65
65
|
end
|
66
66
|
|
67
67
|
def disconnect
|
68
|
-
@subscribe.unsubscribe unless @subscribe.nil?
|
69
|
-
@nats.close unless @nats.nil?
|
70
68
|
@threads.map(&:kill) unless @threads.nil?
|
71
69
|
@queue.close unless @queue.nil?
|
70
|
+
@subscribe.unsubscribe unless @subscribe.nil?
|
71
|
+
@nats.close unless @nats.nil?
|
72
72
|
|
73
|
+
@threads = nil
|
74
|
+
@queue = nil
|
73
75
|
@subscribe = nil
|
74
76
|
@nats = nil
|
75
|
-
@queue = nil
|
76
|
-
@threads = nil
|
77
77
|
end
|
78
78
|
|
79
79
|
def push_to_frontend(session, message_route, payload)
|
@@ -8,7 +8,7 @@ module RubyPitaya
|
|
8
8
|
|
9
9
|
def initialize
|
10
10
|
@id = ''
|
11
|
-
@uid =
|
11
|
+
@uid = nil
|
12
12
|
@data = {}
|
13
13
|
@metadata = {}
|
14
14
|
@frontend_id = ''
|
@@ -23,7 +23,7 @@ module RubyPitaya
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def authenticated?
|
26
|
-
!@uid.
|
26
|
+
!@uid.nil?
|
27
27
|
end
|
28
28
|
|
29
29
|
def user_id
|
@@ -36,7 +36,7 @@ module RubyPitaya
|
|
36
36
|
|
37
37
|
def clear
|
38
38
|
@id = ''
|
39
|
-
@uid =
|
39
|
+
@uid = nil
|
40
40
|
@data = {}
|
41
41
|
@metadata = {}
|
42
42
|
@frontend_id = ''
|
@@ -2,12 +2,10 @@ require 'active_record'
|
|
2
2
|
|
3
3
|
class <%= class_name %> < ActiveRecord::Migration[7.0]
|
4
4
|
|
5
|
-
enable_extension 'pgcrypto' unless extension_enabled?('pgcrypto')
|
6
|
-
|
7
5
|
# Migration suported types reference: https://guides.rubyonrails.org/v3.2/migrations.html#supported-types
|
8
6
|
|
9
7
|
def change
|
10
|
-
create_table :[table-name-here-in-plural]
|
8
|
+
create_table :[table-name-here-in-plural] do |t|
|
11
9
|
# t.belongs_to :user, type: :uuid, foreing_key: true
|
12
10
|
# t.belongs_to :user, type: :uuid, foreing_key: true, index: { unique: true }
|
13
11
|
t.timestamps null: false
|
data/lib/rubypitaya/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubypitaya
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.19.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Luciano Prestes Cavalcanti
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-06-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pg
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - '='
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 5.
|
47
|
+
version: 5.2.0
|
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: 5.
|
54
|
+
version: 5.2.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: etcdv3
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -128,14 +128,14 @@ dependencies:
|
|
128
128
|
requirements:
|
129
129
|
- - '='
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: 7.1.3.
|
131
|
+
version: 7.1.3.3
|
132
132
|
type: :runtime
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - '='
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: 7.1.3.
|
138
|
+
version: 7.1.3.3
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: google-protobuf
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|