#!/usr/bin/env ruby require "bundler/setup" require "gtfs/realtime" require "sqlite3" # Load the RIPTA feed as an example, with a sqlite3 database GTFS::Realtime.configure do |config| config.static_feed = "http://www.ripta.com/googledata/current/google_transit.zip" config.trip_updates_feed = "http://realtime.ripta.com:81/api/tripupdates" config.vehicle_positions_feed = "http://realtime.ripta.com:81/api/vehiclepositions" config.service_alerts_feed = "http://realtime.ripta.com:81/api/servicealerts" config.database_path = "sqlite://database.db" end def reload! files = $LOADED_FEATURES.select { |feat| feat =~ /\/gtfs-realtime\// } files.each { |file| load file } GTFS::Realtime.refresh_realtime_feed! end require "irb" IRB.start