botbase 0.1.6 → 0.1.7

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
  SHA1:
3
- metadata.gz: ff6c3b0ea464e7839677611732bb1389551737a8
4
- data.tar.gz: 1ad5c911800819f41a64ee43ecb6cbee28973923
3
+ metadata.gz: 231780a7e4b9c17fdaec8fcea576eaf9832fefa2
4
+ data.tar.gz: a113f2e4f637e2b51c6632ba2d15078ea46d8ced
5
5
  SHA512:
6
- metadata.gz: 13c7599d1d80812e1c19affcc5d0f7537552025aee3bef8acf106c9deb222d3b15fb0c1f1825f924c22174392e8d39496ebe09c7606df67c2f0b070f460a7936
7
- data.tar.gz: 7a6b77d09ddfcc2e1e7cbbe21d634b51e56c2e3e22fc05ed37cc425b45c30ddd8cb01ab2261a57184a0759677962b821c5c3f46a8102d662811d473e527c784c
6
+ metadata.gz: fcbb264f013bfee7ee2c7bc6dd1911de566e780e4e41201a858e85beb2c4a50535fdf867e97046063e6f833ff8562468e86bacd1c61a70b1df9cb26a7f022034
7
+ data.tar.gz: d0b5a4388d413efcb99f0f0bbd884194da376fe30d673e99e04b38be5f26814180396a8e8572936f0c727f05439a7aa4aab2ff01b899883fb02edaa9409b3564
@@ -1,3 +1 @@
1
- ���!fD]��\x� |��׋�9�B��Q1�yH ��zA����UKJh��6x᪟�&�
2
- ��5�¿������Eu�� <��Q@.���z���"6��pl�hrX��) �����xu:#�����<2H�P�C4�j���݊�����}K��?�h�X�a�R�#CJ ��c*��k����{H����D�l�xg<+eP��v9��H,���"WZ���*�Z⳰Q���f�)�a
3
- Z�:g�%k^��bpqg��
1
+ N��K�S�#B�irEzt���G�Q ��\V�q =� ��Oh ��{���.���8��i��]q�x��vh�2 �t� �����@�
data.tar.gz.sig CHANGED
@@ -1,4 +1 @@
1
- {i��E��c�st!dqgfu'�F��)eH'���i%�/�� ���3�^p�@7-��`%�Be.��(��k��wRW]T!�s��j�������B̸�s���`��I��
2
- O� �N�����N�1�NJ��綧�Wmqh%k#��� �J~���U���f��� ��4Ӧ
3
- v V\���+.,&H��x��?n2d:`���D�)d;/_���<ײw��
4
- �I�Wʭ��y�����\4��$�� 
1
+ ��04$V8��Ҹ>��d�6����G��NGW��y�@u%��a� A��Zi�!�|���4�^��_�ts��룱�h~������`W��=�<HI��}�vp#|����a7�fOrI�Gѱ�f٤'�M=՟��O�a$�^�����!sd�m^������21d%����n-�:c�cfԳ�6ҷF�"X�ܦ2� ��ϧ�!֪���i�Ҝ,�tՈ@��ƙ���<Ϋ�ԛ4`t���� ��->��D
@@ -6,32 +6,25 @@
6
6
  require 'simple-config'
7
7
 
8
8
 
9
-
10
- class BotBase
9
+ class BotBase
10
+
11
+ attr_reader :log
12
+
11
13
 
12
- def initialize(config=nil, botname: 'Nicole', notifier: nil, debug: false)
14
+ def initialize(config=nil, botname: 'Nicole', notifier: nil, log: log)
13
15
 
14
- @h = nil
15
16
 
16
- @botname, @notifier, @debug = botname, notifier, debug
17
+ @botname, @notifier, @log, @h = botname, notifier, log, nil
17
18
 
18
19
  if config then
19
20
 
20
21
  @h = SimpleConfig.new(config).to_h
21
- puts 'j:' + @h.inspect
22
- # load the service modules
23
22
  @modules = initialize_modules(@h[:modules])
24
23
 
25
24
  end
26
25
 
27
26
  end
28
27
 
29
- # used for display debug messages from modules
30
- #
31
- def debug(msg)
32
- notice 'botbase/debug: ' + msg if @debug
33
- end
34
-
35
28
  # used for display debug messages from modules
36
29
  #
37
30
  def notice(msg)
@@ -41,6 +34,8 @@ class BotBase
41
34
  def received(sender='user01', msg, mode: :voicechat, echo_node: 'node1')
42
35
 
43
36
  msg.rstrip!
37
+
38
+ log.info 'BotBase/received: ' + msg if log
44
39
  self.restart if msg == @botname + ' restart'
45
40
 
46
41
  r = nil
@@ -60,7 +55,7 @@ class BotBase
60
55
 
61
56
  def restart
62
57
 
63
- puts 'restarting ...'
58
+ log.info 'BotBase/restart: restarting ...'
64
59
  @modules = initialize_modules(@h[:modules]) if @h
65
60
  notice "echo: #{@botname} is now ready"
66
61
 
@@ -74,16 +69,15 @@ class BotBase
74
69
 
75
70
  name, settings = m
76
71
 
77
- debug 'initialising botbase-module-' + name.to_s
72
+ log.info 'BotBase/initialize_modules: ' +
73
+ 'initialising botbase-module-' + name.to_s
78
74
 
79
75
  klass_name = 'BotBaseModule' + name.to_s
80
-
81
76
 
82
77
  r << Kernel.const_get(klass_name).new(settings.merge({callback: self}))
83
78
 
84
79
  end
85
80
 
86
81
  end
87
-
88
82
 
89
83
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: botbase
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -31,7 +31,7 @@ cert_chain:
31
31
  YxZGLFY3TBqGLKUMyiOYlOa0oKBNAqnib62M7h9nxMt9pixyl6hKzikU6vwApKBU
32
32
  hHWzzAMK8eZsvA==
33
33
  -----END CERTIFICATE-----
34
- date: 2017-10-14 00:00:00.000000000 Z
34
+ date: 2017-10-29 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: simple-config
@@ -42,7 +42,7 @@ dependencies:
42
42
  version: '0.6'
43
43
  - - ">="
44
44
  - !ruby/object:Gem::Version
45
- version: 0.6.1
45
+ version: 0.6.3
46
46
  type: :runtime
47
47
  prerelease: false
48
48
  version_requirements: !ruby/object:Gem::Requirement
@@ -52,7 +52,7 @@ dependencies:
52
52
  version: '0.6'
53
53
  - - ">="
54
54
  - !ruby/object:Gem::Version
55
- version: 0.6.1
55
+ version: 0.6.3
56
56
  description:
57
57
  email: james@jamesrobertson.eu
58
58
  executables: []
metadata.gz.sig CHANGED
Binary file