bin/console in gtfs-realtime-0.3.0 vs bin/console in gtfs-realtime-0.4.0
- old
+ new
@@ -1,17 +1,18 @@
#!/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_path = "sqlite://database.db"
+ 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 }