Class: Omnibar::Github

Inherits:
Query
  • Object
show all
Defined in:
lib/omnibar/github.rb

Instance Attribute Summary

Attributes inherited from Query

#input

Instance Method Summary collapse

Methods inherited from Query

#copy_to_clipboard, inherited, #initialize, #open_in_browser, #preview_text

Constructor Details

This class inherits a constructor from Omnibar::Query

Instance Method Details

#perform!Object



13
14
15
16
# File 'lib/omnibar/github.rb', line 13

def perform!
  param = result.downcase.gsub(/\s/, '-')
  open_in_browser "https://github.com/#{param}"
end

#resultObject



3
4
5
6
7
# File 'lib/omnibar/github.rb', line 3

def result
  repo = search.find(input)
  return repo if repo
  return input if input.match?(/^[\w-]+\/[\w-]+$/)
end

#searchObject



9
10
11
# File 'lib/omnibar/github.rb', line 9

def search
  @fm = FuzzyMatch.new(Omnibar.config.github.repos)
end