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 CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- slacky (0.2.1)
4
+ slacky (0.2.2)
5
5
  dotenv
6
6
  em-cron
7
7
  eventmachine
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
@@ -1,3 +1,3 @@
1
1
  module Slacky
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
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.1
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-05-31 00:00:00.000000000 Z
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: -2329901822562595396
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: -2329901822562595396
238
+ hash: -4580152558995582524
239
239
  requirements: []
240
240
  rubyforge_project:
241
241
  rubygems_version: 1.8.23