ninoxe 1.1.5 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +9 -12
- data/app/models/chouette/access_link.rb +52 -51
- data/app/models/chouette/access_point.rb +7 -7
- data/app/models/chouette/active_record.rb +28 -28
- data/app/models/chouette/company.rb +3 -3
- data/app/models/chouette/connection_link.rb +3 -3
- data/app/models/chouette/footnote.rb +1 -1
- data/app/models/chouette/group_of_line.rb +2 -2
- data/app/models/chouette/journey_pattern.rb +7 -3
- data/app/models/chouette/line.rb +11 -9
- data/app/models/chouette/network.rb +2 -2
- data/app/models/chouette/pt_link.rb +1 -1
- data/app/models/chouette/route.rb +9 -10
- data/app/models/chouette/stop_area.rb +8 -8
- data/app/models/chouette/stop_point.rb +3 -3
- data/app/models/chouette/time_table.rb +25 -122
- data/app/models/chouette/time_table_date.rb +1 -1
- data/app/models/chouette/time_table_period.rb +1 -1
- data/app/models/chouette/vehicle_journey.rb +82 -77
- data/app/models/chouette/vehicle_journey_at_stop.rb +1 -1
- data/config/database.yml +16 -8
- data/config/database.yml.travis +15 -6
- data/db/migrate/20150526075108_add_foreign_key_to_routes.rb +28 -0
- data/lib/ninoxe/engine.rb +4 -0
- data/lib/ninoxe/version.rb +1 -1
- data/lib/ninoxe.rb +3 -0
- data/spec/dummy/README.rdoc +15 -248
- data/spec/dummy/Rakefile +1 -1
- data/spec/dummy/app/{mailers/.gitkeep → assets/images/.keep} +0 -0
- data/spec/dummy/app/assets/javascripts/application.js +3 -5
- data/spec/dummy/app/assets/stylesheets/application.css +1 -1
- data/spec/dummy/app/controllers/application_controller.rb +3 -1
- data/spec/dummy/app/{models/.gitkeep → controllers/concerns/.keep} +0 -0
- data/spec/dummy/{lib/assets/.gitkeep → app/mailers/.keep} +0 -0
- data/spec/dummy/{log/.gitkeep → app/models/.keep} +0 -0
- data/spec/dummy/app/models/concerns/.keep +0 -0
- data/spec/dummy/app/views/layouts/application.html.erb +2 -2
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/config/application.rb +8 -36
- data/spec/dummy/config/boot.rb +4 -9
- data/spec/dummy/config/database.yml +16 -8
- data/spec/dummy/config/environment.rb +2 -4
- data/spec/dummy/config/environments/development.rb +11 -19
- data/spec/dummy/config/environments/production.rb +41 -28
- data/spec/dummy/config/environments/test.rb +13 -14
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/inflections.rb +6 -5
- data/spec/dummy/config/initializers/secret_token.rb +7 -2
- data/spec/dummy/config/initializers/session_store.rb +1 -6
- data/spec/dummy/config/initializers/wrap_parameters.rb +6 -6
- data/spec/dummy/config/locales/en.yml +20 -2
- data/spec/dummy/config/locales/fr.yml +23 -0
- data/spec/dummy/config.ru +1 -1
- data/spec/dummy/db/schema.rb +147 -143
- data/spec/dummy/lib/assets/.keep +0 -0
- data/spec/dummy/log/.keep +0 -0
- data/spec/dummy/public/404.html +43 -11
- data/spec/dummy/public/422.html +43 -11
- data/spec/dummy/public/500.html +43 -11
- data/spec/dummy/script/rails +1 -1
- data/spec/factories/chouette_access_links.rb +13 -0
- data/spec/factories/chouette_access_points.rb +12 -0
- data/spec/factories/chouette_companies.rb +9 -0
- data/spec/factories/chouette_connection_links.rb +13 -0
- data/spec/factories/chouette_footnotes.rb +10 -0
- data/spec/factories/chouette_group_of_lines.rb +9 -0
- data/spec/factories/chouette_journey_pattern.rb +40 -0
- data/spec/factories/chouette_lines.rb +44 -0
- data/spec/factories/chouette_networks.rb +9 -0
- data/spec/factories/chouette_routes.rb +26 -0
- data/spec/factories/chouette_stop_areas.rb +12 -0
- data/spec/factories/chouette_stop_points.rb +10 -0
- data/spec/factories/chouette_time_table.rb +37 -0
- data/spec/factories/chouette_vehicle_journey.rb +66 -0
- data/spec/factories/chouette_vehicle_journey_at_stop.rb +8 -0
- data/spec/models/chouette/access_link_spec.rb +17 -13
- data/spec/models/chouette/access_point_spec.rb +106 -103
- data/spec/models/chouette/active_record_spec.rb +57 -57
- data/spec/models/chouette/area_type_spec.rb +8 -8
- data/spec/models/chouette/company_spec.rb +18 -18
- data/spec/models/chouette/connection_link_spec.rb +19 -15
- data/spec/models/chouette/direction_spec.rb +8 -8
- data/spec/models/chouette/exporter_spec.rb +4 -4
- data/spec/models/chouette/file_validator_spec.rb +4 -4
- data/spec/models/chouette/footnote_spec.rb +1 -1
- data/spec/models/chouette/group_of_line_spec.rb +11 -11
- data/spec/models/chouette/journey_pattern_spec.rb +16 -14
- data/spec/models/chouette/line_spec.rb +36 -32
- data/spec/models/chouette/loader_spec.rb +9 -9
- data/spec/models/chouette/network_spec.rb +9 -9
- data/spec/models/chouette/object_id_spec.rb +31 -28
- data/spec/models/chouette/route_spec.rb +51 -47
- data/spec/models/chouette/stop_area_spec.rb +191 -188
- data/spec/models/chouette/stop_point_spec.rb +13 -10
- data/spec/models/chouette/time_table_period_spec.rb +18 -18
- data/spec/models/chouette/time_table_spec.rb +303 -255
- data/spec/models/chouette/transport_mode_spec.rb +10 -10
- data/spec/models/chouette/trident_active_record_spec.rb +17 -17
- data/spec/models/chouette/vehicle_journey_at_stop_spec.rb +13 -12
- data/spec/models/chouette/vehicle_journey_spec.rb +46 -46
- data/spec/presenters/chouette/geometry/line_presenter_spec.rb +2 -2
- data/spec/spec_helper.rb +22 -9
- metadata +102 -87
- data/config/database.yml.ci +0 -14
- data/lib/factories/chouette_access_links.rb +0 -11
- data/lib/factories/chouette_access_points.rb +0 -8
- data/lib/factories/chouette_companies.rb +0 -5
- data/lib/factories/chouette_connection_links.rb +0 -11
- data/lib/factories/chouette_footnotes.rb +0 -6
- data/lib/factories/chouette_group_of_lines.rb +0 -5
- data/lib/factories/chouette_journey_pattern.rb +0 -32
- data/lib/factories/chouette_lines.rb +0 -31
- data/lib/factories/chouette_networks.rb +0 -5
- data/lib/factories/chouette_routes.rb +0 -20
- data/lib/factories/chouette_stop_areas.rb +0 -8
- data/lib/factories/chouette_stop_points.rb +0 -7
- data/lib/factories/chouette_time_table.rb +0 -23
- data/lib/factories/chouette_vehicle_journey.rb +0 -51
- data/lib/factories/chouette_vehicle_journey_at_stop.rb +0 -5
- 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
|
-
|