hoopscrape 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +15 -0
- data/.yardopts +7 -0
- data/CHANGELOG.md +20 -0
- data/LICENSE +619 -0
- data/README.md +390 -0
- data/Rakefile +22 -0
- data/lib/hoopscrape.rb +113 -0
- data/lib/hoopscrape/ArrayConversions.rb +56 -0
- data/lib/hoopscrape/Hash.rb +9 -0
- data/lib/hoopscrape/Navigator.rb +60 -0
- data/lib/hoopscrape/NbaBoxScore.rb +174 -0
- data/lib/hoopscrape/NbaPlayer.rb +82 -0
- data/lib/hoopscrape/NbaRoster.rb +74 -0
- data/lib/hoopscrape/NbaSchedule.rb +258 -0
- data/lib/hoopscrape/NbaTeamList.rb +63 -0
- data/lib/hoopscrape/NbaUrls.rb +86 -0
- data/lib/hoopscrape/PrintUtils.rb +34 -0
- data/lib/hoopscrape/String.rb +16 -0
- data/lib/hoopscrape/Struct.rb +9 -0
- data/lib/hoopscrape/SymbolDefaults.rb +31 -0
- data/lib/hoopscrape/requires.rb +28 -0
- data/lib/tasks/build.rake +28 -0
- data/lib/tasks/rubo.rake +30 -0
- metadata +141 -0
@@ -0,0 +1,31 @@
|
|
1
|
+
# Field Symbol Defaults for Array Type Conversion
|
2
|
+
module SymbolDefaults
|
3
|
+
# @note Field Symbols for {NbaBoxScore#homePlayers} and {NbaBoxScore#awayPlayers}
|
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]
|
6
|
+
|
7
|
+
# @note Field Symbols for {NbaBoxScore#homeTotals} and {NbaBoxScore#awayTotals}
|
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]
|
10
|
+
|
11
|
+
# @note Field Symbols for {NbaSchedule#futureGames}
|
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]
|
14
|
+
|
15
|
+
# @note Field Symbols for {NbaSchedule#pastGames}
|
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]
|
18
|
+
|
19
|
+
# @note Field Symbols for {NbaRoster#players}
|
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]
|
22
|
+
|
23
|
+
# @note Field Symbols for {NbaTeamList#teamList}
|
24
|
+
# [Team ID, Team Name, Division, Conference]
|
25
|
+
S_TEAM = [:team, :name, :division, :conference]
|
26
|
+
|
27
|
+
# Returns a default structure format
|
28
|
+
def defaultFormat(f_mat)
|
29
|
+
return f_mat if [:to_structs, :to_hashes].any? { |x| x.eql?(f_mat) }
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# gems
|
2
|
+
require 'nokogiri'
|
3
|
+
|
4
|
+
# libraries
|
5
|
+
require 'open-uri'
|
6
|
+
require 'time'
|
7
|
+
|
8
|
+
# Core Extensions
|
9
|
+
require_relative 'Hash'
|
10
|
+
require_relative 'Struct'
|
11
|
+
require_relative 'String'
|
12
|
+
require_relative 'ArrayConversions' # To Hash | Struct conversions
|
13
|
+
|
14
|
+
require_relative 'Navigator'
|
15
|
+
|
16
|
+
# hoopscrape
|
17
|
+
require_relative 'NbaUrls'
|
18
|
+
require_relative 'NbaBoxScore'
|
19
|
+
require_relative 'NbaRoster'
|
20
|
+
require_relative 'NbaTeamList'
|
21
|
+
require_relative 'NbaSchedule'
|
22
|
+
require_relative 'NbaPlayer'
|
23
|
+
|
24
|
+
# Modules
|
25
|
+
require_relative 'SymbolDefaults'
|
26
|
+
require_relative 'PrintUtils'
|
27
|
+
include SymbolDefaults
|
28
|
+
include PrintUtils
|
@@ -0,0 +1,28 @@
|
|
1
|
+
namespace :build do
|
2
|
+
desc 'Build gem.'
|
3
|
+
task :gem do
|
4
|
+
Rake::Task['build:readme'].execute
|
5
|
+
`gem build hoopscrape.gemspec`
|
6
|
+
end
|
7
|
+
|
8
|
+
desc 'Build and install gem.'
|
9
|
+
task :install do
|
10
|
+
Rake::Task['build:gem'].execute
|
11
|
+
file = `ls *.gem | head -n 1`
|
12
|
+
puts `gem install #{file}`
|
13
|
+
end
|
14
|
+
|
15
|
+
desc 'Inject table of contents into README.md'
|
16
|
+
task :readme do
|
17
|
+
`ruby readme/generate.rb`
|
18
|
+
end
|
19
|
+
|
20
|
+
desc 'Prepare gem deployment.'
|
21
|
+
task :deployment do
|
22
|
+
Rake::Task['rubo:fix'].execute
|
23
|
+
puts Rake::Task['test'].execute
|
24
|
+
puts Rake::Task['build:gem'].execute
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
task build: ['build:install']
|
data/lib/tasks/rubo.rake
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
namespace :rubo do
|
2
|
+
desc 'Generate and display Rubocop HTML report.'
|
3
|
+
task :html do
|
4
|
+
`rubocop -f html -D --out rubocop/report.html`
|
5
|
+
end
|
6
|
+
|
7
|
+
desc 'Autofix Issues.'
|
8
|
+
task :fix do
|
9
|
+
`rubocop -a`
|
10
|
+
Rake::Task['rubo:html'].execute
|
11
|
+
end
|
12
|
+
|
13
|
+
desc 'AutoFix issues and display report.'
|
14
|
+
task :fix_report do
|
15
|
+
Rake::Task['rubo:fix'].execute
|
16
|
+
Rake::Task['rubo:report'].execute
|
17
|
+
end
|
18
|
+
|
19
|
+
desc 'Regenerate To Do .yml'
|
20
|
+
task :autogen do
|
21
|
+
`rubocop --auto-gen-config`
|
22
|
+
end
|
23
|
+
|
24
|
+
desc 'Show rubocop HTML report'
|
25
|
+
task :report do
|
26
|
+
`open rubocop/report.html`
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
task rubo: ['rubo:fix_report']
|
metadata
ADDED
@@ -0,0 +1,141 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: hoopscrape
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.4
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Meissa Dia
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-08-04 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: nokogiri
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.6'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.6'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: json
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - <
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '2.0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - <
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '2.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: minitest
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ~>
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '5.9'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '5.9'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '10.4'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ~>
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '10.4'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rubocop
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ~>
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: !binary |-
|
76
|
+
MC40MS4y
|
77
|
+
type: :development
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - ~>
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: !binary |-
|
84
|
+
MC40MS4y
|
85
|
+
description: HoopScrape allows you to easily integrate logistic and statistical information
|
86
|
+
about your favorite basketball teams in your own development projects. Easily access
|
87
|
+
data via Structs for dot notation, Hashes for ActiveRecord integration or String
|
88
|
+
arrays.
|
89
|
+
email:
|
90
|
+
- meissadia@gmail.com
|
91
|
+
executables: []
|
92
|
+
extensions: []
|
93
|
+
extra_rdoc_files: []
|
94
|
+
files:
|
95
|
+
- .yardopts
|
96
|
+
- CHANGELOG.md
|
97
|
+
- LICENSE
|
98
|
+
- README.md
|
99
|
+
- Rakefile
|
100
|
+
- lib/hoopscrape.rb
|
101
|
+
- lib/hoopscrape/ArrayConversions.rb
|
102
|
+
- lib/hoopscrape/Hash.rb
|
103
|
+
- lib/hoopscrape/Navigator.rb
|
104
|
+
- lib/hoopscrape/NbaBoxScore.rb
|
105
|
+
- lib/hoopscrape/NbaPlayer.rb
|
106
|
+
- lib/hoopscrape/NbaRoster.rb
|
107
|
+
- lib/hoopscrape/NbaSchedule.rb
|
108
|
+
- lib/hoopscrape/NbaTeamList.rb
|
109
|
+
- lib/hoopscrape/NbaUrls.rb
|
110
|
+
- lib/hoopscrape/PrintUtils.rb
|
111
|
+
- lib/hoopscrape/String.rb
|
112
|
+
- lib/hoopscrape/Struct.rb
|
113
|
+
- lib/hoopscrape/SymbolDefaults.rb
|
114
|
+
- lib/hoopscrape/requires.rb
|
115
|
+
- lib/tasks/build.rake
|
116
|
+
- lib/tasks/rubo.rake
|
117
|
+
homepage: https://github.com/meissadia/hoopscrape
|
118
|
+
licenses:
|
119
|
+
- GPL-3.0
|
120
|
+
metadata: {}
|
121
|
+
post_install_message:
|
122
|
+
rdoc_options: []
|
123
|
+
require_paths:
|
124
|
+
- lib
|
125
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
126
|
+
requirements:
|
127
|
+
- - ! '>='
|
128
|
+
- !ruby/object:Gem::Version
|
129
|
+
version: 1.9.3
|
130
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
131
|
+
requirements:
|
132
|
+
- - ! '>='
|
133
|
+
- !ruby/object:Gem::Version
|
134
|
+
version: '0'
|
135
|
+
requirements: []
|
136
|
+
rubyforge_project:
|
137
|
+
rubygems_version: 2.6.10
|
138
|
+
signing_key:
|
139
|
+
specification_version: 4
|
140
|
+
summary: Programmatic access to professional basketball statistical data
|
141
|
+
test_files: []
|