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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 664d5c44e79a902f2d22bb75c73ca39dee02907732456193056a614fe673f1e5
4
- data.tar.gz: d4424b42c0e1813b33ec2c1552d331d670d5242e412cb27634c0f9bf7a72ddb7
3
+ metadata.gz: 991c183f8fbd4c8d04110b3d4bc59007a12fbf3d579c9b34d01f7744757d75d8
4
+ data.tar.gz: 5ecc30f4564d7a0c2e3a403f172ad69c83c229e46376162cdeb8ccb8060712bd
5
5
  SHA512:
6
- metadata.gz: ac787493ada1bf0e49c29adecc0efd254cde6f59d02a4c0ae406898559ca001a6fa5bca5a31705633844c2e509fc928a856c7a2922b0d2465c4500cfe98f5102
7
- data.tar.gz: 99c8a8c61d83d5a8d09ebd973f67d728e6c5fb8c595db8bb1ca0b3dc0658441f9c7fcae64f4d9780128ee6e7418222387f27ee040c2b9ffbfc1b34c68f455d1c
6
+ metadata.gz: 28d38f92b44efd7373985204acfbbe85fe69fb30a98fc43f6e0f603c0fb4496202d55ad35156433d1598bfb2fad59a2e9b0c1b1bd4a3e7cbd2e70cdbd0b84e24
7
+ data.tar.gz: 896d915e99ea08fe238610c114ccdc3a705c9186c108f2655942f280842bbf14984f0ea9220c6778cc9130044cfc4d6928c5a0b406e277ee07867d363b67f561
@@ -9,6 +9,7 @@ require 'football/butler/competitions'
9
9
  require 'football/butler/matches'
10
10
  require 'football/butler/areas'
11
11
  require 'football/butler/teams'
12
+ require 'football/butler/standings'
12
13
 
13
14
  module Football
14
15
  module Butler
@@ -92,7 +92,10 @@ module Football
92
92
  end
93
93
 
94
94
  def log(text)
95
- puts "\n\nFootball::Butler::VERSION: #{Football::Butler::VERSION} - #{text}\n\n"
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
@@ -9,7 +9,7 @@ module Football
9
9
 
10
10
  ## MATCH
11
11
  # v2/matches/{id}
12
- # returns match object directly as a hash
12
+ # returns ["head2head", "match"]
13
13
  def self.by_id(id:)
14
14
  path = "#{PATH}/#{id}"
15
15
  Api.get(path: path)
@@ -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
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Football
4
4
  module Butler
5
- # TIER_ONE Version April 2021
6
- VERSION = "1.0.1"
5
+ # TIER_ONE with Standings (new packages) - April 2021
6
+ VERSION = "1.1.0"
7
7
  end
8
8
  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.1
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-03 00:00:00.000000000 Z
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: Get data from https://www.football-data.org
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.1.2
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: []