Go to file
Erik Michaels-Ober e5b9384fc3 Pretty-format JSON cache/fixture 2014-01-04 16:11:55 +01:00
cache Pretty-format JSON cache/fixture 2014-01-04 16:11:55 +01:00
certs Rename public certificate 2013-02-07 12:38:51 -08:00
lib Pretty-format JSON cache/fixture 2014-01-04 16:11:55 +01:00
spec Fix query to include Cincinnati Reds 2014-01-04 16:11:55 +01:00
.gemtest Opt-in for testing with rubygems-test 2011-02-03 12:45:55 -05:00
.gitignore Add Yardstick 2013-12-31 06:08:57 +01:00
.rspec Refactor specs 2014-01-04 16:11:53 +01:00
.rubocop.yml Update EndAlignment and CaseIndentation style [ci skip] 2014-01-01 16:32:09 +01:00
.travis.yml Remove non-existant JRuby modes 2013-12-31 17:26:53 +01:00
.yardopts Update YARD task 2013-01-27 10:49:25 -08:00
CONTRIBUTING.md Add Yardstick 2013-12-31 06:08:57 +01:00
Gemfile Refactor specs 2014-01-04 16:11:53 +01:00
LICENSE.md Update copyright year [ci skip] 2013-02-09 07:51:26 -08:00
README.md Test against Ruby 2.1.0 2013-12-30 19:55:00 +01:00
Rakefile Pretty-format JSON cache/fixture 2014-01-04 16:11:55 +01:00
mlb.gemspec Fix RuboCop offenses 2013-12-31 06:05:58 +01:00

README.md

MLB.rb

Gem Version Build Status Dependency Status Code Climate Coverage Status

MLB.rb is a Ruby library for retrieving current Major League Baseball players, managers, teams, divisions, and leagues.

Installation

gem install mlb

To ensure the code you're installing hasn't been tampered with, it's recommended that you verify the signature. To do this, you need to add my public key as a trusted certificate (you only need to do this once):

gem cert --add <(curl -Ls https://raw.github.com/sferik/mlb/master/certs/sferik.pem)

Then, install the gem with the high security trust policy:

gem install mlb -P HighSecurity

Documentation

http://rdoc.info/gems/mlb

Usage Examples

$ irb
>> require 'mlb'
>> MLB::Team.all.first.name                   # => "Arizona Diamondbacks"
>> MLB::Team.all.first.league                 # => "National League"
>> MLB::Team.all.first.division               # => "National League West"
>> MLB::Team.all.first.manager                # => "Bob Melvin"
>> MLB::Team.all.first.wins                   # => 82
>> MLB::Team.all.first.losses                 # => 80
>> MLB::Team.all.first.founded                # => 1998
>> MLB::Team.all.first.mascot                 # => nil
>> MLB::Team.all.first.ballpark               # => "Chase Field"
>> MLB::Team.all.first.logo_url               # => "http://img.freebase.com/api/trans/image_thumb/wikipedia/images/en_id/13104064"
>> MLB::Team.all.first.players.first.name     # => "Alex Romero"
>> MLB::Team.all.first.players.first.number   # => 28
>> MLB::Team.all.first.players.first.position # => "Right fielder"

Supported Ruby Versions

This library aims to support and is tested against the following Ruby implementations:

  • Ruby 1.8.7
  • Ruby 1.9.2
  • Ruby 1.9.3
  • Ruby 2.0.0
  • Ruby 2.1.0
  • Rubinius
  • JRuby

If something doesn't work on one of these interpreters, it's a bug.

This library may inadvertently work (or seem to work) on other Ruby implementations, however support will only be provided for the versions listed above.

If you would like this library to support another Ruby version, you may volunteer to be a maintainer. Being a maintainer entails making sure all tests run and pass on that implementation. When something breaks on your implementation, you will be responsible for providing patches in a timely fashion. If critical issues for a particular implementation exist at the time of a major release, support for that Ruby version may be dropped.

Colophon

MLB was built with the following tools:

Copyright (c) 2010-2013 Erik Michaels-Ober. See LICENSE for details.