Class: Rabbit::Command::Rabbit
- Inherits:
-
Object
- Object
- Rabbit::Command::Rabbit
- Includes:
- GetText
- Defined in:
- lib/rabbit/command/rabbit.rb
Constant Summary
Constants included from GetText
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Rabbit
constructor
A new instance of Rabbit.
- #run(arguments) ⇒ Object
Methods included from GetText
Constructor Details
#initialize ⇒ Rabbit
Returns a new instance of Rabbit.
33 34 35 |
# File 'lib/rabbit/command/rabbit.rb', line 33 def initialize @logger = nil end |
Class Method Details
.run(*arguments) ⇒ Object
28 29 30 |
# File 'lib/rabbit/command/rabbit.rb', line 28 def run(*arguments) new.run(arguments) end |
Instance Method Details
#run(arguments) ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/rabbit/command/rabbit.rb', line 37 def run(arguments) GC.disable require "rbconfig" require "rabbit/console" require "rabbit/source" require "rabbit/renderer" require "rabbit/front" @options, @logger = parse_command_line_arguments(arguments) require "rabbit/canvas" GC.enable application = ::Rabbit.application succeeded = false application.signal_connect("command-line") do |_, command_line| application.activate succeeded ? 0 : 1 end application.signal_connect("activate") do begin succeeded = catch do |abort_tag| @abort_tag = abort_tag __send__("do_#{@options.action}") end rescue @logger.error($!) end end application.run.zero? end |