chatscript 0.0.7 → 0.0.8

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: 35bb5bc0492859590235bcf85c7f0eb6b761141a
4
- data.tar.gz: 2bdcf4d5c314dd2caeba541246d1dee025ccc9a7
3
+ metadata.gz: f82757d31016052945a071dd16e09cf48c6fdabb
4
+ data.tar.gz: 6f85ad8a3ee26aa31c9b5559f47c3b52e65d1712
5
5
  SHA512:
6
- metadata.gz: c39a000b72cba20a9ee4eb0f6a5226f8ac078738d4f9b95d4cd9fe5fd8a0730dc35db2e43526a2461c33c2ee242291aeaafbff60f0e491a5cabdd1d09b92f591
7
- data.tar.gz: 9b403c429fbbdbef2b70fae2fa5efed7cd4c958111af3337524e484bdd6cdbbe7b43253e4eb901719a8162ffd9fae541ec136392d5018e45aa1ef8675c83a27a
6
+ metadata.gz: 673b40c711880378a539865a3d2981ebda0477263ffbb0a8adfb6c0d0bc8399c1264ca2b7b40c765c2696273f3f5ca32f77262db466ad8bb4ccf871a8f682608
7
+ data.tar.gz: d0b8cab9834739b4bb98a06f0c9a5745a0a18cb20924ba71245398ccdb0eac724a646523bbe4d2becef2b557c359a1c43e7f5fdbce7688558542c79ef49ad3ea
@@ -10,21 +10,6 @@ module ChatScript
10
10
  class Message
11
11
  attr_accessor :text, :oob
12
12
 
13
- #
14
- # msg = ChatScript::Message.new 'Bonjour a tout le monde', oob: 'salut()'
15
- # msg.text
16
- # => "Bonjour a tout le monde"
17
- # msg.oob
18
- # => "salut()"
19
- #
20
- # msg = ChatScript::Message.new '[ this is a oob message ] hi there! '
21
- # msg.text
22
- # => "hi there!"
23
- # msg.oob
24
- # => "this is a oob message"
25
- # msg.to_str
26
- # => "[ this is a oob message ] hi there!"
27
- #
28
13
  def initialize(text = '', oob: '')
29
14
  if text.match(/\[.*\]/).nil?
30
15
  # no oob inside txt
@@ -35,8 +20,8 @@ module ChatScript
35
20
  @oob, @text = text.match(/\[(.*)\](.*)/).captures
36
21
 
37
22
  # remove any blanks
38
- @oob.strip!
39
23
  @text.strip!
24
+ @oob.strip!
40
25
  end
41
26
  end
42
27
 
@@ -86,15 +71,15 @@ module ChatScript
86
71
  # first volley
87
72
  # user message is null (void string)
88
73
  #
89
- def start(user = @defaultuser)
90
- volley(user, '')
74
+ def start( user: @defaultuser )
75
+ volley( '', user: user )
91
76
  end
92
77
 
93
78
 
94
79
  #
95
80
  # send a user message to the bot and get the bot reply
96
81
  #
97
- def volley( user = @default_user, message )
82
+ def volley( message, user: @default_user )
98
83
  begin
99
84
  # open client socket
100
85
  socket = TCPSocket.open(@hostname, @port)
@@ -1,3 +1,3 @@
1
1
  module ChatScript
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chatscript
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Giorgio Robino
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-02-21 00:00:00.000000000 Z
11
+ date: 2017-02-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler