charyf 0.2.8 → 0.2.9

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: 8cfa0cfb7f56db44ae90413b60cc7a4e52efbcb9
4
- data.tar.gz: 66ab9d05c60b4b7fec8f7f0fd35fbf1f6ac6154e
3
+ metadata.gz: 7c18514711153530b6ec38086d043116a9fe43f4
4
+ data.tar.gz: bd3695d976533447bf9a1c822ccc9289c4ba4f07
5
5
  SHA512:
6
- metadata.gz: 7678c7af6c8606b78880d4bbc44407eb2a16264ceb083b3f3da58be733862b73a6246b6a9a34e581874c675c4617a8513eb89b3a9fede55fe21fc78ea749b0a9
7
- data.tar.gz: 124617de56346b73fa8b3285e707fd12cc9dedc858052ee5bd73ebf7fdc9d9a7563567d48066b73b3a6d109a06b68f750e4aba507831a2cbc4fc13fec6ae834b
6
+ metadata.gz: 1e0e95b6362d59a34a67bf2eef0ed2d4de4de2042892ff6b7e9a8d599a42ba123028f7b1b4cd10b20b2e9fac19308530122e24060c01e1b2690bc050d1efd37c
7
+ data.tar.gz: 6704b0af876f06ba75609ef1e6c477f3377d47435f002769e0bb30cf6618c50c747299cfd814d5344333c204c4c7fe11030e379b7b891a17f0ff7ef1652876ab
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- charyf (0.2.8)
4
+ charyf (0.2.9)
5
5
  charyf_sig (~> 1.1.2)
6
6
  colorize (~> 0.8)
7
7
  i18n (~> 0.9)
data/README.md CHANGED
@@ -22,3 +22,8 @@ To read more about roadmap continue to [Roadmap](https://github.com/Charyf/chary
22
22
  To report an issue follow steps in [Reporting an issue](https://github.com/Charyf/charyf-core/wiki/Reporting-an-issue)
23
23
 
24
24
  Continue to [wiki](https://github.com/Charyf/charyf-core/wiki)
25
+
26
+
27
+ ***
28
+
29
+ The development process is currently on hold. The author has to finish his Master's thesis. :)
@@ -10,8 +10,8 @@ module Charyf
10
10
 
11
11
  module ClassMethods
12
12
 
13
- def before_action(method_name, only: [], except: [])
14
- (@_before_actions ||= {})[method_name] = Charyf::Utils.create_action_filters(only, except)
13
+ def before_action(method_name, on_all = nil, only: [], except: [])
14
+ (@_before_actions ||= {})[method_name] = Charyf::Utils.create_action_filters(on_all, only, except)
15
15
  end
16
16
 
17
17
  def _before_actions(action)
@@ -53,7 +53,9 @@ module Charyf
53
53
  " with [#{response.inspect}]"
54
54
  )
55
55
 
56
- request.referer.reply(conversation_id, response)
56
+ request.referer.reply(conversation_id, request.message_id, response)
57
+
58
+ return response
57
59
  end
58
60
 
59
61
  def conversation_id
@@ -16,8 +16,8 @@ module Charyf
16
16
 
17
17
  module ClassMethods
18
18
 
19
- def auto_reply(only: [], except: [])
20
- @_render_filters = Charyf::Utils.create_action_filters(only, except)
19
+ def auto_reply(on_all = nil, only: [], except: [])
20
+ @_render_filters = Charyf::Utils.create_action_filters(on_all, only, except)
21
21
  end
22
22
 
23
23
  def _render_on?(action)
@@ -78,6 +78,7 @@ module Charyf
78
78
  result = controller.send(get_action_name(context))
79
79
  handle_after_actions(controller)
80
80
 
81
+ # TODO collect all replies
81
82
  return :OK, result
82
83
  rescue Exception => e
83
84
  # Dispatch the error to all error handlers
@@ -26,7 +26,7 @@ module Charyf
26
26
  end
27
27
 
28
28
  sig_self ['String', 'Charyf::Engine::Response'], nil,
29
- def self.reply(conversation_id, response)
29
+ def self.reply(conversation_id, message_id, response)
30
30
  interface = _interfaces[conversation_id]
31
31
  raise InvalidConversationError.new("No program interface found for conversation #{conversation_id}") unless interface
32
32
 
@@ -38,13 +38,14 @@ module Charyf
38
38
  end
39
39
  end
40
40
 
41
- sig_self [['Symbol', 'Array'], 'Array'], 'Hash',
42
- def self.create_action_filters(only = [], except = [])
41
+ def self.create_action_filters(on_all = nil, only = [], except = [])
43
42
  if only && only != :all && !only.empty? && except && !except.empty?
44
43
  raise InvalidDefinitionError.new("Define only or except, don't define both");
45
44
  end
46
45
 
47
46
  _only = except && except.empty? ? only.map(&:to_sym) : :all
47
+
48
+ _only = :all if on_all == :all
48
49
  _except = except.map(&:to_sym)
49
50
 
50
51
  {
@@ -11,7 +11,7 @@ module Charyf
11
11
  module VERSION
12
12
  MAJOR = 0
13
13
  MINOR = 2
14
- TINY = 8
14
+ TINY = 9
15
15
  PRE = nil
16
16
 
17
17
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: charyf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.8
4
+ version: 0.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Ludvigh
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-04-16 00:00:00.000000000 Z
11
+ date: 2018-05-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: charyf_sig