README.md in gtfs-realtime-0.1.0 vs README.md in gtfs-realtime-0.2.0
- old
+ new
@@ -24,20 +24,22 @@
```
require 'gtfs-realtime'
GTFS::Realtime.configure do |config|
- config.static_feed = "http://www.ripta.com/googledata/current/google_transit.zip"
+ config.static_feed = "http://www.ripta.com/googledata/current/google_transit.zip" # File path or URL
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" # leave unset to use an in-memory database
end
# After calling 'configure', the gem loads all relevant GTFS info into a database.
# This may take some time (up to a minute) depending on the size of the input data.
# By default, gtfs-realtime uses an in-memory database, which requires reloading all
# data from scratch on each launch. If you'd like to use a persistent database instead,
-# set the 'GTFS_DATABASE_PATH' environment variable, and a SQLite DB will be generated.
+# set 'config.database_path' above, and include a scheme/protocol path for the DB type
+# that you would like to use. gtfs-realtime will generate the relevant tables.
@nearby = GTFS::Realtime::Stop.nearby(41.834521, -71.396906)
stop = @nearby.first
upcoming_bus = stop.stop_time_updates.first
trip_info = upcoming_bus.trip