adapt-charyf 0.3.3 → 0.3.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.
- checksums.yaml +4 -4
- data/README.md +41 -3
- data/lib/adapt-charyf.rb +10 -1
- data/lib/adapt/generators/install/install_generator.rb +3 -2
- data/lib/adapt/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ea719f91c8054cacde7a84ca5dbb632fe84ae6d
|
4
|
+
data.tar.gz: 2f01c46da1dd23664986235bf58587e5abd84d3f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 725e8c4ba6ca43625a21e01679ce15eeb39702e38bdaefdfbda6a56d98a644537ee61604f1ce88274c32ff0350e5db6a80b544ff144ca1ca75dcf98b3e8a321d
|
7
|
+
data.tar.gz: acf6207915f0a3b78fff29c51e4fbb44634f7401a344be8b527e1f18358ab61fcb0c31c177a6fc1ad6a971bca3a06ff323b544e22486faf59166de2697a55cda
|
data/README.md
CHANGED
@@ -4,19 +4,57 @@ Adapt-Charyf is a ruby wrapper around Mycroft's Intent parser library [mycroft/A
|
|
4
4
|
|
5
5
|
# Getting Started
|
6
6
|
|
7
|
+
## Installing to existing charyf applicaiton
|
8
|
+
|
7
9
|
Add this line to your charyf application's Gemfile:
|
8
10
|
|
9
11
|
```ruby
|
10
|
-
gem 'adapt-
|
12
|
+
gem 'adapt-charyf'
|
11
13
|
```
|
12
14
|
|
13
15
|
And then execute:
|
14
16
|
|
15
17
|
$ bundle
|
16
18
|
|
17
|
-
|
19
|
+
Then add the adapt to the applocation loads by adding line to ``config/load.rb``
|
20
|
+
```ruby
|
21
|
+
require 'adapt-charyf'
|
22
|
+
```
|
23
|
+
|
24
|
+
To generate the intializer run
|
25
|
+
```bash
|
26
|
+
charyf generate adapt:install
|
27
|
+
```
|
28
|
+
|
29
|
+
You should be welcomed by the message
|
30
|
+
```
|
31
|
+
create config/initializers/adapt.rb
|
32
|
+
notice Adapt installed
|
33
|
+
Do not forget to set adapt intent processor in application configuration
|
34
|
+
```
|
35
|
+
|
36
|
+
You can configure the processor inside ``config/initializers/adapt.rb`` which was generated by the installer
|
37
|
+
|
38
|
+
Now enable adapt processor inside your application config (``config/application.rb``) or specific environment config (e.g.: ``config/environments/development.rb``)
|
39
|
+
|
40
|
+
```ruby
|
41
|
+
config.enabled_intent_processors = [.., :adapt, ..]
|
42
|
+
```
|
43
|
+
|
44
|
+
## Install with new charyf application
|
45
|
+
You can add adapt as intent processor during generation of new application. Just use
|
46
|
+
``--intent-processors=adapt`` as argument with your ``charyf new ...`` command.
|
47
|
+
|
48
|
+
After new app is created make sure you crete the initializer by running
|
49
|
+
```bash
|
50
|
+
charyf generate adapt:install
|
51
|
+
```
|
52
|
+
|
53
|
+
When installing adapt along charyf new application, ``config/loads.rb`` and configuration inside ``config/application.rb`` will be populated automatically.
|
54
|
+
|
55
|
+
You can configure the processor inside ``config/initializers/adapt.rb`` which was generated by the installer
|
18
56
|
|
19
|
-
|
57
|
+
## Dependencies
|
20
58
|
|
21
59
|
Make sure the python library is installed
|
22
60
|
```pip install -e git+https://github.com/mycroftai/adapt#egg=adapt-parser``` [or use pip3 if desired]
|
data/lib/adapt-charyf.rb
CHANGED
@@ -6,12 +6,21 @@ require_relative 'adapt/processor'
|
|
6
6
|
module Adapt
|
7
7
|
class Extension < Charyf::Extension
|
8
8
|
|
9
|
+
# Load generators inside this block
|
9
10
|
generators do
|
10
11
|
require_relative 'adapt/generators/intent/intent_generator'
|
11
12
|
require_relative 'adapt/generators/install/install_generator'
|
12
13
|
end
|
13
14
|
|
14
|
-
|
15
|
+
# Add generator hooks
|
16
|
+
#
|
17
|
+
# Skill hook is run when new skill is being generated
|
18
|
+
#
|
19
|
+
config.generators.skill_hooks << 'adapt:intent'
|
20
|
+
#
|
21
|
+
# Installers are automatically run if this gem is present during generation of new application
|
22
|
+
#
|
23
|
+
config.generators.installers << 'adapt:install'
|
15
24
|
|
16
25
|
# If unset, I18n locale will be used
|
17
26
|
config.locale = nil
|
@@ -11,10 +11,11 @@ module Adapt
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def finalize
|
14
|
-
return
|
14
|
+
return if behavior != :invoke || options[:autorun]
|
15
15
|
|
16
16
|
say_status 'notice', "Adapt installed" +
|
17
|
-
"\n\t\tDo not forget to set adapt intent processor in application configuration"
|
17
|
+
"\n\t\tDo not forget to set adapt intent processor in application configuration" +
|
18
|
+
"\n\t\t\tconfig.enabled_intent_processors = [.., :adapt, ..]", :green
|
18
19
|
end
|
19
20
|
|
20
21
|
end
|
data/lib/adapt/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: adapt-charyf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.4
|
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-
|
11
|
+
date: 2018-04-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: charyf
|