Class: MediawikiTasks

Inherits:
Thor
  • Object
show all
Defined in:
lib/tasks/thorfile.rb

Instance Method Summary collapse

Instance Method Details

#search(query) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/tasks/thorfile.rb', line 5

def search(query)
  require 'config/environment'

  results = Dradis::Plugins::Mediawiki::Filters::FullTextSearch.new.query(query: query)

  puts "Wiki Search\n==========="
  puts "#{results.size} results"

  results.each do |record|
    puts "#{record.title}\n\t#{record.description}"
  end
end