xbox_leaders 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.irbrc +8 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/Gemfile.lock +5 -3
- data/LICENSE.txt +22 -0
- data/README.md +36 -0
- data/Rakefile +1 -9
- data/lib/xbox_leaders/api.rb +4 -5
- data/lib/xbox_leaders/version.rb +3 -0
- data/lib/xbox_leaders.rb +0 -1
- data/spec/xbox_leaders/api_spec.rb +1 -1
- data/xbox_leaders.gemspec +24 -0
- metadata +24 -4
- data/.rvmrc +0 -48
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dcc5eee4d42e8480fc99601a30cc7c8f45c24421
|
4
|
+
data.tar.gz: f9e0125ccdaf5f3a0ae7fdf572add32e4521ee7c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d0bebb0f6a74d173914e4f8ef1581ef401f17143a6b37d235db4b3ca45ce26484c05ba861aeafb29f396f7585d1d62adf906594f35b8825c7c81dd2522f18c8a
|
7
|
+
data.tar.gz: 949c8c301a13071840a405eee869c9def4573441af7c5462dd7d11a5be63982e8e4892cb66aa1133462ffbeba50fccaba96b95eaf12f186aada96825400e60e0
|
data/.irbrc
ADDED
data/.ruby-gemset
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
xbox_leaders
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby-2.0.0-p0
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
xbox_leaders (1.0.
|
4
|
+
xbox_leaders (1.0.1)
|
5
5
|
httparty
|
6
6
|
|
7
7
|
GEM
|
@@ -9,16 +9,17 @@ GEM
|
|
9
9
|
specs:
|
10
10
|
coderay (1.0.9)
|
11
11
|
diff-lcs (1.2.1)
|
12
|
-
httparty (0.
|
12
|
+
httparty (0.11.0)
|
13
13
|
multi_json (~> 1.0)
|
14
14
|
multi_xml (>= 0.5.2)
|
15
15
|
method_source (0.8.1)
|
16
|
-
multi_json (1.7.
|
16
|
+
multi_json (1.7.3)
|
17
17
|
multi_xml (0.5.3)
|
18
18
|
pry (0.9.12)
|
19
19
|
coderay (~> 1.0.5)
|
20
20
|
method_source (~> 0.8)
|
21
21
|
slop (~> 3.4)
|
22
|
+
rake (10.0.4)
|
22
23
|
rspec (2.13.0)
|
23
24
|
rspec-core (~> 2.13.0)
|
24
25
|
rspec-expectations (~> 2.13.0)
|
@@ -34,5 +35,6 @@ PLATFORMS
|
|
34
35
|
|
35
36
|
DEPENDENCIES
|
36
37
|
pry
|
38
|
+
rake
|
37
39
|
rspec
|
38
40
|
xbox_leaders!
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 Brandon Rice
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
# XboxLeaders
|
2
|
+
|
3
|
+
This is a wrapper around the Xbox Live API provided for free at [https://www.xboxleaders.com/](https://www.xboxleaders.com/).
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'xbox_leaders'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install xbox_leaders
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
2.0.0p0 :001 > require 'xbox_leaders'
|
22
|
+
=> true
|
23
|
+
2.0.0p0 :002 > api = XboxLeaders::Api.new
|
24
|
+
=> #<XboxLeaders::Api:0x007fbba19adeb8 @timeout=6>
|
25
|
+
2.0.0p0 :003 > api.fetch_profile('Major Nelson')
|
26
|
+
=> {"Tier"=>"gold", "IsValid"=>1, "IsCheater"=>0, "IsOnline"=>0, "OnlineStatus"=>"Offline", "XBLLaunchTeam"=>1, "NXELaunchTeam"=>1, "KinectLaunchTeam"=>1, "AvatarTile"=>"http://avatar.xboxlive.com/avatar/Major%20Nelson/avatarpic-l.png", "AvatarSmall"=>"http://avatar.xboxlive.com/avatar/Major%20Nelson/avatarpic-s.png", "AvatarLarge"=>"http://avatar.xboxlive.com/avatar/Major%20Nelson/avatarpic-l.png", "AvatarBody"=>"http://avatar.xboxlive.com/avatar/Major%20Nelson/avatar-body.png", "AvatarTileSSL"=>"https://avatar-ssl.xboxlive.com/avatar/Major%20Nelson/avatarpic-l.png", "AvatarSmallSSL"=>"https://avatar-ssl.xboxlive.com/avatar/Major%20Nelson/avatarpic-s.png", "AvatarLargeSSL"=>"https://avatar-ssl.xboxlive.com/avatar/Major%20Nelson/avatarpic-l.png", "AvatarBodySSL"=>"https://avatar-ssl.xboxlive.com/avatar/Major%20Nelson/avatar-body.png", "Gamertag"=>"Major Nelson", "GamerScore"=>63147, "Reputation"=>20, "Name"=>nil, "Motto"=>"", "Location"=>"", "Bio"=>nil}
|
27
|
+
|
28
|
+
See the specs, rdocs, lib files, and documentation at [https://www.xboxleaders.com/](https://www.xboxleaders.com/) for more API calls.
|
29
|
+
|
30
|
+
## Contributing
|
31
|
+
|
32
|
+
1. Fork it
|
33
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
34
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
35
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
36
|
+
5. Create new Pull Request
|
data/Rakefile
CHANGED
data/lib/xbox_leaders/api.rb
CHANGED
@@ -3,8 +3,7 @@ require 'httparty'
|
|
3
3
|
class XboxLeaders::Api
|
4
4
|
|
5
5
|
include HTTParty
|
6
|
-
base_uri 'https://www.xboxleaders.com/api'
|
7
|
-
format :json
|
6
|
+
base_uri 'https://www.xboxleaders.com/api/1.0'
|
8
7
|
|
9
8
|
attr_accessor :timeout
|
10
9
|
|
@@ -31,10 +30,10 @@ class XboxLeaders::Api
|
|
31
30
|
private
|
32
31
|
|
33
32
|
def get(path, query={})
|
34
|
-
response = self.class.get(path, timeout: timeout, query: query).to_hash
|
33
|
+
response = self.class.get(path + ".json", timeout: timeout, query: query).to_hash
|
35
34
|
|
36
|
-
if error = response['
|
37
|
-
raise ArgumentError, error
|
35
|
+
if error = response['Error']
|
36
|
+
raise ArgumentError, error
|
38
37
|
end
|
39
38
|
|
40
39
|
response['Data']
|
data/lib/xbox_leaders.rb
CHANGED
@@ -17,7 +17,7 @@ describe XboxLeaders::Api do
|
|
17
17
|
it 'validates the gamertag' do
|
18
18
|
api = XboxLeaders::Api.new
|
19
19
|
lambda { api.fetch_profile('nevern02') }.should_not raise_exception
|
20
|
-
lambda { api.fetch_profile('
|
20
|
+
lambda { api.fetch_profile('fajdkfjdife99fgsd<F2>') }.should raise_exception
|
21
21
|
end
|
22
22
|
|
23
23
|
it 'fetches a profile' do
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'xbox_leaders/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "xbox_leaders"
|
8
|
+
spec.version = XboxLeaders::VERSION
|
9
|
+
spec.authors = ["Brandon Rice"]
|
10
|
+
spec.email = ["brice84@gmail.com"]
|
11
|
+
spec.description = %q{A wrapper for the Xbox Live API provided by Xbox Leaders: https://www.xboxleaders.com/}
|
12
|
+
spec.summary = %q{An Xbox Live API wrapper}
|
13
|
+
spec.homepage = "https://github.com/nevern02/xbox_leaders"
|
14
|
+
spec.license = "MIT"
|
15
|
+
spec.files = `git ls-files`.split($/)
|
16
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
17
|
+
spec.require_paths = ['lib']
|
18
|
+
|
19
|
+
spec.add_runtime_dependency 'httparty'
|
20
|
+
spec.add_development_dependency 'rake'
|
21
|
+
spec.add_development_dependency 'pry'
|
22
|
+
spec.add_development_dependency 'rspec'
|
23
|
+
end
|
24
|
+
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xbox_leaders
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Rice
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-05-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - '>='
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: pry
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -60,15 +74,21 @@ extensions: []
|
|
60
74
|
extra_rdoc_files: []
|
61
75
|
files:
|
62
76
|
- .gitignore
|
77
|
+
- .irbrc
|
63
78
|
- .rspec
|
64
|
-
- .
|
79
|
+
- .ruby-gemset
|
80
|
+
- .ruby-version
|
65
81
|
- Gemfile
|
66
82
|
- Gemfile.lock
|
83
|
+
- LICENSE.txt
|
84
|
+
- README.md
|
67
85
|
- Rakefile
|
68
86
|
- lib/xbox_leaders.rb
|
69
87
|
- lib/xbox_leaders/api.rb
|
88
|
+
- lib/xbox_leaders/version.rb
|
70
89
|
- spec/spec_helper.rb
|
71
90
|
- spec/xbox_leaders/api_spec.rb
|
91
|
+
- xbox_leaders.gemspec
|
72
92
|
homepage: https://github.com/nevern02/xbox_leaders
|
73
93
|
licenses:
|
74
94
|
- MIT
|
@@ -89,7 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
89
109
|
version: '0'
|
90
110
|
requirements: []
|
91
111
|
rubyforge_project:
|
92
|
-
rubygems_version: 2.0.
|
112
|
+
rubygems_version: 2.0.0.rc.2
|
93
113
|
signing_key:
|
94
114
|
specification_version: 4
|
95
115
|
summary: An Xbox Live API wrapper
|
data/.rvmrc
DELETED
@@ -1,48 +0,0 @@
|
|
1
|
-
#!/usr/bin/env bash
|
2
|
-
|
3
|
-
# This is an RVM Project .rvmrc file, used to automatically load the ruby
|
4
|
-
# development environment upon cd'ing into the directory
|
5
|
-
|
6
|
-
# First we specify our desired <ruby>[@<gemset>], the @gemset name is optional,
|
7
|
-
# Only full ruby name is supported here, for short names use:
|
8
|
-
# echo "rvm use 2.0.0" > .rvmrc
|
9
|
-
environment_id="ruby-2.0.0@xbox_leaders"
|
10
|
-
|
11
|
-
# Uncomment the following lines if you want to verify rvm version per project
|
12
|
-
# rvmrc_rvm_version="1.18.21 (stable)" # 1.10.1 seams as a safe start
|
13
|
-
# eval "$(echo ${rvm_version}.${rvmrc_rvm_version} | awk -F. '{print "[[ "$1*65536+$2*256+$3" -ge "$4*65536+$5*256+$6" ]]"}' )" || {
|
14
|
-
# echo "This .rvmrc file requires at least RVM ${rvmrc_rvm_version}, aborting loading."
|
15
|
-
# return 1
|
16
|
-
# }
|
17
|
-
|
18
|
-
# First we attempt to load the desired environment directly from the environment
|
19
|
-
# file. This is very fast and efficient compared to running through the entire
|
20
|
-
# CLI and selector. If you want feedback on which environment was used then
|
21
|
-
# insert the word 'use' after --create as this triggers verbose mode.
|
22
|
-
if [[ -d "${rvm_path:-$HOME/.rvm}/environments"
|
23
|
-
&& -s "${rvm_path:-$HOME/.rvm}/environments/$environment_id" ]]
|
24
|
-
then
|
25
|
-
\. "${rvm_path:-$HOME/.rvm}/environments/$environment_id"
|
26
|
-
[[ -s "${rvm_path:-$HOME/.rvm}/hooks/after_use" ]] &&
|
27
|
-
\. "${rvm_path:-$HOME/.rvm}/hooks/after_use" || true
|
28
|
-
else
|
29
|
-
# If the environment file has not yet been created, use the RVM CLI to select.
|
30
|
-
rvm --create "$environment_id" || {
|
31
|
-
echo "Failed to create RVM environment '${environment_id}'."
|
32
|
-
return 1
|
33
|
-
}
|
34
|
-
fi
|
35
|
-
|
36
|
-
# If you use bundler, this might be useful to you:
|
37
|
-
# if [[ -s Gemfile ]] && {
|
38
|
-
# ! builtin command -v bundle >/dev/null ||
|
39
|
-
# builtin command -v bundle | GREP_OPTIONS= \grep $rvm_path/bin/bundle >/dev/null
|
40
|
-
# }
|
41
|
-
# then
|
42
|
-
# printf "%b" "The rubygem 'bundler' is not installed. Installing it now.\n"
|
43
|
-
# gem install bundler
|
44
|
-
# fi
|
45
|
-
# if [[ -s Gemfile ]] && builtin command -v bundle >/dev/null
|
46
|
-
# then
|
47
|
-
# bundle install | GREP_OPTIONS= \grep -vE '^Using|Your bundle is complete'
|
48
|
-
# fi
|