Class: Textmate::Source::Github

Inherits:
Base
  • Object
show all
Defined in:
lib/textmate/source/github.rb

Instance Method Summary collapse

Methods inherited from Base

#<=>, #around_install, #clear_existing, #local_path_for, #name, name

Instance Method Details

#bundles(search = '') ⇒ Object



7
8
9
10
11
# File 'lib/textmate/source/github.rb', line 7

def bundles(search = '')
  github_search(search).map do |repository|
    normalize_github_repo_name(repository.name).split('.').first
  end.uniq.sort
end

#install(bundle) ⇒ Object



13
14
15
16
17
18
19
20
21
# File 'lib/textmate/source/github.rb', line 13

def install(bundle)
  repositories = github_search(bundle).sort_by { |r| r.followers }.reverse

  case repositories.length
    when 0 then abort("Can't find Github bundle to install: #{bundle}")
    when 1 then install_bundle_from_github(repositories.first, bundle)
    else        install_bundle_from_github(select_repository(repositories), bundle)
  end
end