ninoxe 1.1.5 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +9 -12
  3. data/app/models/chouette/access_link.rb +52 -51
  4. data/app/models/chouette/access_point.rb +7 -7
  5. data/app/models/chouette/active_record.rb +28 -28
  6. data/app/models/chouette/company.rb +3 -3
  7. data/app/models/chouette/connection_link.rb +3 -3
  8. data/app/models/chouette/footnote.rb +1 -1
  9. data/app/models/chouette/group_of_line.rb +2 -2
  10. data/app/models/chouette/journey_pattern.rb +7 -3
  11. data/app/models/chouette/line.rb +11 -9
  12. data/app/models/chouette/network.rb +2 -2
  13. data/app/models/chouette/pt_link.rb +1 -1
  14. data/app/models/chouette/route.rb +9 -10
  15. data/app/models/chouette/stop_area.rb +8 -8
  16. data/app/models/chouette/stop_point.rb +3 -3
  17. data/app/models/chouette/time_table.rb +25 -122
  18. data/app/models/chouette/time_table_date.rb +1 -1
  19. data/app/models/chouette/time_table_period.rb +1 -1
  20. data/app/models/chouette/vehicle_journey.rb +82 -77
  21. data/app/models/chouette/vehicle_journey_at_stop.rb +1 -1
  22. data/config/database.yml +16 -8
  23. data/config/database.yml.travis +15 -6
  24. data/db/migrate/20150526075108_add_foreign_key_to_routes.rb +28 -0
  25. data/lib/ninoxe/engine.rb +4 -0
  26. data/lib/ninoxe/version.rb +1 -1
  27. data/lib/ninoxe.rb +3 -0
  28. data/spec/dummy/README.rdoc +15 -248
  29. data/spec/dummy/Rakefile +1 -1
  30. data/spec/dummy/app/{mailers/.gitkeep → assets/images/.keep} +0 -0
  31. data/spec/dummy/app/assets/javascripts/application.js +3 -5
  32. data/spec/dummy/app/assets/stylesheets/application.css +1 -1
  33. data/spec/dummy/app/controllers/application_controller.rb +3 -1
  34. data/spec/dummy/app/{models/.gitkeep → controllers/concerns/.keep} +0 -0
  35. data/spec/dummy/{lib/assets/.gitkeep → app/mailers/.keep} +0 -0
  36. data/spec/dummy/{log/.gitkeep → app/models/.keep} +0 -0
  37. data/spec/dummy/app/models/concerns/.keep +0 -0
  38. data/spec/dummy/app/views/layouts/application.html.erb +2 -2
  39. data/spec/dummy/bin/bundle +3 -0
  40. data/spec/dummy/bin/rails +4 -0
  41. data/spec/dummy/bin/rake +4 -0
  42. data/spec/dummy/config/application.rb +8 -36
  43. data/spec/dummy/config/boot.rb +4 -9
  44. data/spec/dummy/config/database.yml +16 -8
  45. data/spec/dummy/config/environment.rb +2 -4
  46. data/spec/dummy/config/environments/development.rb +11 -19
  47. data/spec/dummy/config/environments/production.rb +41 -28
  48. data/spec/dummy/config/environments/test.rb +13 -14
  49. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  50. data/spec/dummy/config/initializers/inflections.rb +6 -5
  51. data/spec/dummy/config/initializers/secret_token.rb +7 -2
  52. data/spec/dummy/config/initializers/session_store.rb +1 -6
  53. data/spec/dummy/config/initializers/wrap_parameters.rb +6 -6
  54. data/spec/dummy/config/locales/en.yml +20 -2
  55. data/spec/dummy/config/locales/fr.yml +23 -0
  56. data/spec/dummy/config.ru +1 -1
  57. data/spec/dummy/db/schema.rb +147 -143
  58. data/spec/dummy/lib/assets/.keep +0 -0
  59. data/spec/dummy/log/.keep +0 -0
  60. data/spec/dummy/public/404.html +43 -11
  61. data/spec/dummy/public/422.html +43 -11
  62. data/spec/dummy/public/500.html +43 -11
  63. data/spec/dummy/script/rails +1 -1
  64. data/spec/factories/chouette_access_links.rb +13 -0
  65. data/spec/factories/chouette_access_points.rb +12 -0
  66. data/spec/factories/chouette_companies.rb +9 -0
  67. data/spec/factories/chouette_connection_links.rb +13 -0
  68. data/spec/factories/chouette_footnotes.rb +10 -0
  69. data/spec/factories/chouette_group_of_lines.rb +9 -0
  70. data/spec/factories/chouette_journey_pattern.rb +40 -0
  71. data/spec/factories/chouette_lines.rb +44 -0
  72. data/spec/factories/chouette_networks.rb +9 -0
  73. data/spec/factories/chouette_routes.rb +26 -0
  74. data/spec/factories/chouette_stop_areas.rb +12 -0
  75. data/spec/factories/chouette_stop_points.rb +10 -0
  76. data/spec/factories/chouette_time_table.rb +37 -0
  77. data/spec/factories/chouette_vehicle_journey.rb +66 -0
  78. data/spec/factories/chouette_vehicle_journey_at_stop.rb +8 -0
  79. data/spec/models/chouette/access_link_spec.rb +17 -13
  80. data/spec/models/chouette/access_point_spec.rb +106 -103
  81. data/spec/models/chouette/active_record_spec.rb +57 -57
  82. data/spec/models/chouette/area_type_spec.rb +8 -8
  83. data/spec/models/chouette/company_spec.rb +18 -18
  84. data/spec/models/chouette/connection_link_spec.rb +19 -15
  85. data/spec/models/chouette/direction_spec.rb +8 -8
  86. data/spec/models/chouette/exporter_spec.rb +4 -4
  87. data/spec/models/chouette/file_validator_spec.rb +4 -4
  88. data/spec/models/chouette/footnote_spec.rb +1 -1
  89. data/spec/models/chouette/group_of_line_spec.rb +11 -11
  90. data/spec/models/chouette/journey_pattern_spec.rb +16 -14
  91. data/spec/models/chouette/line_spec.rb +36 -32
  92. data/spec/models/chouette/loader_spec.rb +9 -9
  93. data/spec/models/chouette/network_spec.rb +9 -9
  94. data/spec/models/chouette/object_id_spec.rb +31 -28
  95. data/spec/models/chouette/route_spec.rb +51 -47
  96. data/spec/models/chouette/stop_area_spec.rb +191 -188
  97. data/spec/models/chouette/stop_point_spec.rb +13 -10
  98. data/spec/models/chouette/time_table_period_spec.rb +18 -18
  99. data/spec/models/chouette/time_table_spec.rb +303 -255
  100. data/spec/models/chouette/transport_mode_spec.rb +10 -10
  101. data/spec/models/chouette/trident_active_record_spec.rb +17 -17
  102. data/spec/models/chouette/vehicle_journey_at_stop_spec.rb +13 -12
  103. data/spec/models/chouette/vehicle_journey_spec.rb +46 -46
  104. data/spec/presenters/chouette/geometry/line_presenter_spec.rb +2 -2
  105. data/spec/spec_helper.rb +22 -9
  106. metadata +102 -87
  107. data/config/database.yml.ci +0 -14
  108. data/lib/factories/chouette_access_links.rb +0 -11
  109. data/lib/factories/chouette_access_points.rb +0 -8
  110. data/lib/factories/chouette_companies.rb +0 -5
  111. data/lib/factories/chouette_connection_links.rb +0 -11
  112. data/lib/factories/chouette_footnotes.rb +0 -6
  113. data/lib/factories/chouette_group_of_lines.rb +0 -5
  114. data/lib/factories/chouette_journey_pattern.rb +0 -32
  115. data/lib/factories/chouette_lines.rb +0 -31
  116. data/lib/factories/chouette_networks.rb +0 -5
  117. data/lib/factories/chouette_routes.rb +0 -20
  118. data/lib/factories/chouette_stop_areas.rb +0 -8
  119. data/lib/factories/chouette_stop_points.rb +0 -7
  120. data/lib/factories/chouette_time_table.rb +0 -23
  121. data/lib/factories/chouette_vehicle_journey.rb +0 -51
  122. data/lib/factories/chouette_vehicle_journey_at_stop.rb +0 -5
  123. data/spec/dummy/config/initializers/active_record.rb +0 -2
@@ -1,23 +0,0 @@
1
- Factory.define :time_table_date, :class => "Chouette::TimeTableDate" do |tmd|
2
- end
3
- Factory.define :time_table_period, :class => "Chouette::TimeTablePeriod" do |tmp|
4
- end
5
-
6
- Factory.define :time_table, :class => "Chouette::TimeTable" do |time_table|
7
- time_table.sequence(:comment) { |n| "Timetable #{n}" }
8
- time_table.sequence(:objectid) { |n| "test:Timetable:#{n}" }
9
- time_table.sequence(:int_day_types) { (1..7).to_a.map{ |n| 2**(n+1)}.sum }
10
- time_table.after_create { |t|
11
- 0.upto(4) do |i|
12
- t.dates.create(Factory.attributes_for(:time_table_date, :date => i.days.since.to_date, :in_out => true))
13
- end
14
- start_date = Date.today
15
- end_date = start_date + 10
16
- 0.upto(3) do |i|
17
- t.periods.create(Factory.attributes_for(:time_table_period, :period_start => start_date, :period_end => end_date))
18
- start_date = start_date + 20
19
- end_date = start_date + 10
20
- end
21
- t.save_shortcuts
22
- }
23
- end
@@ -1,51 +0,0 @@
1
- Factory.define :vehicle_journey_common, :class => "Chouette::VehicleJourney" do |v|
2
- v.sequence(:objectid) { |n| "test:VehicleJourney:#{n}" }
3
- end
4
-
5
- Factory.define :vehicle_journey, :parent => :vehicle_journey_common do |v|
6
- v.association :journey_pattern, :factory => :journey_pattern
7
- v.after_build do |vj|
8
- vj.route_id = vj.journey_pattern.route_id
9
- end
10
- v.after_create do |vj|
11
- vj.journey_pattern.stop_points.each_with_index do |sp,index|
12
- vj.vehicle_journey_at_stops << Factory( :vehicle_journey_at_stop,
13
- :vehicle_journey => vj,
14
- :stop_point => sp,
15
- :arrival_time => (-1 * index).minutes.ago,
16
- :departure_time => (-1 * index).minutes.ago)
17
- end
18
- end
19
- end
20
- Factory.define :vehicle_journey_odd, :parent => :vehicle_journey_common do |v|
21
- v.association :journey_pattern, :factory => :journey_pattern_odd
22
- v.after_build do |vj|
23
- vj.route_id = vj.journey_pattern.route_id
24
- end
25
- v.after_create do |vj|
26
- vj.journey_pattern.stop_points.each_with_index do |sp,index|
27
- vj.vehicle_journey_at_stops << Factory( :vehicle_journey_at_stop,
28
- :vehicle_journey => vj,
29
- :stop_point => sp,
30
- :arrival_time => (-1 * index).minutes.ago,
31
- :departure_time => (-1 * index).minutes.ago)
32
- end
33
- end
34
- end
35
- Factory.define :vehicle_journey_even, :parent => :vehicle_journey_common do |v|
36
- v.association :journey_pattern, :factory => :journey_pattern_even
37
- v.after_build do |vj|
38
- vj.route_id = vj.journey_pattern.route_id
39
- end
40
- v.after_create do |vj|
41
- vj.journey_pattern.stop_points.each_with_index do |sp,index|
42
- vj.vehicle_journey_at_stops << Factory( :vehicle_journey_at_stop,
43
- :vehicle_journey => vj,
44
- :stop_point => sp,
45
- :arrival_time => (-1 * index).minutes.ago,
46
- :departure_time => (-1 * index).minutes.ago)
47
- end
48
- end
49
- end
50
-
51
-
@@ -1,5 +0,0 @@
1
- Factory.define :vehicle_journey_at_stop, :class => "Chouette::VehicleJourneyAtStop" do |vjas|
2
-
3
- vjas.association :vehicle_journey, :factory => :vehicle_journey
4
- end
5
-
@@ -1,2 +0,0 @@
1
- ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::NATIVE_DATABASE_TYPES[:primary_key] = "bigserial primary key"
2
-