Class: Vimmer::Installers::VimDotOrg

Inherits:
Object
  • Object
show all
Defined in:
lib/vimmer/installers/vim_dot_org.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



10
11
12
# File 'lib/vimmer/installers/vim_dot_org.rb', line 10

def path
  @path
end

#plugin_nameObject (readonly)

Returns the value of attribute plugin_name.



10
11
12
# File 'lib/vimmer/installers/vim_dot_org.rb', line 10

def plugin_name
  @plugin_name
end

#script_idObject (readonly)

Returns the value of attribute script_id.



10
11
12
# File 'lib/vimmer/installers/vim_dot_org.rb', line 10

def script_id
  @script_id
end

Class Method Details

.for_url(path) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/vimmer/installers/vim_dot_org.rb', line 17

def self.for_url(path)

  m = VIM_DOT_ORG_URL_PATTERN.match(path)
  script_id = m[1]

  raise Vimmer::PluginNotFoundError unless repository.key?(script_id)

  script_name = repository[script_id]
  github_path_template = "https://github.com/vim-scripts/%s.git"

  github_path = github_path_template % [script_name]

  Github.new(:path => github_path)
end

.match?(url) ⇒ Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/vimmer/installers/vim_dot_org.rb', line 13

def self.match?(url)
  !(url =~ VIM_DOT_ORG_URL_PATTERN).nil?
end