Class: ITRP::Cmd_fts
Instance Attribute Summary
Attributes inherited from Cmd
#attach_cmd, #children, #enabled_in_state, #trigger
Instance Method Summary collapse
- #completions(patt) ⇒ Object
- #enter(s) ⇒ Object
-
#initialize(e) ⇒ Cmd_fts
constructor
A new instance of Cmd_fts.
Methods inherited from Cmd
#appstate, #find_node, #is_root?, #place_node, #print_state, #set_time_window, #treeprint
Constructor Details
#initialize(e) ⇒ Cmd_fts
Returns a new instance of Cmd_fts.
4 5 6 7 8 9 |
# File 'lib/handlers/fts.rb', line 4 def initialize (e) super(e) @enabled_in_state = :any @attach_cmd = 'set' @trigger = 'fts' end |
Instance Method Details
#completions(patt) ⇒ Object
12 13 14 15 16 |
# File 'lib/handlers/fts.rb', line 12 def completions(patt) [ "HTTP Headers {28217924-E7A5-4523-993C-44B52758D5A8}", "SSL Certs {9FEB8ADE-ADBB-49AD-BC68-C6A02F389C71}", ].grep( /#{Regexp.escape(patt)}/i) end |
#enter(s) ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'lib/handlers/fts.rb', line 19 def enter(s) patt = s.scan(/set\s+fts\s+(.*)\s+({.*}$)/).flatten patt[0].strip! print("\nContext set to FTS (Full Text Search) [#{patt[0]}] [#{patt[1]}]\n\n") @appenv.prompt = "iTRP D:(#{patt[0]})> " @appenv.context_data[:cgguid] = patt[1] @appenv.context_data[:cgname] = patt[0] @appenv.context = :fts end |