artemis-bot 0.1.1 → 0.1.2
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 +1 -0
- data/artemis-bot.gemspec +1 -0
- data/lib/artemis/bot/conversator.rb +1 -3
- data/lib/artemis/bot/version.rb +1 -1
- metadata +16 -4
- data/lib/artemis/bot/connection.rb +0 -15
- data/lib/artemis/bot/errors.rb +0 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b7fde2cdb6be88c14f023b4dc69d45d1ef061ca6
|
4
|
+
data.tar.gz: 64a994cff17da25e572e64488bd31517877fc7c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c06ee93e1f451ae63429014a10eeb85fd47e285f563cf2a0235368d049df1a7babd7367785f7856b061b76a1c0b04e44f21ee871f47ee1f1a9452fc9b6effe19
|
7
|
+
data.tar.gz: 54c14eccdc3a8ad7a4262d569105b454af6c2f82325832caf2fadf0d76edf1c25058f5897ee8a87ac3c315beea5790bbe02d7f556de7f8f70c2764560c3ed88c
|
data/README.md
CHANGED
@@ -26,6 +26,7 @@ First you need to configure Artemis with your Conversation credentials
|
|
26
26
|
Artemis::Bot.configure do |config|
|
27
27
|
config.username = "your-username-here"
|
28
28
|
config.password = "your-password-here"
|
29
|
+
config.base_uri = "https://gateway.watsonplatform.net/conversation/api"
|
29
30
|
end
|
30
31
|
```
|
31
32
|
|
data/artemis-bot.gemspec
CHANGED
@@ -22,6 +22,7 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.add_dependency "httparty", "~> 0.14.0"
|
23
23
|
spec.add_dependency "httmultiparty", "~> 0.3.16"
|
24
24
|
spec.add_dependency "activesupport", "~> 4.0"
|
25
|
+
spec.add_dependency "olimpo", "~> 0.1.0"
|
25
26
|
|
26
27
|
spec.add_development_dependency "bundler", "~> 1.12"
|
27
28
|
spec.add_development_dependency "rake", "~> 10.0"
|
@@ -1,13 +1,11 @@
|
|
1
1
|
require 'artemis/bot/response'
|
2
2
|
require 'artemis/bot/message_request'
|
3
|
-
require 'artemis/bot/connection'
|
4
|
-
require 'artemis/bot/errors'
|
5
3
|
require 'artemis/services/object_to_hash'
|
6
4
|
|
7
5
|
module Artemis
|
8
6
|
module Bot
|
9
7
|
class Conversator < Olimpo::Base
|
10
|
-
|
8
|
+
headers 'Content-Type' => 'application/json'
|
11
9
|
|
12
10
|
def self.message(workspace_id, message_request = Artemis::Bot::MessageRequest.new)
|
13
11
|
message_request_hash = Artemis::Services::ObjectToHash.convert(message_request, include_nils: false)
|
data/lib/artemis/bot/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: artemis-bot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Walter Reyes
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-11-
|
11
|
+
date: 2016-11-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '4.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: olimpo
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 0.1.0
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 0.1.0
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: bundler
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -115,12 +129,10 @@ files:
|
|
115
129
|
- bin/setup
|
116
130
|
- lib/.DS_Store
|
117
131
|
- lib/artemis/bot.rb
|
118
|
-
- lib/artemis/bot/connection.rb
|
119
132
|
- lib/artemis/bot/context.rb
|
120
133
|
- lib/artemis/bot/context/system.rb
|
121
134
|
- lib/artemis/bot/conversator.rb
|
122
135
|
- lib/artemis/bot/entity.rb
|
123
|
-
- lib/artemis/bot/errors.rb
|
124
136
|
- lib/artemis/bot/input.rb
|
125
137
|
- lib/artemis/bot/intent.rb
|
126
138
|
- lib/artemis/bot/message_request.rb
|
@@ -1,15 +0,0 @@
|
|
1
|
-
module Artemis
|
2
|
-
module Bot
|
3
|
-
module Connection
|
4
|
-
def self.included(klass)
|
5
|
-
klass.class_eval do
|
6
|
-
include HTTMultiParty
|
7
|
-
base_uri 'https://gateway.watsonplatform.net/conversation/api'
|
8
|
-
headers 'Content-Type' => 'application/json'
|
9
|
-
basic_auth Artemis::Bot.username, Artemis::Bot.password
|
10
|
-
debug_output $stdout
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
data/lib/artemis/bot/errors.rb
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
module Artemis
|
2
|
-
module Bot
|
3
|
-
class Error < StandardError
|
4
|
-
attr_accessor :http_status, :response_body
|
5
|
-
|
6
|
-
def initialize(http_status, response_body)
|
7
|
-
message = " [HTTP #{http_status}] #{response_body}"
|
8
|
-
super(message)
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
|
-
# Any error with a 5xx HTTP status code
|
13
|
-
class ServerError < Error; end
|
14
|
-
|
15
|
-
# Any error with a 4xx HTTP status code
|
16
|
-
class ClientError < Error; end
|
17
|
-
end
|
18
|
-
end
|