rshighscores 2.1.4 → 2.2.0
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 +4 -4
- data/README.md +2 -2
- data/lib/rshighscores.rb +1 -1
- data/lib/rshighscores/player.rb +2 -2
- data/spec/lookup_spec.rb +1 -1
- data/spec/oldschool_spec.rb +1 -1
- data/spec/player_spec.rb +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a37e4b4add8bd3e2a939dfc58fedc4dcaa14645d
|
|
4
|
+
data.tar.gz: 8686e2fa755b72d32bff7b877b46b8aa95a7158d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a42c24b7d007f936a462bbac14359e0d0082bf926569be75013a3a54bde21dca9c9e838ebdd887152671b526d5db59c027fb0e921289536556440b03eadf9022
|
|
7
|
+
data.tar.gz: 29ea5aa2affda8a1e8a811f31000e30b9694a50b02ff671d88f9b31ddcd7e2e4201e603c111ea43f2c2f40d08c3da7e91ecff72019e527094dcf90215dbb986c
|
data/README.md
CHANGED
|
@@ -31,11 +31,11 @@ Or install it yourself as:
|
|
|
31
31
|
```ruby
|
|
32
32
|
require 'rshighscores'
|
|
33
33
|
|
|
34
|
-
foot = RsHighscores::Player.new "Foot"
|
|
34
|
+
foot = RsHighscores::Player.new "Foot", force: true
|
|
35
35
|
highscores = foot.stats
|
|
36
36
|
puts highscores.hunter.level # => 99
|
|
37
37
|
|
|
38
|
-
jebrim = OSRS::Player.new "Jebrim" # RsHighscores::OldSchool::Player would work too
|
|
38
|
+
jebrim = OSRS::Player.new "Jebrim", force: true # RsHighscores::OldSchool::Player would work too
|
|
39
39
|
highscores = jebrim.stats
|
|
40
40
|
puts highscores.agility.level # => 99
|
|
41
41
|
```
|
data/lib/rshighscores.rb
CHANGED
data/lib/rshighscores/player.rb
CHANGED
|
@@ -7,11 +7,11 @@ module RsHighscores
|
|
|
7
7
|
|
|
8
8
|
attr_reader :name, :raw_stats, :stats
|
|
9
9
|
|
|
10
|
-
def initialize name,
|
|
10
|
+
def initialize name, params = {}
|
|
11
11
|
@name = name
|
|
12
12
|
validate_name
|
|
13
13
|
|
|
14
|
-
fetch_highscores if
|
|
14
|
+
fetch_highscores if params[:force]
|
|
15
15
|
end
|
|
16
16
|
|
|
17
17
|
def validate_name
|
data/spec/lookup_spec.rb
CHANGED
data/spec/oldschool_spec.rb
CHANGED
data/spec/player_spec.rb
CHANGED
|
@@ -17,7 +17,7 @@ describe RsHighscores::Player do
|
|
|
17
17
|
|
|
18
18
|
it "spaces being replaced" do
|
|
19
19
|
lambda {
|
|
20
|
-
RsHighscores::Player.new "samb o", :
|
|
20
|
+
RsHighscores::Player.new "samb o", force: true
|
|
21
21
|
}.should_not raise_error
|
|
22
22
|
end
|
|
23
23
|
end
|
|
@@ -51,7 +51,7 @@ describe RsHighscores::Player do
|
|
|
51
51
|
|
|
52
52
|
describe "highscore lookup" do
|
|
53
53
|
it "member lookup" do
|
|
54
|
-
player = RsHighscores::Player.new "jake", :
|
|
54
|
+
player = RsHighscores::Player.new "jake", force: true # Not Foot in case he cancels membership
|
|
55
55
|
|
|
56
56
|
lambda {
|
|
57
57
|
player.fetch_highscores
|
|
@@ -66,7 +66,7 @@ describe RsHighscores::Player do
|
|
|
66
66
|
|
|
67
67
|
it "non-member/banned lookup" do
|
|
68
68
|
lambda {
|
|
69
|
-
RsHighscores::Player.new "smithking087", :
|
|
69
|
+
RsHighscores::Player.new "smithking087", force: true # Known banned player
|
|
70
70
|
}.should raise_error(OpenURI::HTTPError)
|
|
71
71
|
end
|
|
72
72
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rshighscores
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Sam Broughton
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2013-09-
|
|
12
|
+
date: 2013-09-12 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: bundler
|