Class: Vim::Jar::Plugin::Git

Inherits:
Object
  • Object
show all
Includes:
Installer::Git
Defined in:
lib/vim-jar/plugin/git.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Installer::Git

#install_to

Constructor Details

#initialize(attrs) ⇒ Git

Returns a new instance of Git.



9
10
11
12
13
14
15
16
# File 'lib/vim-jar/plugin/git.rb', line 9

def initialize(attrs) 
  attrs.each_pair do |name, value|
    if self.respond_to? name 
      self.instance_variable_set("@#{name}", value)
    end
  end
  @target_path = config.bundle_home.join(name)
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



7
8
9
# File 'lib/vim-jar/plugin/git.rb', line 7

def name
  @name
end

#target_pathObject (readonly)

Returns the value of attribute target_path.



7
8
9
# File 'lib/vim-jar/plugin/git.rb', line 7

def target_path
  @target_path
end

#urlObject (readonly)

Returns the value of attribute url.



7
8
9
# File 'lib/vim-jar/plugin/git.rb', line 7

def url
  @url
end

Instance Method Details

#configObject



26
27
28
# File 'lib/vim-jar/plugin/git.rb', line 26

def config 
  ::Vim::Jar::Config.instance
end

#installObject



18
19
20
21
22
23
24
# File 'lib/vim-jar/plugin/git.rb', line 18

def install
  if !File.exist?(target_path) 
    install_to(url, target_path) 
  else
    raise ::Vim::Jar::Installer.new("")
  end
end