class Omnibar::Github

Public Class Methods

Public Instance Methods

perform!() click to toggle source
# File lib/omnibar/queries/github.rb, line 13
def perform!
  param = result.downcase.gsub(/\s/, '-')
  open_in_browser "https://github.com/#{param}"
end
relevance() click to toggle source
# File lib/omnibar/queries/github.rb, line 18
def relevance
  if repo_full_name?
    0.75
  elsif result
    input.levenshtein_similar(result)
  end
end
repo_full_name?() click to toggle source
# File lib/omnibar/queries/github.rb, line 26
def repo_full_name?
  input.match?(/^[\w-]+\/[\w-]+$/)
end
result() click to toggle source
# File lib/omnibar/queries/github.rb, line 3
def result
  repo = search.find(input)
  return repo if repo
  return input if repo_full_name?
end