Class: Redcar::FilterCommand

Inherits:
Object
  • Object
show all
Defined in:
lib/filter_command.rb,
lib/filter_command/history.rb,
lib/filter_command/commands.rb,
lib/filter_command/evaluator.rb,
lib/filter_command/formats/show.rb,
lib/filter_command/output_format.rb,
lib/filter_command/autocompletion.rb,
lib/filter_command/command_parser.rb,
lib/filter_command/formats/insert.rb,
lib/filter_command/filter_speedbar.rb,
lib/filter_command/formats/discard.rb,
lib/filter_command/formats/replace.rb

Overview

A Shell Command Runner and Parser with support for many output formats

Defined Under Namespace

Classes: Autocompletion, CommandParser, DiscardOutput, EvaluateText, Evaluator, FilterSpeedbar, History, InsertOutput, OpenFilterSpeedbar, OutputFormat, ReplaceInput, RerunLastFilter, ShowText

Class Method Summary collapse

Class Method Details

.keymapsObject

Registered Default Keybindings



33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/filter_command.rb', line 33

def self.keymaps
  osx = Redcar::Keymap.build("main", :osx) do
    link "Cmd+Shift+R", OpenFilterSpeedbar
    link "Ctrl+L", RerunLastFilter
    link "Ctrl+R", EvaluateText
  end
  linwin = Redcar::Keymap.build("main", [:linux, :windows]) do
    link "Alt+O", OpenFilterSpeedbar
    link "Alt+U", RerunLastFilter
    link "Alt+R", EvaluateText
  end
  [osx, linwin]
end

Defined Menu Items to display in Redcar



20
21
22
23
24
25
26
27
28
29
30
# File 'lib/filter_command.rb', line 20

def self.menus
  Menu::Builder.build do
    sub_menu "Plugins" do
      sub_menu "Filter Through Command" do
        item "Open Speedbar...", FilterCommand::OpenFilterSpeedbar
        item "Re-run Last Filter", FilterCommand::RerunLastFilter
        item "Evaluate Text", FilterCommand::EvaluateText
      end
    end
  end
end

.storageObject

Plugin Storage for recently run commands



48
49
50
51
52
53
54
# File 'lib/filter_command.rb', line 48

def self.storage
  @storage ||= begin
    storage = Plugin::Storage.new('filter_through_command')
    storage.set_default('recent_commands', [])
    storage
  end
end