ninoxe 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -8,6 +8,8 @@ class Chouette::JourneyPattern < Chouette::TridentActiveRecord
8
8
  has_and_belongs_to_many :stop_points, :class_name => 'Chouette::StopPoint', :order => 'stop_points.position', :before_add => :vjas_add, :before_remove => :vjas_remove, :after_add => :shortcuts_update_for_add, :after_remove => :shortcuts_update_for_remove
9
9
 
10
10
  attr_accessible :route_id, :objectid, :object_version, :creation_time, :creator_id, :name, :comment, :registration_number, :published_name, :departure_stop_point_id, :arrival_stop_point_id, :stop_point_ids, :stop_points
11
+
12
+ validates_presence_of :route
11
13
 
12
14
  # TODO: this a workarround
13
15
  # otherwise, we loose the first stop_point
@@ -33,7 +35,7 @@ class Chouette::JourneyPattern < Chouette::TridentActiveRecord
33
35
  ordered_stop_points = stop_points
34
36
  ordered_stop_points = ordered_stop_points.sort { |a,b| a.position <=> b.position} unless ordered_stop_points.empty?
35
37
 
36
- self.update_attributes!( :departure_stop_point_id => (ordered_stop_points.first && ordered_stop_points.first.id),
38
+ self.update_attributes( :departure_stop_point_id => (ordered_stop_points.first && ordered_stop_points.first.id),
37
39
  :arrival_stop_point_id => (ordered_stop_points.last && ordered_stop_points.last.id))
38
40
  end
39
41
  def shortcuts_update_for_remove( stop_point)
@@ -42,7 +44,7 @@ class Chouette::JourneyPattern < Chouette::TridentActiveRecord
42
44
  ordered_stop_points = stop_points
43
45
  ordered_stop_points = ordered_stop_points.sort { |a,b| a.position <=> b.position} unless ordered_stop_points.empty?
44
46
 
45
- self.update_attributes!( :departure_stop_point_id => (ordered_stop_points.first && ordered_stop_points.first.id),
47
+ self.update_attributes( :departure_stop_point_id => (ordered_stop_points.first && ordered_stop_points.first.id),
46
48
  :arrival_stop_point_id => (ordered_stop_points.last && ordered_stop_points.last.id))
47
49
  end
48
50
  def vjas_add( stop_point)
@@ -21,7 +21,7 @@ class Chouette::Route < Chouette::TridentActiveRecord
21
21
  end
22
22
  end
23
23
  belongs_to :opposite_route, :class_name => 'Chouette::Route', :foreign_key => :opposite_route_id
24
- has_many :stop_points, inverse_of: :route, :order => 'position', :dependent => :destroy do
24
+ has_many :stop_points, :order => 'position', :dependent => :destroy do
25
25
  def find_by_stop_area(stop_area)
26
26
  stop_area_ids = Integer === stop_area ? [stop_area] : (stop_area.children_in_depth + [stop_area]).map(&:id)
27
27
  where( :stop_area_id => stop_area_ids).first or
@@ -5,7 +5,9 @@ class Chouette::TimeTable < Chouette::TridentActiveRecord
5
5
  attr_accessible :objectid, :object_version, :creation_time, :creator_id, :version, :comment
6
6
  attr_accessible :int_day_types,:monday,:tuesday,:wednesday,:thursday,:friday,:saturday,:sunday
7
7
  attr_accessible :start_date, :end_date
8
+ attr_accessible :school_holliday,:public_holliday,:market_day
8
9
  attr_accessor :monday,:tuesday,:wednesday,:thursday,:friday,:saturday,:sunday
10
+ attr_accessor :school_holliday,:public_holliday,:market_day
9
11
 
10
12
  has_many :dates, inverse_of: :time_table, :validate => :true, :class_name => "Chouette::TimeTableDate", :order => :date, :dependent => :destroy, :after_add => :shortcuts_update, :after_remove => :shortcuts_update
11
13
  has_many :periods, inverse_of: :time_table, :validate => :true, :class_name => "Chouette::TimeTablePeriod", :order => :period_start, :dependent => :destroy, :after_add => :shortcuts_update, :after_remove => :shortcuts_update
@@ -183,6 +185,15 @@ class Chouette::TimeTable < Chouette::TridentActiveRecord
183
185
  def sunday
184
186
  day_by_mask(256)
185
187
  end
188
+ def school_holliday
189
+ day_by_mask(512)
190
+ end
191
+ def public_holliday
192
+ day_by_mask(1024)
193
+ end
194
+ def market_day
195
+ day_by_mask(2048)
196
+ end
186
197
 
187
198
  def set_day(day,flag)
188
199
  if (day == '1')
@@ -214,6 +225,15 @@ class Chouette::TimeTable < Chouette::TridentActiveRecord
214
225
  def sunday=(day)
215
226
  set_day(day,256)
216
227
  end
217
-
228
+ def school_holliday=(day)
229
+ set_day(day,512)
230
+ end
231
+ def public_holliday=(day)
232
+ set_day(day,1024)
233
+ end
234
+ def market_day=(day)
235
+ set_day(day,2048)
236
+ end
237
+
218
238
  end
219
239
 
@@ -1,3 +1,3 @@
1
1
  module Ninoxe
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
data/lib/ninoxe.rb CHANGED
@@ -2,6 +2,7 @@ require "ninoxe/engine"
2
2
 
3
3
  require "acts_as_list"
4
4
  require "foreigner"
5
+ require "acts_as_tree"
5
6
 
6
7
  module Ninoxe
7
8
  end
metadata CHANGED
@@ -1,17 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ninoxe
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
8
8
  - Marc Florisson
9
9
  - Michel Etienne
10
10
  - Luc Donnet
11
+ - Zakaria Bouziane
11
12
  autorequire:
12
13
  bindir: bin
13
14
  cert_chain: []
14
- date: 2014-05-14 00:00:00.000000000 Z
15
+ date: 2014-07-03 00:00:00.000000000 Z
15
16
  dependencies:
16
17
  - !ruby/object:Gem::Dependency
17
18
  name: georuby-ext
@@ -39,7 +40,7 @@ dependencies:
39
40
  version: 3.1.3
40
41
  - - <
41
42
  - !ruby/object:Gem::Version
42
- version: 3.2.14
43
+ version: '4.0'
43
44
  type: :runtime
44
45
  prerelease: false
45
46
  version_requirements: !ruby/object:Gem::Requirement
@@ -50,13 +51,13 @@ dependencies:
50
51
  version: 3.1.3
51
52
  - - <
52
53
  - !ruby/object:Gem::Version
53
- version: 3.2.14
54
+ version: '4.0'
54
55
  - !ruby/object:Gem::Dependency
55
56
  name: acts_as_list
56
57
  requirement: !ruby/object:Gem::Requirement
57
58
  none: false
58
59
  requirements:
59
- - - ~>
60
+ - - ! '>='
60
61
  - !ruby/object:Gem::Version
61
62
  version: 0.1.6
62
63
  type: :runtime
@@ -64,9 +65,25 @@ dependencies:
64
65
  version_requirements: !ruby/object:Gem::Requirement
65
66
  none: false
66
67
  requirements:
67
- - - ~>
68
+ - - ! '>='
68
69
  - !ruby/object:Gem::Version
69
70
  version: 0.1.6
71
+ - !ruby/object:Gem::Dependency
72
+ name: acts_as_tree
73
+ requirement: !ruby/object:Gem::Requirement
74
+ none: false
75
+ requirements:
76
+ - - ! '>='
77
+ - !ruby/object:Gem::Version
78
+ version: 1.1.0
79
+ type: :runtime
80
+ prerelease: false
81
+ version_requirements: !ruby/object:Gem::Requirement
82
+ none: false
83
+ requirements:
84
+ - - ! '>='
85
+ - !ruby/object:Gem::Version
86
+ version: 1.1.0
70
87
  - !ruby/object:Gem::Dependency
71
88
  name: foreigner
72
89
  requirement: !ruby/object:Gem::Requirement
@@ -88,7 +105,7 @@ dependencies:
88
105
  requirement: !ruby/object:Gem::Requirement
89
106
  none: false
90
107
  requirements:
91
- - - ~>
108
+ - - ! '>='
92
109
  - !ruby/object:Gem::Version
93
110
  version: '0.9'
94
111
  type: :development
@@ -96,7 +113,7 @@ dependencies:
96
113
  version_requirements: !ruby/object:Gem::Requirement
97
114
  none: false
98
115
  requirements:
99
- - - ~>
116
+ - - ! '>='
100
117
  - !ruby/object:Gem::Version
101
118
  version: '0.9'
102
119
  - !ruby/object:Gem::Dependency
@@ -184,25 +201,25 @@ dependencies:
184
201
  requirement: !ruby/object:Gem::Requirement
185
202
  none: false
186
203
  requirements:
187
- - - ! '>='
204
+ - - ~>
188
205
  - !ruby/object:Gem::Version
189
- version: '0'
206
+ version: 2.14.2
190
207
  type: :development
191
208
  prerelease: false
192
209
  version_requirements: !ruby/object:Gem::Requirement
193
210
  none: false
194
211
  requirements:
195
- - - ! '>='
212
+ - - ~>
196
213
  - !ruby/object:Gem::Version
197
- version: '0'
214
+ version: 2.14.2
198
215
  - !ruby/object:Gem::Dependency
199
- name: shoulda-matchers
216
+ name: rspec-mocks
200
217
  requirement: !ruby/object:Gem::Requirement
201
218
  none: false
202
219
  requirements:
203
220
  - - ~>
204
221
  - !ruby/object:Gem::Version
205
- version: 1.5.6
222
+ version: 2.14.6
206
223
  type: :development
207
224
  prerelease: false
208
225
  version_requirements: !ruby/object:Gem::Requirement
@@ -210,23 +227,23 @@ dependencies:
210
227
  requirements:
211
228
  - - ~>
212
229
  - !ruby/object:Gem::Version
213
- version: 1.5.6
230
+ version: 2.14.6
214
231
  - !ruby/object:Gem::Dependency
215
- name: nokogiri
232
+ name: shoulda-matchers
216
233
  requirement: !ruby/object:Gem::Requirement
217
234
  none: false
218
235
  requirements:
219
- - - ~>
236
+ - - ! '>='
220
237
  - !ruby/object:Gem::Version
221
- version: 1.5.9
238
+ version: 1.5.6
222
239
  type: :development
223
240
  prerelease: false
224
241
  version_requirements: !ruby/object:Gem::Requirement
225
242
  none: false
226
243
  requirements:
227
- - - ~>
244
+ - - ! '>='
228
245
  - !ruby/object:Gem::Version
229
- version: 1.5.9
246
+ version: 1.5.6
230
247
  - !ruby/object:Gem::Dependency
231
248
  name: factory_girl_rails
232
249
  requirement: !ruby/object:Gem::Requirement
@@ -248,22 +265,29 @@ dependencies:
248
265
  requirement: !ruby/object:Gem::Requirement
249
266
  none: false
250
267
  requirements:
251
- - - ~>
268
+ - - ! '>='
252
269
  - !ruby/object:Gem::Version
253
270
  version: '3.1'
271
+ - - <
272
+ - !ruby/object:Gem::Version
273
+ version: '4.0'
254
274
  type: :development
255
275
  prerelease: false
256
276
  version_requirements: !ruby/object:Gem::Requirement
257
277
  none: false
258
278
  requirements:
259
- - - ~>
279
+ - - ! '>='
260
280
  - !ruby/object:Gem::Version
261
281
  version: '3.1'
282
+ - - <
283
+ - !ruby/object:Gem::Version
284
+ version: '4.0'
262
285
  description: This library provides a model to navigate through Chouette database.
263
286
  email:
264
287
  - mflorisson@cityway.fr
265
288
  - metienne@cityway.fr
266
289
  - ldonnet@cityway.fr
290
+ - zbouziane@cityway.fr
267
291
  executables: []
268
292
  extensions: []
269
293
  extra_rdoc_files: []
@@ -390,7 +414,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
390
414
  version: '0'
391
415
  segments:
392
416
  - 0
393
- hash: 648832328759611835
417
+ hash: 4466989225262963059
394
418
  required_rubygems_version: !ruby/object:Gem::Requirement
395
419
  none: false
396
420
  requirements:
@@ -399,7 +423,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
399
423
  version: '0'
400
424
  segments:
401
425
  - 0
402
- hash: 648832328759611835
426
+ hash: 4466989225262963059
403
427
  requirements: []
404
428
  rubyforge_project:
405
429
  rubygems_version: 1.8.23