halo-api 0.4.3 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.env.example +4 -0
- data/.github/workflows/main.yml +34 -0
- data/.rspec +0 -1
- data/.rubocop.yml +79 -0
- data/CONTRIBUTING.md +9 -0
- data/Gemfile +3 -1
- data/README.md +16 -18
- data/Rakefile +5 -3
- data/bin/console +4 -3
- data/halo-api.gemspec +20 -18
- data/lib/halo-api.rb +3 -4
- data/lib/halo-api/api_response.rb +3 -1
- data/lib/halo-api/client.rb +4 -3
- data/lib/halo-api/clients/halo5_client.rb +2 -4
- data/lib/halo-api/clients/halo_wars2_client.rb +2 -4
- data/lib/halo-api/configuration.rb +5 -5
- data/lib/halo-api/modules/halo5/metadata.rb +8 -4
- data/lib/halo-api/modules/halo5/profile.rb +2 -1
- data/lib/halo-api/modules/halo5/stats.rb +2 -2
- data/lib/halo-api/modules/halo5/ugc.rb +2 -2
- data/lib/halo-api/modules/halo_wars2/metadata.rb +2 -2
- data/lib/halo-api/modules/halo_wars2/stats.rb +2 -2
- data/lib/halo-api/version.rb +3 -1
- metadata +104 -46
- data/.travis.yml +0 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 2a42d4f434fff2d9750332094368fa2716e424ae174813fd69829821872909a7
|
4
|
+
data.tar.gz: ba71b0569f573e75df90b2d9e02b68dcefa2e4506d6cc3d69ee2e05d5556e9d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc36634a971d5d312414465e7fad6bce69443524b69fcd9aeff2ad2251c9ae303e6c220ec1698f5bbe09575e4b403a005e80c3a4132ff5ea2944bbc158285da1
|
7
|
+
data.tar.gz: 9fefbfa29add4bcd940a6ad0dddd6ecb34ecfd48218bbd90befc9ada8aab8e9988f35884fc82bdb89b805ddf483f5a4a0d3729f851b705e0a5bc28f8881814a4
|
data/.env.example
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
name: CI
|
2
|
+
|
3
|
+
on: [ 'push', 'pull_request' ]
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
build:
|
7
|
+
runs-on: ubuntu-latest
|
8
|
+
|
9
|
+
services:
|
10
|
+
redis:
|
11
|
+
image: redis
|
12
|
+
ports:
|
13
|
+
- 6379:6379
|
14
|
+
|
15
|
+
strategy:
|
16
|
+
matrix:
|
17
|
+
ruby-version: [ '2.5', '2.6', '2.7', '3.0' ]
|
18
|
+
|
19
|
+
steps:
|
20
|
+
- uses: actions/checkout@v2
|
21
|
+
|
22
|
+
- name: Set up Ruby
|
23
|
+
uses: ruby/setup-ruby@v1
|
24
|
+
with:
|
25
|
+
ruby-version: ${{ matrix.ruby-version }}
|
26
|
+
bundler-cache: true
|
27
|
+
|
28
|
+
- name: Run tests
|
29
|
+
env:
|
30
|
+
HALO_API_KEY: ${{ secrets.HALO_API_KEY }}
|
31
|
+
HALO_REGION: ${{ secrets.HALO_REGION }}
|
32
|
+
HALO_REDIS: ${{ secrets.HALO_REDIS }}
|
33
|
+
HALO_TTL: ${{ secrets.HALO_TTL }}
|
34
|
+
run: bundle exec rake
|
data/.rspec
CHANGED
data/.rubocop.yml
ADDED
@@ -0,0 +1,79 @@
|
|
1
|
+
require:
|
2
|
+
- rubocop-performance
|
3
|
+
- rubocop-rspec
|
4
|
+
|
5
|
+
AllCops:
|
6
|
+
TargetRubyVersion: 2.5
|
7
|
+
NewCops: enable
|
8
|
+
SuggestExtensions: false
|
9
|
+
Exclude:
|
10
|
+
- '*.md'
|
11
|
+
|
12
|
+
Layout/SpaceInsideHashLiteralBraces:
|
13
|
+
EnforcedStyle: no_space
|
14
|
+
|
15
|
+
Metrics/BlockLength:
|
16
|
+
Max: 36
|
17
|
+
Exclude:
|
18
|
+
- spec/**/*.rb
|
19
|
+
- halo-api.gemspec
|
20
|
+
|
21
|
+
Metrics/BlockNesting:
|
22
|
+
Max: 2
|
23
|
+
|
24
|
+
Layout/LineLength:
|
25
|
+
AllowURI: true
|
26
|
+
Enabled: false
|
27
|
+
|
28
|
+
Metrics/MethodLength:
|
29
|
+
CountComments: false
|
30
|
+
Max: 15
|
31
|
+
|
32
|
+
Metrics/ModuleLength:
|
33
|
+
Max: 120
|
34
|
+
|
35
|
+
Metrics/ClassLength:
|
36
|
+
Max: 120
|
37
|
+
|
38
|
+
Metrics/ParameterLists:
|
39
|
+
Max: 5
|
40
|
+
CountKeywordArgs: true
|
41
|
+
|
42
|
+
Style/Documentation:
|
43
|
+
Enabled: false
|
44
|
+
|
45
|
+
Layout/DotPosition:
|
46
|
+
EnforcedStyle: trailing
|
47
|
+
|
48
|
+
Naming/FileName:
|
49
|
+
Enabled: false
|
50
|
+
|
51
|
+
Layout/AccessModifierIndentation:
|
52
|
+
Enabled: false
|
53
|
+
|
54
|
+
Style/TrailingCommaInArrayLiteral:
|
55
|
+
EnforcedStyleForMultiline: 'no_comma'
|
56
|
+
|
57
|
+
Style/TrailingCommaInHashLiteral:
|
58
|
+
EnforcedStyleForMultiline: 'no_comma'
|
59
|
+
|
60
|
+
RSpec/MultipleExpectations:
|
61
|
+
Max: 30
|
62
|
+
|
63
|
+
RSpec/ExampleLength:
|
64
|
+
Max: 35
|
65
|
+
|
66
|
+
RSpec/FilePath:
|
67
|
+
Enabled: false
|
68
|
+
|
69
|
+
RSpec/BeforeAfterAll:
|
70
|
+
Enabled: false
|
71
|
+
|
72
|
+
RSpec/NamedSubject:
|
73
|
+
Enabled: false
|
74
|
+
|
75
|
+
RSpec/EmptyExampleGroup:
|
76
|
+
Enabled: false
|
77
|
+
|
78
|
+
RSpec/MultipleMemoizedHelpers:
|
79
|
+
Max: 10
|
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
## How to contribute
|
2
|
+
|
3
|
+
Bug reports and pull requests are welcome!
|
4
|
+
|
5
|
+
1. Fork it
|
6
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
7
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
8
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
9
|
+
5. Create new Pull Request
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,9 +1,8 @@
|
|
1
1
|
# HaloAPI
|
2
2
|
[![Gem Version](https://badge.fury.io/rb/halo-api.svg)](https://badge.fury.io/rb/halo-api)
|
3
|
-
[![Dependency Status](https://gemnasium.com/badges/github.com/xarlybovi/halo-api.svg)](https://gemnasium.com/github.com/xarlybovi/halo-api)
|
4
3
|
[![Code Climate](https://codeclimate.com/github/xarlybovi/halo-api.png)](https://codeclimate.com/github/xarlybovi/halo-api)
|
5
|
-
[![
|
6
|
-
[![
|
4
|
+
[![Actions Status](https://github.com/xarlybovi/halo-api/workflows/CI/badge.svg)](https://github.com/xarlybovi/halo-api/actions)
|
5
|
+
[![codecov](https://codecov.io/gh/xarlybovi/halo-api/branch/master/graph/badge.svg?token=NJLMA4MDU1)](https://codecov.io/gh/xarlybovi/halo-api)
|
7
6
|
|
8
7
|
Wrapper for Halo Public API (BETA). https://developer.haloapi.com
|
9
8
|
|
@@ -12,7 +11,7 @@ Wrapper for Halo Public API (BETA). https://developer.haloapi.com
|
|
12
11
|
Add this line to your application's Gemfile:
|
13
12
|
|
14
13
|
```ruby
|
15
|
-
gem 'halo-api'
|
14
|
+
gem 'halo-api', '~> 1.0.0'
|
16
15
|
```
|
17
16
|
|
18
17
|
And then execute:
|
@@ -32,23 +31,32 @@ Halo.configure do |config|
|
|
32
31
|
end
|
33
32
|
````
|
34
33
|
|
35
|
-
|
34
|
+
Configuration with redis and region (optional parameters)
|
36
35
|
````ruby
|
37
36
|
Halo.configure do |config|
|
38
37
|
config.api_key = ENV['HALO_API_KEY']
|
39
|
-
config.region = ENV['HALO_REGION']
|
38
|
+
config.region = ENV['HALO_REGION'] # default 'en'
|
40
39
|
config.redis = ENV['HALO_REDIS']
|
40
|
+
config.ttl = ENV['HALO_TTL'] # default 1800
|
41
41
|
end
|
42
42
|
````
|
43
43
|
|
44
44
|
````ruby
|
45
45
|
halo5_client = Halo.halo5
|
46
|
+
# => Halo::Halo5
|
46
47
|
halo_wars2_client = Halo.halo_wars2
|
48
|
+
# => Halo::HaloWars2
|
47
49
|
|
48
50
|
h5_missions = halo5_client.metadata.campaign_missions
|
51
|
+
# => Array
|
52
|
+
h5_enemies = halo5_client.metadata.enemies
|
53
|
+
# => Array
|
49
54
|
h5_player_appearance = halo5_client.profile(player: 'xarly bovi').player_appearance
|
50
|
-
|
51
|
-
|
55
|
+
# => Array
|
56
|
+
hw2_campaign_levels = halo_wars2_client.metadata.campaign_levels
|
57
|
+
# => Array
|
58
|
+
hw2_seasons = halo_wars2_client.metadata.seasons
|
59
|
+
# => Array
|
52
60
|
````
|
53
61
|
|
54
62
|
## TODO
|
@@ -61,16 +69,6 @@ h2w_campaign_levels = halo_wars2_client.metadata.campaign_levels
|
|
61
69
|
- [ ] Paged requests
|
62
70
|
- [ ] Documentation
|
63
71
|
|
64
|
-
## Contributing
|
65
|
-
|
66
|
-
Bug reports and pull requests are welcome!
|
67
|
-
|
68
|
-
1. Fork it
|
69
|
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
70
|
-
3. Commit your changes (`git commit -am 'Add some feature'`)
|
71
|
-
4. Push to the branch (`git push origin my-new-feature`)
|
72
|
-
5. Create new Pull Request
|
73
|
-
|
74
72
|
## License
|
75
73
|
|
76
74
|
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
data/Rakefile
CHANGED
data/bin/console
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
2
3
|
|
3
|
-
require
|
4
|
-
require
|
4
|
+
require 'bundler/setup'
|
5
|
+
require 'halo-api'
|
5
6
|
|
6
7
|
# You can add fixtures and/or initialization code here to make experimenting
|
7
8
|
# with your gem easier. You can also use a different console, if you like.
|
@@ -10,5 +11,5 @@ require "halo-api"
|
|
10
11
|
# require "pry"
|
11
12
|
# Pry.start
|
12
13
|
|
13
|
-
require
|
14
|
+
require 'irb'
|
14
15
|
IRB.start(__FILE__)
|
data/halo-api.gemspec
CHANGED
@@ -1,8 +1,6 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
-
require 'halo-api/version'
|
3
|
+
require_relative 'lib/halo-api/version'
|
6
4
|
|
7
5
|
Gem::Specification.new do |spec|
|
8
6
|
spec.name = 'halo-api'
|
@@ -15,26 +13,30 @@ Gem::Specification.new do |spec|
|
|
15
13
|
spec.homepage = 'https://github.com/xarlybovi/halo-api.git'
|
16
14
|
spec.license = 'MIT'
|
17
15
|
|
18
|
-
spec.files
|
19
|
-
f.match(%r{
|
16
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
17
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
|
20
18
|
end
|
21
19
|
spec.bindir = 'exe'
|
22
|
-
spec.executables = spec.files.grep(%r{
|
20
|
+
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
23
21
|
spec.require_paths = ['lib']
|
24
22
|
|
25
|
-
# This gem will work with 2.
|
26
|
-
spec.required_ruby_version = '>= 2.
|
23
|
+
# This gem will work with 2.5.8 or greater
|
24
|
+
spec.required_ruby_version = '>= 2.5.8'
|
27
25
|
|
28
|
-
spec.add_runtime_dependency '
|
29
|
-
spec.add_runtime_dependency '
|
30
|
-
spec.add_runtime_dependency 'redis', '~> 4.
|
26
|
+
spec.add_runtime_dependency 'addressable', '~> 2.8', '>= 2.8.0'
|
27
|
+
spec.add_runtime_dependency 'httparty', '~> 0.18.1'
|
28
|
+
spec.add_runtime_dependency 'redis', '~> 4.3'
|
31
29
|
|
32
|
-
spec.add_development_dependency 'bundler', '~>
|
33
|
-
spec.add_development_dependency '
|
34
|
-
spec.add_development_dependency 'rspec', '~> 3.6'
|
30
|
+
spec.add_development_dependency 'bundler', '~> 2.2.24'
|
31
|
+
spec.add_development_dependency 'codecov', '~> 0.5.2'
|
35
32
|
spec.add_development_dependency 'dotenv', '~> 2.2', '>= 2.2.1'
|
36
|
-
spec.add_development_dependency 'rubocop', '~> 0.50'
|
37
|
-
spec.add_development_dependency 'coveralls', '~> 0.8.21'
|
38
33
|
spec.add_development_dependency 'pry', '~> 0.11'
|
39
|
-
spec.add_development_dependency '
|
34
|
+
spec.add_development_dependency 'rake', '~> 13.0.6'
|
35
|
+
spec.add_development_dependency 'rspec', '~> 3.10.0'
|
36
|
+
spec.add_development_dependency 'rubocop', '~> 1.18'
|
37
|
+
spec.add_development_dependency 'rubocop-performance', '~> 1.11'
|
38
|
+
spec.add_development_dependency 'rubocop-rspec', '~> 2.4.0'
|
39
|
+
spec.add_development_dependency 'simplecov', '~> 0.21'
|
40
|
+
spec.add_development_dependency 'vcr', '~> 6.0'
|
41
|
+
spec.add_development_dependency 'webmock', '~> 3.13'
|
40
42
|
end
|
data/lib/halo-api.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'halo-api/version'
|
2
4
|
require 'halo-api/configuration'
|
3
5
|
require 'halo-api/client'
|
@@ -6,12 +8,10 @@ require 'halo-api/api_response'
|
|
6
8
|
require 'halo-api/clients/halo5_client'
|
7
9
|
require 'halo-api/clients/halo_wars2_client'
|
8
10
|
|
9
|
-
|
10
11
|
module Halo
|
11
12
|
extend Configuration
|
12
13
|
|
13
14
|
class << self
|
14
|
-
|
15
15
|
def halo5(options = {})
|
16
16
|
Halo::Clients::Halo5Client.new(options)
|
17
17
|
end
|
@@ -19,6 +19,5 @@ module Halo
|
|
19
19
|
def halo_wars2(options = {})
|
20
20
|
Halo::Clients::HaloWars2Client.new(options)
|
21
21
|
end
|
22
|
-
|
23
22
|
end
|
24
|
-
end
|
23
|
+
end
|
data/lib/halo-api/client.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Halo
|
2
4
|
class Client
|
3
|
-
|
4
5
|
attr_accessor(*Configuration::OPTIONS)
|
5
6
|
|
6
7
|
def initialize(options = {})
|
@@ -15,6 +16,7 @@ module Halo
|
|
15
16
|
|
16
17
|
def set_up_cache(redis_url, ttl)
|
17
18
|
return @cached = false unless redis_url
|
19
|
+
|
18
20
|
@ttl = ttl || Halo::Configuration::DEFAULT_TTL
|
19
21
|
@cached = true
|
20
22
|
@redis = Redis.new url: redis_url
|
@@ -35,7 +37,6 @@ module Halo
|
|
35
37
|
cache_store[:cached]
|
36
38
|
end
|
37
39
|
|
38
|
-
|
39
40
|
private
|
40
41
|
|
41
42
|
def merge_options_and_return_obj(options, obj)
|
@@ -43,4 +44,4 @@ module Halo
|
|
43
44
|
obj.new(opts)
|
44
45
|
end
|
45
46
|
end
|
46
|
-
end
|
47
|
+
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'halo-api/client'
|
2
4
|
|
3
5
|
require 'halo-api/modules/halo5/metadata'
|
@@ -5,13 +7,10 @@ require 'halo-api/modules/halo5/profile'
|
|
5
7
|
require 'halo-api/modules/halo5/stats'
|
6
8
|
require 'halo-api/modules/halo5/ugc'
|
7
9
|
|
8
|
-
|
9
10
|
module Halo
|
10
11
|
module Clients
|
11
|
-
|
12
12
|
# Halo 5 Client
|
13
13
|
class Halo5Client < Client
|
14
|
-
|
15
14
|
def initialize(options = {})
|
16
15
|
super(options)
|
17
16
|
end
|
@@ -31,7 +30,6 @@ module Halo
|
|
31
30
|
def ugc(options = {})
|
32
31
|
merge_options_and_return_obj(options, Halo::Halo5::Ugc)
|
33
32
|
end
|
34
|
-
|
35
33
|
end
|
36
34
|
end
|
37
35
|
end
|
@@ -1,15 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'halo-api/client'
|
2
4
|
|
3
5
|
require 'halo-api/modules/halo_wars2/metadata'
|
4
6
|
require 'halo-api/modules/halo_wars2/stats'
|
5
7
|
|
6
|
-
|
7
8
|
module Halo
|
8
9
|
module Clients
|
9
|
-
|
10
10
|
# Halo Wars 2 Client
|
11
11
|
class HaloWars2Client < Client
|
12
|
-
|
13
12
|
def initialize(options = {})
|
14
13
|
super(options)
|
15
14
|
end
|
@@ -21,7 +20,6 @@ module Halo
|
|
21
20
|
def stats(options = {})
|
22
21
|
merge_options_and_return_obj(options, Halo::HaloWars2::Stats)
|
23
22
|
end
|
24
|
-
|
25
23
|
end
|
26
24
|
end
|
27
25
|
end
|
@@ -1,11 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Halo
|
2
4
|
module Configuration
|
3
|
-
|
4
5
|
OPTIONS = %i[api_key region redis ttl].freeze
|
5
6
|
|
6
7
|
DEFAULT_API_KEY = nil
|
7
|
-
DEFAULT_REGION = 'en'
|
8
|
-
DEFAULT_REDIS = 'redis://localhost:6379'
|
8
|
+
DEFAULT_REGION = 'en'
|
9
|
+
DEFAULT_REDIS = 'redis://localhost:6379'
|
9
10
|
DEFAULT_TTL = 1800 # 30m
|
10
11
|
|
11
12
|
attr_accessor(*OPTIONS)
|
@@ -19,6 +20,5 @@ module Halo
|
|
19
20
|
option.merge!(key => send(key))
|
20
21
|
end
|
21
22
|
end
|
22
|
-
|
23
23
|
end
|
24
|
-
end
|
24
|
+
end
|
@@ -1,7 +1,8 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Halo
|
2
4
|
module Halo5
|
3
5
|
class Metadata < APIResponse
|
4
|
-
|
5
6
|
def initialize(options = {})
|
6
7
|
@endpoint = '/metadata/h5/metadata'
|
7
8
|
|
@@ -16,6 +17,10 @@ module Halo
|
|
16
17
|
get_data("#{@endpoint}/commendations", options)
|
17
18
|
end
|
18
19
|
|
20
|
+
def company_commendations(options = {})
|
21
|
+
get_data("#{@endpoint}/company-commendations", options)
|
22
|
+
end
|
23
|
+
|
19
24
|
def csr_designations(options = {})
|
20
25
|
get_data("#{@endpoint}/csr-designations", options)
|
21
26
|
end
|
@@ -52,8 +57,8 @@ module Halo
|
|
52
57
|
get_data("#{@endpoint}/medals", options)
|
53
58
|
end
|
54
59
|
|
55
|
-
def
|
56
|
-
get_data("#{@endpoint}/
|
60
|
+
def playlists(options = {})
|
61
|
+
get_data("#{@endpoint}/playlists", options)
|
57
62
|
end
|
58
63
|
|
59
64
|
def requisition(id, options = {})
|
@@ -87,7 +92,6 @@ module Halo
|
|
87
92
|
def weapons(options = {})
|
88
93
|
get_data("#{@endpoint}/weapons", options)
|
89
94
|
end
|
90
|
-
|
91
95
|
end
|
92
96
|
end
|
93
97
|
end
|
@@ -1,7 +1,8 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Halo
|
2
4
|
module Halo5
|
3
5
|
class Stats < APIResponse
|
4
|
-
|
5
6
|
def initialize(options = {})
|
6
7
|
@endpoint = '/stats/h5'
|
7
8
|
super(options)
|
@@ -74,7 +75,6 @@ module Halo
|
|
74
75
|
def pc_psr_custom(players, options = {})
|
75
76
|
get_data("#{@endpoint}pc/servicerecords/custom", options.merge(players: players))
|
76
77
|
end
|
77
|
-
|
78
78
|
end
|
79
79
|
end
|
80
80
|
end
|
@@ -1,7 +1,8 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Halo
|
2
4
|
module Halo5
|
3
5
|
class Ugc < APIResponse
|
4
|
-
|
5
6
|
def initialize(options = {})
|
6
7
|
@player = options.delete(:player)
|
7
8
|
@endpoint = "/ugc/h5/players/#{@player}"
|
@@ -24,7 +25,6 @@ module Halo
|
|
24
25
|
def player_map_variants(options = {})
|
25
26
|
get_data("#{@endpoint}/mapvariants", options)
|
26
27
|
end
|
27
|
-
|
28
28
|
end
|
29
29
|
end
|
30
30
|
end
|
@@ -1,7 +1,8 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Halo
|
2
4
|
module HaloWars2
|
3
5
|
class Metadata < APIResponse
|
4
|
-
|
5
6
|
def initialize(options = {})
|
6
7
|
@endpoint = '/metadata/hw2'
|
7
8
|
|
@@ -71,7 +72,6 @@ module Halo
|
|
71
72
|
def techs(options = {})
|
72
73
|
get_data("#{@endpoint}/techs", options)
|
73
74
|
end
|
74
|
-
|
75
75
|
end
|
76
76
|
end
|
77
77
|
end
|
@@ -1,7 +1,8 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Halo
|
2
4
|
module HaloWars2
|
3
5
|
class Stats < APIResponse
|
4
|
-
|
5
6
|
def initialize(options = {})
|
6
7
|
@endpoint = '/stats/hw2'
|
7
8
|
|
@@ -43,7 +44,6 @@ module Halo
|
|
43
44
|
def player_xp(players, options = {})
|
44
45
|
get_data("#{@endpoint}/xp", options.merge(players: players))
|
45
46
|
end
|
46
|
-
|
47
47
|
end
|
48
48
|
end
|
49
49
|
end
|
data/lib/halo-api/version.rb
CHANGED
metadata
CHANGED
@@ -1,181 +1,237 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: halo-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carlos Ruiz
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-08-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: addressable
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 2.8.0
|
17
20
|
- - "~>"
|
18
21
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
22
|
+
version: '2.8'
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 2.8.0
|
24
30
|
- - "~>"
|
25
31
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
32
|
+
version: '2.8'
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
34
|
+
name: httparty
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
30
36
|
requirements:
|
31
37
|
- - "~>"
|
32
38
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
34
|
-
- - ">="
|
35
|
-
- !ruby/object:Gem::Version
|
36
|
-
version: 2.5.2
|
39
|
+
version: 0.18.1
|
37
40
|
type: :runtime
|
38
41
|
prerelease: false
|
39
42
|
version_requirements: !ruby/object:Gem::Requirement
|
40
43
|
requirements:
|
41
44
|
- - "~>"
|
42
45
|
- !ruby/object:Gem::Version
|
43
|
-
version:
|
44
|
-
- - ">="
|
45
|
-
- !ruby/object:Gem::Version
|
46
|
-
version: 2.5.2
|
46
|
+
version: 0.18.1
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: redis
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
51
|
- - "~>"
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: '4.
|
53
|
+
version: '4.3'
|
54
54
|
type: :runtime
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
58
|
- - "~>"
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version: '4.
|
60
|
+
version: '4.3'
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
62
|
name: bundler
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|
64
64
|
requirements:
|
65
65
|
- - "~>"
|
66
66
|
- !ruby/object:Gem::Version
|
67
|
-
version:
|
67
|
+
version: 2.2.24
|
68
68
|
type: :development
|
69
69
|
prerelease: false
|
70
70
|
version_requirements: !ruby/object:Gem::Requirement
|
71
71
|
requirements:
|
72
72
|
- - "~>"
|
73
73
|
- !ruby/object:Gem::Version
|
74
|
-
version:
|
74
|
+
version: 2.2.24
|
75
75
|
- !ruby/object:Gem::Dependency
|
76
|
-
name:
|
76
|
+
name: codecov
|
77
77
|
requirement: !ruby/object:Gem::Requirement
|
78
78
|
requirements:
|
79
79
|
- - "~>"
|
80
80
|
- !ruby/object:Gem::Version
|
81
|
-
version:
|
81
|
+
version: 0.5.2
|
82
82
|
type: :development
|
83
83
|
prerelease: false
|
84
84
|
version_requirements: !ruby/object:Gem::Requirement
|
85
85
|
requirements:
|
86
86
|
- - "~>"
|
87
87
|
- !ruby/object:Gem::Version
|
88
|
-
version:
|
88
|
+
version: 0.5.2
|
89
89
|
- !ruby/object:Gem::Dependency
|
90
|
-
name:
|
90
|
+
name: dotenv
|
91
91
|
requirement: !ruby/object:Gem::Requirement
|
92
92
|
requirements:
|
93
93
|
- - "~>"
|
94
94
|
- !ruby/object:Gem::Version
|
95
|
-
version: '
|
95
|
+
version: '2.2'
|
96
|
+
- - ">="
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
version: 2.2.1
|
96
99
|
type: :development
|
97
100
|
prerelease: false
|
98
101
|
version_requirements: !ruby/object:Gem::Requirement
|
99
102
|
requirements:
|
100
103
|
- - "~>"
|
101
104
|
- !ruby/object:Gem::Version
|
102
|
-
version: '
|
105
|
+
version: '2.2'
|
106
|
+
- - ">="
|
107
|
+
- !ruby/object:Gem::Version
|
108
|
+
version: 2.2.1
|
103
109
|
- !ruby/object:Gem::Dependency
|
104
|
-
name:
|
110
|
+
name: pry
|
105
111
|
requirement: !ruby/object:Gem::Requirement
|
106
112
|
requirements:
|
107
113
|
- - "~>"
|
108
114
|
- !ruby/object:Gem::Version
|
109
|
-
version: '
|
110
|
-
|
115
|
+
version: '0.11'
|
116
|
+
type: :development
|
117
|
+
prerelease: false
|
118
|
+
version_requirements: !ruby/object:Gem::Requirement
|
119
|
+
requirements:
|
120
|
+
- - "~>"
|
111
121
|
- !ruby/object:Gem::Version
|
112
|
-
version:
|
122
|
+
version: '0.11'
|
123
|
+
- !ruby/object:Gem::Dependency
|
124
|
+
name: rake
|
125
|
+
requirement: !ruby/object:Gem::Requirement
|
126
|
+
requirements:
|
127
|
+
- - "~>"
|
128
|
+
- !ruby/object:Gem::Version
|
129
|
+
version: 13.0.6
|
113
130
|
type: :development
|
114
131
|
prerelease: false
|
115
132
|
version_requirements: !ruby/object:Gem::Requirement
|
116
133
|
requirements:
|
117
134
|
- - "~>"
|
118
135
|
- !ruby/object:Gem::Version
|
119
|
-
version:
|
120
|
-
|
136
|
+
version: 13.0.6
|
137
|
+
- !ruby/object:Gem::Dependency
|
138
|
+
name: rspec
|
139
|
+
requirement: !ruby/object:Gem::Requirement
|
140
|
+
requirements:
|
141
|
+
- - "~>"
|
121
142
|
- !ruby/object:Gem::Version
|
122
|
-
version:
|
143
|
+
version: 3.10.0
|
144
|
+
type: :development
|
145
|
+
prerelease: false
|
146
|
+
version_requirements: !ruby/object:Gem::Requirement
|
147
|
+
requirements:
|
148
|
+
- - "~>"
|
149
|
+
- !ruby/object:Gem::Version
|
150
|
+
version: 3.10.0
|
123
151
|
- !ruby/object:Gem::Dependency
|
124
152
|
name: rubocop
|
125
153
|
requirement: !ruby/object:Gem::Requirement
|
126
154
|
requirements:
|
127
155
|
- - "~>"
|
128
156
|
- !ruby/object:Gem::Version
|
129
|
-
version: '
|
157
|
+
version: '1.18'
|
130
158
|
type: :development
|
131
159
|
prerelease: false
|
132
160
|
version_requirements: !ruby/object:Gem::Requirement
|
133
161
|
requirements:
|
134
162
|
- - "~>"
|
135
163
|
- !ruby/object:Gem::Version
|
136
|
-
version: '
|
164
|
+
version: '1.18'
|
137
165
|
- !ruby/object:Gem::Dependency
|
138
|
-
name:
|
166
|
+
name: rubocop-performance
|
139
167
|
requirement: !ruby/object:Gem::Requirement
|
140
168
|
requirements:
|
141
169
|
- - "~>"
|
142
170
|
- !ruby/object:Gem::Version
|
143
|
-
version:
|
171
|
+
version: '1.11'
|
144
172
|
type: :development
|
145
173
|
prerelease: false
|
146
174
|
version_requirements: !ruby/object:Gem::Requirement
|
147
175
|
requirements:
|
148
176
|
- - "~>"
|
149
177
|
- !ruby/object:Gem::Version
|
150
|
-
version:
|
178
|
+
version: '1.11'
|
151
179
|
- !ruby/object:Gem::Dependency
|
152
|
-
name:
|
180
|
+
name: rubocop-rspec
|
153
181
|
requirement: !ruby/object:Gem::Requirement
|
154
182
|
requirements:
|
155
183
|
- - "~>"
|
156
184
|
- !ruby/object:Gem::Version
|
157
|
-
version:
|
185
|
+
version: 2.4.0
|
158
186
|
type: :development
|
159
187
|
prerelease: false
|
160
188
|
version_requirements: !ruby/object:Gem::Requirement
|
161
189
|
requirements:
|
162
190
|
- - "~>"
|
163
191
|
- !ruby/object:Gem::Version
|
164
|
-
version:
|
192
|
+
version: 2.4.0
|
193
|
+
- !ruby/object:Gem::Dependency
|
194
|
+
name: simplecov
|
195
|
+
requirement: !ruby/object:Gem::Requirement
|
196
|
+
requirements:
|
197
|
+
- - "~>"
|
198
|
+
- !ruby/object:Gem::Version
|
199
|
+
version: '0.21'
|
200
|
+
type: :development
|
201
|
+
prerelease: false
|
202
|
+
version_requirements: !ruby/object:Gem::Requirement
|
203
|
+
requirements:
|
204
|
+
- - "~>"
|
205
|
+
- !ruby/object:Gem::Version
|
206
|
+
version: '0.21'
|
207
|
+
- !ruby/object:Gem::Dependency
|
208
|
+
name: vcr
|
209
|
+
requirement: !ruby/object:Gem::Requirement
|
210
|
+
requirements:
|
211
|
+
- - "~>"
|
212
|
+
- !ruby/object:Gem::Version
|
213
|
+
version: '6.0'
|
214
|
+
type: :development
|
215
|
+
prerelease: false
|
216
|
+
version_requirements: !ruby/object:Gem::Requirement
|
217
|
+
requirements:
|
218
|
+
- - "~>"
|
219
|
+
- !ruby/object:Gem::Version
|
220
|
+
version: '6.0'
|
165
221
|
- !ruby/object:Gem::Dependency
|
166
|
-
name:
|
222
|
+
name: webmock
|
167
223
|
requirement: !ruby/object:Gem::Requirement
|
168
224
|
requirements:
|
169
225
|
- - "~>"
|
170
226
|
- !ruby/object:Gem::Version
|
171
|
-
version: '
|
227
|
+
version: '3.13'
|
172
228
|
type: :development
|
173
229
|
prerelease: false
|
174
230
|
version_requirements: !ruby/object:Gem::Requirement
|
175
231
|
requirements:
|
176
232
|
- - "~>"
|
177
233
|
- !ruby/object:Gem::Version
|
178
|
-
version: '
|
234
|
+
version: '3.13'
|
179
235
|
description: Wrapper for Halo Public API (BETA). https://developer.haloapi.com
|
180
236
|
email:
|
181
237
|
- xarlybovi@gmail.com
|
@@ -183,9 +239,12 @@ executables: []
|
|
183
239
|
extensions: []
|
184
240
|
extra_rdoc_files: []
|
185
241
|
files:
|
242
|
+
- ".env.example"
|
243
|
+
- ".github/workflows/main.yml"
|
186
244
|
- ".gitignore"
|
187
245
|
- ".rspec"
|
188
|
-
- ".
|
246
|
+
- ".rubocop.yml"
|
247
|
+
- CONTRIBUTING.md
|
189
248
|
- Gemfile
|
190
249
|
- LICENSE.txt
|
191
250
|
- README.md
|
@@ -218,15 +277,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
218
277
|
requirements:
|
219
278
|
- - ">="
|
220
279
|
- !ruby/object:Gem::Version
|
221
|
-
version: 2.
|
280
|
+
version: 2.5.8
|
222
281
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
223
282
|
requirements:
|
224
283
|
- - ">="
|
225
284
|
- !ruby/object:Gem::Version
|
226
285
|
version: '0'
|
227
286
|
requirements: []
|
228
|
-
|
229
|
-
rubygems_version: 2.6.11
|
287
|
+
rubygems_version: 3.0.3.1
|
230
288
|
signing_key:
|
231
289
|
specification_version: 4
|
232
290
|
summary: Wrapper for Halo Public API.
|