komonjo 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/komonjo.rb +2 -1
- data/lib/komonjo/client.rb +6 -1
- data/lib/komonjo/services/messages_service.rb +1 -2
- data/lib/komonjo/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 33c3167538caaa077adb697faf3e37ceea56232d
|
4
|
+
data.tar.gz: 63436f5123d9f6569c82b69754c6a8fb39519b6d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 760467d6543d8147f81b0d871ee360900eb89cc0ace366173f80ab8e53c64297cd670ea7a3838816038c34f4c769efccad3dad1b62bf4721d42810e561500cc3
|
7
|
+
data.tar.gz: 0d9f9d5d94e88ad858169695c66b1fa251f138b7d9b709d90a91ebed68889e1dd4190284cb03fb3cef451a5e99d6334f8fe30c43d2ffe7e989f0ba36a0335336
|
data/lib/komonjo.rb
CHANGED
@@ -1,7 +1,8 @@
|
|
1
|
+
require 'komonjo/extensions/hash_extensions'
|
2
|
+
|
1
3
|
require 'komonjo/client'
|
2
4
|
require 'komonjo/version'
|
3
5
|
require 'komonjo/connections/slack_connection'
|
4
|
-
require 'komonjo/extensions/hash_extensions'
|
5
6
|
require 'komonjo/extensions/to_json'
|
6
7
|
require 'komonjo/gateways/channels_gateway'
|
7
8
|
require 'komonjo/gateways/messages_gateway'
|
data/lib/komonjo/client.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
module Komonjo
|
2
2
|
class Client
|
3
|
+
using ::HashExtensions
|
3
4
|
attr_accessor :api_token
|
4
5
|
def initialize(options)
|
5
6
|
@api_token = options[:token]
|
@@ -19,7 +20,11 @@ module Komonjo
|
|
19
20
|
end
|
20
21
|
|
21
22
|
def messages(opts)
|
22
|
-
|
23
|
+
if opts.is_a?(String)
|
24
|
+
channel_name = opts
|
25
|
+
opts = { channel_name: channel_name }
|
26
|
+
end
|
27
|
+
opts = Hash[opts.symbolize_keys]
|
23
28
|
s = Komonjo::Service::MessagesService.new(@api_token)
|
24
29
|
s.instance_variable_set('@connection', Komonjo::Mock::SlackMock) if @debug
|
25
30
|
s.messages(opts)
|
@@ -7,9 +7,8 @@ module Komonjo
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def messages(opts)
|
10
|
-
channel_name = opts[:channels_name]
|
11
10
|
connection = connection(@api_token)
|
12
|
-
history = connection.channels_history(
|
11
|
+
history = connection.channels_history(opts)
|
13
12
|
users = connection.users_list
|
14
13
|
gateway = Komonjo::Gateway::MessagesGateway.new(history, users)
|
15
14
|
gateway.messages
|
data/lib/komonjo/version.rb
CHANGED