botolo 0.30.0 → 0.32.0

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
  SHA1:
3
- metadata.gz: 0e9f55e2e112a1c105586fb0294f998d7077b49e
4
- data.tar.gz: 94d95d0c5cf8338cff05657c2d3f120c93ed12b4
3
+ metadata.gz: 52d258af33ca2cab35144c133fd802a2946c51d3
4
+ data.tar.gz: f62bd12546bfe5ac7645066be6fc19f18dc605c1
5
5
  SHA512:
6
- metadata.gz: d15ec2ef12ca3272e993dfd332d483ca6cbf6027a8de1f5a532df0cec6c21eb684534aab1875d1d1441cd00649f4e3ad96859c2aba55cad31dab1d25c7fb1ce2
7
- data.tar.gz: deca604042f8f5087deae6d8cbe302e5cf4666cbe03a81e2ebd64f49c2aef8eaf73072165beede72a096c27cdb1dd7fdf98fd09e35e14b901b9a94197d20e0c3
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.log Process.pid
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
- @bot = Botolo::Bot::Engine.new({:config=>config_file})
28
- $logger.log "#{@bot.name} is online" if @bot.online?
29
- $logger.log "#{@bot.name} is offline" unless @bot.online?
30
- @bot.run if @bot.online?
31
- @bot.infinite_loop
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
 
@@ -60,8 +60,9 @@ module Botolo
60
60
  end
61
61
 
62
62
  def infinite_loop
63
- while true
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.1
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
@@ -1,3 +1,3 @@
1
1
  module Botolo
2
- VERSION = "0.30.0"
2
+ VERSION = "0.32.0"
3
3
  end
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.30.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-08 00:00:00.000000000 Z
11
+ date: 2013-07-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler