diff options
| author | Zog | 2018-04-04 11:06:27 +0200 | 
|---|---|---|
| committer | Johan Van Ryseghem | 2018-05-28 10:34:19 +0200 | 
| commit | ac79e03aced3969df8626f15165a0f6e6f783295 (patch) | |
| tree | 63f6cfd0bf4212e184e35075484ce8ac9e45f48a /lib/tasks/exports.rake | |
| parent | 72f9cc6d810fd2a2226e9b1f0c74b8fbfbb2811c (diff) | |
| download | chouette-core-ac79e03aced3969df8626f15165a0f6e6f783295.tar.bz2 | |
Refs #6216; Uniformize output folders
And fix logs
Diffstat (limited to 'lib/tasks/exports.rake')
| -rw-r--r-- | lib/tasks/exports.rake | 14 | 
1 files changed, 7 insertions, 7 deletions
| diff --git a/lib/tasks/exports.rake b/lib/tasks/exports.rake index 845d581d3..33fbf81ed 100644 --- a/lib/tasks/exports.rake +++ b/lib/tasks/exports.rake @@ -52,9 +52,9 @@ namespace :export do        puts "No maching journeys were found".red      else        exports_group = SimpleInterfacesGroup.new "Export Complet \"#{referential.name}\" du #{Time.now.to_date} au #{args[:timelapse].to_i.days.from_now.to_date}" -      exports_group.shared_options = {verbose: true} +      exports_group.shared_options = {verbose: true, output_dir: args[:output_dir]} -      exporter = SimpleJsonExporter.create configuration_name: "#{args[:configuration_name]}_companies", filepath: "#{args[:output_dir]}/#{args[:configuration_name]}_companies.json" +      exporter = SimpleJsonExporter.create configuration_name: "#{args[:configuration_name]}_companies", filepath: "#{args[:output_dir]}/service_type.json"        ids = journeys.pluck :company_id        ids += journeys.joins(route: :line).pluck :"lines.company_id" @@ -64,28 +64,28 @@ namespace :export do        exports_group.add_interface exporter, "Services Types", :export -      exporter = SimpleJsonExporter.create configuration_name: "#{args[:configuration_name]}_schedules", filepath: "#{args[:output_dir]}/#{args[:configuration_name]}_schedules.json" +      exporter = SimpleJsonExporter.create configuration_name: "#{args[:configuration_name]}_schedules", filepath: "#{args[:output_dir]}/schedule.json"        exporter.configure do |config| -        config.collection = journeys +        config.collection = journeys.where("custom_field_values->>'capacity' IS NOT NULL")        end        exports_group.add_interface exporter, "Schedules", :export -      exporter = SimpleJsonExporter.create configuration_name: "#{args[:configuration_name]}_routes", filepath: "#{args[:output_dir]}/#{args[:configuration_name]}_routes.json" +      exporter = SimpleJsonExporter.create configuration_name: "#{args[:configuration_name]}_routes", filepath: "#{args[:output_dir]}/route.json"        exporter.configure do |config|          config.collection = Chouette::JourneyPattern.where(id: journeys.pluck(:journey_pattern_id).uniq)        end        exports_group.add_interface exporter, "Routes", :export -      exporter = SimpleJsonExporter.create configuration_name: "#{args[:configuration_name]}_stops", filepath: "#{args[:output_dir]}/#{args[:configuration_name]}_stops.json" +      exporter = SimpleJsonExporter.create configuration_name: "#{args[:configuration_name]}_stops", filepath: "#{args[:output_dir]}/station.json"        exporter.configure do |config|          config.collection = Chouette::StopArea.where(id: journeys.joins(:stop_points).pluck(:"stop_points.stop_area_id").uniq).order('parent_id ASC NULLS FIRST')        end        exports_group.add_interface exporter, "Stops", :export -      exporter = SimpleJsonExporter.create configuration_name: "#{args[:configuration_name]}_journeys", filepath: "#{args[:output_dir]}/#{args[:configuration_name]}_journeys.json" +      exporter = SimpleJsonExporter.create configuration_name: "#{args[:configuration_name]}_journeys", filepath: "#{args[:output_dir]}/service.json"        exporter.configure do |config|          config.collection = journeys        end | 
