Sha256: 8fccea89da12eda409d1803847ed766bd64a18d3ae6d9fc8741a9b81093c6497
Contents?: true
Size: 1015 Bytes
Versions: 1
Compression:
Stored size: 1015 Bytes
Contents
require 'thor' require 'vimmer' module Vimmer class CLI < Thor desc "install PATH", "Installs plugin available at path PATH" def install(path) setup begin installer = Vimmer::Installers::Github.new(:path => path) installer.install rescue Vimmer::InvalidPathError => e $stderr.puts "The URL #{e.path} is invalid." exit 1 rescue Vimmer::PluginNotFoundError $stderr.puts "The plugin #{installer.plugin_name} could not be found" exit 1 end end desc "uninstall NAME", "Removes plugin named NAME" def uninstall(name) unless Vimmer.plugin?(name) $stderr.puts "The plugin #{name} is not installed." exit 1 end installer = Vimmer::Installers::Github.new(:name => name) installer.uninstall end private def setup Vimmer.setup end def method_missing(name, *args) $stderr.puts 'Could not find command "%s".' % name exit 1 end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
vimmer-0.1.0 | lib/vimmer/cli.rb |