charyf 0.2.9 → 0.2.10
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 +4 -4
- data/Gemfile.lock +1 -3
- data/charyf.gemspec +0 -1
- data/lib/charyf/deps.rb +0 -7
- data/lib/charyf/engine/controller/controller.rb +0 -1
- data/lib/charyf/engine/controller/renderers.rb +0 -6
- data/lib/charyf/engine/dispatcher/base.rb +0 -1
- data/lib/charyf/engine/interface/program.rb +0 -6
- data/lib/charyf/engine/request.rb +0 -1
- data/lib/charyf/engine/session/processors/processor.rb +0 -2
- data/lib/charyf/engine/session/session.rb +0 -2
- data/lib/charyf/engine/skill/info.rb +0 -1
- data/lib/charyf/utils/application.rb +0 -2
- data/lib/charyf/utils/machine.rb +0 -1
- data/lib/charyf/utils/storage/provider.rb +0 -4
- data/lib/charyf/utils/utils.rb +0 -1
- data/lib/charyf/version.rb +1 -1
- data/todo.md +0 -1
- metadata +1 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b99229b9888f43029d9e51373d9df530df31265
|
4
|
+
data.tar.gz: 5abf44d14306c35517f165fa367e07205f6d1366
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 11388a95f19750048153a6e31804ad7fcf3603ff6c3fb58d1ca4817acfbb88b97b376661ee17980e7282b355ba8740ffdc81447fcbcf10f822d2baeb1cd79baf
|
7
|
+
data.tar.gz: 4752b08207fee648489bb475da0786956e4ee3e337b05ad9b1a178ee875b612cc80aa4ef5ace4c72ccfa697939781eb317d6cb4de6aa6d00ab73f6b57eec8337
|
data/Gemfile.lock
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
charyf (0.2.
|
5
|
-
charyf_sig (~> 1.1.2)
|
4
|
+
charyf (0.2.10)
|
6
5
|
colorize (~> 0.8)
|
7
6
|
i18n (~> 0.9)
|
8
7
|
thor (>= 0.18.1, < 2.0)
|
@@ -10,7 +9,6 @@ PATH
|
|
10
9
|
GEM
|
11
10
|
remote: https://rubygems.org/
|
12
11
|
specs:
|
13
|
-
charyf_sig (1.1.2)
|
14
12
|
coderay (1.1.2)
|
15
13
|
colorize (0.8.1)
|
16
14
|
concurrent-ruby (1.0.5)
|
data/charyf.gemspec
CHANGED
@@ -33,7 +33,6 @@ Gem::Specification.new do |spec|
|
|
33
33
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
34
34
|
|
35
35
|
# Internal dependencies
|
36
|
-
spec.add_runtime_dependency 'charyf_sig', '~> 1.1.2'
|
37
36
|
|
38
37
|
# External dependencies
|
39
38
|
spec.add_runtime_dependency 'i18n', '~> 0.9'
|
data/lib/charyf/deps.rb
CHANGED
@@ -30,7 +30,6 @@ module Charyf
|
|
30
30
|
|
31
31
|
end # End of ClassMethods
|
32
32
|
|
33
|
-
# TODO sig
|
34
33
|
def response_folder
|
35
34
|
return nil if skill.nil?
|
36
35
|
|
@@ -48,12 +47,10 @@ module Charyf
|
|
48
47
|
end
|
49
48
|
end
|
50
49
|
|
51
|
-
# TODO sig
|
52
50
|
def responses_for(action)
|
53
51
|
Dir[response_folder.join("#{action}**")]
|
54
52
|
end
|
55
53
|
|
56
|
-
# TODO sig
|
57
54
|
def render_text_response(action)
|
58
55
|
file_path = response_folder.join("#{action}.txt.erb")
|
59
56
|
|
@@ -62,7 +59,6 @@ module Charyf
|
|
62
59
|
_render_sample_response file_path
|
63
60
|
end
|
64
61
|
|
65
|
-
# TODO sig
|
66
62
|
def render_html_response(action)
|
67
63
|
file_path = response_folder.join("#{action}.html.erb")
|
68
64
|
|
@@ -84,12 +80,10 @@ module Charyf
|
|
84
80
|
end
|
85
81
|
|
86
82
|
|
87
|
-
# TODO sig
|
88
83
|
def controller_path
|
89
84
|
controller_name.underscore
|
90
85
|
end
|
91
86
|
|
92
|
-
# TODO sig
|
93
87
|
def exists?(path)
|
94
88
|
File.exists?(path)
|
95
89
|
end
|
@@ -25,7 +25,6 @@ module Charyf
|
|
25
25
|
# NOP
|
26
26
|
end
|
27
27
|
|
28
|
-
sig_self ['String', 'Charyf::Engine::Response'], nil,
|
29
28
|
def self.reply(conversation_id, message_id, response)
|
30
29
|
interface = _interfaces[conversation_id]
|
31
30
|
raise InvalidConversationError.new("No program interface found for conversation #{conversation_id}") unless interface
|
@@ -33,7 +32,6 @@ module Charyf
|
|
33
32
|
interface.reply(response)
|
34
33
|
end
|
35
34
|
|
36
|
-
sig_self ['String', 'Proc'], 'Charyf::Interface::Program',
|
37
35
|
def self.create(conversation_id, handler)
|
38
36
|
interface = self.new(conversation_id, handler)
|
39
37
|
|
@@ -46,24 +44,20 @@ module Charyf
|
|
46
44
|
@_interfaces ||= Hash.new
|
47
45
|
end
|
48
46
|
|
49
|
-
sig [nil, 'Proc'],
|
50
47
|
def initialize(conversation_id, handler)
|
51
48
|
|
52
49
|
@handler = handler
|
53
50
|
@conversation_id = conversation_id.to_s
|
54
51
|
end
|
55
52
|
|
56
|
-
sig ['Charyf::Engine::Request'],
|
57
53
|
def process(request)
|
58
54
|
self.class.dispatcher.dispatch(request)
|
59
55
|
end
|
60
56
|
|
61
|
-
sig ['Charyf::Engine::Response'],
|
62
57
|
def reply(response)
|
63
58
|
handler.call(response)
|
64
59
|
end
|
65
60
|
|
66
|
-
sig [], 'Charyf::Engine::Request',
|
67
61
|
def request
|
68
62
|
Charyf::Engine::Request.new(self.class, conversation_id, SecureRandom.hex)
|
69
63
|
end
|
@@ -11,12 +11,10 @@ module Charyf
|
|
11
11
|
|
12
12
|
include Charyf::Strategy::BaseClass
|
13
13
|
|
14
|
-
sig ['Charyf::Engine::Request'], ['Charyf::Engine::Session', 'NilClass'],
|
15
14
|
def process(request)
|
16
15
|
raise Charyf::Utils::NotImplemented.new
|
17
16
|
end
|
18
17
|
|
19
|
-
sig_self [], ['Charyf::Engine::Session::Processor::Base'],
|
20
18
|
def self.get
|
21
19
|
raise Charyf::Utils::NotImplemented.new
|
22
20
|
end
|
@@ -7,7 +7,6 @@ module Charyf
|
|
7
7
|
attr_reader :uuid, :skill, :controller, :action, :timestamp
|
8
8
|
|
9
9
|
# TODO - mention it could return nil
|
10
|
-
# TODO sig
|
11
10
|
def self.get(uuid)
|
12
11
|
yaml = _storage.get(uuid)
|
13
12
|
yaml ? YAML.load(yaml) : nil
|
@@ -45,7 +44,6 @@ module Charyf
|
|
45
44
|
self.class._storage.store(@uuid, YAML.dump(self))
|
46
45
|
end
|
47
46
|
|
48
|
-
sig [], ['Symbol', 'String', 'NilClass'],
|
49
47
|
def full_controller_name
|
50
48
|
@controller.blank? ? nil : @skill.camelize + '::' + @controller.camelize
|
51
49
|
end
|
@@ -64,7 +64,6 @@ module Charyf
|
|
64
64
|
instance_eval(&block)
|
65
65
|
end
|
66
66
|
|
67
|
-
# TODO sig, nullable
|
68
67
|
def session_processor
|
69
68
|
# TODO resolve dependency on engine - maybe move the base classes to utils?
|
70
69
|
klass = Charyf::Engine::Session::Processor.list[config.session_processor]
|
@@ -105,7 +104,6 @@ module Charyf
|
|
105
104
|
klass
|
106
105
|
end
|
107
106
|
|
108
|
-
# TODO sig, nullable
|
109
107
|
def storage_provider
|
110
108
|
klass = Charyf::Utils::StorageProvider.list[config.storage_provider]
|
111
109
|
raise Charyf::Utils::InvalidConfiguration.new("No storage provider with name '#{config.storage_provider}' found") unless klass
|
data/lib/charyf/utils/machine.rb
CHANGED
@@ -11,22 +11,18 @@ module Charyf
|
|
11
11
|
|
12
12
|
include Charyf::Strategy::BaseClass
|
13
13
|
|
14
|
-
sig_self [['Module', 'String']], ['Charyf::Utils::StorageProvider::Base'],
|
15
14
|
def self.get_for(klass)
|
16
15
|
raise Charyf::Utils::NotImplemented.new
|
17
16
|
end
|
18
17
|
|
19
|
-
sig [nil], [nil],
|
20
18
|
def get(key)
|
21
19
|
raise Charyf::Utils::NotImplemented.new
|
22
20
|
end
|
23
21
|
|
24
|
-
sig [nil, nil], [nil],
|
25
22
|
def store(key, value)
|
26
23
|
raise Charyf::Utils::NotImplemented.new
|
27
24
|
end
|
28
25
|
|
29
|
-
sig [nil], [nil],
|
30
26
|
def remove(key)
|
31
27
|
raise Charyf::Utils::NotImplemented.new
|
32
28
|
end
|
data/lib/charyf/utils/utils.rb
CHANGED
@@ -54,7 +54,6 @@ module Charyf
|
|
54
54
|
}
|
55
55
|
end
|
56
56
|
|
57
|
-
sig_self ['Symbol', 'Hash'], ['TrueClass', 'FalseClass'],
|
58
57
|
def self.match_action_filters?(name, filters = {only: [], except: []} )
|
59
58
|
(filters[:only] == :all && !filters[:except].include?(name)) ||
|
60
59
|
((filters[:only] != :all) && (filters[:only] || []).include?(name))
|
data/lib/charyf/version.rb
CHANGED
data/todo.md
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: charyf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Richard Ludvigh
|
@@ -10,20 +10,6 @@ bindir: exe
|
|
10
10
|
cert_chain: []
|
11
11
|
date: 2018-05-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: charyf_sig
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: 1.1.2
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: 1.1.2
|
27
13
|
- !ruby/object:Gem::Dependency
|
28
14
|
name: i18n
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|