gtfs_engine 1.5.3 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/Rakefile +6 -5
- data/app/controllers/gtfs_engine/agencies_controller.rb +2 -14
- data/app/controllers/gtfs_engine/application_controller.rb +2 -14
- data/app/controllers/gtfs_engine/calendar_dates_controller.rb +2 -14
- data/app/controllers/gtfs_engine/calendars_controller.rb +7 -19
- data/app/controllers/gtfs_engine/data_sets_controller.rb +10 -24
- data/app/controllers/gtfs_engine/fare_attributes_controller.rb +2 -14
- data/app/controllers/gtfs_engine/fare_rules_controller.rb +2 -14
- data/app/controllers/gtfs_engine/feed_infos_controller.rb +2 -14
- data/app/controllers/gtfs_engine/frequencies_controller.rb +2 -14
- data/app/controllers/gtfs_engine/routes_controller.rb +2 -14
- data/app/controllers/gtfs_engine/shapes_controller.rb +2 -14
- data/app/controllers/gtfs_engine/stop_times_controller.rb +2 -14
- data/app/controllers/gtfs_engine/stops_controller.rb +2 -14
- data/app/controllers/gtfs_engine/transfers_controller.rb +9 -21
- data/app/controllers/gtfs_engine/trips_controller.rb +4 -16
- data/app/helpers/gtfs_engine/default_views_helper.rb +8 -21
- data/app/helpers/gtfs_engine/fields_helper.rb +3 -15
- data/app/models/gtfs_engine/agency.rb +3 -15
- data/app/models/gtfs_engine/calendar.rb +21 -38
- data/app/models/gtfs_engine/calendar_date.rb +5 -17
- data/app/models/gtfs_engine/data_set.rb +20 -32
- data/app/models/gtfs_engine/fare_attribute.rb +3 -15
- data/app/models/gtfs_engine/fare_rule.rb +9 -23
- data/app/models/gtfs_engine/feed_info.rb +3 -15
- data/app/models/gtfs_engine/frequency.rb +5 -17
- data/app/models/gtfs_engine/route.rb +4 -17
- data/app/models/gtfs_engine/shape.rb +5 -17
- data/app/models/gtfs_engine/stop.rb +5 -18
- data/app/models/gtfs_engine/stop_time.rb +5 -19
- data/app/models/gtfs_engine/transfer.rb +5 -17
- data/app/models/gtfs_engine/trip.rb +8 -25
- data/app/views/gtfs_engine/calendars/dates.json.jsend +3 -17
- data/app/views/gtfs_engine/data_sets/index.json.jsend +4 -18
- data/app/views/gtfs_engine/data_sets/show.json.jsend +2 -16
- data/app/views/gtfs_engine/gtfs/index.json.jsend +1 -15
- data/app/views/gtfs_engine/gtfs/show.json.jsend +1 -15
- data/app/views/gtfs_engine/transfers/from.json.jsend +1 -15
- data/app/views/gtfs_engine/transfers/from_to.json.jsend +1 -15
- data/app/views/gtfs_engine/transfers/to.json.jsend +1 -15
- data/app/views/gtfs_engine/trips/block.json.jsend +1 -15
- data/bin/rails +5 -3
- data/config/routes.rb +3 -16
- data/db/migrate/20140320045108_create_gtfs_engine_data_sets.rb +2 -0
- data/db/migrate/20140320045232_create_gtfs_engine_calendars.rb +2 -0
- data/db/migrate/20140320045751_create_gtfs_engine_calendar_dates.rb +2 -0
- data/db/migrate/20140320050100_create_gtfs_engine_shapes.rb +2 -0
- data/db/migrate/20140320051140_create_gtfs_engine_routes.rb +4 -2
- data/db/migrate/20140320052005_create_gtfs_engine_stops.rb +4 -2
- data/db/migrate/20140320052508_create_gtfs_engine_trips.rb +3 -1
- data/db/migrate/20140320052907_create_gtfs_engine_stop_times.rb +2 -0
- data/db/migrate/20140401032609_create_gtfs_engine_agencies.rb +2 -0
- data/db/migrate/20140405235947_create_gtfs_engine_fare_attributes.rb +2 -0
- data/db/migrate/20140406063500_create_gtfs_engine_fare_rules.rb +3 -1
- data/db/migrate/20140406071922_create_gtfs_engine_frequencies.rb +2 -0
- data/db/migrate/20140406072309_create_gtfs_engine_transfers.rb +2 -0
- data/db/migrate/20140406073548_create_gtfs_engine_feed_infos.rb +2 -0
- data/lib/gtfs_engine.rb +2 -14
- data/lib/gtfs_engine/concerns.rb +2 -14
- data/lib/gtfs_engine/concerns/controllers.rb +10 -18
- data/lib/gtfs_engine/concerns/controllers/data_access.rb +28 -40
- data/lib/gtfs_engine/concerns/controllers/gtfs.rb +17 -50
- data/lib/gtfs_engine/engine.rb +2 -15
- data/lib/gtfs_engine/exceptions.rb +4 -19
- data/lib/gtfs_engine/json_responder.rb +9 -23
- data/lib/gtfs_engine/middleware/base.rb +6 -19
- data/lib/gtfs_engine/middleware/json_parse_errors.rb +6 -20
- data/lib/gtfs_engine/sources.rb +33 -44
- data/lib/gtfs_engine/version.rb +30 -37
- data/lib/tasks/gtfs_engine_tasks.rake +15 -25
- metadata +36 -43
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 02cb0a7ffc669fa4275fb0c6a35ad9473e120ce7ce2145a4a4a14ebc3393b273
|
|
4
|
+
data.tar.gz: 4cd67072f4747c6bd758f5857d4dc65c9b1bf7dbc029a52e89a1d5114429b0b5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 91649e7f8fa25159ae6866bcbe8d1bbefc19841a070af12e5072daa58f4adc871cbf0ce37d9bf9706c7190f1b16294137227b9b212b28f5796187cc5f44f8795
|
|
7
|
+
data.tar.gz: f242bfc52c4cc6e96346abd85058ca16f46e29ad6ed2a306e598c861ff6f0b8cbe259e3590791fbc0380dcb67b255883fbf1f15236c8489f270d36b682915760
|
data/Rakefile
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
#
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
2
3
|
begin
|
|
3
4
|
require 'bundler/setup'
|
|
4
5
|
rescue LoadError
|
|
5
6
|
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
|
6
7
|
end
|
|
7
8
|
|
|
8
|
-
require '
|
|
9
|
+
require 'juwelier'
|
|
9
10
|
require File.dirname(__FILE__) + '/lib/gtfs_engine/version'
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
Juwelier::Tasks.new do |gem|
|
|
12
13
|
gem.name = 'gtfs_engine'
|
|
13
14
|
gem.version = GtfsEngine::Version.to_s
|
|
14
15
|
gem.homepage = 'http://github.com/sangster/gtfs_engine'
|
|
15
16
|
gem.license = 'GPL-3.0'
|
|
16
17
|
gem.summary = 'Read General Transit Feed Specification zip files'
|
|
17
|
-
gem.description = <<-EOF.strip.gsub
|
|
18
|
+
gem.description = <<-EOF.strip.gsub(/\s+/, ' ')
|
|
18
19
|
A Rails Engine to provide a basic RESTful interface for GTFS feeds.
|
|
19
20
|
|
|
20
21
|
GTFS Spec: https://developers.google.com/transit/gtfs
|
|
@@ -25,7 +26,7 @@ Jeweler::Tasks.new do |gem|
|
|
|
25
26
|
gem.files = Dir['{app,config,db,lib}/**/*', 'Rakefile']
|
|
26
27
|
end
|
|
27
28
|
|
|
28
|
-
|
|
29
|
+
Juwelier::RubygemsDotOrgTasks.new
|
|
29
30
|
|
|
30
31
|
task bump: ['bump:patch']
|
|
31
32
|
namespace :bump do
|
|
@@ -1,17 +1,5 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
# The KNOWtime server is free software: you can redistribute it and/or modify it
|
|
4
|
-
# under the terms of the GNU General Public License as published by the Free
|
|
5
|
-
# Software Foundation, either version 3 of the License, or (at your option) any
|
|
6
|
-
# later version.
|
|
7
|
-
#
|
|
8
|
-
# The KNOWtime server is distributed in the hope that it will be useful, but
|
|
9
|
-
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
10
|
-
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
11
|
-
# details.
|
|
12
|
-
#
|
|
13
|
-
# You should have received a copy of the GNU General Public License
|
|
14
|
-
# along with the KNOWtime server. If not, see <http://www.gnu.org/licenses/>.
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
15
3
|
module GtfsEngine
|
|
16
4
|
class AgenciesController < ApplicationController
|
|
17
5
|
include Concerns::Controllers::Gtfs
|
|
@@ -1,17 +1,5 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
# The KNOWtime server is free software: you can redistribute it and/or modify it
|
|
4
|
-
# under the terms of the GNU General Public License as published by the Free
|
|
5
|
-
# Software Foundation, either version 3 of the License, or (at your option) any
|
|
6
|
-
# later version.
|
|
7
|
-
#
|
|
8
|
-
# The KNOWtime server is distributed in the hope that it will be useful, but
|
|
9
|
-
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
10
|
-
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
11
|
-
# details.
|
|
12
|
-
#
|
|
13
|
-
# You should have received a copy of the GNU General Public License
|
|
14
|
-
# along with the KNOWtime server. If not, see <http://www.gnu.org/licenses/>.
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
15
3
|
module GtfsEngine
|
|
16
4
|
class ApplicationController < ActionController::Base
|
|
17
5
|
include Concerns::Controllers::DataAccess
|
|
@@ -1,17 +1,5 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
# The KNOWtime server is free software: you can redistribute it and/or modify it
|
|
4
|
-
# under the terms of the GNU General Public License as published by the Free
|
|
5
|
-
# Software Foundation, either version 3 of the License, or (at your option) any
|
|
6
|
-
# later version.
|
|
7
|
-
#
|
|
8
|
-
# The KNOWtime server is distributed in the hope that it will be useful, but
|
|
9
|
-
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
10
|
-
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
11
|
-
# details.
|
|
12
|
-
#
|
|
13
|
-
# You should have received a copy of the GNU General Public License
|
|
14
|
-
# along with the KNOWtime server. If not, see <http://www.gnu.org/licenses/>.
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
15
3
|
module GtfsEngine
|
|
16
4
|
class CalendarDatesController < ApplicationController
|
|
17
5
|
include Concerns::Controllers::Gtfs
|
|
@@ -1,17 +1,5 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
# The KNOWtime server is free software: you can redistribute it and/or modify it
|
|
4
|
-
# under the terms of the GNU General Public License as published by the Free
|
|
5
|
-
# Software Foundation, either version 3 of the License, or (at your option) any
|
|
6
|
-
# later version.
|
|
7
|
-
#
|
|
8
|
-
# The KNOWtime server is distributed in the hope that it will be useful, but
|
|
9
|
-
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
10
|
-
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
11
|
-
# details.
|
|
12
|
-
#
|
|
13
|
-
# You should have received a copy of the GNU General Public License
|
|
14
|
-
# along with the KNOWtime server. If not, see <http://www.gnu.org/licenses/>.
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
15
3
|
module GtfsEngine
|
|
16
4
|
class CalendarsController < ApplicationController
|
|
17
5
|
include Concerns::Controllers::Gtfs
|
|
@@ -30,20 +18,20 @@ module GtfsEngine
|
|
|
30
18
|
|
|
31
19
|
def for_date
|
|
32
20
|
date = params[:YYYY_MM_DD]
|
|
33
|
-
check_format!
|
|
34
|
-
@records = Calendar.from_date_string
|
|
35
|
-
respond_with
|
|
21
|
+
check_format!(date)
|
|
22
|
+
@records = Calendar.from_date_string(date)
|
|
23
|
+
respond_with(@records, template: 'gtfs_engine/gtfs/index')
|
|
36
24
|
end
|
|
37
25
|
|
|
38
26
|
def dates
|
|
39
27
|
@dates = record.dates
|
|
40
|
-
render
|
|
28
|
+
render(:dates)
|
|
41
29
|
end
|
|
42
30
|
|
|
43
31
|
private
|
|
44
32
|
|
|
45
33
|
def check_format!(date_str)
|
|
46
|
-
unless
|
|
34
|
+
unless /^\d{4}-\d\d-\d\d$/ === date_str
|
|
47
35
|
raise DateFormatError, "Got '#{date_str}. Expected format: YYYY-MM-DD'"
|
|
48
36
|
end
|
|
49
37
|
end
|
|
@@ -1,21 +1,9 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
# The KNOWtime server is free software: you can redistribute it and/or modify it
|
|
4
|
-
# under the terms of the GNU General Public License as published by the Free
|
|
5
|
-
# Software Foundation, either version 3 of the License, or (at your option) any
|
|
6
|
-
# later version.
|
|
7
|
-
#
|
|
8
|
-
# The KNOWtime server is distributed in the hope that it will be useful, but
|
|
9
|
-
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
10
|
-
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
11
|
-
# details.
|
|
12
|
-
#
|
|
13
|
-
# You should have received a copy of the GNU General Public License
|
|
14
|
-
# along with the KNOWtime server. If not, see <http://www.gnu.org/licenses/>.
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
15
3
|
module GtfsEngine
|
|
16
4
|
class DataSetsController < ApplicationController
|
|
17
5
|
def index
|
|
18
|
-
expires_in
|
|
6
|
+
expires_in(3.hours)
|
|
19
7
|
|
|
20
8
|
@data_sets = Rails.cache.fetch('data_sets_index') do
|
|
21
9
|
{}.tap do |sets|
|
|
@@ -25,22 +13,20 @@ module GtfsEngine
|
|
|
25
13
|
end
|
|
26
14
|
end
|
|
27
15
|
|
|
28
|
-
dates = @data_sets.values.flatten.collect
|
|
29
|
-
if stale?
|
|
30
|
-
respond_with @data_sets
|
|
31
|
-
end
|
|
16
|
+
dates = @data_sets.values.flatten.collect(&:created_at)
|
|
17
|
+
respond_with(@data_sets) if stale?(last_modified: dates.max, public: true)
|
|
32
18
|
end
|
|
33
19
|
|
|
34
20
|
def show
|
|
35
|
-
expires_in
|
|
21
|
+
expires_in(2.hours)
|
|
36
22
|
|
|
37
|
-
@data_set = data
|
|
23
|
+
@data_set = data(:id)
|
|
38
24
|
|
|
39
25
|
# Set location if the given id is a data-source name and not an ID
|
|
40
|
-
if param_is_data_set_name?
|
|
41
|
-
respond_with
|
|
26
|
+
if param_is_data_set_name?(:id)
|
|
27
|
+
respond_with(@data_set, location: data_set_url(@data_set))
|
|
42
28
|
else
|
|
43
|
-
respond_with
|
|
29
|
+
respond_with(@data_set)
|
|
44
30
|
end
|
|
45
31
|
end
|
|
46
32
|
end
|
|
@@ -1,17 +1,5 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
# The KNOWtime server is free software: you can redistribute it and/or modify it
|
|
4
|
-
# under the terms of the GNU General Public License as published by the Free
|
|
5
|
-
# Software Foundation, either version 3 of the License, or (at your option) any
|
|
6
|
-
# later version.
|
|
7
|
-
#
|
|
8
|
-
# The KNOWtime server is distributed in the hope that it will be useful, but
|
|
9
|
-
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
10
|
-
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
11
|
-
# details.
|
|
12
|
-
#
|
|
13
|
-
# You should have received a copy of the GNU General Public License
|
|
14
|
-
# along with the KNOWtime server. If not, see <http://www.gnu.org/licenses/>.
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
15
3
|
module GtfsEngine
|
|
16
4
|
class FareAttributesController < ApplicationController
|
|
17
5
|
include Concerns::Controllers::Gtfs
|
|
@@ -1,17 +1,5 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
# The KNOWtime server is free software: you can redistribute it and/or modify it
|
|
4
|
-
# under the terms of the GNU General Public License as published by the Free
|
|
5
|
-
# Software Foundation, either version 3 of the License, or (at your option) any
|
|
6
|
-
# later version.
|
|
7
|
-
#
|
|
8
|
-
# The KNOWtime server is distributed in the hope that it will be useful, but
|
|
9
|
-
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
10
|
-
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
11
|
-
# details.
|
|
12
|
-
#
|
|
13
|
-
# You should have received a copy of the GNU General Public License
|
|
14
|
-
# along with the KNOWtime server. If not, see <http://www.gnu.org/licenses/>.
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
15
3
|
module GtfsEngine
|
|
16
4
|
class FareRulesController < ApplicationController
|
|
17
5
|
include Concerns::Controllers::Gtfs
|
|
@@ -1,17 +1,5 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
# The KNOWtime server is free software: you can redistribute it and/or modify it
|
|
4
|
-
# under the terms of the GNU General Public License as published by the Free
|
|
5
|
-
# Software Foundation, either version 3 of the License, or (at your option) any
|
|
6
|
-
# later version.
|
|
7
|
-
#
|
|
8
|
-
# The KNOWtime server is distributed in the hope that it will be useful, but
|
|
9
|
-
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
10
|
-
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
11
|
-
# details.
|
|
12
|
-
#
|
|
13
|
-
# You should have received a copy of the GNU General Public License
|
|
14
|
-
# along with the KNOWtime server. If not, see <http://www.gnu.org/licenses/>.
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
15
3
|
module GtfsEngine
|
|
16
4
|
class FeedInfosController < ApplicationController
|
|
17
5
|
include Concerns::Controllers::Gtfs
|
|
@@ -1,17 +1,5 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
# The KNOWtime server is free software: you can redistribute it and/or modify it
|
|
4
|
-
# under the terms of the GNU General Public License as published by the Free
|
|
5
|
-
# Software Foundation, either version 3 of the License, or (at your option) any
|
|
6
|
-
# later version.
|
|
7
|
-
#
|
|
8
|
-
# The KNOWtime server is distributed in the hope that it will be useful, but
|
|
9
|
-
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
10
|
-
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
11
|
-
# details.
|
|
12
|
-
#
|
|
13
|
-
# You should have received a copy of the GNU General Public License
|
|
14
|
-
# along with the KNOWtime server. If not, see <http://www.gnu.org/licenses/>.
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
15
3
|
module GtfsEngine
|
|
16
4
|
class FrequenciesController < ApplicationController
|
|
17
5
|
include Concerns::Controllers::Gtfs
|
|
@@ -1,17 +1,5 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
# The KNOWtime server is free software: you can redistribute it and/or modify it
|
|
4
|
-
# under the terms of the GNU General Public License as published by the Free
|
|
5
|
-
# Software Foundation, either version 3 of the License, or (at your option) any
|
|
6
|
-
# later version.
|
|
7
|
-
#
|
|
8
|
-
# The KNOWtime server is distributed in the hope that it will be useful, but
|
|
9
|
-
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
10
|
-
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
11
|
-
# details.
|
|
12
|
-
#
|
|
13
|
-
# You should have received a copy of the GNU General Public License
|
|
14
|
-
# along with the KNOWtime server. If not, see <http://www.gnu.org/licenses/>.
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
15
3
|
module GtfsEngine
|
|
16
4
|
class RoutesController < ApplicationController
|
|
17
5
|
include Concerns::Controllers::Gtfs
|
|
@@ -1,17 +1,5 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
# The KNOWtime server is free software: you can redistribute it and/or modify it
|
|
4
|
-
# under the terms of the GNU General Public License as published by the Free
|
|
5
|
-
# Software Foundation, either version 3 of the License, or (at your option) any
|
|
6
|
-
# later version.
|
|
7
|
-
#
|
|
8
|
-
# The KNOWtime server is distributed in the hope that it will be useful, but
|
|
9
|
-
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
10
|
-
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
11
|
-
# details.
|
|
12
|
-
#
|
|
13
|
-
# You should have received a copy of the GNU General Public License
|
|
14
|
-
# along with the KNOWtime server. If not, see <http://www.gnu.org/licenses/>.
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
15
3
|
module GtfsEngine
|
|
16
4
|
class ShapesController < ApplicationController
|
|
17
5
|
include Concerns::Controllers::Gtfs
|
|
@@ -1,17 +1,5 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
# The KNOWtime server is free software: you can redistribute it and/or modify it
|
|
4
|
-
# under the terms of the GNU General Public License as published by the Free
|
|
5
|
-
# Software Foundation, either version 3 of the License, or (at your option) any
|
|
6
|
-
# later version.
|
|
7
|
-
#
|
|
8
|
-
# The KNOWtime server is distributed in the hope that it will be useful, but
|
|
9
|
-
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
10
|
-
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
11
|
-
# details.
|
|
12
|
-
#
|
|
13
|
-
# You should have received a copy of the GNU General Public License
|
|
14
|
-
# along with the KNOWtime server. If not, see <http://www.gnu.org/licenses/>.
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
15
3
|
module GtfsEngine
|
|
16
4
|
class StopTimesController < ApplicationController
|
|
17
5
|
include Concerns::Controllers::Gtfs
|
|
@@ -1,17 +1,5 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
# The KNOWtime server is free software: you can redistribute it and/or modify it
|
|
4
|
-
# under the terms of the GNU General Public License as published by the Free
|
|
5
|
-
# Software Foundation, either version 3 of the License, or (at your option) any
|
|
6
|
-
# later version.
|
|
7
|
-
#
|
|
8
|
-
# The KNOWtime server is distributed in the hope that it will be useful, but
|
|
9
|
-
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
10
|
-
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
11
|
-
# details.
|
|
12
|
-
#
|
|
13
|
-
# You should have received a copy of the GNU General Public License
|
|
14
|
-
# along with the KNOWtime server. If not, see <http://www.gnu.org/licenses/>.
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
15
3
|
module GtfsEngine
|
|
16
4
|
class StopsController < ApplicationController
|
|
17
5
|
include Concerns::Controllers::Gtfs
|
|
@@ -1,17 +1,5 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
# The KNOWtime server is free software: you can redistribute it and/or modify it
|
|
4
|
-
# under the terms of the GNU General Public License as published by the Free
|
|
5
|
-
# Software Foundation, either version 3 of the License, or (at your option) any
|
|
6
|
-
# later version.
|
|
7
|
-
#
|
|
8
|
-
# The KNOWtime server is distributed in the hope that it will be useful, but
|
|
9
|
-
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
10
|
-
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
11
|
-
# details.
|
|
12
|
-
#
|
|
13
|
-
# You should have received a copy of the GNU General Public License
|
|
14
|
-
# along with the KNOWtime server. If not, see <http://www.gnu.org/licenses/>.
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
15
3
|
module GtfsEngine
|
|
16
4
|
class TransfersController < ApplicationController
|
|
17
5
|
include Concerns::Controllers::Gtfs
|
|
@@ -20,19 +8,19 @@ module GtfsEngine
|
|
|
20
8
|
:min_transfer_time
|
|
21
9
|
|
|
22
10
|
def from
|
|
23
|
-
@transfers = collection.where
|
|
24
|
-
respond_with
|
|
11
|
+
@transfers = collection.where(from_stop_id: params[:stop_id])
|
|
12
|
+
respond_with(@transfers)
|
|
25
13
|
end
|
|
26
14
|
|
|
27
15
|
def to
|
|
28
|
-
@transfers = collection.where
|
|
29
|
-
respond_with
|
|
16
|
+
@transfers = collection.where(to_stop_id: params[:stop_id])
|
|
17
|
+
respond_with(@transfers)
|
|
30
18
|
end
|
|
31
19
|
|
|
32
20
|
def from_to
|
|
33
|
-
@transfer = collection.find_by
|
|
34
|
-
|
|
35
|
-
respond_with
|
|
21
|
+
@transfer = collection.find_by(from_stop_id: params[:from_id],
|
|
22
|
+
to_stop_id: params[:to_id])
|
|
23
|
+
respond_with(@transfer)
|
|
36
24
|
end
|
|
37
25
|
end
|
|
38
26
|
end
|
|
@@ -1,17 +1,5 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
# The KNOWtime server is free software: you can redistribute it and/or modify it
|
|
4
|
-
# under the terms of the GNU General Public License as published by the Free
|
|
5
|
-
# Software Foundation, either version 3 of the License, or (at your option) any
|
|
6
|
-
# later version.
|
|
7
|
-
#
|
|
8
|
-
# The KNOWtime server is distributed in the hope that it will be useful, but
|
|
9
|
-
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
10
|
-
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
11
|
-
# details.
|
|
12
|
-
#
|
|
13
|
-
# You should have received a copy of the GNU General Public License
|
|
14
|
-
# along with the KNOWtime server. If not, see <http://www.gnu.org/licenses/>.
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
15
3
|
module GtfsEngine
|
|
16
4
|
class TripsController < ApplicationController
|
|
17
5
|
include Concerns::Controllers::Gtfs
|
|
@@ -27,8 +15,8 @@ module GtfsEngine
|
|
|
27
15
|
:bikes_allowed
|
|
28
16
|
|
|
29
17
|
def block
|
|
30
|
-
@trips = collection.where
|
|
31
|
-
respond_with
|
|
18
|
+
@trips = collection.where(block_id: params[:id])
|
|
19
|
+
respond_with(@trips)
|
|
32
20
|
end
|
|
33
21
|
end
|
|
34
22
|
end
|