Class: Vendorise::Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/vendorise/parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url) ⇒ Parser

Returns a new instance of Parser.



5
6
7
# File 'lib/vendorise/parser.rb', line 5

def initialize(url)
  @url = url
end

Instance Attribute Details

#urlObject (readonly)

Returns the value of attribute url.



3
4
5
# File 'lib/vendorise/parser.rb', line 3

def url
  @url
end

Instance Method Details

#gem_nameObject



13
14
15
# File 'lib/vendorise/parser.rb', line 13

def gem_name
  File.basename url, ".git"
end

#gem_urlObject



9
10
11
# File 'lib/vendorise/parser.rb', line 9

def gem_url
  url =~ /^\s+$/ ? nil : url
end