quakelive_api 0.1.0 → 0.1.1

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
  SHA1:
3
- metadata.gz: 709a918a29beb2d88f7beb75da2c7f6096adc835
4
- data.tar.gz: d4a6265dead1d076be6ae38443f2c089c99a41ed
3
+ metadata.gz: dd07e3b24f8bd5ae655d3bab010f22eef0951f03
4
+ data.tar.gz: 6d571ee6e0b6d72fbf378ce5f34bfe3e2c8c2631
5
5
  SHA512:
6
- metadata.gz: e9840762fc084ddc77e0073bc7ec2bc45c2766e8e22f56bed4aee3b3e9b4399aeefc9879d01a02ee65e9ae97bd55b2e9becdeaca5b1b3b11567fbbc93ec5f531
7
- data.tar.gz: aa5dee7c81d9251820f6b8b0fa8a54f5fc314d15aeeec57527e52c3529da9264c63a7310673c195e71849d100f916a84a06265445b8385cc967e214209588c3a
6
+ metadata.gz: 81b4452ec62024f5089e5010139e08ba581bf1fb360238fb3200b57a66bdf811a06232f47bc712cbcc0b03ae1087a272bf33f3c3e42f9d55daf93165a9be9007
7
+ data.tar.gz: cedfce00fec557f10162fc1f41a9b255a9fe69d538799964ffe60a04216b20b2a95c751cf803b12f3170b94caf49c1382fe1808c0cf7bd3fb3777af4314ecd8d
data/.travis.yml CHANGED
@@ -4,7 +4,6 @@ rvm:
4
4
  - 1.9.3
5
5
  - 2.0
6
6
  - 2.1
7
- - ruby-head
8
7
 
9
8
  notifications:
10
9
  email: false
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.1.1
2
+
3
+ - proper inactive accounts detection
4
+
1
5
  ## 0.1.0
2
6
  _no breaking changes_
3
7
 
@@ -6,7 +6,7 @@ module QuakeliveApi
6
6
  end
7
7
 
8
8
  def invalid_player?
9
- document.css('.profile_title').text =~ /Unknown Player/
9
+ document.css('p.tc').text =~ /The requested player could not be found or is not yet active/i
10
10
  end
11
11
 
12
12
  def request_error?
@@ -1,3 +1,3 @@
1
1
  module QuakeliveApi
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -0,0 +1,57 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://www.quakelive.com/profile/summary/vfj_cosiek
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - "*/*"
14
+ User-Agent:
15
+ - Ruby
16
+ Host:
17
+ - www.quakelive.com
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Server:
24
+ - nginx/0.7.67
25
+ Date:
26
+ - Thu, 21 Aug 2014 16:46:33 GMT
27
+ Content-Type:
28
+ - text/html
29
+ Transfer-Encoding:
30
+ - chunked
31
+ Connection:
32
+ - close
33
+ X-Powered-By:
34
+ - PHP/5.3.3
35
+ X-Ql-Ident:
36
+ - 0 standard
37
+ Vary:
38
+ - Accept-Encoding
39
+ body:
40
+ encoding: UTF-8
41
+ string: "<div style=\"text-align: left\">\n\t\t<div style=\"display: none\"
42
+ id=\"prf_player_name\">vfj_cosiek</div>\n <h1 class=\"profile_title\">\n
43
+ \ vfj_cosiek\n </h1>\n\t<div class=\"prf_header\">\n
44
+ \ \t\t\n\t\t<form onsubmit=\"quakelive.mod_profile.ProfileJumpClick();
45
+ return false\" style=\"margin: 0; padding: 0\">\n\t\t\t<div id=\"jump_player_msg\"></div>\n\t\t\t<div
46
+ class=\"prf_section_searchbar\">\n\t\t\t\t<input type=\"text\" placeholder=\"Jump
47
+ to profile&hellip;\" class=\"input_default\" id=\"profile_jump_input\" />\n\t\t\t\t<a
48
+ href=\"javascript:;\" onclick=\"quakelive.mod_profile.ProfileJumpClick();
49
+ return false\"><img src=\"http://cdn.quakelive.com/web/2014080602/images/sf/leaderboard/search_v2014080602.0.png\"
50
+ width=\"23\" height=\"23\" /></a>\n\t\t\t</div>\n\t\t</form>\n\t\t\n\t\t<div
51
+ class=\"cl\"></div>\n\t</div>\n\t\n\t<div id=\"qlv_profileListContainer\">\n\t\t<p
52
+ class=\"tc TwentyPxTxt sixtypad midGrayTxt\">\n The requested player could
53
+ not be found or is not yet active. Please check your spelling and try again.
54
+ \ \n</p>\n\t</div>\n</div>"
55
+ http_version:
56
+ recorded_at: Thu, 21 Aug 2014 16:46:33 GMT
57
+ recorded_with: VCR 2.9.2
@@ -4,13 +4,20 @@ require "test_helper"
4
4
  describe "QuakeliveApi::Profile" do
5
5
 
6
6
  describe "on error" do
7
- it "raises an exception on non existing profiles" do
7
+ it "raises an exception on non existing profile" do
8
8
  VCR.use_cassette("profiles/not_existing") do
9
9
  profile = QuakeliveApi::Profile.new('not_existing_profile123')
10
10
  assert_raises(QuakeliveApi::Error::PlayerNotFound) { profile.summary }
11
11
  end
12
12
  end
13
13
 
14
+ it "raises an exception on not active profile" do
15
+ VCR.use_cassette("profiles/not_active") do
16
+ profile = QuakeliveApi::Profile.new('vfj_cosiek')
17
+ assert_raises(QuakeliveApi::Error::PlayerNotFound) { profile.summary }
18
+ end
19
+ end
20
+
14
21
  it "raises an exception on request error response from ql" do
15
22
  VCR.use_cassette("profiles/error") do
16
23
  profile = QuakeliveApi::Profile.new('óąśðł')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quakelive_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rafal Wojsznis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-18 00:00:00.000000000 Z
11
+ date: 2014-08-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -162,6 +162,7 @@ files:
162
162
  - test/fixtures/profiles/full/statistics.yml
163
163
  - test/fixtures/profiles/full/summary.yml
164
164
  - test/fixtures/profiles/mariano.yml
165
+ - test/fixtures/profiles/not_active.yml
165
166
  - test/fixtures/profiles/not_existing.yml
166
167
  - test/fixtures/statistics/xsi.yml
167
168
  - test/quakelive_api/game_time_test.rb
@@ -208,6 +209,7 @@ test_files:
208
209
  - test/fixtures/profiles/full/statistics.yml
209
210
  - test/fixtures/profiles/full/summary.yml
210
211
  - test/fixtures/profiles/mariano.yml
212
+ - test/fixtures/profiles/not_active.yml
211
213
  - test/fixtures/profiles/not_existing.yml
212
214
  - test/fixtures/statistics/xsi.yml
213
215
  - test/quakelive_api/game_time_test.rb