cinch-lastactive 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
- metadata.gz: eff5483272f48167f951c872bf2f7f3b0a08d47d
4
- data.tar.gz: a1e7da2e586b9ab44737f94f3b813293bd6015a0
3
+ metadata.gz: 1038a7084112cee8178cc986209fc7dc8ab113fa
4
+ data.tar.gz: 89a413dea4e523e856c534cab66079d2814446df
5
5
  SHA512:
6
- metadata.gz: 60364b92148a793170f183dce572f57f551bcdc288a07e7e07017ceba71b713971ffe82b56e58adc5fc994a492e96e7cd1a3024c58bd841266f86eb8ced3f188
7
- data.tar.gz: 43088a700d3e43b13b435014e7707b15021e32bc74654e5f6d67dc15fd32762ffa10386d5acd9e4adfd89d45d89c4936b968113db888957aece3770d4a656f1e
6
+ metadata.gz: 44bb8d0c3a42767e5fbaee8a717b742fcaea4383be21be1f8ab89741b9b36c807e4c80bafe001f2843498da5c7f82e41e3d20e4eba968c47524856f6770f45b4
7
+ data.tar.gz: 19182e51ecb9e089639e854a9996c8a725d98108cc81e2352753e7610749dca053b651a3e11387c1db3cc85dcef066e9343cd85ecc889de0a6ff1f8b2699c0e9
@@ -10,22 +10,23 @@ module Cinch::Plugins
10
10
 
11
11
  def initialize(*args)
12
12
  super
13
- @time = Time.now
13
+ @times = Hash.new(Time.now)
14
14
  end
15
15
 
16
16
  def join_respond(m)
17
17
  return if m.user.nick == @bot.nick
18
- m.reply "Hello, #{m.user.nick}. The last activity was #{time_passed} ago."
18
+ m.reply "Hello, #{m.user.nick}. The last activity was "\
19
+ "#{time_passed(m.channel.name)} ago."
19
20
  end
20
21
 
21
22
  def update_time(m)
22
- @time = Time.now
23
+ @times[m.channel.name] = Time.now
23
24
  end
24
25
 
25
26
  private
26
27
 
27
- def time_passed
28
- Cinch::Toolbox.time_format(Time.now - @time)
28
+ def time_passed(channel)
29
+ Cinch::Toolbox.time_format(Time.now - @times[channel])
29
30
  end
30
31
  end
31
32
  end
@@ -1,7 +1,7 @@
1
1
  module Cinch
2
2
  module Plugins
3
3
  class LastActive
4
- VERSION = '0.0.1'
4
+ VERSION = '0.0.2'
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cinch-lastactive
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Haberer