botolo 0.21.0 → 0.30.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 121ffe98d6362e2f0b5316521c164c2f4ae79bde
4
- data.tar.gz: 552c1fbb1337556779307ae03ab92d2dd6d8fea8
3
+ metadata.gz: 0e9f55e2e112a1c105586fb0294f998d7077b49e
4
+ data.tar.gz: 94d95d0c5cf8338cff05657c2d3f120c93ed12b4
5
5
  SHA512:
6
- metadata.gz: b1193f85d2b9d44c09911d0576b0f1b304583223a9f2a01ec422cc82fce917f0948a10dd67f45bc17261be1218df2f09c1aead6cca3de735206434e3746ab026
7
- data.tar.gz: 77e1e58679edf8be194f48ebbd4232f61d1ce2aac8581ecc2b89c9c21b800589b5730592dc4cc1b63961b1b0b07789d80b416de2ca72ded649b4d28175427c84
6
+ metadata.gz: d15ec2ef12ca3272e993dfd332d483ca6cbf6027a8de1f5a532df0cec6c21eb684534aab1875d1d1441cd00649f4e3ad96859c2aba55cad31dab1d25c7fb1ce2
7
+ data.tar.gz: deca604042f8f5087deae6d8cbe302e5cf4666cbe03a81e2ebd64f49c2aef8eaf73072165beede72a096c27cdb1dd7fdf98fd09e35e14b901b9a94197d20e0c3
data/bin/botolo CHANGED
@@ -5,6 +5,7 @@ require 'openssl'
5
5
  require 'codesake_commons'
6
6
 
7
7
  DEFAULT_BEHAVIOUR = "./lib/botolo/bot/behaviour.rb"
8
+ BOTOLO_PID = File.join(".", "botolo.pid")
8
9
 
9
10
  OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE
10
11
 
@@ -17,10 +18,20 @@ config_file = ARGV[0] if ARGV.count == 1
17
18
 
18
19
  $logger.die "usage: botolo bot_configuration_file" if config_file.nil?
19
20
 
20
- @bot = Botolo::Bot::Engine.new({:config=>config_file})
21
- $logger.log "#{@bot.name} is online" if @bot.online?
22
- $logger.log "#{@bot.name} is offline" unless @bot.online?
23
- @bot.run if @bot.online?
24
- @bot.infinite_loop
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}"
25
+
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
25
36
 
26
37
 
@@ -81,7 +81,7 @@ module Botolo
81
81
  $logger.log "shutting down threads"
82
82
  @task_pids.each do |pid|
83
83
  Thread.kill(pid)
84
- sleep 0.05
84
+ sleep 0.1
85
85
  $logger.log "pid #{pid} killed" if ! pid.alive?
86
86
  $logger.err "pid #{pid} not killed" if pid.alive?
87
87
  end
@@ -1,3 +1,3 @@
1
1
  module Botolo
2
- VERSION = "0.21.0"
2
+ VERSION = "0.30.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.21.0
4
+ version: 0.30.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-05 00:00:00.000000000 Z
11
+ date: 2013-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler