Module: Vimmer::Installers

Extended by:
Installers
Included in:
Installers
Defined in:
lib/vimmer/installers.rb,
lib/vimmer/installers/github.rb,
lib/vimmer/installers/vim_dot_org.rb

Defined Under Namespace

Classes: Github, VimDotOrg

Constant Summary collapse

GITHUB_GIT_PATH_TEMPLATE =
"https://github.com/%s/%s.git"
GITHUB_GIT_URL_PATTERN =
%r{^https://github.com/[a-zA-Z0-9\-_\+%]+/([a-zA-Z0-9\-_\+\.]+).git$}
GITHUB_PUBLIC_URL_PATTERN =
%r{^https?://github.com/([a-zA-Z0-9\-_\+%]+)/([a-zA-Z0-9\-_\+\.]+[^.git])$}
VIM_DOT_ORG_URL_PATTERN =
%r{https?://(?:www\.)?vim\.org/scripts/script.php\?script_id=(\d{1,5})}

Instance Method Summary collapse

Instance Method Details

#for_url(url) ⇒ Object



9
10
11
12
13
14
15
16
17
# File 'lib/vimmer/installers.rb', line 9

def for_url(url)
  if Github.match?(url)
    Github
  elsif VimDotOrg.match?(url)
    VimDotOrg.for_url(url)
  else
    raise Vimmer::InstallerNotFoundError.new(url)
  end
end