slacky 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/lib/slacky/bot.rb +15 -0
- data/lib/slacky/version.rb +1 -1
- metadata +4 -4
data/Gemfile.lock
CHANGED
data/lib/slacky/bot.rb
CHANGED
@@ -46,6 +46,8 @@ module Slacky
|
|
46
46
|
|
47
47
|
populate_users
|
48
48
|
populate_channels
|
49
|
+
stay_alive
|
50
|
+
|
49
51
|
end
|
50
52
|
|
51
53
|
def web_client
|
@@ -222,6 +224,19 @@ module Slacky
|
|
222
224
|
puts " done!"
|
223
225
|
end
|
224
226
|
|
227
|
+
def stay_alive
|
228
|
+
at '* * * * *' do
|
229
|
+
@client.ping stamp: Time.now.to_f
|
230
|
+
end
|
231
|
+
|
232
|
+
on :pong do |data|
|
233
|
+
now = Time.now.to_f
|
234
|
+
stamp = data.stamp
|
235
|
+
delta = now - stamp
|
236
|
+
@config.log "Slow ping pong response: #{delta}s" if delta > 5
|
237
|
+
end
|
238
|
+
end
|
239
|
+
|
225
240
|
def blowup(user, data, args, &respond)
|
226
241
|
respond.call "Tick... tick... tick... BOOM! Goodbye."
|
227
242
|
EM.next_tick do
|
data/lib/slacky/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: slacky
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-06-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: slack-ruby-client
|
@@ -226,7 +226,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
226
226
|
version: '0'
|
227
227
|
segments:
|
228
228
|
- 0
|
229
|
-
hash: -
|
229
|
+
hash: -4580152558995582524
|
230
230
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
231
231
|
none: false
|
232
232
|
requirements:
|
@@ -235,7 +235,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
235
235
|
version: '0'
|
236
236
|
segments:
|
237
237
|
- 0
|
238
|
-
hash: -
|
238
|
+
hash: -4580152558995582524
|
239
239
|
requirements: []
|
240
240
|
rubyforge_project:
|
241
241
|
rubygems_version: 1.8.23
|