hoopscrape 1.0.5 → 1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- YzE5NTc0N2MyODcxZDM0ZjRhYTE4MmYzNTlmMzhhYzlmNDJjY2JjMA==
5
- data.tar.gz: !binary |-
6
- NGVhYmNmMzA5Nzk4NDMzNDVhZjU4Mzg1NjgxM2M2ODQwNGI4NmYyYw==
2
+ SHA1:
3
+ metadata.gz: 1ae9b22a5a1e472fe46f78ecc3243f367209d172
4
+ data.tar.gz: eb033bf2d961c331b089192ede7f89ef4595a98b
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- Yzk1NmQ4ZjNkNGNiY2I0YTVlZTJhZDViNzczZjNjNDkwYzIxYWZkOTNkYTk1
10
- NjE3Y2UxZWEzODBiNjlhZjE5YTlkYjRiZGIzNjVlMDhjMTNiNmMxMWM0NThl
11
- MTMwZGRhNGM3ZTVkNTI4Y2IyODg5M2U0ZmE3MzA0Y2M2ZTU2ZTE=
12
- data.tar.gz: !binary |-
13
- NDc4ZDc4MTdkMjljMzM2YTc5MDNiZWViMDM0ZGJkZDE2MmEzNjA2YTc4OWIz
14
- YmNjNjFjNzUyZWNmNTAwMjIwNmFjMWMxYmVmNTMzNTNjODIzZTA0YTJmN2Ri
15
- YzRmNjE1ZDU0NDFjOTNiZmNlYjllOTVlYmJkMDUwNzkzMjllZDE=
6
+ metadata.gz: 332982960e13a108651c75d6bfc798abd5681b3aaf016004ad969a2404b181f3565f31f67fa4a842cad90a3e19bcc3dfbe121345f83707b21c4d731cfecd2d65
7
+ data.tar.gz: c62227c57162555d30991970b28d8fe254d9f6d822c9f947eaf4f905d41b33cef1f49e0b6618e3fe33974e4680e690d23e46b5a7d71b3d11825b40ae3021632b
@@ -1,6 +1,10 @@
1
1
  ### Change Log :: HoopScrape
2
2
 
3
3
  ## Version 1.1
4
+ + Fixed security vulnerabilities with Nokogiri and Rubocop. Unfortunately, this means HoopScrape now requires Ruby >= 2.1.0
5
+ + Updated test suite.
6
+
7
+ ## Version 1.0.5
4
8
  + NbaPlayer: Add player id to return structure
5
9
  + Documentation cleanup
6
10
 
data/README.md CHANGED
@@ -50,8 +50,8 @@ It provides a number of ways to simplify data interaction, including :
50
50
  + String arrays - Raw data for you to manipulate as you see fit.
51
51
 
52
52
  Version 1.1
53
- + NbaPlayer: Add player id to return structure
54
- + Documentation cleanup
53
+ + Fixed security vulnerabilities with Nokogiri and Rubocop. Unfortunately, this means HoopScrape now requires Ruby >= 2.1.0
54
+ + Updated test suite.
55
55
 
56
56
  + Please report any [issues] you encounter!
57
57
 
@@ -3,7 +3,7 @@ require_relative 'hoopscrape/requires'
3
3
  # HoopScrape main class
4
4
  class HoopScrape
5
5
  # Gem Version
6
- VERSION = '1.0.5'.freeze
6
+ VERSION = '1.1'.freeze
7
7
  # initialize
8
8
  def initialize(config = {})
9
9
  @format = defaultFormat(config[:format])
@@ -238,7 +238,7 @@ class NbaSchedule
238
238
  # Store TV?
239
239
  def saveTV(cell, txt, result)
240
240
  # Network image, link or name?
241
- result << (%w(a img).include?(cell.children[0].node_name) || txt.size > 1).to_s
241
+ result << (%w[a img].include?(cell.children[0].node_name) || txt.size > 1).to_s
242
242
  end
243
243
 
244
244
  # Store Processed Schedule Row
@@ -251,7 +251,7 @@ class NbaSchedule
251
251
 
252
252
  # Adjust and format dates
253
253
  def formatGameDate(month_day, year, game_time = '00:00:00')
254
- year += 1 unless %w(Oct Nov Dec).include?(month_day.split[0])
254
+ year += 1 unless %w[Oct Nov Dec].include?(month_day.split[0])
255
255
  d = DateTime.parse(game_time + ' , ' + month_day + ',' + year.to_s)
256
256
  d.strftime('%Y-%m-%d %H:%M:%S') # Game DateTime String
257
257
  end
@@ -22,9 +22,9 @@ class NbaTeamList
22
22
 
23
23
  @teamList = []
24
24
  h = 0 # Head of teamNames range
25
- west_conf = %w(Northwest Pacific Southwest) # Western Conference Divs
25
+ west_conf = %w[Northwest Pacific Southwest] # Western Conference Divs
26
26
  # Process Teams by Division
27
- divs = %w(Atlantic Pacific Central Southwest Southeast Northwest)
27
+ divs = %w[Atlantic Pacific Central Southwest Southeast Northwest]
28
28
  divs.each do |div|
29
29
  @teamList += processTeams(div, team_names[h, 5], west_conf) # Store Team Data
30
30
  h += 5
@@ -2,30 +2,30 @@
2
2
  module SymbolDefaults
3
3
  # @note Field Symbols for {NbaBoxScore#homePlayers} and {NbaBoxScore#awayPlayers}
4
4
  # [Team ID, ESPN Player ID, Player Name (short), Position, Minutes, Field Goals Made, Field Goals Attempted, 3P Made, 3P Attempted, Free Throws Made, Free Throws Attempted, Offensive Rebounds, Defensive Rebounds, Total Rebounds, Assists, Steals, Blocks, Turnovers, Personal Fouls, Plus/Minus, Points, Starter?]
5
- S_BOX_P = [:team, :id, :name, :position, :minutes, :fgm, :fga, :tpm, :tpa, :ftm, :fta, :oreb, :dreb, :rebounds, :assists, :steals, :blocks, :turnovers, :fouls, :plusminus, :points, :starter]
5
+ S_BOX_P = %i[team id name position minutes fgm fga tpm tpa ftm fta oreb dreb rebounds assists steals blocks turnovers fouls plusminus points starter]
6
6
 
7
7
  # @note Field Symbols for {NbaBoxScore#homeTotals} and {NbaBoxScore#awayTotals}
8
8
  # [Team ID, Field Goals Made, Field Goals Attempted, 3P Made, 3P Attempted, Free Throws Made, Free Throws Attempted, Offensive Rebounds, Defensive Rebounds, Total Rebounds, Assists, Steals, Blocks, Turnovers, Personal Fouls, Plus/Minus, Points, Starter?]
9
- S_BOX_T = [:team, :fgm, :fga, :tpm, :tpa, :ftm, :fta, :oreb, :dreb, :rebounds, :assists, :steals, :blocks, :turnovers, :fouls, :points]
9
+ S_BOX_T = %i[team fgm fga tpm tpa ftm fta oreb dreb rebounds assists steals blocks turnovers fouls points]
10
10
 
11
11
  # @note Field Symbols for {NbaSchedule#futureGames}
12
12
  # [Team ID, Game #, Game Date, Home Game?, Opponent ID, Game Time, Televised?, Game DateTime, Season Type]
13
- S_GAME_F = [:team, :game_num, :date, :home, :opponent, :time, :tv, :datetime, :season_type]
13
+ S_GAME_F = %i[team game_num date home opponent time tv datetime season_type]
14
14
 
15
15
  # @note Field Symbols for {NbaSchedule#pastGames}
16
16
  # [Team ID, Game #, Game Date, Home Game?, Opponent ID, Win?, Team Score, Opp Score, Boxscore ID, Wins, Losses, Game DateTime, Season Type]
17
- S_GAME_P = [:team, :game_num, :date, :home, :opponent, :win, :team_score, :opp_score, :boxscore_id, :wins, :losses, :datetime, :season_type]
17
+ S_GAME_P = %i[team game_num date home opponent win team_score opp_score boxscore_id wins losses datetime season_type]
18
18
 
19
19
  # @note Field Symbols for {NbaRoster#players}
20
20
  # [Team ID, Jersey #, Player Name, ESPN Player ID, Position, Age, Height ft, Height in, Weight, College, Salary]
21
- S_ROSTER = [:team, :jersey, :name, :id, :position, :age, :height_ft, :height_in, :weight, :college, :salary]
21
+ S_ROSTER = %i[team jersey name id position age height_ft height_in weight college salary]
22
22
 
23
23
  # @note Field Symbols for {NbaTeamList#teamList}
24
24
  # [Team ID, Team Name, Division, Conference]
25
- S_TEAM = [:team, :name, :division, :conference]
25
+ S_TEAM = %i[team name division conference]
26
26
 
27
27
  # Returns a default structure format
28
28
  def defaultFormat(f_mat)
29
- return f_mat if [:to_structs, :to_hashes].any? { |x| x.eql?(f_mat) }
29
+ return f_mat if %i[to_structs to_hashes].any? { |x| x.eql?(f_mat) }
30
30
  end
31
31
  end
@@ -20,7 +20,9 @@ namespace :build do
20
20
  desc 'Prepare gem deployment.'
21
21
  task :deployment do
22
22
  Rake::Task['rubo:fix'].execute
23
+ puts `./cc-test-reporter before-build`
23
24
  puts Rake::Task['test'].execute
25
+ puts `./cc-test-reporter after-build --exit-code 0`
24
26
  puts Rake::Task['build:gem'].execute
25
27
  end
26
28
  end
metadata CHANGED
@@ -1,87 +1,91 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hoopscrape
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: '1.1'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Meissa Dia
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-05 00:00:00.000000000 Z
11
+ date: 2018-08-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.6'
19
+ version: '1.8'
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 1.8.2
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - ~>
27
+ - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: '1.8'
30
+ - - ">="
25
31
  - !ruby/object:Gem::Version
26
- version: '1.6'
32
+ version: 1.8.2
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: json
29
35
  requirement: !ruby/object:Gem::Requirement
30
36
  requirements:
31
- - - <
37
+ - - "<"
32
38
  - !ruby/object:Gem::Version
33
39
  version: '2.0'
34
40
  type: :runtime
35
41
  prerelease: false
36
42
  version_requirements: !ruby/object:Gem::Requirement
37
43
  requirements:
38
- - - <
44
+ - - "<"
39
45
  - !ruby/object:Gem::Version
40
46
  version: '2.0'
41
47
  - !ruby/object:Gem::Dependency
42
48
  name: minitest
43
49
  requirement: !ruby/object:Gem::Requirement
44
50
  requirements:
45
- - - ~>
51
+ - - "~>"
46
52
  - !ruby/object:Gem::Version
47
53
  version: '5.9'
48
54
  type: :development
49
55
  prerelease: false
50
56
  version_requirements: !ruby/object:Gem::Requirement
51
57
  requirements:
52
- - - ~>
58
+ - - "~>"
53
59
  - !ruby/object:Gem::Version
54
60
  version: '5.9'
55
61
  - !ruby/object:Gem::Dependency
56
62
  name: rake
57
63
  requirement: !ruby/object:Gem::Requirement
58
64
  requirements:
59
- - - ~>
65
+ - - "~>"
60
66
  - !ruby/object:Gem::Version
61
67
  version: '10.4'
62
68
  type: :development
63
69
  prerelease: false
64
70
  version_requirements: !ruby/object:Gem::Requirement
65
71
  requirements:
66
- - - ~>
72
+ - - "~>"
67
73
  - !ruby/object:Gem::Version
68
74
  version: '10.4'
69
75
  - !ruby/object:Gem::Dependency
70
76
  name: rubocop
71
77
  requirement: !ruby/object:Gem::Requirement
72
78
  requirements:
73
- - - ~>
79
+ - - "~>"
74
80
  - !ruby/object:Gem::Version
75
- version: !binary |-
76
- MC40MS4y
81
+ version: 0.49.0
77
82
  type: :development
78
83
  prerelease: false
79
84
  version_requirements: !ruby/object:Gem::Requirement
80
85
  requirements:
81
- - - ~>
86
+ - - "~>"
82
87
  - !ruby/object:Gem::Version
83
- version: !binary |-
84
- MC40MS4y
88
+ version: 0.49.0
85
89
  description: HoopScrape allows you to easily integrate logistic and statistical information
86
90
  about your favorite basketball teams in your own development projects. Easily access
87
91
  data via Structs for dot notation, Hashes for ActiveRecord integration or String
@@ -92,7 +96,7 @@ executables: []
92
96
  extensions: []
93
97
  extra_rdoc_files: []
94
98
  files:
95
- - .yardopts
99
+ - ".yardopts"
96
100
  - CHANGELOG.md
97
101
  - LICENSE
98
102
  - README.md
@@ -124,17 +128,17 @@ require_paths:
124
128
  - lib
125
129
  required_ruby_version: !ruby/object:Gem::Requirement
126
130
  requirements:
127
- - - ! '>='
131
+ - - ">="
128
132
  - !ruby/object:Gem::Version
129
- version: 1.9.3
133
+ version: 2.1.0
130
134
  required_rubygems_version: !ruby/object:Gem::Requirement
131
135
  requirements:
132
- - - ! '>='
136
+ - - ">="
133
137
  - !ruby/object:Gem::Version
134
138
  version: '0'
135
139
  requirements: []
136
140
  rubyforge_project:
137
- rubygems_version: 2.6.10
141
+ rubygems_version: 2.6.14
138
142
  signing_key:
139
143
  specification_version: 4
140
144
  summary: Programmatic access to professional basketball statistical data