Class: LogPoop
- Inherits:
-
Object
- Object
- LogPoop
- Defined in:
- lib/logpoop.rb
Constant Summary collapse
- POOP_TYPES =
[ "make - simulate compiling something for a long, long, looooong time ", "poop - take a dump in your terminal", "print - print the given text over and over in every terminal", "tail - simulate 'tail -f' in all your open terminals", "test - simulate a console test run (needs two terminals open)", ]
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ LogPoop
constructor
A new instance of LogPoop.
Constructor Details
Class Method Details
.banner ⇒ Object
15 16 17 18 19 20 |
# File 'lib/logpoop.rb', line 15 def self. <<-STR Description: Look busy! Tail some stuff in your open terminals, or even simulate running some tests. STR end |
.instance ⇒ Object
55 56 57 |
# File 'lib/logpoop.rb', line 55 def self.instance @@instance end |
.parse_options ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/logpoop.rb', line 29 def self. = { :type => :tail, :log_dir => "/var/log" } o = OptionParser.new do |opt| opt. = self. opt.on("-v", "--version", "Show version") do puts File.read(File.join(File.dirname(__FILE__), '..', 'VERSION')) exit end opt.on("-d", "--log_dir DIRECTORY", "Log directory") do |d| [:log_dir] = d end opt.on("-t", "--type TYPE", "Poop type. Available types: \t\n#{POOP_TYPES.join("\t\n")}") do |t| [:type] = t end opt.on("-p", "--print TEXT", "Text to print (only valid with poop type 'print')") do |t| [:text] = t end end o.parse! end |