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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4125fa9f68b59e2bc87aca4c9323dffaf2b2f5e9
4
- data.tar.gz: 764b916befc17af71dfa835356d82d7e42f3d61e
3
+ metadata.gz: 4ea719f91c8054cacde7a84ca5dbb632fe84ae6d
4
+ data.tar.gz: 2f01c46da1dd23664986235bf58587e5abd84d3f
5
5
  SHA512:
6
- metadata.gz: 7c2f478798f25aa61fd89a5b1ecc91df724946cedf1fd2a1d70f30eb0c40eefba9d37e2378f51b3eef6dbe8f7f8ea4c869e49c1d3a93181943f1c753aa95540c
7
- data.tar.gz: fbb76f671f2880ca58d4958007abef7442d24b349f20de378f7bc4980ac148da13fc1dedfec865038e5bc9eb03eb454b30bca46269cff7545cc31ca962171fd0
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-chartf'
12
+ gem 'adapt-charyf'
11
13
  ```
12
14
 
13
15
  And then execute:
14
16
 
15
17
  $ bundle
16
18
 
17
- Or install it yourself as:
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
- $ gem install adapt-charyf
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]
@@ -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
- config.generators.skill_hooks :intents, :adapt => true
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 unless behavior == :invoke
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", :green
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
@@ -1,3 +1,3 @@
1
1
  module Adapt
2
- VERSION = '0.3.3'
2
+ VERSION = '0.3.4'
3
3
  end
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.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-14 00:00:00.000000000 Z
11
+ date: 2018-04-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: charyf