Class: TreeRepl::Cd
Instance Attribute Summary
Attributes inherited from Cmd
Instance Method Summary collapse
- #exec(args) ⇒ Object
- #help ⇒ Object
-
#initialize(repl) ⇒ Cd
constructor
A new instance of Cd.
Constructor Details
#initialize(repl) ⇒ Cd
Returns a new instance of Cd.
54 55 56 |
# File 'lib/treerepl/cmds.rb', line 54 def initialize(repl) super(repl,'cd') end |
Instance Method Details
#exec(args) ⇒ Object
57 58 59 60 61 62 |
# File 'lib/treerepl/cmds.rb', line 57 def exec(args) args = ['/'] if args.empty? path = args.join ' ' n = repl.eval_path repl.cur,path repl.cur = n if n end |
#help ⇒ Object
63 64 65 |
# File 'lib/treerepl/cmds.rb', line 63 def help 'Change directory' end |