Class: ZergXcode::Plugins::Irb

Inherits:
Object
  • Object
show all
Defined in:
lib/zerg_xcode/plugins/irb.rb

Overview

Loads up an Xcode project and the ZergXcode library into an irb shell.

Instance Method Summary collapse

Instance Method Details

#helpObject



15
16
17
18
19
20
21
22
23
24
# File 'lib/zerg_xcode/plugins/irb.rb', line 15

def help
  {:short => 'opens up a project in an interactive ruby shell',
   :long => <<"END" }
Usage: irb [path]

Loads the object graph in the Xcode project at the given path. If no path is
given, looks for a project in the current directory. The project object is
available as the global variable $p.
END
end

#run(args) ⇒ Object



26
27
28
29
30
31
32
# File 'lib/zerg_xcode/plugins/irb.rb', line 26

def run(args)
  $p = ZergXcode.load(args.shift || '.')
  
  print "This is an IRB shell. Your project is available as $p.\n" + 
        "Use the 'quit' command if you're here by mistake.\n"
  IRB.start __FILE__
end