nutella_framework 0.6.7 → 0.6.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b009d2b3e95c7adc7eed7433044b9fb7760c4641
4
- data.tar.gz: 1b19db1b0a5fad6f938c75022b5c341a1cb13e6e
3
+ metadata.gz: 5491cc28aa7ac6f8941e7e220ba9a727d426e39a
4
+ data.tar.gz: 43283252a40fd9b938c2e16d9e9f6f6211962eea
5
5
  SHA512:
6
- metadata.gz: 457a4dea5e90ef12726ee65d82a66009b8d3636112233c8717a1ed615357220e98e399738ad9488a7fb6d9cf0326baa48d64dd035dab9326ff4d3f1d9506127d
7
- data.tar.gz: 3bb8c59a350e51c406a21f19843a09d2dd8896e97ffc0671d5fe37daf0496c6746c935c1d7cc4809be2d1264860857d345739ad478f166cdfc735a49bbb50a20
6
+ metadata.gz: 4865474d1579f5fb6bb389f309b10c605d50cbc78098df3044d140f0a6d50d2ab59ce2ef66b5727ef75fdfdea8bed32f6e371334f57aee2281737168ca4e03b2
7
+ data.tar.gz: ff9d12b5d5e69736016cf79cc154013eb25afeb09da631798381883265cc760d7fdf7a4963c95be404ec9759e0404e8980365586b9489e957521805c828902f4
data/Gemfile CHANGED
@@ -8,7 +8,7 @@ gem 'sinatra-cross_origin', '~> 0.3.2'
8
8
  gem 'thin', '~>1.6'
9
9
  gem 'nokogiri', '~>1.6'
10
10
  gem 'slop', '~>4.0'
11
- gem 'nutella_lib','~>0.4', '>=0.4.15'
11
+ gem 'nutella_lib','~>0.4', '>=0.4.18'
12
12
  gem 'activesupport', '~>4.2'
13
13
  gem 'mandrill-api', '~>1.0', '>=1.0.53'
14
14
  gem 'bson', '~> 3.0'
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.7
1
+ 0.6.8
@@ -174,7 +174,6 @@ nutella.f.net.subscribe_to_all_runs('location/resource/add', lambda do |message,
174
174
  end
175
175
  publishResourceAdd(app_id, run_id, resources[rid])
176
176
  cache.publish_add
177
- puts('Added resource')
178
177
  end
179
178
 
180
179
  end
@@ -195,7 +194,6 @@ nutella.f.net.subscribe_to_all_runs('location/resource/remove', lambda do |messa
195
194
  resources.delete(rid)
196
195
  publishResourceRemove(app_id, run_id, resourceCopy)
197
196
  cache.publish_remove
198
- puts('Removed resource')
199
197
 
200
198
  end
201
199
  end)
@@ -270,7 +268,7 @@ def updateResource(app_id, run_id, updatedResource)
270
268
  if proximity != nil && proximity['rid'] != nil && proximity['distance'] != nil
271
269
  baseStation = resources[proximity['rid']]
272
270
 
273
- if baseStation != nil
271
+ if baseStation != nil && baseStation['proximity_range'] != nil
274
272
 
275
273
  if baseStation['proximity_range'] >= proximity['distance']
276
274
  if resource['proximity'] != nil && resource['proximity']['rid'] && resource['proximity']['distance']
@@ -358,9 +356,6 @@ def updateResource(app_id, run_id, updatedResource)
358
356
  if parameter['delete'] != nil
359
357
  ps.delete(parameter['key'])
360
358
  else
361
- puts "--------"
362
- puts parameter['key']
363
- puts parameter['value']
364
359
  ps[parameter['key']] = parameter['value']
365
360
  end
366
361
  end
@@ -368,8 +363,6 @@ def updateResource(app_id, run_id, updatedResource)
368
363
  end
369
364
 
370
365
  if type != nil
371
- puts 'Update type'
372
-
373
366
  if type == 'STATIC'
374
367
  resource['type'] = type
375
368
  resource.delete('proximity')
@@ -382,29 +375,18 @@ def updateResource(app_id, run_id, updatedResource)
382
375
  resource['type'] = type
383
376
  resource.delete('proximity_range')
384
377
  end
385
-
386
- puts 'Stored resource'
387
378
  end
388
379
 
389
380
  if proximity_range != nil
390
- puts 'Update proximity range'
391
-
392
381
  if resource['type'] == 'STATIC'
393
382
  resource['proximity_range'] = proximity_range
394
383
  end
395
-
396
- puts 'Stored resource'
397
-
398
384
  end
399
385
 
400
386
  if proximity == nil && discrete == nil && continuous == nil && parameters == nil
401
-
402
387
  resource.delete('proximity')
403
388
  resource.delete('continuous')
404
389
  resource.delete('discrete')
405
-
406
- puts 'Stored resource'
407
-
408
390
  end
409
391
 
410
392
  resources[rid]=resource
@@ -418,8 +400,6 @@ nutella.f.net.handle_requests_on_all_runs('location/resources', lambda do |reque
418
400
  resources = nutella.f.persist.get_run_mongo_object_store(app_id, run_id, 'resources')
419
401
  groups = nutella.f.persist.get_run_mongo_object_store(app_id, run_id, 'groups')
420
402
 
421
- puts 'Send list of resources'
422
-
423
403
  rid = request['rid']
424
404
  group = request['group']
425
405
  reply = nil
@@ -476,7 +456,6 @@ nutella.f.net.subscribe_to_all_runs('location/room/update', lambda do |message,
476
456
  r['y'] = y
477
457
 
478
458
  publishRoomUpdate(app_id, run_id, r)
479
- puts 'Room updated'
480
459
  end
481
460
  end)
482
461
 
@@ -488,27 +467,18 @@ def computeResourceUpdate(app_id, run_id, rid)
488
467
 
489
468
  if resource != nil
490
469
  if resource['proximity'] != nil
491
- puts 'Proximity resource detected: take coordinates base station'
492
-
493
470
  if resource['proximity']['rid'] != nil
494
- puts 'Search for base station ' + resource['proximity']['rid']
495
471
  baseStation = resources[resource['proximity']['rid']]
496
472
 
497
473
  if baseStation != nil && baseStation['continuous'] != nil
498
- puts 'Copy continuous position base station'
499
474
  resource['proximity']['continuous'] = baseStation['continuous']
500
475
 
501
476
  # Update basic station
502
477
  computeResourceUpdate(app_id, run_id, resource['proximity']['rid'])
503
- else
504
- puts 'Continuous position not present'
505
478
  end
506
479
 
507
480
  if baseStation != nil && baseStation['discrete'] != nil
508
- puts 'Copy discrete position base station'
509
481
  resource['proximity']['discrete'] = baseStation['discrete']
510
- else
511
- puts 'Discrete position not present'
512
482
  end
513
483
  end
514
484
  end
@@ -539,7 +509,6 @@ def computeResourceUpdate(app_id, run_id, rid)
539
509
 
540
510
  # Send update
541
511
  publishResourceUpdate(app_id, run_id, resource)
542
- puts 'Sent update'
543
512
 
544
513
  end
545
514
  end
@@ -702,7 +671,6 @@ end
702
671
  # Request the size of the room
703
672
  nutella.f.net.handle_requests_on_all_runs('location/room', lambda do |request, app_id, run_id, from|
704
673
  room = nutella.f.persist.get_run_mongo_object_store(app_id, run_id, 'room')
705
- puts 'Send the room dimension'
706
674
 
707
675
  r = {}
708
676
 
@@ -726,8 +694,6 @@ nutella.f.net.handle_requests_on_all_runs('location/tracking/discrete', lambda d
726
694
 
727
695
  discrete_tracking = nutella.f.persist.get_run_mongo_object_store(app_id, run_id, 'discrete_tracking')
728
696
 
729
- puts 'Send the discrete tracking system'
730
-
731
697
  x = discrete_tracking['x']
732
698
  y = discrete_tracking['y']
733
699
  width = discrete_tracking['width']
@@ -754,8 +720,6 @@ nutella.f.net.handle_requests_on_all_runs('location/tracking/discrete', lambda d
754
720
  end
755
721
  end)
756
722
 
757
- puts 'Initialization completed'
758
-
759
723
  # Routine that delete old proximity beacons
760
724
 
761
725
  while sleep 0.5
@@ -767,14 +731,13 @@ while sleep 0.5
767
731
 
768
732
  resources.to_h.each do |_, resource|
769
733
  if resource['proximity'] != nil && resource['proximity']['timestamp'] != nil
770
- if Time.now.to_f - resource['proximity']['timestamp'] > 3.0
734
+ if Time.now.to_f - resource['proximity']['timestamp'] > 5.0
771
735
  if resource['proximity']['rid'] != nil
772
736
  baseStations.push(resource['proximity']['rid'])
773
737
  publishResourceExit(app_id, run_id, resource, resource['proximity']['rid'])
774
738
  end
775
739
  resource['proximity'] = {}
776
740
  resources[resource['rid']] = resource
777
- puts 'Delete proximity resource'
778
741
  publishResourceUpdate(app_id, run_id, resource)
779
742
  end
780
743
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nutella_framework
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.7
4
+ version: 0.6.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alessandro Gnoli
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-29 00:00:00.000000000 Z
11
+ date: 2015-10-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: semantic
@@ -128,7 +128,7 @@ dependencies:
128
128
  requirements:
129
129
  - - ">="
130
130
  - !ruby/object:Gem::Version
131
- version: 0.4.15
131
+ version: 0.4.18
132
132
  - - "~>"
133
133
  - !ruby/object:Gem::Version
134
134
  version: '0.4'
@@ -138,7 +138,7 @@ dependencies:
138
138
  requirements:
139
139
  - - ">="
140
140
  - !ruby/object:Gem::Version
141
- version: 0.4.15
141
+ version: 0.4.18
142
142
  - - "~>"
143
143
  - !ruby/object:Gem::Version
144
144
  version: '0.4'