komonjo 0.1.2 → 0.1.3
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 798370713cab42d460462ffde7e043381df1a6ae
|
4
|
+
data.tar.gz: 4227c41288c90b7876e45cda0a213f30ec4c7d48
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c5537adcd50292f9a3e73ddb11663f64b248f2f01131d83d654ae960f488fef23e5ced6c7ecd1e70d1d03e6bc7d75bc2207726acddd12c03768b3e427efd4090
|
7
|
+
data.tar.gz: 99e5ee97cc4224c6a0775ca246485d2a6242dcfa62ecf21f05a75bde24db626dffc41ae67a405a28159a7ebcd9cbe0a47533f4c04beb7db9691807a397cd0a42
|
data/lib/komonjo/client.rb
CHANGED
@@ -18,10 +18,11 @@ module Komonjo
|
|
18
18
|
s.channels
|
19
19
|
end
|
20
20
|
|
21
|
-
def messages(
|
21
|
+
def messages(opts)
|
22
|
+
opts = { channel_name: opts } if opts.is_a?(String)
|
22
23
|
s = Komonjo::Service::MessagesService.new(@api_token)
|
23
24
|
s.instance_variable_set('@connection', Komonjo::Mock::SlackMock) if @debug
|
24
|
-
s.messages(
|
25
|
+
s.messages(opts)
|
25
26
|
end
|
26
27
|
end
|
27
28
|
end
|
@@ -9,10 +9,14 @@ module Komonjo
|
|
9
9
|
@client = Slack::Client.new(token: api_token)
|
10
10
|
end
|
11
11
|
|
12
|
-
def channels_history(
|
13
|
-
channel_name
|
14
|
-
|
15
|
-
|
12
|
+
def channels_history(opts)
|
13
|
+
channel_name = opts.delete(:channel_name)
|
14
|
+
unless opts[:channel]
|
15
|
+
channel_name[0] = '' if channel_name[0] == '#'
|
16
|
+
channel_id = channel_id channel_name
|
17
|
+
opts[:channel] = channel_id
|
18
|
+
end
|
19
|
+
ret = client.channels_history(opts)
|
16
20
|
fail 'error' unless ret['ok']
|
17
21
|
ret['messages']
|
18
22
|
end
|
@@ -6,11 +6,12 @@ module Komonjo
|
|
6
6
|
@api_token = api_token
|
7
7
|
end
|
8
8
|
|
9
|
-
def messages(
|
9
|
+
def messages(opts)
|
10
|
+
channel_name = opts[:channels_name]
|
10
11
|
connection = connection(@api_token)
|
11
|
-
history = connection.channels_history
|
12
|
+
history = connection.channels_history(channel_name)
|
12
13
|
users = connection.users_list
|
13
|
-
gateway = Komonjo::Gateway::MessagesGateway.new
|
14
|
+
gateway = Komonjo::Gateway::MessagesGateway.new(history, users)
|
14
15
|
gateway.messages
|
15
16
|
end
|
16
17
|
end
|
data/lib/komonjo/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: komonjo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- hkdnet
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-04-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: slack-api
|