rubypitaya 3.18.0 → 3.19.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: 23592096f6cc56554da1958457f9566531bb6d2c58add785cd8cf1eafce29b59
4
- data.tar.gz: b68cdda23917f19691f4177390a819c095c06e2fc950841070f1aafa8f8d58dc
3
+ metadata.gz: 641d9de9003c1bc448ba4305f85fcc19be032c92d57ca2be5404399c5a182f7f
4
+ data.tar.gz: 453fb2b595c049633f65a52e725f3330feec41dafdc2cd8bf9e71863a9755ddf
5
5
  SHA512:
6
- metadata.gz: 21fdee9ed64d6eed14ffd0a3e51bda109fa94a5075112de65a4abb472227a701276a34e6e04fe7a28b2de84909e1e3d02ce1e1fdcbef9b913ac0edc3decb584a
7
- data.tar.gz: 18df23cb8a74fbc9851eb9dc8a17ab5f16f2ed5e5de0b69176fe517709d02cfb4b69274068a491f7c74a7cb1563910bb87ba22f90481a70e0a2fff9815f9b8dd
6
+ metadata.gz: 8f8dbf848550e217108f2478f4a614b12c42a147370131991518383a266f9ca76050d3a00aa8b1eef059b0721236a03a640f34c05b202d7ae4fababace4e33df
7
+ data.tar.gz: d458ef71fbffb2f949e0eff17583c1ef917d1d86dbf3eeef6383278efd52400a20f2cf6b786eba6c436155f7529014cac04f09f20335dcff5e10812e2e871e86
@@ -1,6 +1,6 @@
1
1
  source "https://rubygems.org"
2
2
 
3
- gem 'rubypitaya', '3.18.0'
3
+ gem 'rubypitaya', '3.19.0'
4
4
 
5
5
  group :development do
6
6
  gem 'pry', '0.14.2'
@@ -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.18.0)
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.18.0)
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, id: :uuid do |t|
9
- t.belongs_to :user, type: :uuid, foreing_key: true, index: { unique: true }
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
@@ -21,6 +21,7 @@ database:
21
21
  user: 'postgres'
22
22
  password: 'postgres'
23
23
  name: 'ruby_pitaya'
24
+ pool: 5
24
25
 
25
26
  http:
26
27
  enabled: true
@@ -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 | 00000000-0000-0000-0000-000000000001 |
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": "00000000-0000-0000-0000-000000000001"
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": "00000000-0000-0000-0000-000000000001"
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": "00000000-0000-0000-0000-000000000001"
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, id: :uuid do |t|
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.strip.empty?
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 = ''
@@ -9,6 +9,10 @@ module RubyPitaya
9
9
 
10
10
  module AppSpecHelper
11
11
 
12
+ def self.session
13
+ @@session
14
+ end
15
+
12
16
  def self.initialize_before_suite
13
17
  default_setup = Setup.new.get_config
14
18
  default_config = ConfigCore.new
@@ -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], id: :uuid do |t|
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
@@ -1,3 +1,3 @@
1
1
  module RubyPitaya
2
- VERSION = '3.18.0'
2
+ VERSION = '3.19.0'
3
3
  end
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.18.0
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-04-12 00:00:00.000000000 Z
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.1.0
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.1.0
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.2
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.2
138
+ version: 7.1.3.3
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: google-protobuf
141
141
  requirement: !ruby/object:Gem::Requirement