omnibot 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
data/lib/omnibot.rb CHANGED
@@ -8,6 +8,7 @@ require 'xmpp4r'
8
8
  require 'xmpp4r/client'
9
9
  require 'xmpp4r/roster'
10
10
  require 'socket'
11
+ require 'date'
11
12
 
12
13
  %w[ helpers jabberbot amqpconsumer omnisend launcher periodiccommand ].each do |file|
13
14
  require "omnibot/#{file}.rb"
@@ -116,6 +116,8 @@ module OmniBot
116
116
  return "just now"
117
117
  elsif amount < 60*60
118
118
  return "less than a hour ago"
119
+ elsif amount < 60*60*2
120
+ return " two hours ago"
119
121
  elsif amount < 60*60*6
120
122
  return amount.div(3600).to_s + " hours ago"
121
123
  end
@@ -29,7 +29,8 @@ module OmniBot
29
29
 
30
30
  def start
31
31
  now = Time.now
32
- next_report_time = Time.local(now.year, now.month, now.day+1, 1, 0, 0)
32
+ tomorrow = DateTime.now+1
33
+ next_report_time = Time.local(tomorrow.year, tomorrow.month, tomorrow.day, 1, 0, 0)
33
34
  next_report_time = next_report_time + @pause
34
35
  @timer_provider.add_timer(next_report_time - now) { on_first_timer }
35
36
  end
@@ -1,3 +1,3 @@
1
1
  module OmniBot
2
- VERSION = '0.0.5'
2
+ VERSION = '0.0.6'
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omnibot
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 5
10
- version: 0.0.5
9
+ - 6
10
+ version: 0.0.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - theirix
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-01-25 00:00:00 +03:00
18
+ date: 2011-01-31 00:00:00 +03:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency