DCMetro

A ruby gem providing access to the WMATA Rails API on the command line and in a Ruby on Rails application.

CLI. WMATA in the terminal.

Get system wide Rail alerts and arrival and departure times without leaving the console.

gem install dcmetro

$ dcmetro
Commands:
  dcmetro alerts          
  # Display DC Metro system wide alerts.
  dcmetro help [COMMAND]  
  # Describe available commands or one specific command
  dcmetro line COLOR      
  # Display rail lines, 
  # if COLOR, displays stations on the COLOR line
  dcmetro station NAME    
  # Display station arrival and departure times.

Rails. Easily include WMATA Rail information.

Simplify navigating the WMATA API, merely instantiate a new class and call the methods.

See a live example app, with more details here

class WelcomeController < ApplicationController

    def index
        dc_metro = DCMetro::Information.new
        @alerts = dc_metro.alerts['Incidents']
        @lines = dc_metro.line
        @stations = dc_metro.line "green"
        @college_park = dc_metro.station "college park"
    end
    %section{:id => "alerts"}
        - if @alerts.empty?
            %p No incidents to report
        - else
            - @alerts.each do |alert|
                %p= alert['Description']

Fork the repo. Install the gem.

Get system wide Rail alerts and arrival and departure times without leaving the console.

gem install dcmetro

Gem Version build Coverage Status

Fork the repo

Visit the Ruby Gems Page