cinch-wit 0.0.1 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGES.md +11 -0
- data/README.md +2 -1
- data/cinch-wit.gemspec +22 -15
- data/lib/cinch/wit/version.rb +3 -3
- data/lib/cinch/wit.rb +23 -23
- metadata +19 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: ab5c72598415aeb14fea273070de17ff01154e396053d2418821364f13545ac5
|
4
|
+
data.tar.gz: ae830c870b1a8f322ad55dcbaba8ff5b604b3f5d8f96641add65a6c86f918a70
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 14fc9ef73a539eb25c93aec6eeeb2b13da8a6300a74892c265db6396bf334c129c2de8d20460f9e4e942a0f84eb0c7012396b34854e2cb8272cac27d305f330b
|
7
|
+
data.tar.gz: 5b80a3d747728d23e2110b78c69893e718480417b27e09c0fb5c2ed6ea62cf0eaeb407a4ac9624cc6c4fd11eed9fdb7fa9c32eb8175efd5e6b8d3f488eb445cc
|
data/CHANGES.md
CHANGED
@@ -1,6 +1,17 @@
|
|
1
1
|
Cinch Wit Plugin Changes
|
2
2
|
========================
|
3
3
|
|
4
|
+
## v0.0.3 - *2021-05-25*
|
5
|
+
|
6
|
+
- Raised Bundler dev dependency to >= 2.2.10 for security fixes
|
7
|
+
- https://github.com/advisories/GHSA-fp4w-jxhp-m23p
|
8
|
+
- https://github.com/advisories/GHSA-g98m-96g9-wfjq
|
9
|
+
|
10
|
+
## v0.0.2 - *2013-11-08*
|
11
|
+
|
12
|
+
- Fixed typo for `Cinch::Wit::VERSION` constant
|
13
|
+
- Fixed documented `require` paths in README
|
14
|
+
|
4
15
|
## v0.0.1 - *2013-11-08*
|
5
16
|
|
6
17
|
- First version.
|
data/README.md
CHANGED
@@ -31,7 +31,8 @@ Note: This guide expects you to already have basic familiarity of [Cinch][2] and
|
|
31
31
|
After installing the gem, register the plugin in your Cinch bot, like so:
|
32
32
|
|
33
33
|
``` ruby
|
34
|
-
require 'cinch
|
34
|
+
require 'cinch'
|
35
|
+
require 'cinch/wit'
|
35
36
|
|
36
37
|
bot = Cinch::Bot.new do
|
37
38
|
configure do |c|
|
data/cinch-wit.gemspec
CHANGED
@@ -1,20 +1,27 @@
|
|
1
|
+
lib = File.expand_path('../lib', __FILE__)
|
2
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
+
|
4
|
+
require 'cinch/wit/version'
|
5
|
+
|
1
6
|
Gem::Specification.new do |spec|
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
7
|
+
spec.name = 'cinch-wit'
|
8
|
+
spec.version = Cinch::Wit::VERSION
|
9
|
+
spec.authors = ['Justin Workman']
|
10
|
+
spec.email = ['xtagon@gmail.com']
|
11
|
+
spec.summary = "A Cinch plugin for the Wit API"
|
12
|
+
spec.description = "A Cinch plugin to use Wit's natural language processing in your IRC bot"
|
13
|
+
spec.license = 'MIT'
|
14
|
+
|
15
|
+
spec.metadata = { 'rubygems_mfa_required' => 'true' }
|
9
16
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
17
|
+
spec.files = `git ls-files`.split($/)
|
18
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
19
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
20
|
+
spec.require_paths = ['lib']
|
14
21
|
|
15
|
-
|
16
|
-
|
22
|
+
spec.add_runtime_dependency 'cinch'
|
23
|
+
spec.add_runtime_dependency 'wit'
|
17
24
|
|
18
|
-
|
19
|
-
|
25
|
+
spec.add_development_dependency 'bundler', '>= 2.2.10'
|
26
|
+
spec.add_development_dependency 'rake'
|
20
27
|
end
|
data/lib/cinch/wit/version.rb
CHANGED
data/lib/cinch/wit.rb
CHANGED
@@ -1,31 +1,31 @@
|
|
1
1
|
module Cinch
|
2
|
-
|
3
|
-
|
4
|
-
|
2
|
+
module Plugins
|
3
|
+
class Wit
|
4
|
+
include Cinch::Plugin
|
5
5
|
|
6
|
-
|
6
|
+
require 'wit'
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
8
|
+
# Match when the bot's name is mentioned at the START.
|
9
|
+
# e.g. "Bot, how are you?"
|
10
|
+
match lambda { |msg| /\A\s*#{msg.bot.nick}[:,](.+)/i }, use_prefix: false
|
11
11
|
|
12
|
-
|
13
|
-
|
14
|
-
|
12
|
+
# Match when the bot's name is mentioned at the END.
|
13
|
+
# e.g. "Hello, Bot."
|
14
|
+
match lambda { |msg| /(.+),\s+#{msg.bot.nick}[.?!\s]*\s*\Z/i }, use_prefix: false
|
15
15
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
16
|
+
# Send a message to the Wit API and dispatch an event with the outcome.
|
17
|
+
def execute(msg, message)
|
18
|
+
wit_response = wit_client.message(message.strip)
|
19
|
+
outcome = wit_response['outcome']
|
20
|
+
debug outcome.to_s
|
21
|
+
msg.bot.handlers.dispatch :intent, msg, outcome
|
22
|
+
end
|
23
23
|
|
24
|
-
|
24
|
+
private
|
25
25
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
26
|
+
def wit_client
|
27
|
+
@wit_client ||= ::Wit::Client.new(config[:access_token])
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
31
|
end
|
metadata
CHANGED
@@ -1,69 +1,69 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cinch-wit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Workman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-07-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cinch
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: wit
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: 2.2.10
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: 2.2.10
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rake
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
description: A Cinch plugin to use Wit's natural language processing in your IRC bot
|
@@ -73,8 +73,8 @@ executables: []
|
|
73
73
|
extensions: []
|
74
74
|
extra_rdoc_files: []
|
75
75
|
files:
|
76
|
-
- .gitignore
|
77
|
-
- .rspec
|
76
|
+
- ".gitignore"
|
77
|
+
- ".rspec"
|
78
78
|
- CHANGES.md
|
79
79
|
- Gemfile
|
80
80
|
- LICENSE.txt
|
@@ -86,26 +86,25 @@ files:
|
|
86
86
|
homepage:
|
87
87
|
licenses:
|
88
88
|
- MIT
|
89
|
-
metadata:
|
89
|
+
metadata:
|
90
|
+
rubygems_mfa_required: 'true'
|
90
91
|
post_install_message:
|
91
92
|
rdoc_options: []
|
92
93
|
require_paths:
|
93
94
|
- lib
|
94
95
|
required_ruby_version: !ruby/object:Gem::Requirement
|
95
96
|
requirements:
|
96
|
-
- -
|
97
|
+
- - ">="
|
97
98
|
- !ruby/object:Gem::Version
|
98
99
|
version: '0'
|
99
100
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
100
101
|
requirements:
|
101
|
-
- -
|
102
|
+
- - ">="
|
102
103
|
- !ruby/object:Gem::Version
|
103
104
|
version: '0'
|
104
105
|
requirements: []
|
105
|
-
|
106
|
-
rubygems_version: 2.0.3
|
106
|
+
rubygems_version: 3.3.18
|
107
107
|
signing_key:
|
108
108
|
specification_version: 4
|
109
109
|
summary: A Cinch plugin for the Wit API
|
110
110
|
test_files: []
|
111
|
-
has_rdoc:
|