open_dota_api 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 27e6de5245cfbbfb2198500daf1100ac4a0a36a3
4
- data.tar.gz: 445de76394198e662bec06c96a8ad44f9735ceec
3
+ metadata.gz: 10283b2823ec6879ee2cbc78d3e7a17455a3a806
4
+ data.tar.gz: eff45f3ecc4dfef96d2d915fa2fee43a0ebfa606
5
5
  SHA512:
6
- metadata.gz: 144462d5ff85254be1675d734f58258a0ad92b6b789e638066385323804b558d1aff53a4bba956dc19b9e2579b08b2c16ebf4db6e781a285ece395fa85ad38f4
7
- data.tar.gz: 69bc1ac8454e5fbe99e030dc46279d787e8c8d3dc4d925cd7f082189e3565f4bee75ffa5af3c42abc5ae0ab319b6572ad7ca2c86fcc302739b946034768c9a39
6
+ metadata.gz: 30840cf124f3c4ef6f24e862d222cab56dfe20e118b9bf262b7715e126172c3d97bdae6ea02dfbafe99d05d0068c6c894a6847904c5fe48b83e7f1e49e391566
7
+ data.tar.gz: f956ca55c5f2f13d14b3a613b2f8d28020d6680542ed4c71eddc0909aa93786d3970ce5ea92fc0f73c8e6dc7109403c8edc31c61832cf930428bff40d47e2ac9
@@ -6,7 +6,7 @@ require 'open_dota_api/hero'
6
6
 
7
7
  module OpenDotaApi
8
8
  class Client
9
- INTERFACE = 'api'
9
+ INTERFACE = 'api'.freeze
10
10
 
11
11
  def leagues
12
12
  leagues_data = request(League::ENDPOINT)
@@ -21,7 +21,7 @@ module OpenDotaApi
21
21
  end
22
22
 
23
23
  def matches(match_id = nil)
24
- match_data = request(Match::ENDPOINT, match_id)
24
+ match_data = request(Match::ENDPOINT, match_id)
25
25
  return {} unless match_data
26
26
  Match.new(match_data)
27
27
  end
@@ -4,7 +4,7 @@ module OpenDotaApi
4
4
  class Hero < Entity
5
5
  include Entities::Instantiatable
6
6
 
7
- ENDPOINT = 'heroes'
7
+ ENDPOINT = 'heroes'.freeze
8
8
 
9
9
  def id
10
10
  data['id']
@@ -4,7 +4,7 @@ module OpenDotaApi
4
4
  class League < Entity
5
5
  include Entities::Instantiatable
6
6
 
7
- ENDPOINT = 'leagues'
7
+ ENDPOINT = 'leagues'.freeze
8
8
 
9
9
  def league_id
10
10
  data['leagueid']
@@ -3,7 +3,7 @@ require 'open_dota_api/matches/player'
3
3
 
4
4
  module OpenDotaApi
5
5
  class Match < Entity
6
- ENDPOINT = 'matches'
6
+ ENDPOINT = 'matches'.freeze
7
7
 
8
8
  def match_id
9
9
  data['match_id']
@@ -58,7 +58,7 @@ module OpenDotaApi
58
58
  end
59
59
 
60
60
  def replay_url
61
- "http://replay#{ cluster }.valve.net/570/#{ match_id }_#{ replay_salt }.dem.bz2"
61
+ "http://replay#{cluster}.valve.net/570/#{match_id}_#{replay_salt}.dem.bz2"
62
62
  end
63
63
 
64
64
  def players
@@ -3,7 +3,6 @@ require 'open_dota_api/entity'
3
3
  module OpenDotaApi
4
4
  module Matches
5
5
  class Player < Entity
6
-
7
6
  def match_id
8
7
  data['match_id']
9
8
  end
@@ -4,7 +4,7 @@ module OpenDotaApi
4
4
  class Team < Entity
5
5
  include Entities::Instantiatable
6
6
 
7
- ENDPOINT = 'teams'
7
+ ENDPOINT = 'teams'.freeze
8
8
 
9
9
  def team_id
10
10
  data['team_id']
@@ -34,4 +34,4 @@ module OpenDotaApi
34
34
  data['tag']
35
35
  end
36
36
  end
37
- end
37
+ end
@@ -1,3 +1,3 @@
1
1
  module OpenDotaApi
2
- VERSION = '0.0.2'
2
+ VERSION = '0.0.3'.freeze
3
3
  end
@@ -9,9 +9,9 @@ describe OpenDotaApi::Connection do
9
9
  end
10
10
 
11
11
  it 'returns response object' do
12
- stub_request(:get, "http://api.opendota.com/").
13
- with(headers: {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'User-Agent'=>'Ruby'}).
14
- to_return(status: 200, body: "", headers: {})
12
+ stub_request(:get, 'http://api.opendota.com/')
13
+ .with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'User-Agent' => 'Ruby' })
14
+ .to_return(status: 200, body: '', headers: {})
15
15
 
16
16
  expect(OpenDotaApi::Connection.get(pathname).class).to eq HTTParty::Response
17
17
  end
@@ -6,7 +6,7 @@ describe OpenDotaApi::Hero do
6
6
  let(:localized_name) { 'Anti-Mage' }
7
7
  let(:primary_attr) { 'agi' }
8
8
  let(:attack_type) { 'Melee' }
9
- let(:roles) { %w(Carry Escape Nuker) }
9
+ let(:roles) { %w[Carry Escape Nuker] }
10
10
  let(:legs) { 2 }
11
11
 
12
12
  let(:heroes_file) { File.read('spec/data/heroes.json') }
@@ -45,4 +45,4 @@ describe OpenDotaApi::League do
45
45
  expect(league.name).to eq name
46
46
  end
47
47
  end
48
- end
48
+ end
@@ -1,19 +1,19 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe OpenDotaApi::Match do
4
- let(:match_id) { 3149215336 }
5
- let(:start_time) { 1493566333 }
4
+ let(:match_id) { 3_149_215_336 }
5
+ let(:start_time) { 1_493_566_333 }
6
6
  let(:duration) { 2109 }
7
- let(:series_id) { 135248 }
7
+ let(:series_id) { 135_248 }
8
8
  let(:series_type) { 2 }
9
- let(:radiant_team_id) { 2586976 }
10
- let(:dire_team_id) { 1883502 }
11
- let(:match_seq_num) { 2750393746 }
9
+ let(:radiant_team_id) { 2_586_976 }
10
+ let(:dire_team_id) { 1_883_502 }
11
+ let(:match_seq_num) { 2_750_393_746 }
12
12
  let(:league_id) { 5157 }
13
13
  let(:first_blood_time) { 53 }
14
14
  let(:winner) { :dire }
15
15
  let(:cluster) { 136 }
16
- let(:replay_salt) { 565926067 }
16
+ let(:replay_salt) { 565_926_067 }
17
17
  let(:replay_url) { 'http://replay136.valve.net/570/3149215336_565926067.dem.bz2' }
18
18
  let(:players_length) { 10 }
19
19
  let(:player_class) { OpenDotaApi::Match::Player }
@@ -93,7 +93,7 @@ describe OpenDotaApi::Match do
93
93
 
94
94
  it 'returns players' do
95
95
  expect(match.players.length).to eq players_length
96
- expect(match.players.all? { |player| player.kind_of? player_class }).to be_truthy
96
+ expect(match.players.all? { |player| player.is_a? player_class }).to be_truthy
97
97
  end
98
98
  end
99
99
  end
@@ -1,9 +1,9 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe OpenDotaApi::Matches::Player do
4
- let(:match_id) { 3149215336 }
4
+ let(:match_id) { 3_149_215_336 }
5
5
  let(:player_slot) { 0 }
6
- let(:account_id) { 94155156 }
6
+ let(:account_id) { 94_155_156 }
7
7
  let(:assists) { 13 }
8
8
  let(:camps_stacked) { 4 }
9
9
  let(:deaths) { 7 }
@@ -5,7 +5,7 @@ describe OpenDotaApi::Team do
5
5
  let(:rating) { 1550.24 }
6
6
  let(:wins) { 539 }
7
7
  let(:losses) { 355 }
8
- let(:last_match_time) { 1500684592 }
8
+ let(:last_match_time) { 1_500_684_592 }
9
9
  let(:name) { 'Team Liquid' }
10
10
  let(:tag) { 'Liquid' }
11
11
 
@@ -8,4 +8,4 @@ describe OpenDotaApi do
8
8
  it 'respond to the client' do
9
9
  expect(OpenDotaApi.client).to be_a(OpenDotaApi::Client)
10
10
  end
11
- end
11
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: open_dota_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yaroslav Oslavskiy
@@ -116,7 +116,6 @@ extensions: []
116
116
  extra_rdoc_files: []
117
117
  files:
118
118
  - MIT-LICENSE
119
- - Rakefile
120
119
  - lib/open_dota_api.rb
121
120
  - lib/open_dota_api/client.rb
122
121
  - lib/open_dota_api/connection.rb
data/Rakefile DELETED
@@ -1,22 +0,0 @@
1
- begin
2
- require 'bundler/setup'
3
- rescue LoadError
4
- puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
- end
6
-
7
- require 'rdoc/task'
8
-
9
- RDoc::Task.new(:rdoc) do |rdoc|
10
- rdoc.rdoc_dir = 'rdoc'
11
- rdoc.title = 'OpenDotaApi'
12
- rdoc.options << '--line-numbers'
13
- rdoc.rdoc_files.include('README.rdoc')
14
- rdoc.rdoc_files.include('lib/**/*.rb')
15
- end
16
-
17
-
18
- Bundler::GemHelper.install_tasks
19
-
20
-
21
-
22
- task default: :test