array-compositing 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -287,7 +287,7 @@ module ::Array::Compositing::ArrayInterface
287
287
  def perform_single_object_insert_between_hooks( local_index, object )
288
288
 
289
289
  if local_index = super
290
-
290
+
291
291
  @parent_index_map.local_insert( local_index, 1 )
292
292
 
293
293
  @sub_composite_arrays.each do |this_sub_array|
@@ -376,18 +376,14 @@ module ::Array::Compositing::ArrayInterface
376
376
 
377
377
  def update_for_parent_insert( parent_insert_index, object )
378
378
 
379
- unless @parent_index_map.replaced_parent_element_with_parent_index?( parent_insert_index )
380
-
381
- local_index = @parent_index_map.parent_insert( parent_insert_index, 1 )
379
+ local_index = @parent_index_map.parent_insert( parent_insert_index, 1 )
382
380
 
383
- undecorated_insert( local_index, nil )
381
+ undecorated_insert( local_index, nil )
384
382
 
385
- @sub_composite_arrays.each do |this_array|
386
- this_array.instance_eval do
387
- update_for_parent_insert( local_index, object )
388
- end
383
+ @sub_composite_arrays.each do |this_array|
384
+ this_array.instance_eval do
385
+ update_for_parent_insert( local_index, object )
389
386
  end
390
-
391
387
  end
392
388
 
393
389
  end
@@ -191,6 +191,10 @@ class ::Array::Compositing::ParentIndexMap
191
191
  end
192
192
  end
193
193
 
194
+ if local_insert_index < 0
195
+ local_insert_index = 0
196
+ end
197
+
194
198
  # Insert new parent index correspondences.
195
199
  object_count.times do |this_time|
196
200
  this_parent_index = parent_insert_index + this_time
@@ -221,7 +225,7 @@ class ::Array::Compositing::ParentIndexMap
221
225
 
222
226
  # Update count of parent + interpolated objects since we inserted inside the collection.
223
227
  @parent_and_interpolated_object_count += object_count
224
-
228
+
225
229
  return local_insert_index
226
230
 
227
231
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: array-compositing
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-10 00:00:00.000000000 Z
12
+ date: 2012-07-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: array-hooked