botolo 0.30.0 → 0.32.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/botolo +8 -14
- data/lib/botolo/bot/engine.rb +4 -3
- data/lib/botolo/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 52d258af33ca2cab35144c133fd802a2946c51d3
|
4
|
+
data.tar.gz: f62bd12546bfe5ac7645066be6fc19f18dc605c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fe3ee55037253355f68babafbe612a8cf6f3eb1b9cce3fb5716b5053b7a59acce6d872f6f13223eacd87b3a5d338f9f0f244e191d1f04d924cba320ac0fdd067
|
7
|
+
data.tar.gz: 5be41b0d8f74fb1d26fa29ed1c8be6916a36e84d9e22a748f988ce9325560084a227ebd453ea7200c7b6d8b847a93d48967240a08f19fcb026b95a6bb77c7ec9
|
data/bin/botolo
CHANGED
@@ -10,6 +10,7 @@ BOTOLO_PID = File.join(".", "botolo.pid")
|
|
10
10
|
OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE
|
11
11
|
|
12
12
|
$logger = Codesake::Commons::Logging.instance
|
13
|
+
$logger.filename="./codesake-bot.log"
|
13
14
|
trap("INT") { @bot.stop; $logger.helo('bot is shutting down'); Kernel.exit(0) }
|
14
15
|
|
15
16
|
behaviour_file = DEFAULT_BEHAVIOUR
|
@@ -18,20 +19,13 @@ config_file = ARGV[0] if ARGV.count == 1
|
|
18
19
|
|
19
20
|
$logger.die "usage: botolo bot_configuration_file" if config_file.nil?
|
20
21
|
|
21
|
-
$logger.
|
22
|
-
son = Process.fork {
|
23
|
-
$logger.helo "booting botolo v#{Botolo::VERSION} (C) 2013 paolo@armoredcode.com", BOTOLO_PID
|
24
|
-
$logger.log "daemonizing (pid=#{Process.pid}). PID file is #{BOTOLO_PID}"
|
22
|
+
$logger.helo "booting botolo v#{Botolo::VERSION} (C) 2013 paolo@armoredcode.com", BOTOLO_PID
|
25
23
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
}
|
33
|
-
|
34
|
-
Process.detach(son)
|
35
|
-
sleep 5
|
24
|
+
@bot = Botolo::Bot::Engine.new({:config=>config_file})
|
25
|
+
$logger.log "#{@bot.name} is online" if @bot.online?
|
26
|
+
$logger.log "#{@bot.name} is offline" unless @bot.online?
|
27
|
+
@bot.run if @bot.online?
|
28
|
+
# Process.daemon(true, true)
|
29
|
+
@bot.infinite_loop
|
36
30
|
|
37
31
|
|
data/lib/botolo/bot/engine.rb
CHANGED
@@ -60,8 +60,9 @@ module Botolo
|
|
60
60
|
end
|
61
61
|
|
62
62
|
def infinite_loop
|
63
|
-
|
64
|
-
|
63
|
+
loop do
|
64
|
+
sleep(3600) # => 1 d
|
65
|
+
$logger.log " --- mark --- "
|
65
66
|
end
|
66
67
|
end
|
67
68
|
|
@@ -81,7 +82,7 @@ module Botolo
|
|
81
82
|
$logger.log "shutting down threads"
|
82
83
|
@task_pids.each do |pid|
|
83
84
|
Thread.kill(pid)
|
84
|
-
sleep 0.
|
85
|
+
sleep 0.5
|
85
86
|
$logger.log "pid #{pid} killed" if ! pid.alive?
|
86
87
|
$logger.err "pid #{pid} not killed" if pid.alive?
|
87
88
|
end
|
data/lib/botolo/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: botolo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.32.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paolo Perego
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-07-
|
11
|
+
date: 2013-07-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|