lib/vimmer/installers.rb in vimmer-0.1.0 vs lib/vimmer/installers.rb in vimmer-0.2.0
- old
+ new
@@ -1,7 +1,21 @@
module Vimmer
module Installers
+ extend self
- autoload :Github, 'vimmer/installers/github'
+ autoload :Github, 'vimmer/installers/github'
+ autoload :VimDotOrg, 'vimmer/installers/vim_dot_org'
+
+
+ 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
+
end
end