rubypitaya 3.11.0 → 3.12.1

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: bad9c41d62bb4942b96dfff5b40dc4ae4ca1d8eba3ee2707721bdf59739c0182
4
- data.tar.gz: da92de658a771d3a37008412964e3f5d976fab512c804de1147bfc6afdc5208d
3
+ metadata.gz: f393f312709ff7f2e14731c7d12a194418c450e2555da41aa9d5f5849a647d45
4
+ data.tar.gz: afb5740c22fe9a4a9a6ae7dbbb9822750c53bc2e778b70d823c4e2511b66e142
5
5
  SHA512:
6
- metadata.gz: a635d4835b2d1115615a586c96062437ec81c216c617c92284a863fc7859fce75c0e3b537b34c11f2a2e05460f464698122cc6c7916038ec39cc9c8166725797
7
- data.tar.gz: 952703d5f8b7febd62567805ae45ae3bc26e9a06dc8fbcaa1494a205478d277b062b92c7a4f773ca4baecff0a2fced207d41e4f1cbc28e80af5778ea09dd34be
6
+ metadata.gz: 88191d52e0d1f86e37dba77223fe4b20e973d2b85cfc49743524c75c7971b4752771d5b84691647d66175e96d1f701df721e1f54e4285316a0dd4d91c36547b2
7
+ data.tar.gz: 245bba9103786e02b4ef4a489df8d4f813a559c64ddca25bfabc782b5f6df1f7bd063920fde8625112bb3a20c43b6c8885a4a3e51e8aeb3e3fdc3d1962c85c3e
@@ -1,12 +1,12 @@
1
1
  source "https://rubygems.org"
2
2
 
3
- gem 'rubypitaya', '3.11.0'
3
+ gem 'rubypitaya', '3.12.1'
4
4
 
5
5
  group :development do
6
- gem 'pry', '0.14.1'
7
- gem 'rspec', '3.11.0'
8
- gem 'listen', '3.7.1'
9
- gem 'bundler', '2.2.32'
10
- gem 'cucumber', '7.1.0'
11
- gem 'sinatra-contrib', '2.1.0'
6
+ gem 'pry', '0.14.2'
7
+ gem 'rspec', '3.12.0'
8
+ gem 'listen', '3.8.0'
9
+ gem 'bundler', '2.3.26'
10
+ gem 'cucumber', '8.0.0'
11
+ gem 'sinatra-contrib', '3.0.5'
12
12
  end
@@ -1,127 +1,125 @@
1
1
  GEM
2
2
  remote: https://rubygems.org/
3
3
  specs:
4
- activemodel (7.0.2)
5
- activesupport (= 7.0.2)
6
- activerecord (7.0.2)
7
- activemodel (= 7.0.2)
8
- activesupport (= 7.0.2)
9
- activesupport (7.0.2)
4
+ activemodel (7.0.4)
5
+ activesupport (= 7.0.4)
6
+ activerecord (7.0.4)
7
+ activemodel (= 7.0.4)
8
+ activesupport (= 7.0.4)
9
+ activesupport (7.0.4)
10
10
  concurrent-ruby (~> 1.0, >= 1.0.2)
11
11
  i18n (>= 1.6, < 2)
12
12
  minitest (>= 5.1)
13
13
  tzinfo (~> 2.0)
14
14
  builder (3.2.4)
15
15
  coderay (1.1.3)
16
- concurrent-ruby (1.1.9)
17
- cucumber (7.1.0)
16
+ concurrent-ruby (1.1.10)
17
+ connection_pool (2.3.0)
18
+ cucumber (8.0.0)
18
19
  builder (~> 3.2, >= 3.2.4)
19
- cucumber-core (~> 10.1, >= 10.1.0)
20
- cucumber-create-meta (~> 6.0, >= 6.0.1)
21
- cucumber-cucumber-expressions (~> 14.0, >= 14.0.0)
22
- cucumber-gherkin (~> 22.0, >= 22.0.0)
23
- cucumber-html-formatter (~> 17.0, >= 17.0.0)
24
- cucumber-messages (~> 17.1, >= 17.1.1)
25
- cucumber-wire (~> 6.2, >= 6.2.0)
26
- diff-lcs (~> 1.4, >= 1.4.4)
27
- mime-types (~> 3.3, >= 3.3.1)
28
- multi_test (~> 0.1, >= 0.1.2)
20
+ cucumber-ci-environment (~> 9.0, >= 9.0.4)
21
+ cucumber-core (~> 11.0, >= 11.0.0)
22
+ cucumber-cucumber-expressions (~> 15.1, >= 15.1.1)
23
+ cucumber-gherkin (~> 23.0, >= 23.0.1)
24
+ cucumber-html-formatter (~> 19.1, >= 19.1.0)
25
+ cucumber-messages (~> 18.0, >= 18.0.0)
26
+ diff-lcs (~> 1.5, >= 1.5.0)
27
+ mime-types (~> 3.4, >= 3.4.1)
28
+ multi_test (~> 1.1, >= 1.1.0)
29
29
  sys-uname (~> 1.2, >= 1.2.2)
30
- cucumber-core (10.1.1)
31
- cucumber-gherkin (~> 22.0, >= 22.0.0)
32
- cucumber-messages (~> 17.1, >= 17.1.1)
30
+ cucumber-ci-environment (9.1.0)
31
+ cucumber-core (11.0.0)
32
+ cucumber-gherkin (~> 23.0, >= 23.0.1)
33
+ cucumber-messages (~> 18.0, >= 18.0.0)
33
34
  cucumber-tag-expressions (~> 4.1, >= 4.1.0)
34
- cucumber-create-meta (6.0.4)
35
- cucumber-messages (~> 17.1, >= 17.1.1)
36
- sys-uname (~> 1.2, >= 1.2.2)
37
- cucumber-cucumber-expressions (14.0.0)
38
- cucumber-gherkin (22.0.0)
39
- cucumber-messages (~> 17.1, >= 17.1.1)
40
- cucumber-html-formatter (17.0.0)
41
- cucumber-messages (~> 17.1, >= 17.1.0)
42
- cucumber-messages (17.1.1)
35
+ cucumber-cucumber-expressions (15.2.0)
36
+ cucumber-gherkin (23.0.1)
37
+ cucumber-messages (~> 18.0, >= 18.0.0)
38
+ cucumber-html-formatter (19.2.0)
39
+ cucumber-messages (~> 18.0, >= 18.0.0)
40
+ cucumber-messages (18.0.0)
43
41
  cucumber-tag-expressions (4.1.0)
44
- cucumber-wire (6.2.1)
45
- cucumber-core (~> 10.1, >= 10.1.0)
46
- cucumber-cucumber-expressions (~> 14.0, >= 14.0.0)
47
42
  diff-lcs (1.5.0)
48
43
  etcdv3 (0.11.5)
49
44
  grpc (~> 1.17)
50
45
  ffi (1.15.5)
51
- google-protobuf (3.19.4-x86_64-linux)
52
- googleapis-common-protos-types (1.3.0)
46
+ google-protobuf (3.21.12-x86_64-linux)
47
+ googleapis-common-protos-types (1.5.0)
53
48
  google-protobuf (~> 3.14)
54
- grpc (1.43.1-x86_64-linux)
55
- google-protobuf (~> 3.18)
49
+ grpc (1.50.0-x86_64-linux)
50
+ google-protobuf (~> 3.21)
56
51
  googleapis-common-protos-types (~> 1.0)
57
- i18n (1.9.1)
52
+ i18n (1.12.0)
58
53
  concurrent-ruby (~> 1.0)
59
- listen (3.7.1)
54
+ listen (3.8.0)
60
55
  rb-fsevent (~> 0.10, >= 0.10.3)
61
56
  rb-inotify (~> 0.9, >= 0.9.10)
62
57
  method_source (1.0.0)
63
58
  mime-types (3.4.1)
64
59
  mime-types-data (~> 3.2015)
65
60
  mime-types-data (3.2022.0105)
66
- minitest (5.15.0)
61
+ minitest (5.17.0)
67
62
  multi_json (1.15.0)
68
- multi_test (0.1.2)
69
- mustermann (1.1.1)
63
+ multi_test (1.1.0)
64
+ mustermann (3.0.0)
70
65
  ruby2_keywords (~> 0.0.1)
71
- nats-pure (2.0.0)
72
- ostruct (0.5.3)
73
- pg (1.3.1)
74
- pry (0.14.1)
66
+ nats-pure (2.2.1)
67
+ ostruct (0.5.5)
68
+ pg (1.4.5)
69
+ pry (0.14.2)
75
70
  coderay (~> 1.1)
76
71
  method_source (~> 1.0)
77
- rack (2.2.3)
78
- rack-protection (2.1.0)
72
+ rack (2.2.5)
73
+ rack-protection (3.0.5)
79
74
  rack
80
75
  rake (13.0.6)
81
- rb-fsevent (0.11.1)
76
+ rb-fsevent (0.11.2)
82
77
  rb-inotify (0.10.1)
83
78
  ffi (~> 1.0)
84
- redis (4.6.0)
85
- rspec (3.11.0)
86
- rspec-core (~> 3.11.0)
87
- rspec-expectations (~> 3.11.0)
88
- rspec-mocks (~> 3.11.0)
89
- rspec-core (3.11.0)
90
- rspec-support (~> 3.11.0)
91
- rspec-expectations (3.11.0)
79
+ redis (5.0.5)
80
+ redis-client (>= 0.9.0)
81
+ redis-client (0.12.0)
82
+ connection_pool
83
+ rspec (3.12.0)
84
+ rspec-core (~> 3.12.0)
85
+ rspec-expectations (~> 3.12.0)
86
+ rspec-mocks (~> 3.12.0)
87
+ rspec-core (3.12.0)
88
+ rspec-support (~> 3.12.0)
89
+ rspec-expectations (3.12.2)
92
90
  diff-lcs (>= 1.2.0, < 2.0)
93
- rspec-support (~> 3.11.0)
94
- rspec-mocks (3.11.0)
91
+ rspec-support (~> 3.12.0)
92
+ rspec-mocks (3.12.2)
95
93
  diff-lcs (>= 1.2.0, < 2.0)
96
- rspec-support (~> 3.11.0)
97
- rspec-support (3.11.0)
94
+ rspec-support (~> 3.12.0)
95
+ rspec-support (3.12.0)
98
96
  ruby2_keywords (0.0.5)
99
- rubypitaya (3.11.0)
100
- activerecord (= 7.0.2)
97
+ rubypitaya (3.12.1)
98
+ activerecord (= 7.0.4)
101
99
  etcdv3 (= 0.11.5)
102
- google-protobuf (= 3.19.4)
103
- nats-pure (= 2.0.0)
104
- ostruct (= 0.5.3)
105
- pg (= 1.3.1)
100
+ google-protobuf (= 3.21.12)
101
+ nats-pure (= 2.2.1)
102
+ ostruct (= 0.5.5)
103
+ pg (= 1.4.5)
106
104
  rake (= 13.0.6)
107
- redis (= 4.6.0)
108
- sinatra (= 2.1.0)
105
+ redis (= 5.0.5)
106
+ sinatra (= 3.0.5)
109
107
  webrick (= 1.7.0)
110
- sinatra (2.1.0)
111
- mustermann (~> 1.0)
112
- rack (~> 2.2)
113
- rack-protection (= 2.1.0)
108
+ sinatra (3.0.5)
109
+ mustermann (~> 3.0)
110
+ rack (~> 2.2, >= 2.2.4)
111
+ rack-protection (= 3.0.5)
114
112
  tilt (~> 2.0)
115
- sinatra-contrib (2.1.0)
113
+ sinatra-contrib (3.0.5)
116
114
  multi_json
117
- mustermann (~> 1.0)
118
- rack-protection (= 2.1.0)
119
- sinatra (= 2.1.0)
115
+ mustermann (~> 3.0)
116
+ rack-protection (= 3.0.5)
117
+ sinatra (= 3.0.5)
120
118
  tilt (~> 2.0)
121
119
  sys-uname (1.2.2)
122
120
  ffi (~> 1.1)
123
- tilt (2.0.10)
124
- tzinfo (2.0.4)
121
+ tilt (2.0.11)
122
+ tzinfo (2.0.5)
125
123
  concurrent-ruby (~> 1.0)
126
124
  webrick (1.7.0)
127
125
 
@@ -129,13 +127,13 @@ PLATFORMS
129
127
  x86_64-linux
130
128
 
131
129
  DEPENDENCIES
132
- bundler (= 2.2.32)
133
- cucumber (= 7.1.0)
134
- listen (= 3.7.1)
135
- pry (= 0.14.1)
136
- rspec (= 3.11.0)
137
- rubypitaya (= 3.11.0)
138
- sinatra-contrib (= 2.1.0)
130
+ bundler (= 2.3.26)
131
+ cucumber (= 8.0.0)
132
+ listen (= 3.8.0)
133
+ pry (= 0.14.2)
134
+ rspec (= 3.12.0)
135
+ rubypitaya (= 3.12.1)
136
+ sinatra-contrib (= 3.0.5)
139
137
 
140
138
  BUNDLED WITH
141
- 2.2.32
139
+ 2.3.26
@@ -52,7 +52,7 @@ setup-test: clear
52
52
  ## Update gems dependencies on Gemfile.lock
53
53
  update-dependencies:
54
54
  @rm -f Gemfile.lock
55
- @docker run --rm -v "$(PWD)":/usr/src/app -w /usr/src/app ruby:3.0.3 bundle install
55
+ @docker run --rm -v "$(PWD)":/usr/src/app -w /usr/src/app ruby:3.1.3 bundle install
56
56
 
57
57
  ## + Improve metagame
58
58
 
@@ -2,7 +2,7 @@ require 'active_record'
2
2
 
3
3
  class CreatePlayerMigration < ActiveRecord::Migration[7.0]
4
4
 
5
- enable_extension 'pgcrypto'
5
+ enable_extension 'pgcrypto' unless extension_enabled?('pgcrypto')
6
6
 
7
7
  def change
8
8
  create_table :players, id: :uuid do |t|
@@ -1,4 +1,4 @@
1
- FROM ruby:3.0.3-slim
1
+ FROM ruby:3.1.3-slim
2
2
 
3
3
  ENV LANG=C.UTF-8
4
4
  ENV LC_ALL=C.UTF-8
@@ -1,7 +1,7 @@
1
- FROM ruby:3.0.3-slim as builder
1
+ FROM ruby:3.1.3-slim as builder
2
2
 
3
- RUN apt update && \
4
- apt install -y --no-install-recommends \
3
+ RUN apt update && \
4
+ apt install -y --no-install-recommends \
5
5
  curl \
6
6
  libpq-dev \
7
7
  build-essential \
@@ -28,13 +28,13 @@ RUN rm -rf /usr/local/bundle/cache && \
28
28
 
29
29
  # RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
30
30
 
31
- FROM ruby:3.0.3-slim
31
+ FROM ruby:3.1.3-slim
32
32
 
33
33
  ENV LANG=C.UTF-8
34
34
  ENV LC_ALL=C.UTF-8
35
35
 
36
- RUN apt update && \
37
- apt install -y --no-install-recommends \
36
+ RUN apt update && \
37
+ apt install -y --no-install-recommends \
38
38
  netcat \
39
39
  libpq5 \
40
40
  && rm -rf /var/lib/apt/lists/*
@@ -3,25 +3,25 @@ Feature: Hello World
3
3
  As a developer I want to see the hello world messages
4
4
 
5
5
  Scenario: Hello World message
6
- Given client call route 'rubypitaya.helloWorldHandler.sayHello'
7
- Then server should response 'code' as 'RP-200'
8
- And server should response 'data.message' as 'Hello!'
6
+ Given the client calls the route 'rubypitaya.helloWorldHandler.sayHello'
7
+ Then the server response 'code' should be 'RP-200'
8
+ And the server response 'data.message' should be 'Hello!'
9
9
 
10
10
  Scenario: Custom message
11
- When client call route 'rubypitaya.helloWorldHandler.showMessage' with params:
11
+ Given the client calls the route 'rubypitaya.helloWorldHandler.showMessage' with params
12
12
  | message |
13
13
  | Hello World! |
14
- Then server should response 'code' as 'RP-200'
15
- And server should response 'data.message' as 'Hello World!'
14
+ Then the server response 'code' should be 'RP-200'
15
+ And the server response 'data.message' should be 'Hello World!'
16
16
 
17
17
  Scenario: Custom message with json
18
- When client call route 'rubypitaya.helloWorldHandler.showMessage' with json params:
18
+ Given the client calls the route 'rubypitaya.helloWorldHandler.showMessage' with json
19
19
  """
20
20
  {
21
21
  "message": "Hello World!"
22
22
  }
23
23
  """
24
- Then server should response the following json:
24
+ Then the server response should be the following json
25
25
  """
26
26
  {
27
27
  "code": "RP-200",
@@ -3,20 +3,20 @@ Feature: Player
3
3
  As a game player I want to have a player on database
4
4
 
5
5
  Scenario: Create new player
6
- Given config key 'initial_player.wallet.gold' is '10'
7
- And config key 'initial_player.name' is 'Guest'
8
- When client call route 'rubypitaya.playerHandler.authenticate'
9
- Then server should response 'code' as 'RP-200'
10
- And server should response 'data.name' as 'Guest'
11
- And server should response 'data.gold' as '10'
6
+ Given the config key 'initial_player.wallet.gold' is '10'
7
+ And the config key 'initial_player.name' is 'Guest'
8
+ When the client calls the route 'rubypitaya.playerHandler.authenticate'
9
+ Then the server response 'code' should be 'RP-200'
10
+ And the server response 'data.name' should be 'Guest'
11
+ And the server response 'data.gold' should be '10'
12
12
 
13
13
  Scenario: Get player info
14
- Given the following player:
14
+ Given the following Player
15
15
  | name | gold | user_id |
16
16
  | Someone | 15 | 00000000-0000-0000-0000-000000000001 |
17
- And the player 'Someone' is authenticated
18
- When client call route 'rubypitaya.playerHandler.getInfo'
19
- Then server should response the following json:
17
+ And the Player 'Someone' is authenticated
18
+ When the client calls the route 'rubypitaya.playerHandler.getInfo'
19
+ Then the server response should be the following json
20
20
  """
21
21
  {
22
22
  "code": "RP-200",
@@ -27,3 +27,20 @@ Feature: Player
27
27
  }
28
28
  }
29
29
  """
30
+ And the server response 'data' should be the following json
31
+ """
32
+ {
33
+ "name": "Someone",
34
+ "gold": 15,
35
+ "userId": "00000000-0000-0000-0000-000000000001"
36
+ }
37
+ """
38
+ And the server response should contains the following json
39
+ """
40
+ {
41
+ "data": {
42
+ "gold": 15,
43
+ "userId": "00000000-0000-0000-0000-000000000001"
44
+ }
45
+ }
46
+ """
@@ -1,12 +1,12 @@
1
- Given(/^[Tt]he [Pp]layer ["'](.+)["'] is authenticated$/) do |player_name|
2
- player = Player.find_by_name(player_name)
3
- @app_helper.authenticate(player.user_id)
4
- end
5
-
6
- Given(/^[Tt]he following [Pp]layer[s]*[:]*$/) do |table|
1
+ Given(/^the following Player[s]?$/) do |table|
7
2
  player_hashes = table.hashes
8
3
  player_hashes.each do |player_hash|
9
4
  player_hash[:user] = User.new(id: player_hash[:user_id])
10
5
  Player.create(player_hash)
11
6
  end
12
7
  end
8
+
9
+ Given(/^the Player ["'](.+)["'] is authenticated$/) do |player_name|
10
+ player = Player.find_by_name(player_name)
11
+ @app_helper.authenticate(player.user_id)
12
+ end
@@ -1,63 +1,73 @@
1
- Given(/^[Cc]lient call route ["'](.+)["']$/) do |route|
2
- @app_helper.request(route)
1
+ Given(/^the following User[s]?$/) do |table|
2
+ table.hashes.each do |table_hash|
3
+ User.create(id: table_hash[:user_id])
4
+ end
3
5
  end
4
6
 
5
- Given(/^[Cc]lient call route ["'](.+)["'] with param[s]*[:]*$/) do |route, table|
6
- params = table.hashes.first.symbolize_keys
7
- @app_helper.request(route, params)
7
+ Given(/^the User ["'](.+)["'] is authenticated$/) do |user_id|
8
+ @app_helper.authenticate(user_id)
8
9
  end
9
10
 
10
- Given(/^[Cc]lient call route ["'](.+)["'] with json param[s]*[:]*$/) do |route, json|
11
- params = JSON.parse(json, symbolize_names: true)
12
- @app_helper.request(route, params)
11
+ Given(/^the setup key ["'](.+)["'] is ["'](.+)["']$/) do |key, value|
12
+ @app_helper.add_setup(key, value)
13
13
  end
14
14
 
15
- Given(/^[Ss]erver should response ["'](.+)["'] as ["'](.+)["']$/) do |response_key, expected_value|
16
- response_value = @app_helper.response.dig(*response_key.split('.').map(&:to_sym))
17
-
18
- expect(response_value.to_s).to eq(expected_value)
15
+ Given(/^the config key ["'](.+)["'] is ["'](.+)["']$/) do |key, value|
16
+ @app_helper.add_config(key, value)
19
17
  end
20
18
 
21
- Given(/^[Ss]erver should response the following json[:]*$/) do |expected_json|
22
- expected_json = JSON.generate(JSON.parse(expected_json.strip))
23
- response_json = JSON.generate(@app_helper.response)
19
+ Given(/^the config is the following json*$/) do |config_json|
20
+ config = JSON.parse(config_json)
21
+ @app_helper.set_config(config)
22
+ end
24
23
 
25
- puts JSON.pretty_generate(@app_helper.response) if expected_json != response_json
24
+ Given(/^(?:now\s)?today is ["'](.+)["']$/) do |date_text|
25
+ time_now = date_text.to_time
26
26
 
27
- expect(response_json).to eq(expected_json)
27
+ Time.stub(:now).and_return(time_now)
28
28
  end
29
29
 
30
- Given(/^[Ss]etup key ["'](.+)["'] is ["'](.+)["']$/) do |key, value|
31
- @app_helper.add_setup(key, value)
30
+ When(/^the client calls the route ["'](.+)["']$/) do |route|
31
+ @app_helper.request(route)
32
32
  end
33
33
 
34
- Given(/^[Cc]onfig key ["'](.+)["'] is ["'](.+)["']$/) do |key, value|
35
- @app_helper.add_config(key, value)
34
+ When(/^the client calls the route ["'](.+)["'] with params$/) do |route, table|
35
+ params = table.hashes.first.symbolize_keys
36
+ @app_helper.request(route, params)
36
37
  end
37
38
 
38
- Given(/^[Cc]onfig is the following json[:]*$/) do |config_json|
39
- config = JSON.parse(config_json)
40
- @app_helper.set_config(config)
39
+ When(/^the client calls the route ["'](.+)["'] with json$/) do |route, json|
40
+ params = JSON.parse(json, symbolize_names: true)
41
+ @app_helper.request(route, params)
41
42
  end
42
43
 
43
- Given(/^[Pp]rint server response$/) do
44
- puts "response: #{@app_helper.response}"
44
+ Then(/^the server response ["'](.+)["'] should be ["'](.+)["']$/) do |response_key, expected_value|
45
+ response_value = @app_helper.response.dig(*response_key.split('.').map(&:to_sym))
46
+
47
+ expect(response_value.to_s).to eq(expected_value)
45
48
  end
46
49
 
47
- Given(/^(?:[Nn]ow\s)?[Tt]oday is ["'](.+)["']$/) do |date_text|
48
- time_now = date_text.to_time
50
+ Then(/^the server response(?: ["'](.+)["'])? should be the following json$/) do |response_key, expected_json_text|
51
+ response_json = @app_helper.response
52
+ response_json = @app_helper.response.dig(*response_key.split('.').map(&:to_sym)) unless response_key.blank?
49
53
 
50
- Time.stub(:now).and_return(time_now)
54
+ expected_json = JSON.parse(expected_json_text.strip, symbolize_names: true)
55
+
56
+ expect(response_json).to eq(expected_json)
51
57
  end
52
58
 
53
- Given(/^[Tt]he [Uu]ser ["'](.+)["'] is authenticated$/) do |user_id|
54
- @app_helper.authenticate(user_id)
59
+ Then(/^the server response(?: ["'](.+)["'])? should contains the following json[:]?$/) do |response_key, expected_json_text|
60
+ response_json = @app_helper.response
61
+ response_json = @app_helper.response.dig(*response_key.split('.').map(&:to_sym)) unless response_key.blank?
62
+
63
+ expected_json = JSON.parse(expected_json_text.strip, symbolize_names: true)
64
+ expected_json = response_json.deep_merge(expected_json)
65
+
66
+ expect(response_json).to eq(expected_json)
55
67
  end
56
68
 
57
- Given(/^[Tt]he following [Uu]ser[s]*[:]*$/) do |table|
58
- table.hashes.each do |table_hash|
59
- User.create(id: table_hash[:user_id])
60
- end
69
+ Given(/^print server response$/) do
70
+ puts JSON.pretty_generate(@app_helper.response)
61
71
  end
62
72
 
63
73
  Before do
@@ -2,7 +2,7 @@ require 'active_record'
2
2
 
3
3
  class CreateUserMigration < ActiveRecord::Migration[6.1]
4
4
 
5
- enable_extension 'pgcrypto'
5
+ enable_extension 'pgcrypto' unless extension_enabled?('pgcrypto')
6
6
 
7
7
  def change
8
8
  create_table :users, id: :uuid do |t|
@@ -13,9 +13,7 @@ module RubyPitaya
13
13
  def connect
14
14
  @redis = Redis.new(
15
15
  url: @redis_address,
16
- :reconnect_attempts => 10,
17
- :reconnect_delay => 1.5,
18
- :reconnect_delay_max => 2.0,
16
+ :reconnect_attempts => [1.5]*10,
19
17
  )
20
18
 
21
19
  @redis.ping
@@ -27,7 +27,6 @@ module RubyPitaya
27
27
  @setup = settings.setup
28
28
  @services = settings.services
29
29
  @config = settings.config
30
- @objects = settings.objects
31
30
  @session = nil
32
31
  @postman = nil
33
32
 
@@ -72,8 +72,6 @@ module RubyPitaya
72
72
 
73
73
  @services = ServiceHolder.new
74
74
 
75
- @objects = InstanceHolder.new
76
-
77
75
  @initializer_content = InitializerContent.new(@log,
78
76
  @services,
79
77
  @setup,
@@ -104,7 +102,6 @@ module RubyPitaya
104
102
  HttpRoutes.set :services, @services
105
103
  HttpRoutes.set :setup, @setup
106
104
  HttpRoutes.set :config, @config
107
- HttpRoutes.set :objects, @objects
108
105
  HttpRoutes.set :views, [Path::HTTP_VIEWS_FOLDER_PATH] + Path::Plugins::HTTP_VIEWS_FOLDER_PATHS
109
106
 
110
107
  HttpRoutes.auto_reload if @is_development_environment
@@ -1,3 +1,3 @@
1
1
  module RubyPitaya
2
- VERSION = '3.11.0'
2
+ VERSION = '3.12.1'
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.11.0
4
+ version: 3.12.1
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: 2022-03-05 00:00:00.000000000 Z
11
+ date: 2023-01-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pg
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 1.3.1
19
+ version: 1.4.5
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 1.3.1
26
+ version: 1.4.5
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: 4.6.0
47
+ version: 5.0.5
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: 4.6.0
54
+ version: 5.0.5
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: etcdv3
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -72,28 +72,28 @@ dependencies:
72
72
  requirements:
73
73
  - - '='
74
74
  - !ruby/object:Gem::Version
75
- version: 0.5.3
75
+ version: 0.5.5
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: 0.5.3
82
+ version: 0.5.5
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: sinatra
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - '='
88
88
  - !ruby/object:Gem::Version
89
- version: 2.1.0
89
+ version: 3.0.5
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - '='
95
95
  - !ruby/object:Gem::Version
96
- version: 2.1.0
96
+ version: 3.0.5
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: webrick
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -114,126 +114,126 @@ dependencies:
114
114
  requirements:
115
115
  - - '='
116
116
  - !ruby/object:Gem::Version
117
- version: 2.0.0
117
+ version: 2.2.1
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - '='
123
123
  - !ruby/object:Gem::Version
124
- version: 2.0.0
124
+ version: 2.2.1
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: activerecord
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
129
  - - '='
130
130
  - !ruby/object:Gem::Version
131
- version: 7.0.2
131
+ version: 7.0.4
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.0.2
138
+ version: 7.0.4
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: google-protobuf
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
143
  - - '='
144
144
  - !ruby/object:Gem::Version
145
- version: 3.19.4
145
+ version: 3.21.12
146
146
  type: :runtime
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - '='
151
151
  - !ruby/object:Gem::Version
152
- version: 3.19.4
152
+ version: 3.21.12
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: pry
155
155
  requirement: !ruby/object:Gem::Requirement
156
156
  requirements:
157
157
  - - '='
158
158
  - !ruby/object:Gem::Version
159
- version: 0.14.1
159
+ version: 0.14.2
160
160
  type: :development
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
164
  - - '='
165
165
  - !ruby/object:Gem::Version
166
- version: 0.14.1
166
+ version: 0.14.2
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: rspec
169
169
  requirement: !ruby/object:Gem::Requirement
170
170
  requirements:
171
171
  - - '='
172
172
  - !ruby/object:Gem::Version
173
- version: 3.11.0
173
+ version: 3.12.0
174
174
  type: :development
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
178
  - - '='
179
179
  - !ruby/object:Gem::Version
180
- version: 3.11.0
180
+ version: 3.12.0
181
181
  - !ruby/object:Gem::Dependency
182
182
  name: listen
183
183
  requirement: !ruby/object:Gem::Requirement
184
184
  requirements:
185
185
  - - '='
186
186
  - !ruby/object:Gem::Version
187
- version: 3.7.1
187
+ version: 3.8.0
188
188
  type: :development
189
189
  prerelease: false
190
190
  version_requirements: !ruby/object:Gem::Requirement
191
191
  requirements:
192
192
  - - '='
193
193
  - !ruby/object:Gem::Version
194
- version: 3.7.1
194
+ version: 3.8.0
195
195
  - !ruby/object:Gem::Dependency
196
196
  name: bundler
197
197
  requirement: !ruby/object:Gem::Requirement
198
198
  requirements:
199
199
  - - '='
200
200
  - !ruby/object:Gem::Version
201
- version: 2.2.32
201
+ version: 2.3.26
202
202
  type: :development
203
203
  prerelease: false
204
204
  version_requirements: !ruby/object:Gem::Requirement
205
205
  requirements:
206
206
  - - '='
207
207
  - !ruby/object:Gem::Version
208
- version: 2.2.32
208
+ version: 2.3.26
209
209
  - !ruby/object:Gem::Dependency
210
210
  name: cucumber
211
211
  requirement: !ruby/object:Gem::Requirement
212
212
  requirements:
213
213
  - - '='
214
214
  - !ruby/object:Gem::Version
215
- version: 7.1.0
215
+ version: 8.0.0
216
216
  type: :development
217
217
  prerelease: false
218
218
  version_requirements: !ruby/object:Gem::Requirement
219
219
  requirements:
220
220
  - - '='
221
221
  - !ruby/object:Gem::Version
222
- version: 7.1.0
222
+ version: 8.0.0
223
223
  - !ruby/object:Gem::Dependency
224
224
  name: sinatra-contrib
225
225
  requirement: !ruby/object:Gem::Requirement
226
226
  requirements:
227
227
  - - '='
228
228
  - !ruby/object:Gem::Version
229
- version: 2.1.0
229
+ version: 3.0.5
230
230
  type: :development
231
231
  prerelease: false
232
232
  version_requirements: !ruby/object:Gem::Requirement
233
233
  requirements:
234
234
  - - '='
235
235
  - !ruby/object:Gem::Version
236
- version: 2.1.0
236
+ version: 3.0.5
237
237
  description: RubyPitaya is an application to create servers using the pitaya protocol.
238
238
  email:
239
239
  - lucianopcbr@gmail.com
@@ -272,7 +272,7 @@ files:
272
272
  - "./lib/rubypitaya/app-template/docker/wait_for.sh"
273
273
  - "./lib/rubypitaya/app-template/features/hello_world.feature"
274
274
  - "./lib/rubypitaya/app-template/features/player.feature"
275
- - "./lib/rubypitaya/app-template/features/step_definitions/application_steps.rb"
275
+ - "./lib/rubypitaya/app-template/features/step_definitions/player_steps.rb"
276
276
  - "./lib/rubypitaya/app-template/features/step_definitions/rubypitaya_steps.rb"
277
277
  - "./lib/rubypitaya/app-template/features/support/env.rb"
278
278
  - "./lib/rubypitaya/app-template/helm/Chart.yaml"
@@ -384,7 +384,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
384
384
  - !ruby/object:Gem::Version
385
385
  version: '0'
386
386
  requirements: []
387
- rubygems_version: 3.2.32
387
+ rubygems_version: 3.3.26
388
388
  signing_key:
389
389
  specification_version: 4
390
390
  summary: Create servers with pitaya