commit ef522019054024aafba45893b56aac694456031f Author: ZippyDev Date: Sun Jan 20 08:53:02 2019 -0700 initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b04a8c8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,11 @@ +/.bundle/ +/.yardoc +/_yardoc/ +/coverage/ +/doc/ +/pkg/ +/spec/reports/ +/tmp/ + +# rspec failure tracking +.rspec_status diff --git a/.rspec b/.rspec new file mode 100644 index 0000000..34c5164 --- /dev/null +++ b/.rspec @@ -0,0 +1,3 @@ +--format documentation +--color +--require spec_helper diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 0000000..92c2759 --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,17 @@ +AllCops: + TargetRubyVersion: 2.5 +Documentation: + Enabled: false +LineLength: + Max: 120 +Style/RaiseArgs: + EnforcedStyle: compact +Metrics/AbcSize: + Enabled: false +Metrics/MethodLength: + Max: 25 +Lint/Debugger: + Enabled: false +Metrics/BlockLength: + Exclude: + - 'spec/**/*.rb' diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 0000000..73462a5 --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +2.5.1 diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..8c70582 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,7 @@ +--- +sudo: false +language: ruby +cache: bundler +rvm: + - 2.4.4 +before_install: gem install bundler -v 1.17.1 diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..7b78cf7 --- /dev/null +++ b/Gemfile @@ -0,0 +1,6 @@ +source "https://rubygems.org" + +git_source(:github) {|repo_name| "https://github.com/#{repo_name}" } + +# Specify your gem's dependencies in ncaa.gemspec +gemspec diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..2dcfc59 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,96 @@ +PATH + remote: . + specs: + ncaa (0.1.0) + activesupport (~> 5.1) + multi_json (~> 1.13) + nokogiri (~> 1.10) + rest-client (~> 2.0) + +GEM + remote: https://rubygems.org/ + specs: + activesupport (5.2.2) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 0.7, < 2) + minitest (~> 5.1) + tzinfo (~> 1.1) + addressable (2.5.2) + public_suffix (>= 2.0.2, < 4.0) + coderay (1.1.2) + concurrent-ruby (1.1.4) + crack (0.4.3) + safe_yaml (~> 1.0.0) + diff-lcs (1.3) + docile (1.3.1) + domain_name (0.5.20180417) + unf (>= 0.0.5, < 1.0.0) + hashdiff (0.3.8) + http-cookie (1.0.3) + domain_name (~> 0.5) + i18n (1.5.2) + concurrent-ruby (~> 1.0) + json (2.1.0) + method_source (0.9.2) + mime-types (3.2.2) + mime-types-data (~> 3.2015) + mime-types-data (3.2018.0812) + mini_portile2 (2.4.0) + minitest (5.11.3) + multi_json (1.13.1) + netrc (0.11.0) + nokogiri (1.10.1) + mini_portile2 (~> 2.4.0) + pry (0.12.2) + coderay (~> 1.1.0) + method_source (~> 0.9.0) + public_suffix (3.0.3) + rake (12.3.2) + rest-client (2.0.2) + http-cookie (>= 1.0.2, < 2.0) + mime-types (>= 1.16, < 4.0) + netrc (~> 0.8) + rspec (3.8.0) + rspec-core (~> 3.8.0) + rspec-expectations (~> 3.8.0) + rspec-mocks (~> 3.8.0) + rspec-core (3.8.0) + rspec-support (~> 3.8.0) + rspec-expectations (3.8.2) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.8.0) + rspec-mocks (3.8.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.8.0) + rspec-support (3.8.0) + safe_yaml (1.0.4) + simplecov (0.16.1) + docile (~> 1.1) + json (>= 1.8, < 3) + simplecov-html (~> 0.10.0) + simplecov-html (0.10.2) + thread_safe (0.3.6) + tzinfo (1.2.5) + thread_safe (~> 0.1) + unf (0.1.4) + unf_ext + unf_ext (0.0.7.5) + webmock (3.5.1) + addressable (>= 2.3.6) + crack (>= 0.3.2) + hashdiff + +PLATFORMS + ruby + +DEPENDENCIES + bundler (~> 1.16) + ncaa! + pry (~> 0.11) + rake (~> 12.3) + rspec (~> 3.8) + simplecov (~> 0.16) + webmock (~> 3.4) + +BUNDLED WITH + 1.16.3 diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..ac5dff0 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2019 ZippyDev + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..db7c5de --- /dev/null +++ b/README.md @@ -0,0 +1,39 @@ +# Ncaa + +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/ncaa`. To experiment with that code, run `bin/console` for an interactive prompt. + +TODO: Delete this and the text above, and describe your gem + +## Installation + +Add this line to your application's Gemfile: + +```ruby +gem 'ncaa' +``` + +And then execute: + + $ bundle + +Or install it yourself as: + + $ gem install ncaa + +## Usage + +TODO: Write usage instructions here + +## Development + +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. + +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). + +## Contributing + +Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/ncaa. + +## License + +The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT). diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..b7e9ed5 --- /dev/null +++ b/Rakefile @@ -0,0 +1,6 @@ +require "bundler/gem_tasks" +require "rspec/core/rake_task" + +RSpec::Core::RakeTask.new(:spec) + +task :default => :spec diff --git a/bin/console b/bin/console new file mode 100755 index 0000000..74f7acc --- /dev/null +++ b/bin/console @@ -0,0 +1,14 @@ +#!/usr/bin/env ruby + +require "bundler/setup" +require "ncaa" + +# You can add fixtures and/or initialization code here to make experimenting +# with your gem easier. You can also use a different console, if you like. + +# (If you use this, don't forget to add pry to your Gemfile!) +# require "pry" +# Pry.start + +require "irb" +IRB.start(__FILE__) diff --git a/bin/setup b/bin/setup new file mode 100755 index 0000000..dce67d8 --- /dev/null +++ b/bin/setup @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +set -euo pipefail +IFS=$'\n\t' +set -vx + +bundle install + +# Do any other automated setup that you need to do here diff --git a/lib/ncaa.rb b/lib/ncaa.rb new file mode 100644 index 0000000..560aa89 --- /dev/null +++ b/lib/ncaa.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +require 'ncaa/version' +require 'ncaa/base' + +require 'ncaa/client/base' + +module Ncaa + class Error < StandardError; end + # Your code goes here... +end diff --git a/lib/ncaa/version.rb b/lib/ncaa/version.rb new file mode 100644 index 0000000..8ca699e --- /dev/null +++ b/lib/ncaa/version.rb @@ -0,0 +1,3 @@ +module Ncaa + VERSION = "0.1.0" +end diff --git a/ncaa.gemspec b/ncaa.gemspec new file mode 100644 index 0000000..3fe1065 --- /dev/null +++ b/ncaa.gemspec @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +lib = File.expand_path('lib', __dir__) +$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) +require 'ncaa/version' + +Gem::Specification.new do |spec| + spec.name = 'ncaa' + spec.version = Ncaa::VERSION + spec.authors = ['ZippyDev'] + spec.email = ['ZippyDev@protonmail.com'] + + spec.summary = 'NCAA Sports Data' + spec.description = 'NCAA Sports Data' + spec.homepage = 'https://gitlab.com/snogrammer/ncaa' + spec.license = 'MIT' + + # Specify which files should be added to the gem when it is released. + # The `git ls-files -z` loads the files in the RubyGem that have been added into git. + spec.files = Dir.chdir(File.expand_path(__dir__)) do + `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } + end + spec.bindir = 'exe' + spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } + spec.require_paths = ['lib'] + + spec.add_dependency 'activesupport', '~> 5.1' + spec.add_dependency 'multi_json', '~> 1.13' + spec.add_dependency 'nokogiri', '~> 1.10' + spec.add_dependency 'rest-client', '~> 2.0' + + spec.add_development_dependency 'bundler', '~> 1.16' + spec.add_development_dependency 'pry', '~> 0.11' + spec.add_development_dependency 'rake', '~> 12.3' + spec.add_development_dependency 'rspec', '~> 3.8' + spec.add_development_dependency 'simplecov', '~> 0.16' + spec.add_development_dependency 'webmock', '~> 3.4' +end diff --git a/spec/ncaa_spec.rb b/spec/ncaa_spec.rb new file mode 100644 index 0000000..c54c449 --- /dev/null +++ b/spec/ncaa_spec.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +RSpec.describe Ncaa do + it 'has a version number' do + expect(Ncaa::VERSION).not_to be nil + end + + it 'does something useful' do + expect(false).to eq(true) + end +end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb new file mode 100644 index 0000000..e6112d0 --- /dev/null +++ b/spec/spec_helper.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +require 'bundler/setup' +require 'ncaa' + +RSpec.configure do |config| + # Enable flags like --only-failures and --next-failure + config.example_status_persistence_file_path = '.rspec_status' + + # Disable RSpec exposing methods globally on `Module` and `main` + config.disable_monkey_patching! + + config.expect_with :rspec do |c| + c.syntax = :expect + end +end