api_football 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: ba481de52484096749c39fe0b0808c16d3215553279192047cebfa0d47cb0dd2
4
+ data.tar.gz: 20b8eaf9db06f7899b0d2c13fade1425f3eb88452994fae4758552b681d2f7d4
5
+ SHA512:
6
+ metadata.gz: c3e06688e6a51d57977d10b736df0aa2daf9589c2442d89c64f8017bc7bbb320be28d2da0687799f76cca6a44b8b88343ec8c5c5bd666f67499c462b085bfe40
7
+ data.tar.gz: 7642e714e26025fd7e5d536f66685796104dbb4573bfa1f88234b93a4f4e3178d6705258bbe9f0e15800e4edaadfc35c370e43988e67f87ce6c855fc6d057b87
data/.gitignore ADDED
@@ -0,0 +1,11 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,8 @@
1
+ Metrics/LineLength:
2
+ Max: 80
3
+ IgnoredPatterns: ['\#']
4
+ inherit_gem:
5
+ rubocop-rails_config:
6
+ - config/rails.yml
7
+ AllCops:
8
+ TargetRubyVersion: 2.5
data/.travis.yml ADDED
@@ -0,0 +1,5 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.5.0
5
+ before_install: gem install bundler -v 1.16.1
@@ -0,0 +1,74 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at jdaviderb@gmail.com. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [http://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: http://contributor-covenant.org
74
+ [version]: http://contributor-covenant.org/version/1/4/
data/Gemfile ADDED
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
6
+
7
+ # Specify your gem's dependencies in api_football.gemspec
8
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,125 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ api_football (0.1.0)
5
+ faraday
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ actionpack (5.2.1)
11
+ actionview (= 5.2.1)
12
+ activesupport (= 5.2.1)
13
+ rack (~> 2.0)
14
+ rack-test (>= 0.6.3)
15
+ rails-dom-testing (~> 2.0)
16
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
17
+ actionview (5.2.1)
18
+ activesupport (= 5.2.1)
19
+ builder (~> 3.1)
20
+ erubi (~> 1.4)
21
+ rails-dom-testing (~> 2.0)
22
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
23
+ activesupport (5.2.1)
24
+ concurrent-ruby (~> 1.0, >= 1.0.2)
25
+ i18n (>= 0.7, < 2)
26
+ minitest (~> 5.1)
27
+ tzinfo (~> 1.1)
28
+ addressable (2.5.2)
29
+ public_suffix (>= 2.0.2, < 4.0)
30
+ ast (2.4.0)
31
+ builder (3.2.3)
32
+ concurrent-ruby (1.0.5)
33
+ crack (0.4.3)
34
+ safe_yaml (~> 1.0.0)
35
+ crass (1.0.4)
36
+ diff-lcs (1.3)
37
+ erubi (1.7.1)
38
+ faraday (0.14.0)
39
+ multipart-post (>= 1.2, < 3)
40
+ hashdiff (0.3.7)
41
+ i18n (1.0.1)
42
+ concurrent-ruby (~> 1.0)
43
+ jaro_winkler (1.5.1)
44
+ loofah (2.2.2)
45
+ crass (~> 1.0.2)
46
+ nokogiri (>= 1.5.9)
47
+ method_source (0.9.0)
48
+ mini_portile2 (2.3.0)
49
+ minitest (5.11.3)
50
+ multipart-post (2.0.0)
51
+ nokogiri (1.8.4)
52
+ mini_portile2 (~> 2.3.0)
53
+ parallel (1.12.1)
54
+ parser (2.5.1.2)
55
+ ast (~> 2.4.0)
56
+ powerpack (0.1.2)
57
+ public_suffix (3.0.2)
58
+ rack (2.0.5)
59
+ rack-test (1.1.0)
60
+ rack (>= 1.0, < 3)
61
+ rails-dom-testing (2.0.3)
62
+ activesupport (>= 4.2.0)
63
+ nokogiri (>= 1.6)
64
+ rails-html-sanitizer (1.0.4)
65
+ loofah (~> 2.2, >= 2.2.2)
66
+ railties (5.2.1)
67
+ actionpack (= 5.2.1)
68
+ activesupport (= 5.2.1)
69
+ method_source
70
+ rake (>= 0.8.7)
71
+ thor (>= 0.19.0, < 2.0)
72
+ rainbow (3.0.0)
73
+ rake (10.5.0)
74
+ rspec (3.8.0)
75
+ rspec-core (~> 3.8.0)
76
+ rspec-expectations (~> 3.8.0)
77
+ rspec-mocks (~> 3.8.0)
78
+ rspec-core (3.8.0)
79
+ rspec-support (~> 3.8.0)
80
+ rspec-expectations (3.8.1)
81
+ diff-lcs (>= 1.2.0, < 2.0)
82
+ rspec-support (~> 3.8.0)
83
+ rspec-mocks (3.8.0)
84
+ diff-lcs (>= 1.2.0, < 2.0)
85
+ rspec-support (~> 3.8.0)
86
+ rspec-support (3.8.0)
87
+ rubocop (0.58.2)
88
+ jaro_winkler (~> 1.5.1)
89
+ parallel (~> 1.10)
90
+ parser (>= 2.5, != 2.5.1.1)
91
+ powerpack (~> 0.1)
92
+ rainbow (>= 2.2.2, < 4.0)
93
+ ruby-progressbar (~> 1.7)
94
+ unicode-display_width (~> 1.0, >= 1.0.1)
95
+ rubocop-rails_config (0.2.1)
96
+ railties (>= 3.0)
97
+ rubocop (~> 0.56)
98
+ ruby-progressbar (1.10.0)
99
+ safe_yaml (1.0.4)
100
+ thor (0.20.0)
101
+ thread_safe (0.3.6)
102
+ tzinfo (1.2.5)
103
+ thread_safe (~> 0.1)
104
+ unicode-display_width (1.4.0)
105
+ vcr (4.0.0)
106
+ webmock (3.4.2)
107
+ addressable (>= 2.3.6)
108
+ crack (>= 0.3.2)
109
+ hashdiff
110
+
111
+ PLATFORMS
112
+ ruby
113
+
114
+ DEPENDENCIES
115
+ api_football!
116
+ bundler (~> 1.16)
117
+ rake (~> 10.0)
118
+ rspec (~> 3.0)
119
+ rubocop
120
+ rubocop-rails_config
121
+ vcr (~> 4.0.0)
122
+ webmock
123
+
124
+ BUNDLED WITH
125
+ 1.16.1
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2018 Jorge Hernandez
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,43 @@
1
+ # ApiFootball
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/api_football`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'api_football'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install api_football
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
+
31
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/api_football. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
36
+
37
+ ## License
38
+
39
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
40
+
41
+ ## Code of Conduct
42
+
43
+ Everyone interacting in the ApiFootball project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/api_football/blob/master/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ task default: :spec
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ lib = File.expand_path("../lib", __FILE__)
4
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
+ require "api_football/version"
6
+
7
+ Gem::Specification.new do |spec|
8
+ spec.name = "api_football"
9
+ spec.version = ApiFootball::VERSION
10
+ spec.authors = ["Jorge Hernandez"]
11
+ spec.email = ["jdaviderb@gmail.com"]
12
+
13
+ spec.summary = "Ruby API Wrapper for apifootball.com"
14
+ spec.description = "Ruby API Wrapper for apifootball.com"
15
+ spec.homepage = "https://apifootball.com/"
16
+ spec.license = "MIT"
17
+
18
+ # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
19
+ # to allow pushing to a single host or delete this section to allow pushing to any host.
20
+ if spec.respond_to?(:metadata)
21
+ spec.metadata["allowed_push_host"] = "https://rubygems.org"
22
+ else
23
+ raise "RubyGems 2.0 or newer is required to protect against " \
24
+ "public gem pushes."
25
+ end
26
+
27
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
28
+ f.match(%r{^(test|spec|features)/})
29
+ end
30
+ spec.bindir = "exe"
31
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
32
+ spec.require_paths = ["lib"]
33
+
34
+ spec.add_runtime_dependency "faraday"
35
+
36
+ spec.add_development_dependency "bundler", "~> 1.16"
37
+ spec.add_development_dependency "rake", "~> 10.0"
38
+ spec.add_development_dependency "rspec", "~> 3.0"
39
+ spec.add_development_dependency "vcr", "~> 4.0.0"
40
+ spec.add_development_dependency "webmock"
41
+ spec.add_development_dependency "rubocop"
42
+ spec.add_development_dependency "rubocop-rails_config"
43
+ end
data/bin/console ADDED
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "bundler/setup"
5
+ require "api_football"
6
+
7
+ # You can add fixtures and/or initialization code here to make experimenting
8
+ # with your gem easier. You can also use a different console, if you like.
9
+
10
+ # (If you use this, don't forget to add pry to your Gemfile!)
11
+ # require "pry"
12
+ # Pry.start
13
+
14
+ require "irb"
15
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,47 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://apifootball.com/api/?APIkey=655309a09751b590f3ae9bcc01757eace8dcd4c29605170e6675a6044c1b3a3a&action=get_leagues
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.14.0
12
+ Accept-Encoding:
13
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
14
+ Accept:
15
+ - "*/*"
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Date:
22
+ - Sat, 08 Sep 2018 19:23:48 GMT
23
+ Server:
24
+ - Apache/2.2.15 (CentOS)
25
+ X-Powered-By:
26
+ - PHP/5.3.3
27
+ Access-Control-Allow-Origin:
28
+ - "*"
29
+ Cache-Control:
30
+ - max-age=2592000
31
+ Expires:
32
+ - Mon, 08 Oct 2018 19:23:48 GMT
33
+ Vary:
34
+ - Accept-Encoding,User-Agent
35
+ Content-Length:
36
+ - '115'
37
+ Connection:
38
+ - close
39
+ Content-Type:
40
+ - application/json
41
+ body:
42
+ encoding: ASCII-8BIT
43
+ string: '[{"country_id":"169","country_name":"England","league_id":"63","league_name":"Championship"},{"country_id":"173","country_name":"France","league_id":"128","league_name":"Ligue
44
+ 2"}]'
45
+ http_version:
46
+ recorded_at: Sat, 08 Sep 2018 21:23:50 GMT
47
+ recorded_with: VCR 4.0.0
@@ -0,0 +1,46 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://apifootball.com/api/?APIkey=655309a09751b590f3ae9bcc01757eace8dcd4c29605170e6675a6044c1b3a3a&action=get_leagues&country_id=169
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.14.0
12
+ Accept-Encoding:
13
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
14
+ Accept:
15
+ - "*/*"
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Date:
22
+ - Sat, 08 Sep 2018 19:56:40 GMT
23
+ Server:
24
+ - Apache/2.2.15 (CentOS)
25
+ X-Powered-By:
26
+ - PHP/5.3.3
27
+ Access-Control-Allow-Origin:
28
+ - "*"
29
+ Cache-Control:
30
+ - max-age=2592000
31
+ Expires:
32
+ - Mon, 08 Oct 2018 19:56:40 GMT
33
+ Vary:
34
+ - Accept-Encoding,User-Agent
35
+ Content-Length:
36
+ - '86'
37
+ Connection:
38
+ - close
39
+ Content-Type:
40
+ - application/json
41
+ body:
42
+ encoding: ASCII-8BIT
43
+ string: '[{"country_id":"169","country_name":"England","league_id":"63","league_name":"Championship"}]'
44
+ http_version:
45
+ recorded_at: Sat, 08 Sep 2018 21:56:42 GMT
46
+ recorded_with: VCR 4.0.0
@@ -0,0 +1,46 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://apifootball.com/api/?APIkey=655309a09751b590f3ae9bcc01757eace8dcd4c29605170e6675a6044c1b3a3a&action=get_countries
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.14.0
12
+ Accept-Encoding:
13
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
14
+ Accept:
15
+ - "*/*"
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Date:
22
+ - Sat, 08 Sep 2018 19:13:28 GMT
23
+ Server:
24
+ - Apache/2.2.15 (CentOS)
25
+ X-Powered-By:
26
+ - PHP/5.3.3
27
+ Access-Control-Allow-Origin:
28
+ - "*"
29
+ Cache-Control:
30
+ - max-age=2592000
31
+ Expires:
32
+ - Mon, 08 Oct 2018 19:13:28 GMT
33
+ Vary:
34
+ - Accept-Encoding,User-Agent
35
+ Content-Length:
36
+ - '74'
37
+ Connection:
38
+ - close
39
+ Content-Type:
40
+ - application/json
41
+ body:
42
+ encoding: ASCII-8BIT
43
+ string: '[{"country_id":"169","country_name":"England"},{"country_id":"173","country_name":"France"}]'
44
+ http_version:
45
+ recorded_at: Sat, 08 Sep 2018 21:13:29 GMT
46
+ recorded_with: VCR 4.0.0
@@ -0,0 +1,46 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://apifootball.com/api/?APIkey=invalid
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.14.0
12
+ Accept-Encoding:
13
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
14
+ Accept:
15
+ - "*/*"
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Date:
22
+ - Sun, 09 Sep 2018 02:14:50 GMT
23
+ Server:
24
+ - Apache/2.2.15 (CentOS)
25
+ X-Powered-By:
26
+ - PHP/5.3.3
27
+ Access-Control-Allow-Origin:
28
+ - "*"
29
+ Cache-Control:
30
+ - max-age=2592000
31
+ Expires:
32
+ - Tue, 09 Oct 2018 02:14:50 GMT
33
+ Vary:
34
+ - Accept-Encoding,User-Agent
35
+ Content-Length:
36
+ - '70'
37
+ Connection:
38
+ - close
39
+ Content-Type:
40
+ - application/json
41
+ body:
42
+ encoding: ASCII-8BIT
43
+ string: '{"error":404,"message":"Authentification failed!"}'
44
+ http_version:
45
+ recorded_at: Sun, 09 Sep 2018 04:14:51 GMT
46
+ recorded_with: VCR 4.0.0