bin/console in gtfs-realtime-0.2.3 vs bin/console in gtfs-realtime-0.3.0

- old
+ new

@@ -1,14 +1,23 @@ #!/usr/bin/env ruby require "bundler/setup" require "gtfs/realtime" +require "sqlite3" -# 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. +# 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 -# (If you use this, don't forget to add pry to your Gemfile!) -# require "pry" -# Pry.start +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