slack-rtm-receiver 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -4
- data/lib/slack-rtm-receiver/reactor.rb +1 -1
- data/lib/slack-rtm-receiver/session.rb +2 -2
- data/lib/slack-rtm-receiver/version.rb +1 -1
- data/slack-rtm-receiver.gemspec +4 -2
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9d22a6f3a5531d4d40a029fcdc8e6a9bc4b7bdd5
|
4
|
+
data.tar.gz: d3e2c9426ac2d616e2114d01f6d37caac0b7a256
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6e91b861c25e8cfc6755eb00262ec6ef1a15314f7251b5acba4b1f73c1459cf5d6ee221db976867d7f69e250276bcce6cd07469c30958bdaf3e2f1c382b0c287
|
7
|
+
data.tar.gz: 56e51db5a511d6b7398d580f3b00cea290db877801c6573d0f3b3db59d1d7b300c1a1c10d6caa4e917d0d2cbf624a5bfefb602ef4ca591c4a6d77a5b8607d0b8
|
data/README.md
CHANGED
@@ -1,13 +1,15 @@
|
|
1
1
|
# slack-rtm-receiver
|
2
2
|
|
3
|
-
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/slack-rtm-receiver.svg)](https://badge.fury.io/rb/slack-rtm-receiver) [![Code Climate](https://codeclimate.com/github/kenjij/slack-rtm-receiver/badges/gpa.svg)](https://codeclimate.com/github/kenjij/slack-rtm-receiver)
|
4
|
+
|
5
|
+
A Ruby gem. It connects to [Slack](https://slack.com/) [Real Time Messaging API](https://api.slack.com/rtm) to receive events. Runs on EventMachine.
|
4
6
|
|
5
7
|
## Requirements
|
6
8
|
|
7
9
|
- Ruby 2.0.0 <=
|
8
|
-
- eventmachine 1.0
|
9
|
-
- em-http-request 1.1
|
10
|
-
- faye-websocket 0.8
|
10
|
+
- [eventmachine](https://github.com/eventmachine/eventmachine) 1.0 <=
|
11
|
+
- [em-http-request](https://github.com/igrigorik/em-http-request) 1.1 <=
|
12
|
+
- [faye-websocket](https://github.com/faye/faye-websocket-ruby) 0.8 <=
|
11
13
|
|
12
14
|
## Getting Started
|
13
15
|
|
@@ -9,7 +9,7 @@ module SlackRTMReceiver
|
|
9
9
|
# @param opts [Hash] options for Slack web API rtm.start
|
10
10
|
def self.run(opts)
|
11
11
|
logger = SlackRTMReceiver.logger
|
12
|
-
logger.
|
12
|
+
logger.warn "SlackRTMReceiver ver. #{Version} loaded, Reactor starting..."
|
13
13
|
EM.run do
|
14
14
|
session = Session.new
|
15
15
|
starter = Starter.start(session, opts)
|
@@ -33,12 +33,12 @@ module SlackRTMReceiver
|
|
33
33
|
# @return [Boolean] false if a session is already up
|
34
34
|
def start(json)
|
35
35
|
if ws
|
36
|
-
logger.
|
36
|
+
logger.warn 'RTM session start requested, but already running. Ignoring...'
|
37
37
|
return false
|
38
38
|
end
|
39
39
|
h = parse_rtm_start_res(json)
|
40
40
|
@self_uid = h[:self_id]
|
41
|
-
logger.
|
41
|
+
logger.info "I am Slack ID: #{self_uid}. Connecting to websocket...\n URL: #{h[:url]}"
|
42
42
|
opts = {ping: 60}
|
43
43
|
@websocket = Faye::WebSocket::Client.new(h[:url], nil, opts)
|
44
44
|
|
data/slack-rtm-receiver.gemspec
CHANGED
@@ -7,14 +7,16 @@ Gem::Specification.new do |s|
|
|
7
7
|
s.version = SlackRTMReceiver::Version
|
8
8
|
s.authors = ['Ken J.']
|
9
9
|
s.email = ['kenjij@gmail.com']
|
10
|
-
s.
|
11
|
-
s.
|
10
|
+
s.summary = %q{Connects to Slack Real Time Messaging (RTM) API to receive events.}
|
11
|
+
s.description = %q{Connects to Slack Real Time Messaging (RTM) API to receive events. Runs on EventMachine. Use this gem to create your own bot by registering event handlers.}
|
12
12
|
s.homepage = 'https://github.com/kenjij/slack-rtm-receiver'
|
13
13
|
s.license = 'MIT'
|
14
14
|
|
15
15
|
s.files = `git ls-files`.split($/)
|
16
16
|
s.require_paths = ["lib"]
|
17
17
|
|
18
|
+
s.required_ruby_version = '>= 2.0.0'
|
19
|
+
|
18
20
|
s.add_runtime_dependency "eventmachine", "~> 1.0"
|
19
21
|
s.add_runtime_dependency "faye-websocket", "~> 0.8"
|
20
22
|
s.add_runtime_dependency "em-http-request", "~> 1.1"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: slack-rtm-receiver
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ken J.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-08-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: eventmachine
|
@@ -52,7 +52,8 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '1.1'
|
55
|
-
description: Slack RTM
|
55
|
+
description: Connects to Slack Real Time Messaging (RTM) API to receive events. Runs
|
56
|
+
on EventMachine. Use this gem to create your own bot by registering event handlers.
|
56
57
|
email:
|
57
58
|
- kenjij@gmail.com
|
58
59
|
executables: []
|
@@ -81,7 +82,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
81
82
|
requirements:
|
82
83
|
- - ">="
|
83
84
|
- !ruby/object:Gem::Version
|
84
|
-
version:
|
85
|
+
version: 2.0.0
|
85
86
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
86
87
|
requirements:
|
87
88
|
- - ">="
|
@@ -92,5 +93,5 @@ rubyforge_project:
|
|
92
93
|
rubygems_version: 2.4.3
|
93
94
|
signing_key:
|
94
95
|
specification_version: 4
|
95
|
-
summary: Connects to Slack Real Time Messaging API to receive events.
|
96
|
+
summary: Connects to Slack Real Time Messaging (RTM) API to receive events.
|
96
97
|
test_files: []
|