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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 798370713cab42d460462ffde7e043381df1a6ae
4
- data.tar.gz: 4227c41288c90b7876e45cda0a213f30ec4c7d48
3
+ metadata.gz: 33c3167538caaa077adb697faf3e37ceea56232d
4
+ data.tar.gz: 63436f5123d9f6569c82b69754c6a8fb39519b6d
5
5
  SHA512:
6
- metadata.gz: c5537adcd50292f9a3e73ddb11663f64b248f2f01131d83d654ae960f488fef23e5ced6c7ecd1e70d1d03e6bc7d75bc2207726acddd12c03768b3e427efd4090
7
- data.tar.gz: 99e5ee97cc4224c6a0775ca246485d2a6242dcfa62ecf21f05a75bde24db626dffc41ae67a405a28159a7ebcd9cbe0a47533f4c04beb7db9691807a397cd0a42
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'
@@ -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
- opts = { channel_name: opts } if opts.is_a?(String)
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(channel_name)
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
@@ -1,3 +1,3 @@
1
1
  module Komonjo
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: komonjo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - hkdnet