From 989d21f6b0604b9dd748135bc2f9e1be6ae24507 Mon Sep 17 00:00:00 2001 From: jpl Date: Wed, 26 Apr 2017 16:20:57 +0200 Subject: more information into output of rake referential:create --- lib/tasks/referential.rake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/tasks/referential.rake') diff --git a/lib/tasks/referential.rake b/lib/tasks/referential.rake index 9d98a048b..c89cd3f7a 100644 --- a/lib/tasks/referential.rake +++ b/lib/tasks/referential.rake @@ -15,7 +15,9 @@ namespace :referential do ReferentialMetadata.create!(referential: referential, line_ids: [args[:line_id]], periodes: [Date.parse(args[:start_date])..Date.parse(args[:end_date])]) referential.switch - puts "✓ Created Referential '#{name}' (#{referential.id})" + + print "✓ Created Referential ".green, name, "(#{referential.id})".blue, " switched to schema: ", referential.slug.yellow, "\n" + puts " For inspection of data in the console, do a: `Referential.last.switch'".blueish stop_areas = workbench.stop_area_referential.stop_areas.last(10) @@ -32,6 +34,7 @@ namespace :referential do route.stop_areas = stop_areas.reverse end route.save! + print " ✓ Created Route ".green, route.name, "(#{route.id}), ".blue, "Line (#{line.id}) has #{line.routes.count} routes\n" journey_pattern = Chouette::JourneyPattern.create!(route: route, name: "Journey Pattern #{Faker::Name.unique.name}") journey_pattern.stop_points = stop_areas.inject([]) { |stop_points, stop_area| stop_points += stop_area.stop_points } -- cgit v1.2.3