football-butler 1.0.1 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/football/butler.rb +1 -0
- data/lib/football/butler/api.rb +4 -1
- data/lib/football/butler/matches.rb +1 -1
- data/lib/football/butler/standings.rb +43 -0
- data/lib/football/butler/version.rb +2 -2
- metadata +8 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 991c183f8fbd4c8d04110b3d4bc59007a12fbf3d579c9b34d01f7744757d75d8
|
4
|
+
data.tar.gz: 5ecc30f4564d7a0c2e3a403f172ad69c83c229e46376162cdeb8ccb8060712bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 28d38f92b44efd7373985204acfbbe85fe69fb30a98fc43f6e0f603c0fb4496202d55ad35156433d1598bfb2fad59a2e9b0c1b1bd4a3e7cbd2e70cdbd0b84e24
|
7
|
+
data.tar.gz: 896d915e99ea08fe238610c114ccdc3a705c9186c108f2655942f280842bbf14984f0ea9220c6778cc9130044cfc4d6928c5a0b406e277ee07867d363b67f561
|
data/lib/football/butler.rb
CHANGED
data/lib/football/butler/api.rb
CHANGED
@@ -92,7 +92,10 @@ module Football
|
|
92
92
|
end
|
93
93
|
|
94
94
|
def log(text)
|
95
|
-
|
95
|
+
log_text = "Football::Butler::VERSION: #{Football::Butler::VERSION} - #{text}"
|
96
|
+
|
97
|
+
puts "\n\n#{log_text}\n\n"
|
98
|
+
Football::Butler.logger.debug(log_text)
|
96
99
|
end
|
97
100
|
end
|
98
101
|
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Football
|
4
|
+
module Butler
|
5
|
+
class Standings < Base
|
6
|
+
PATH = :standings
|
7
|
+
|
8
|
+
STANDING_TYPE_HOME = 'HOME'
|
9
|
+
STANDING_TYPE_AWAY = 'AWAY'
|
10
|
+
|
11
|
+
## STANDINGS
|
12
|
+
#
|
13
|
+
# season={YEAR}
|
14
|
+
# standingType={standingType}
|
15
|
+
# standingType: [ TOTAL (default) | HOME | AWAY ]
|
16
|
+
#
|
17
|
+
# v2/competitions/{id}/standings
|
18
|
+
def self.by_competition(id:, result: PATH, filters: {})
|
19
|
+
path = "#{Competitions::PATH}/#{id}/#{PATH}"
|
20
|
+
Api.get(path: path, filters: filters, result: result)
|
21
|
+
end
|
22
|
+
|
23
|
+
# v2/competitions/{id}/standings?standingType=HOME
|
24
|
+
def self.home_by_competition(id:, result: PATH, filters: {})
|
25
|
+
filters.merge!({ standingType: STANDING_TYPE_HOME })
|
26
|
+
by_competition(id: id, filters: filters, result: result)
|
27
|
+
end
|
28
|
+
|
29
|
+
# v2/competitions/{id}/standings?standingType=AWAY
|
30
|
+
def self.away_by_competition(id:, result: PATH, filters: {})
|
31
|
+
filters.merge!({ standingType: STANDING_TYPE_AWAY })
|
32
|
+
by_competition(id: id, filters: filters, result: result)
|
33
|
+
end
|
34
|
+
|
35
|
+
# v2/competitions/{id}/standings
|
36
|
+
def self.by_competition_and_year(id:, year:, result: PATH, filters: {})
|
37
|
+
path = "#{Competitions::PATH}/#{id}/#{PATH}"
|
38
|
+
filters.merge!({ season: year })
|
39
|
+
Api.get(path: path, filters: filters, result: result)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: football-butler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jörg Kirschstein
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-04-
|
11
|
+
date: 2021-04-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: byebug
|
@@ -66,7 +66,7 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0.15'
|
69
|
-
description:
|
69
|
+
description: API Wrapper with endpoint classes for https://www.football-data.org
|
70
70
|
email:
|
71
71
|
- info@joerg-kirschstein.de
|
72
72
|
executables: []
|
@@ -80,6 +80,7 @@ files:
|
|
80
80
|
- lib/football/butler/competitions.rb
|
81
81
|
- lib/football/butler/configuration.rb
|
82
82
|
- lib/football/butler/matches.rb
|
83
|
+
- lib/football/butler/standings.rb
|
83
84
|
- lib/football/butler/teams.rb
|
84
85
|
- lib/football/butler/tier.rb
|
85
86
|
- lib/football/butler/version.rb
|
@@ -89,7 +90,7 @@ licenses:
|
|
89
90
|
metadata:
|
90
91
|
homepage_uri: https://github.com/frontimax/football-butler
|
91
92
|
source_code_uri: https://rubygems.org/gems/football_butler
|
92
|
-
post_install_message:
|
93
|
+
post_install_message:
|
93
94
|
rdoc_options: []
|
94
95
|
require_paths:
|
95
96
|
- lib
|
@@ -104,8 +105,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
104
105
|
- !ruby/object:Gem::Version
|
105
106
|
version: '0'
|
106
107
|
requirements: []
|
107
|
-
rubygems_version: 3.
|
108
|
-
signing_key:
|
108
|
+
rubygems_version: 3.0.3
|
109
|
+
signing_key:
|
109
110
|
specification_version: 4
|
110
111
|
summary: Football data via API
|
111
112
|
test_files: []
|