Sha256: 49c65d6ce68f7eefa106d8d2af065375b417aab95db3487ffada2fb046acb6d5

Contents?: true

Size: 819 Bytes

Versions: 1

Compression:

Stored size: 819 Bytes

Contents

#!/usr/bin/env ruby

require "bundler/setup"
require "gtfs/realtime"
require "sqlite3"
require "uri"

# 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_url = "sqlite3:///#{URI.escape(File.expand_path("../../database.db", __FILE__))}"
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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gtfs-realtime-0.4.0 bin/console