gameye 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +4 -4
- data/lib/gameye/match.rb +3 -3
- data/lib/gameye/version.rb +1 -1
- data/spec/fixtures/vcr/Gameye_Match/fetches_an_empty_list_of_matches.yml +1 -1
- data/spec/fixtures/vcr/Gameye_Match/fetches_matches.yml +1 -1
- data/spec/fixtures/vcr/Gameye_Match/starts_a_match.yml +13 -7
- data/spec/lib/gameye/match_spec.rb +8 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b26a5ed2fd6f44fa13078ad29f5b9e2161aded2da8c2d1e4cf3ab061828eaf9e
|
4
|
+
data.tar.gz: 75e72f8cd771dadc7b8bb10522c6e8c5a71dfd590feeb0471b566676889df581
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fcf9f3105042209d1976e437b1cf34dc054d33c182967c25a94a972120869cae202fbf569b5459de05d005ebf449c3402660174be0dd2b7e8172fe334a856904
|
7
|
+
data.tar.gz: 04d3b6870b9ff4ba6e4c88e8efe16978a3cc179418c4ae4e82f5681c96c5dfd9fa13952148a93213f18fe6b09f6ae676144051b2f5f3fe66a8595c7643966cb5
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
gameye (0.0.
|
4
|
+
gameye (0.0.4)
|
5
5
|
faraday (~> 0.8)
|
6
6
|
|
7
7
|
GEM
|
@@ -16,11 +16,11 @@ GEM
|
|
16
16
|
tins (~> 1.6)
|
17
17
|
diff-lcs (1.3)
|
18
18
|
docile (1.3.1)
|
19
|
-
faraday (0.
|
19
|
+
faraday (0.17.0)
|
20
20
|
multipart-post (>= 1.2, < 3)
|
21
21
|
json (2.1.0)
|
22
22
|
method_source (0.8.2)
|
23
|
-
multipart-post (2.
|
23
|
+
multipart-post (2.1.1)
|
24
24
|
pry (0.10.4)
|
25
25
|
coderay (~> 1.1.0)
|
26
26
|
method_source (~> 0.8.1)
|
@@ -63,4 +63,4 @@ DEPENDENCIES
|
|
63
63
|
vcr
|
64
64
|
|
65
65
|
BUNDLED WITH
|
66
|
-
1.
|
66
|
+
1.17.2
|
data/lib/gameye/match.rb
CHANGED
@@ -20,8 +20,8 @@ module Gameye
|
|
20
20
|
matchKey: match_key,
|
21
21
|
config: options
|
22
22
|
})
|
23
|
-
if response.status == 204
|
24
|
-
|
23
|
+
if (response.status == 204 || response.status == 200)
|
24
|
+
JSON.parse(response.body)
|
25
25
|
else
|
26
26
|
response.status
|
27
27
|
end
|
@@ -29,7 +29,7 @@ module Gameye
|
|
29
29
|
|
30
30
|
def self.stop(client: Gameye::Client.new, match_key:)
|
31
31
|
response = client.post("stop-match", { matchKey: match_key })
|
32
|
-
if response.status == 204
|
32
|
+
if (response.status == 204 || response.status == 200)
|
33
33
|
true
|
34
34
|
else
|
35
35
|
response.status
|
data/lib/gameye/version.rb
CHANGED
@@ -5,26 +5,32 @@ http_interactions:
|
|
5
5
|
uri: https://api.gameye.com/action/start-match
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
|
-
string: '{"gameKey":"tf2","locationKeys":["
|
8
|
+
string: '{"gameKey":"tf2","locationKeys":["frankfurt"],"templateKey":"bots","matchKey":"serveme-test-123","config":{"hostname":"Foobarwidget"}}'
|
9
9
|
headers:
|
10
10
|
User-Agent:
|
11
|
-
- Faraday v0.
|
11
|
+
- Faraday v0.17.0
|
12
12
|
Content-Type:
|
13
13
|
- application/json
|
14
14
|
Authorization:
|
15
15
|
- Bearer api-token
|
16
16
|
response:
|
17
17
|
status:
|
18
|
-
code:
|
19
|
-
message:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
20
|
headers:
|
21
21
|
date:
|
22
|
-
-
|
22
|
+
- Mon, 06 Jan 2020 18:59:58 GMT
|
23
|
+
content-type:
|
24
|
+
- application/json; charset=utf-8
|
25
|
+
content-length:
|
26
|
+
- '145'
|
23
27
|
connection:
|
24
28
|
- close
|
29
|
+
vary:
|
30
|
+
- Origin
|
25
31
|
body:
|
26
32
|
encoding: UTF-8
|
27
|
-
string: ''
|
33
|
+
string: '{"id":"serveme-test-123","image":"tf2","location":"frankfurt","host":"178.162.194.76","created":1578337196780,"port":{"game":62382,"hltv":58616}}'
|
28
34
|
http_version:
|
29
|
-
recorded_at:
|
35
|
+
recorded_at: Mon, 06 Jan 2020 18:59:58 GMT
|
30
36
|
recorded_with: VCR 4.0.0
|
@@ -12,8 +12,14 @@ module Gameye
|
|
12
12
|
end
|
13
13
|
|
14
14
|
it "starts a match", :vcr do
|
15
|
-
response = described_class.start(game_key: "tf2", match_key: "serveme-test-123", location_keys: ["
|
16
|
-
expect(response).to be
|
15
|
+
response = described_class.start(game_key: "tf2", match_key: "serveme-test-123", location_keys: ["frankfurt"], template_key: "bots", options: {hostname: "Foobarwidget"})
|
16
|
+
expect(response).to be {}
|
17
|
+
expect(response["host"]).to eql "178.162.194.76"
|
18
|
+
expect(response["id"]).to eql "serveme-test-123"
|
19
|
+
expect(response["image"]).to eql "tf2"
|
20
|
+
expect(response["location"]).to eql "frankfurt"
|
21
|
+
expect(response["port"]["game"]).to eql 62382
|
22
|
+
expect(response["port"]["hltv"]).to eql 58616
|
17
23
|
end
|
18
24
|
|
19
25
|
it "fetches matches", :vcr do
|