Class: Zoom::Profile::Ack
- Inherits:
-
Zoom::Profile
- Object
- Hash
- Zoom::Profile
- Zoom::Profile::Ack
- Defined in:
- lib/zoom/profile/ack.rb
Instance Attribute Summary
Attributes inherited from Zoom::Profile
Instance Method Summary collapse
- #colors ⇒ Object
- #exe(args, pattern) ⇒ Object
-
#initialize(operator = nil, flags = "--smart-case", envprepend = "", append = "") ⇒ Ack
constructor
A new instance of Ack.
Methods inherited from Zoom::Profile
#append, cache_file, #flags, from_json, #info, #operator, #prepend, profile_by_name, #to_s
Constructor Details
#initialize(operator = nil, flags = "--smart-case", envprepend = "", append = "") ⇒ Ack
Returns a new instance of Ack.
23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/zoom/profile/ack.rb', line 23 def initialize( operator = nil, flags = "--smart-case", envprepend = "", append = "" ) # Special case because of debian operator = "ack" operator = "ack-grep" if (ScoobyDoo.where_are_you("ack-grep")) super(operator, flags, envprepend, append) @taggable = true end |
Instance Method Details
#colors ⇒ Object
5 6 7 |
# File 'lib/zoom/profile/ack.rb', line 5 def colors 'ACK_COLOR_LINENO=white ACK_COLOR_MATCH="black on_white"' end |
#exe(args, pattern) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/zoom/profile/ack.rb', line 9 def exe(args, pattern) if (pattern.nil? || pattern.empty?) system( "#{self.to_s} --pager \"#{@pager}\" #{args} " \ "#{self.append}" ) else system( "#{self.to_s} --pager \"#{@pager}\" #{args} " \ "#{pattern.shellescape} #{self.append}" ) end end |