-
Notifications
You must be signed in to change notification settings - Fork 2
/
computerbot.rb
42 lines (37 loc) · 1.71 KB
/
computerbot.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
##########################################################################
#
# Welcome to Computerbot's source, Twitterbot version.
# Copyright 2008 Alexandre Loureiro Solleiro <alex@webcracy.org>, http://webcracy.org
# All rights reserved.
# You are free to use, modify and distribute binary and source copies of this application.
# Be nice if you do. It's my right to demand it.
# This notice must never be separated from the code and you must give me credit for binary or source use.
# Read and respect the licenses of third-party software distributed with this package.
# Author: Alexandre Loureiro Solleiro <alex@webcracy.org>
# Contact: alex@webcracy.org
# Website: http://computer.webcracy.org/
# Documentation: http://computer.webcracy.org/doc/
# Tutorials: http://computer.webcracy.org/tutorials/
# Have fun.
# --------
# To start (runs in the background): ruby computerbot.rb start 'env'
# To restart: ruby computerbot.rb restart 'env'
# To stop: ruby computerbot.rb stop
# To run in the foreground (debug mode): ruby computerbot.rb run 'env'
#
########################################################################
require 'rubygems'
require 'daemons'
ENV_SET = ARGV[1] || 'config'
case ARGV[0].to_s
when 'start', 'run'
puts "___ Bot running in #{ENV_SET} environnement..."
puts "___ You can edit computerbot.rb to use other configs"
puts "___ Type 'ruby computerbot.rb stop' to disconnect the bot"
when 'restart'
puts "___ Bot restarted in #{ENV_SET} environnement..."
puts "___ Type 'ruby computerbot.rb stop' to disconnect the bot"
else
puts "___ Bot disconnected."
end
Daemons.run('lib/computerbot_lib.rb')