wit_bot 0.4.0 → 0.4.1

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: 2822b54c41afb8236a1ae7c1e14480a18d589652
4
- data.tar.gz: 1faa556ee9be09bfaec737127f8d91e5a648e811
3
+ metadata.gz: 1e387a08441a8c5f9c9b1fa391cd8ac4b5a1edb9
4
+ data.tar.gz: 6d49997d4fff960c07f92ed6200cbb72814d1dc9
5
5
  SHA512:
6
- metadata.gz: cd98b6c765b838f0d0fb21db89bd96ba2ce61a1d2adca4272f2dd75947020b392915090dd79b14622298560325668ee23c1ffcccd73208b5e2aa8418a768ace9
7
- data.tar.gz: 7c2f7f111dd129e6a7bbce791621fccad40678b0cca120a3e4252581eb54c852a66bd0789c93d5c1df81798d0f0fe9fed701c84e747ee1d3788413b2a9e86d4d
6
+ metadata.gz: fa5a966a259be1ad435f06600a0b15a17b18749047625ce923192e3cceebbbb32607323df8091f20e5e069859eb79870dff82c29dfe824628bc62905600bb6a7
7
+ data.tar.gz: 7d5ae281e07a6382491a7a830f9001197712576dc21152f859d57bc6b0828e6efdfbd7d713c1e16bfa4575a77bd9d053ad503e3a572960b7383f3da6b10e0717
data/README.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # WitBot
2
2
 
3
+ ![gem version](https://img.shields.io/gem/v/wit_bot.svg?style=flat-square)
4
+ ![gem rank](https://img.shields.io/gem/rt/wit_bot.svg?style=flat-square)
5
+ ![gem downloads](https://img.shields.io/gem/dt/wit_bot.svg?style=flat-square)
6
+
3
7
  A better [wit.ai] client for Ruby. Written in Ruby. With an api for creating bots.
4
8
 
5
9
  Pretty Awesome™
@@ -22,64 +26,11 @@ Or install it yourself as:
22
26
 
23
27
  ## Usage
24
28
 
25
- Start a REPL:
26
-
27
- ```bash
28
- $ wit
29
- ```
30
-
31
- or use with STDIO
32
-
33
- ```bash
34
- $ wit --input --json
35
- ```
36
-
37
- or use programmatically
38
-
39
- 1. Configure WitBot with your access token:
40
-
41
- ```ruby
42
- WitBot.configure do |c|
43
- c.token = ENV['WIT_AI_TOKEN']
44
- end
45
- ```
46
-
47
- 2. Create a message:
48
-
49
- ```ruby
50
- message = WitBot.create_message 'This is a cool test'
51
- ```
52
-
53
- 3. And send it:
54
-
55
- ```ruby
56
- message.send
57
- ```
58
-
59
- 4. Get the outcome:
60
-
61
- ```ruby
62
- outcome = message.outcome
63
- ```
64
-
65
- 5. Get the intent and the entities:
66
-
67
- ```ruby
68
- intent = outcome.intent #=> WitBot::WitModel::Intent
69
- entities = outcome.entities #=> {role => #<WitBot::WitModel::Entity>}
70
- ```
71
-
72
- 6. Get the intent name:
73
-
74
- ```ruby
75
- intent.name #=> "Test"
76
- ```
77
-
78
- More information on the [GitHub wiki][wiki].
29
+ Usage information is on the [wiki].
79
30
 
80
31
  ## Development
81
32
 
82
- After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
33
+ After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` or `bin/wit` for an interactive prompt that will allow you to experiment.
83
34
 
84
35
  To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
85
36
 
data/bin/wit CHANGED
@@ -1,5 +1,8 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
+ lib = File.expand_path('../../lib', __FILE__)
4
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
+
3
6
  require 'awesome_print'
4
7
  require 'optparse'
5
8
  require 'json'
@@ -49,7 +52,7 @@ message = nil
49
52
 
50
53
  if repl
51
54
  begin
52
- puts 'Starting Wit REPL:'
55
+ puts "Starting Wit REPL v#{WitBot::VERSION}:"
53
56
  loop do
54
57
  print 'wit > '
55
58
 
@@ -1,4 +1,7 @@
1
- require_relative '../../lib/wit_bot'
1
+ lib = File.expand_path('../../../lib', __FILE__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+
4
+ require 'wit_bot'
2
5
  require 'ap'
3
6
 
4
7
  WitBot.configure do |c|
data/examples/simple.rb CHANGED
@@ -1,5 +1,8 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
+ lib = File.expand_path('../../lib', __FILE__)
4
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
+
3
6
  require 'awesome_print'
4
7
  require 'wit_bot'
5
8
 
@@ -18,6 +18,10 @@ module WitBot
18
18
  end.flatten]
19
19
  end
20
20
 
21
+ def method_missing(*_)
22
+ nil
23
+ end
24
+
21
25
  private
22
26
  def create_getter(var)
23
27
  self.class.send(:define_method, var, -> { self[var] })
@@ -1,3 +1,3 @@
1
1
  module WitBot
2
- VERSION = '0.4.0'
2
+ VERSION = '0.4.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wit_bot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben (@penne12_)
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-01 00:00:00.000000000 Z
11
+ date: 2016-04-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler