ruby-lol 0.9.8 → 0.9.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lol/autoloader.rb +1 -1
- data/lib/lol/summoner_request.rb +2 -1
- data/lib/lol/version.rb +1 -1
- data/spec/lol/summoner_request_spec.rb +15 -0
- 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: 5299caf56619ad787d30d86f076a8fd100005036
|
4
|
+
data.tar.gz: 7201902288c4e3c4d8a6c22f0721f30b6edbf835
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7bdcb6a21e9c493969974df3ebac981e839a89fbe864d5ed60572a74eedfe5fad0e2007c787f6f7e73126162090283b95c67c411fbc24efb5ca05fa6a64bf13e
|
7
|
+
data.tar.gz: 24edf369c35e6a4732f95575d7b51a5acb740c67b8392e102d8a83fdb72933488b91b42acc40ed29561d77e2f97a303c62c64668d828c6923084c6e80b780025
|
data/lib/lol/autoloader.rb
CHANGED
data/lib/lol/summoner_request.rb
CHANGED
@@ -10,7 +10,8 @@ module Lol
|
|
10
10
|
# @param [Array] summoner names
|
11
11
|
# @return [Array] matching summoners
|
12
12
|
def by_name *names
|
13
|
-
|
13
|
+
escaped_names = names.flatten.map { |name| CGI.escape name.downcase.gsub(/\s/, '') }
|
14
|
+
perform_request(api_url("summoner/by-name/#{escaped_names.join(",")}")).map do |key, data|
|
14
15
|
Summoner.new data
|
15
16
|
end
|
16
17
|
end
|
data/lib/lol/version.rb
CHANGED
@@ -29,6 +29,21 @@ describe SummonerRequest do
|
|
29
29
|
it "returns an array of summoners" do
|
30
30
|
expect(subject.map(&:class).uniq).to eq([Summoner])
|
31
31
|
end
|
32
|
+
|
33
|
+
it 'escapes the given names' do
|
34
|
+
expect(request.class).to receive(:get).with(request.api_url("summoner/by-name/f%C3%B2%C3%A5,f%C3%B9%C3%AE")).and_return(by_name)
|
35
|
+
request.by_name ['fòå', 'fùî']
|
36
|
+
end
|
37
|
+
|
38
|
+
it 'downcase the given names' do
|
39
|
+
expect(request.class).to receive(:get).with(request.api_url("summoner/by-name/foo,bar")).and_return(by_name)
|
40
|
+
request.by_name 'FoO', 'BAR'
|
41
|
+
end
|
42
|
+
|
43
|
+
it 'strips spaces from names' do
|
44
|
+
expect(request.class).to receive(:get).with(request.api_url("summoner/by-name/foo,bar")).and_return(by_name)
|
45
|
+
request.by_name 'Fo o', 'b a r'
|
46
|
+
end
|
32
47
|
end
|
33
48
|
|
34
49
|
describe "#name" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-lol
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Giovanni Intini
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-02-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|