nutella_lib 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aa7384c4726a3e52f18381983e8b022f01a13039642e4eeb66c0f83950c8481a
4
- data.tar.gz: a660ef5d63f9d768a089a557d501367fdabf4630891933a4cb09840e30d151ad
3
+ metadata.gz: 986c66672005d3c3659accb4855ea7e904efb5dcee2b010b7dc5b36f7aac2764
4
+ data.tar.gz: 536c2b1be05a955de0344ba7d453c6b1920c8a2fb398072cee773fb1b4764a1b
5
5
  SHA512:
6
- metadata.gz: 7f8461b3850835943925f23adf6fe69fc0ec9a05cd8785e31681679a3dbb87e17957d118003a6426fd2963641596e735cc84652eada6f257aeaba8e476c5f308
7
- data.tar.gz: bb06eea03b236e50aa179bda90c04fe390f8485e8a3a8155584caeb1921c002361c46020a1f1a916ad381ad9f3847d2c7819082ff27260194530988f97f8670f
6
+ metadata.gz: 8db4b357b3ec4098f3278ac78f7de3241abadd9b895a73fe805dc212280c2d87fdf801d6832b8166d9c7585c7aa7000c3fd22b0f45bed12a1eb48e87d66d2efb
7
+ data.tar.gz: 8e8300a8e6ba5866c2a637f276a906e6c76738472260944c58fb838dc92352e82fa0b18bae8a8ca983cf7c7bb721de15a13a524bf74ac7f02126c99212ee8371
@@ -1,6 +1,6 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.6.3
3
+ - 2.3.8
4
4
  before_install:
5
5
  - gem update --system
6
6
  - gem install bundler
data/Gemfile CHANGED
@@ -1,5 +1,7 @@
1
1
  source 'http://rubygems.org'
2
2
 
3
+ ruby '2.3.8'
4
+
3
5
  gem 'mqtt', '~> 0.5', '>= 0.5'
4
6
  gem 'ansi', '~> 1.5', '>= 1.5'
5
7
  gem 'mongo','~> 2.0'
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.0
1
+ 0.6.0
@@ -26,3 +26,6 @@ end
26
26
 
27
27
  # Make sure any exception in any thread kills the program
28
28
  Thread::abort_on_exception = true
29
+
30
+ # Make sure we flush standard output after each write
31
+ $stdout.sync = true
@@ -33,7 +33,6 @@ module Nutella
33
33
  def self.log; Nutella::App::Log; end
34
34
  def self.persist; Nutella::App::Persist; end
35
35
 
36
-
37
36
  # Parse command line arguments for app level components
38
37
  #
39
38
  # @param [Array] args command line arguments array
@@ -60,7 +59,5 @@ module Nutella
60
59
  Nutella.set_resource_id resource_id
61
60
  end
62
61
 
63
-
64
62
  end
65
-
66
63
  end
@@ -12,11 +12,12 @@ module Nutella
12
12
  Nutella.resource_id = nil
13
13
  Nutella.mongo_host = broker_hostname
14
14
  Nutella.mqtt = SimpleMQTTClient.new broker_hostname
15
+
15
16
  # Start pinging
16
17
  Nutella.net.start_pinging
17
18
  # Fetch the `run_id`s list for this application and subscribe to its updates
18
- net.async_request('app_runs_list', lambda { |res| Nutella.app.app_runs_list = res })
19
- self.net.subscribe('app_runs_list', lambda {|message, _| Nutella.app.app_runs_list = message })
19
+ # net.async_request('app_runs_list', lambda { |res| Nutella.app.app_runs_list = res })
20
+ # self.net.subscribe('app_runs_list', lambda {|message, _| Nutella.app.app_runs_list = message })
20
21
  end
21
22
 
22
23
  # Accessors for sub-modules
@@ -24,8 +25,17 @@ module Nutella
24
25
  def self.log; Nutella::Framework::Log; end
25
26
  def self.persist; Nutella::Framework::Persist; end
26
27
 
27
-
28
- # Utility functions
28
+ # Parse command line arguments for framework-level components
29
+ #
30
+ # @param [Array] args command line arguments array
31
+ # @return String broker address
32
+ def self.parse_args(args)
33
+ if args.length < 1
34
+ STDERR.puts 'Couldn\'t read broker address from the command line, impossible to initialize component!'
35
+ return
36
+ end
37
+ return args[0]
38
+ end
29
39
 
30
40
  # Extracts the component name from the folder where the code for this component is located
31
41
  #
@@ -41,7 +51,5 @@ module Nutella
41
51
  Nutella.set_resource_id resource_id
42
52
  end
43
53
 
44
-
45
54
  end
46
-
47
55
  end
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: nutella_lib 0.5.0 ruby lib
5
+ # stub: nutella_lib 0.6.0 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "nutella_lib".freeze
9
- s.version = "0.5.0"
9
+ s.version = "0.6.0"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib".freeze]
13
13
  s.authors = ["Alessandro Gnoli".freeze]
14
- s.date = "2019-10-27"
14
+ s.date = "2019-12-15"
15
15
  s.description = "Implements the nutella protocol and exposes it natively".freeze
16
16
  s.email = "tebemis@gmail.com".freeze
17
17
  s.extra_rdoc_files = [
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nutella_lib
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alessandro Gnoli
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-27 00:00:00.000000000 Z
11
+ date: 2019-12-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mqtt