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: 2c91db95a77670fde2a70b77136d6ca521e82e3a
4
- data.tar.gz: 568207528eebf0f83334234e3e4d50af44d2aaaa
3
+ metadata.gz: 798370713cab42d460462ffde7e043381df1a6ae
4
+ data.tar.gz: 4227c41288c90b7876e45cda0a213f30ec4c7d48
5
5
  SHA512:
6
- metadata.gz: 2a5b5fedadb5219a43d86ffa63da2582e22d1c0e291a798f061e9f32b8f8dd0487e4428e7d3fecada68a6e25ab68688906c0055520fd2686cd8124dbe15bbaa7
7
- data.tar.gz: 80e6eabae677cf7a325cc7af53d31db43b2a057d8f48730aee1aea0540f974780b21f4ecc44b75e72c93a0208a1771e7a98d7a2c4253a9d90ff43345e65ee00d
6
+ metadata.gz: c5537adcd50292f9a3e73ddb11663f64b248f2f01131d83d654ae960f488fef23e5ced6c7ecd1e70d1d03e6bc7d75bc2207726acddd12c03768b3e427efd4090
7
+ data.tar.gz: 99e5ee97cc4224c6a0775ca246485d2a6242dcfa62ecf21f05a75bde24db626dffc41ae67a405a28159a7ebcd9cbe0a47533f4c04beb7db9691807a397cd0a42
@@ -18,10 +18,11 @@ module Komonjo
18
18
  s.channels
19
19
  end
20
20
 
21
- def messages(channel_name)
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(channel_name)
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(channel_name)
13
- channel_name[0] = '' if channel_name[0] == '#'
14
- channel_id = channel_id channel_name
15
- ret = client.channels_history(channel: channel_id)
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(channel_name)
9
+ def messages(opts)
10
+ channel_name = opts[:channels_name]
10
11
  connection = connection(@api_token)
11
- history = connection.channels_history channel_name
12
+ history = connection.channels_history(channel_name)
12
13
  users = connection.users_list
13
- gateway = Komonjo::Gateway::MessagesGateway.new history, users
14
+ gateway = Komonjo::Gateway::MessagesGateway.new(history, users)
14
15
  gateway.messages
15
16
  end
16
17
  end
@@ -1,3 +1,3 @@
1
1
  module Komonjo
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
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.2
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-02-19 00:00:00.000000000 Z
11
+ date: 2016-04-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: slack-api