Class: Vim::Jar::Cli
- Inherits:
-
Thor
- Object
- Thor
- Vim::Jar::Cli
- Defined in:
- lib/vim-jar/cli.rb
Instance Method Summary collapse
- #edit ⇒ Object
- #init ⇒ Object
- #install ⇒ Object
- #installed ⇒ Object
- #uninstall(name) ⇒ Object
- #update ⇒ Object
Instance Method Details
#edit ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/vim-jar/cli.rb', line 24 def edit check! editor = [ENV['BUNDLER_EDITOR'], ENV['VISUAL'], ENV['EDITOR']].find{|e| !e.nil? && !e.empty? } if editor command = "#{editor} #{config.bundle_file_path}" success = system(command) raise ::Vim::Jar::InstallError.new "Could not run '#{command}'" unless success else ::Vim::Jar::InstallError.new("To open BundleFile, set $EDITOR or $BUNDLER_EDITOR") end end |
#init ⇒ Object
10 11 12 13 14 |
# File 'lib/vim-jar/cli.rb', line 10 def init check! done exit 0 end |
#install ⇒ Object
17 18 19 20 21 |
# File 'lib/vim-jar/cli.rb', line 17 def install check! loader = ::Vim::Jar::Loader.new loader.execute end |
#installed ⇒ Object
38 39 40 |
# File 'lib/vim-jar/cli.rb', line 38 def installed STDOUT.puts ::Vim::Jar::Plugin.installed.join("\n") end |
#uninstall(name) ⇒ Object
51 52 53 54 55 56 57 58 59 60 |
# File 'lib/vim-jar/cli.rb', line 51 def uninstall(name) check! if ::Vim::Jar::Plugin.installed.include?(name) ::Vim::Jar::Plugin.uninstall(name) STDOUT.puts "plugin #{name} has been already remove from #{config.bundle_home.join(name)}" else STDERR.puts "You didn't install plugin named #{name}" end end |