Guest User

Untitled

a guest
Jul 19th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. indexer_in = ENV['PATH'].gsub(';', ':').split(':').detect {|p| f = File.join(p, 'indexer') ; File.exist?(f) || File.exist?(f + '.exe')}
  2. if indexer_in
  3. # we know it's in the path, so run - or use indexer_in to address the path directly.
  4. `indexer`[/^Sphinx (\d\.\d\.\d)/, 1]
  5. else
  6. puts 'not found'
  7. end
Add Comment
Please, Sign In to add comment