slack-api 1.3.0 → 1.4.0

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: d383afb0c1abcd350b4579ea8fd3d7e78efd950f
4
- data.tar.gz: 70c96fa892c7bf9b13ecd29ec48cf91950a0037b
3
+ metadata.gz: 571b107b642e75e3bfa7a194454566e68f03f792
4
+ data.tar.gz: 97a0f11c6594fc6bb060e6cc4df77f34a81a4ec6
5
5
  SHA512:
6
- metadata.gz: 15a71f2251cbbea3ed9930a6304edf59e4c1c32ec66b8860c73e8d39ba564a86a03ba8cd42e2df7ac10ca8288d8696e0b61e6a516ab82f392492d9aa47e5445e
7
- data.tar.gz: 740ecdbddba7332c5276a76ebb887a50ba7821107c842a36f4f1a75f4266edc170d2f4576371943f26130cefa0df6ffd0ab1d4ff3d827db329317a84854d1174
6
+ metadata.gz: d23bbac61b40e0210efaca05d6a7af3bac51719cb74631524a9ea94e3b6ed3779bec8a5e1dbecb4ff4dfa0e11c4d501e2b6da08fe8839059daf7c7bce20cb727
7
+ data.tar.gz: ffec25a4593d5efe4951db4dab0072b5be1bd75f2e8091e6cd4a474ca4ff38281e3f7d2772e2697c3d00010554a09d56f0bd0b21c50191ef379b3d0d012acc5e
data/README.md CHANGED
@@ -39,10 +39,6 @@ Slack.auth_test
39
39
 
40
40
  [https://github.com/aki017/slack-ruby-gem/tree/dev/examples](https://github.com/aki017/slack-ruby-gem/tree/dev/examples)
41
41
 
42
- ## RTM
43
-
44
- [Slack Bot Real Time Messaging API Integration in Ruby Tutorial](http://code.dblock.org/2015/04/28/slack-bot-real-time-messaging-api-integration-tutorial.html) thanks @dblock
45
-
46
42
  ## Contributing
47
43
 
48
44
  1. Fork it ( http://github.com/aki017/slack-ruby-gem/fork )
@@ -0,0 +1,11 @@
1
+ require "slack"
2
+ require "yaml"
3
+
4
+ token = ENV["TOKEN"] || (print "Token: "; gets.strip)
5
+ client = Slack::Client.new token: token
6
+
7
+ rtm = client.realtime
8
+ rtm.on :message do |m|
9
+ p m
10
+ end
11
+ rtm.start
@@ -13,7 +13,7 @@ module Slack
13
13
  # @option options [Object] :sort_dir
14
14
  # Change sort direction to ascending (asc) or descending (desc).
15
15
  # @option options [Object] :highlight
16
- # Pass a value of 1 to enable query highlight markers (see below).
16
+ # Pass a value of true to enable query highlight markers (see below).
17
17
  # @option options [Object] :count
18
18
  # Number of items to return per page.
19
19
  # @option options [Object] :page
@@ -37,7 +37,7 @@ module Slack
37
37
  # @option options [Object] :sort_dir
38
38
  # Change sort direction to ascending (asc) or descending (desc).
39
39
  # @option options [Object] :highlight
40
- # Pass a value of 1 to enable query highlight markers (see below).
40
+ # Pass a value of true to enable query highlight markers (see below).
41
41
  # @option options [Object] :count
42
42
  # Number of items to return per page.
43
43
  # @option options [Object] :page
@@ -61,7 +61,7 @@ module Slack
61
61
  # @option options [Object] :sort_dir
62
62
  # Change sort direction to ascending (asc) or descending (desc).
63
63
  # @option options [Object] :highlight
64
- # Pass a value of 1 to enable query highlight markers (see below).
64
+ # Pass a value of true to enable query highlight markers (see below).
65
65
  # @option options [Object] :count
66
66
  # Number of items to return per page.
67
67
  # @option options [Object] :page
@@ -16,7 +16,7 @@ module Slack
16
16
 
17
17
  def start
18
18
  EM.run do
19
- ws = Faye::WebSocket::Client.new(@url)
19
+ ws = Faye::WebSocket::Client.new(@url, nil, ping: 30)
20
20
 
21
21
  ws.on :open do |event|
22
22
  end
@@ -31,6 +31,7 @@ module Slack
31
31
  end
32
32
 
33
33
  ws.on :close do |event|
34
+ @callbacks[:close].each { |c| c.call } unless @callbacks[:close].nil?
34
35
  EM.stop
35
36
  end
36
37
  end
@@ -1,3 +1,3 @@
1
1
  module Slack
2
- VERSION = "1.3.0"
2
+ VERSION = "1.4.0"
3
3
  end
@@ -32,7 +32,7 @@ Gem::Specification.new do |spec|
32
32
  spec.add_development_dependency "pry"
33
33
 
34
34
  spec.add_runtime_dependency "faraday", "~> 0.11"
35
- spec.add_runtime_dependency "faraday_middleware", "0.10.1"
35
+ spec.add_runtime_dependency "faraday_middleware", "~> 0.10.0"
36
36
  spec.add_runtime_dependency "multi_json", ">= 1.0.3", "~> 1.0"
37
- spec.add_runtime_dependency "faye-websocket", "~> 0.9.2"
37
+ spec.add_runtime_dependency "faye-websocket", "~> 0.10.6"
38
38
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slack-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - aki017
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-23 00:00:00.000000000 Z
11
+ date: 2017-02-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -196,16 +196,16 @@ dependencies:
196
196
  name: faraday_middleware
197
197
  requirement: !ruby/object:Gem::Requirement
198
198
  requirements:
199
- - - '='
199
+ - - "~>"
200
200
  - !ruby/object:Gem::Version
201
- version: 0.10.1
201
+ version: 0.10.0
202
202
  type: :runtime
203
203
  prerelease: false
204
204
  version_requirements: !ruby/object:Gem::Requirement
205
205
  requirements:
206
- - - '='
206
+ - - "~>"
207
207
  - !ruby/object:Gem::Version
208
- version: 0.10.1
208
+ version: 0.10.0
209
209
  - !ruby/object:Gem::Dependency
210
210
  name: multi_json
211
211
  requirement: !ruby/object:Gem::Requirement
@@ -232,14 +232,14 @@ dependencies:
232
232
  requirements:
233
233
  - - "~>"
234
234
  - !ruby/object:Gem::Version
235
- version: 0.9.2
235
+ version: 0.10.6
236
236
  type: :runtime
237
237
  prerelease: false
238
238
  version_requirements: !ruby/object:Gem::Requirement
239
239
  requirements:
240
240
  - - "~>"
241
241
  - !ruby/object:Gem::Version
242
- version: 0.9.2
242
+ version: 0.10.6
243
243
  description: A Ruby wrapper for the Slack API
244
244
  email:
245
245
  - aki@aki017.info
@@ -258,6 +258,7 @@ files:
258
258
  - README.md
259
259
  - Rakefile
260
260
  - examples/basic.rb
261
+ - examples/rtm.rb
261
262
  - lib/faraday/raise_http_exception.rb
262
263
  - lib/generators/schema.json
263
264
  - lib/generators/tasks/generate.rb