rubypitaya 3.18.0 → 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 +1 -1
- data/lib/rubypitaya/app-template/Gemfile.lock +2 -2
- 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
|
@@ -105,7 +105,7 @@ GEM
|
|
105
105
|
rspec-support (~> 3.13.0)
|
106
106
|
rspec-support (3.13.1)
|
107
107
|
ruby2_keywords (0.0.5)
|
108
|
-
rubypitaya (3.
|
108
|
+
rubypitaya (3.19.0)
|
109
109
|
activerecord (= 7.1.3.2)
|
110
110
|
etcdv3 (= 0.11.6)
|
111
111
|
google-protobuf (= 3.25.2)
|
@@ -144,7 +144,7 @@ DEPENDENCIES
|
|
144
144
|
listen (= 3.9.0)
|
145
145
|
pry (= 0.14.2)
|
146
146
|
rspec (= 3.13.0)
|
147
|
-
rubypitaya (= 3.
|
147
|
+
rubypitaya (= 3.19.0)
|
148
148
|
sinatra-contrib (= 3.2.0)
|
149
149
|
|
150
150
|
BUNDLED WITH
|
@@ -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
|