Skip to content

Instantly share code, notes, and snippets.

@jtaby
Created May 28, 2011 18:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jtaby/997085 to your computer and use it in GitHub Desktop.
Save jtaby/997085 to your computer and use it in GitHub Desktop.
class AckWindowController < NSWindowController
attr_writer :directoryPath
attr_accessor :searchQuery, :tableView, :searchButton
def runQuery(sender)
# arguments = ["--output=\"\\n$\\`\\n$&\\n$'\"", self.searchQuery.stringValue];
arguments = [self.searchQuery.stringValue];
bundle_path = NSBundle.mainBundle.resourcePath
cmd = "#{bundle_path}/ack -Q #{arguments.join " "}"
puts "------ Dir.chdir: #{@directoryPath}"
Dir.chdir @directoryPath
puts "------ Running: #{cmd}"
puts `#{cmd}`
end
end
--------------------------------
Output:
------ Dir.chdir: /Users/majd/github/sproutcore20
------ Running: /Users/majd/Library/Developer/Xcode/DerivedData/VimAck-dljtoceskfuszeeafrbvgdtzqcxh/Build/Products/Debug/VimAck.app/Contents/Resources/ack -Q SC.Object
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment