Class: ZergXcode::Plugins::Irb

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

Instance Method Summary collapse

Instance Method Details

#helpObject



4
5
6
7
8
9
10
11
12
13
# File 'lib/zerg_xcode/plugins/irb.rb', line 4

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



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

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