class Ruboty::WikiSearch::Actions::WikiSearch

Public Instance Methods

sync() click to toggle source
# File lib/ruboty/wiki_search/actions/wiki_search.rb, line 7
def sync
  Ruboty::WikiSearch::GitOperation.sync!
  message.reply('wiki repository synced.')
rescue => e
  message.reply("wiki repository sync error! #{e}")
end

Private Instance Methods

search_params(string) click to toggle source
# File lib/ruboty/wiki_search/actions/wiki_search.rb, line 40
def search_params(string)
  strings = string.gsub(/ /, ' ').split(' ')
  repo = strings.select {|b| b.start_with?('repo:') }.first&.gsub(/^repo:/, '')
  strings.delete("repo:#{repo}")

  {
    repo: repo,
    text: strings.first,
  }
end