gameye 0.0.4 → 0.0.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7fe8af996da8df1646ee7316f126ac83c6a8424af1f67ee06e9d88af8d9beddf
4
- data.tar.gz: 2a1e3c13e41111301ecad35dbffbb76cb81bf3d11a1ce2f5236da1e58c9d84d8
3
+ metadata.gz: b26a5ed2fd6f44fa13078ad29f5b9e2161aded2da8c2d1e4cf3ab061828eaf9e
4
+ data.tar.gz: 75e72f8cd771dadc7b8bb10522c6e8c5a71dfd590feeb0471b566676889df581
5
5
  SHA512:
6
- metadata.gz: 698d205bc5dd7d61dff0f283fc7fe46c87611e344de5bcff1b0724194b35ffbab39e3cf9d88b4fc6110c7a250dfa57479de3f5daf8fdf4ab65bdb1ca3f6cfb93
7
- data.tar.gz: a146ed56ad9a1545257df0ef1980a39a0a6bcab6797161ec362a2560d3bc04a48a0e4025f31fd462792e7cb0ca1b483a095c9475ac4ac351cce06d8397a03c2e
6
+ metadata.gz: fcf9f3105042209d1976e437b1cf34dc054d33c182967c25a94a972120869cae202fbf569b5459de05d005ebf449c3402660174be0dd2b7e8172fe334a856904
7
+ data.tar.gz: 04d3b6870b9ff4ba6e4c88e8efe16978a3cc179418c4ae4e82f5681c96c5dfd9fa13952148a93213f18fe6b09f6ae676144051b2f5f3fe66a8595c7643966cb5
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gameye (0.0.1)
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.15.3)
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.0.0)
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.14.5
66
+ 1.17.2
@@ -20,8 +20,8 @@ module Gameye
20
20
  matchKey: match_key,
21
21
  config: options
22
22
  })
23
- if response.status == 204
24
- true
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
@@ -1,3 +1,3 @@
1
1
  module Gameye
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://api.gameye.com/fetch/match
5
+ uri: https://api.gameye.com/query/match
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://api.gameye.com/fetch/match
5
+ uri: https://api.gameye.com/query/match
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -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":["rotterdam"],"templateKey":"bots","matchKey":"serveme-test-123","config":{"hostname":"Foobarwidget"}}'
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.15.3
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: 204
19
- message: No Content
18
+ code: 200
19
+ message: OK
20
20
  headers:
21
21
  date:
22
- - Tue, 30 Oct 2018 18:47:33 GMT
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: Tue, 30 Oct 2018 18:47:33 GMT
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: ["rotterdam"], template_key: "bots", options: {hostname: "Foobarwidget"})
16
- expect(response).to be true
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gameye
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arie