Method: Consular::DSL#tab
- Defined in:
- lib/consular/dsl.rb
#tab(*args, &block) ⇒ Object
Run commands in the context of a tab.
122 123 124 125 126 127 128 129 130 131 132 133 134 |
# File 'lib/consular/dsl.rb', line 122 def tab(*args, &block) tabs = @_context[:tabs] key = "tab#{tabs.keys.size}" return (tabs[key] = { :commands => args }) unless block_given? context = (tabs[key] = {:commands => []}) = args. [:name] = args.first unless args.empty? context[:options] = run_context context, &block @_context = @_windows[@_windows.keys.last] # Jump back out into the context of the last window. end |