nutella_lib 0.3.0 → 0.3.1

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: 452fc30366c7f02a64fb608208189e791be03b59
4
- data.tar.gz: 9707d639e096aa37f9d34fefba639b198309ddb6
3
+ metadata.gz: 809635436c6083ffcc66ee67660196d6fedd0161
4
+ data.tar.gz: fc2d5da13567805306c78c295da4642c09b2b168
5
5
  SHA512:
6
- metadata.gz: 23a92b1be185d721717535403503bba4eb316ac7a771d2b927329b1748e4a60e81334423bda05aa0d1872188b36e3c2ea88bdd21752b7326963ec21b0fe4fe8f
7
- data.tar.gz: 98788b6730515f32623ce4ca3fb785221d1d7454117c4fe4eb577b950c667a2d07b7d6cb4ec89fb5ab8ab71e5401207fd43cf52f9ce5230cb252d4def4663c30
6
+ metadata.gz: 637ca3db4ef68539e09bfe8a4889c23f4d56bcb3a70a81ab9fe1be719c5b7810ec2ed6fee6dae1f8918840b373e4757dc0c0920b4acdce964fc818a4e8656a99
7
+ data.tar.gz: ce91068690716748971db0a22f8874da88641d1f5b2b2b40a8951f6033679fe63b45418a71e16fdc004c95e940e1b53445e35afcdd118ffd3329ee1e43aa5c27
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.0
1
+ 0.3.1
@@ -92,7 +92,7 @@ module Nutella
92
92
  # string (the string will be wrapped into a JSON string automatically. Format: {"payload":"<message>"})
93
93
  # hash (the hash will be converted into a JSON string automatically)
94
94
  # json string (the JSON string will be sent as is)
95
- def Net.sync_req (channel, message=nil)
95
+ def Net.sync_request (channel, message=nil)
96
96
  # Pad channel
97
97
  new_channel = "#{Nutella.run_id}/#{channel}"
98
98
  # Prepare message
@@ -124,7 +124,7 @@ module Nutella
124
124
  # string (the string will be wrapped into a JSON string automatically. Format: {"payload":"<message>"})
125
125
  # hash (the hash will be converted into a JSON string automatically)
126
126
  # json string (the JSON string will be sent as is)
127
- def Net.async_req (channel, message=nil, callback)
127
+ def Net.async_request (channel, message=nil, callback)
128
128
  # Pad channel
129
129
  new_channel = "#{Nutella.run_id}/#{channel}"
130
130
  # Prepare message
data/nutella_lib.gemspec CHANGED
@@ -2,11 +2,11 @@
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.3.0 ruby lib
5
+ # stub: nutella_lib 0.3.1 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "nutella_lib"
9
- s.version = "0.3.0"
9
+ s.version = "0.3.1"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
@@ -48,31 +48,31 @@ class TestNutellaLib < MiniTest::Test
48
48
  # end
49
49
 
50
50
 
51
- # def test_request_response
52
- # nutella.init('my_run_id', 'ltg.evl.uic.edu', 'my_bot_component')
53
- # nutella.set_resource_id 'my_resource_id'
54
- #
55
- # nutella.net.subscribe('demo1', lambda do |message, component_id, resource_id|
56
- # puts "Received a message from #{component_id}/#{resource_id}. Message: #{message}"
57
- # end)
58
- #
59
- # nutella.net.handle_requests( 'demo1', lambda do |message, component_id, resource_id|
60
- # puts "We received a request: message #{message}, from #{component_id}/#{resource_id}"
61
- # #Then we are going to return some JSON
62
- # {my:'json'}
63
- # end)
64
- #
65
- # response = nutella.net.sync_req( 'demo1', 'my request is a string' )
66
- # puts 'Response to sync'
67
- # p response
68
- #
69
- # nutella.net.async_req( 'demo1', 'my request is a string', lambda do |response|
70
- # puts 'Response to async'
71
- # p response
72
- # end)
73
- #
74
- # nutella.net.listen
75
- # end
51
+ def test_request_response
52
+ nutella.init('my_run_id', 'ltg.evl.uic.edu', 'my_bot_component')
53
+ nutella.set_resource_id 'my_resource_id'
54
+
55
+ nutella.net.subscribe('demo1', lambda do |message, component_id, resource_id|
56
+ puts "Received a message from #{component_id}/#{resource_id}. Message: #{message}"
57
+ end)
58
+
59
+ nutella.net.handle_requests( 'demo1', lambda do |message, component_id, resource_id|
60
+ puts "We received a request: message #{message}, from #{component_id}/#{resource_id}"
61
+ #Then we are going to return some JSON
62
+ {my:'json'}
63
+ end)
64
+
65
+ response = nutella.net.sync_request( 'demo1', 'my request is a string' )
66
+ puts 'Response to sync'
67
+ p response
68
+
69
+ nutella.net.async_request( 'demo1', 'my request is a string', lambda do |response|
70
+ puts 'Response to async'
71
+ p response
72
+ end)
73
+
74
+ nutella.net.listen
75
+ end
76
76
 
77
77
 
78
78
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nutella_lib
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alessandro Gnoli