Class: Toothpick::Search
- Inherits:
-
Object
- Object
- Toothpick::Search
- Defined in:
- lib/toothpick/search.rb
Instance Method Summary collapse
-
#initialize(picks_dir, string) ⇒ Search
constructor
A new instance of Search.
Constructor Details
#initialize(picks_dir, string) ⇒ Search
Returns a new instance of Search.
4 5 6 7 8 9 10 11 12 |
# File 'lib/toothpick/search.rb', line 4 def initialize(picks_dir, string) # Works only with the_silver_searcher for now unless `cd #{picks_dir} && ag --version`.nil? space_separated_filenames = `ag -l #{string}`.split.join(' ') unless space_separated_filenames.empty? system("$EDITOR #{space_separated_filenames}") end end end |