cogibara 0.0.3 → 0.0.4
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.
- data/bin/cogibara-local +2 -0
- data/bin/cogibara-redis +2 -0
- data/lib/cogibara.rb +6 -0
- data/lib/cogibara/default_config.rb +2 -2
- data/lib/cogibara/default_config.yml +44 -0
- data/lib/cogibara/version.rb +1 -1
- metadata +2 -1
data/bin/cogibara-local
CHANGED
data/bin/cogibara-redis
CHANGED
data/lib/cogibara.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require "cogibara/version"
|
2
|
+
require 'yaml'
|
2
3
|
|
3
4
|
module Cogibara
|
4
5
|
class << self
|
@@ -14,6 +15,11 @@ module Cogibara
|
|
14
15
|
@config ||= Configuration.new
|
15
16
|
end
|
16
17
|
|
18
|
+
def default_config
|
19
|
+
# dispatcher.config_from_yaml(YAML.load_file('cogibara/default_config.yml'))
|
20
|
+
load 'cogibara/default_config.rb'
|
21
|
+
end
|
22
|
+
|
17
23
|
def dispatcher
|
18
24
|
@dispatcher ||= Dispatcher.new
|
19
25
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'yaml'
|
2
2
|
Cogibara.setup_dispatcher do |dispatcher|
|
3
|
-
|
4
|
-
|
3
|
+
yml = YAML.load("---\nname: cucumber\nspeak: false\nhard_parse: true\nsoft_parse: true\nmodules:\n- module_name: chat\n keywords:\n - talk\n - chat\n- module_name: translate\n keywords: translate\n- module_name: Wolfram Alpha\n keywords: ask\n file_name: wolfram_alpha\n API_KEY: \n- module_name: Wiki\n keywords: wiki\n- module_name: Maluuba\n keywords:\n - maluuba\n - parse\n file_name: soft_parser\n API_KEY: \n- module_name: Reminder Setter\n keywords: REMINDER\n- module_name: Calendar\n keywords: CALENDAR\n username: \n password: \n- module_name: Knowledge\n keywords: KNOWLEDGE\n WOLFRAM_KEY: \n- module_name: Weather\n keywords: WEATHER\n API_KEY: \n- module_name: Help\n keywords: HELP\n")
|
4
|
+
dispatcher.config_from_yaml(yml)
|
5
5
|
# dispatcher.register_operator(["REMINDER"],{name: "Reminder Setter"})
|
6
6
|
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
---
|
2
|
+
name: cucumber
|
3
|
+
speak: false
|
4
|
+
hard_parse: true
|
5
|
+
soft_parse: true
|
6
|
+
modules:
|
7
|
+
- module_name: chat
|
8
|
+
keywords: [talk,chat]
|
9
|
+
#Bot_ID: 24007
|
10
|
+
#
|
11
|
+
- module_name: translate
|
12
|
+
keywords: translate
|
13
|
+
#
|
14
|
+
- module_name: Wolfram Alpha
|
15
|
+
keywords: ask
|
16
|
+
file_name: wolfram_alpha
|
17
|
+
API_KEY: #YourAPIKey
|
18
|
+
#
|
19
|
+
- module_name: Wiki
|
20
|
+
keywords: wiki
|
21
|
+
#
|
22
|
+
- module_name: Maluuba
|
23
|
+
keywords: [maluuba, parse]
|
24
|
+
file_name: soft_parser
|
25
|
+
API_KEY: #YourAPIKey
|
26
|
+
#
|
27
|
+
- module_name: Reminder Setter
|
28
|
+
keywords: REMINDER
|
29
|
+
#
|
30
|
+
- module_name: Calendar
|
31
|
+
keywords: CALENDAR
|
32
|
+
username: #YourGmailName
|
33
|
+
password: #YourGmailPassword
|
34
|
+
#
|
35
|
+
- module_name: Knowledge
|
36
|
+
keywords: KNOWLEDGE
|
37
|
+
WOLFRAM_KEY: #YourAPIKey
|
38
|
+
#
|
39
|
+
- module_name: Weather
|
40
|
+
keywords: WEATHER
|
41
|
+
API_KEY: #YourAPIKey
|
42
|
+
#
|
43
|
+
- module_name: Help
|
44
|
+
keywords: HELP
|
data/lib/cogibara/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cogibara
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -304,6 +304,7 @@ files:
|
|
304
304
|
- lib/cogibara/configuration.rb
|
305
305
|
- lib/cogibara/confirmer.rb
|
306
306
|
- lib/cogibara/default_config.rb
|
307
|
+
- lib/cogibara/default_config.yml
|
307
308
|
- lib/cogibara/dispatcher.rb
|
308
309
|
- lib/cogibara/file_handler.rb
|
309
310
|
- lib/cogibara/message.rb
|