Class: DebsFromRepos::ListUrl
- Inherits:
-
Object
- Object
- DebsFromRepos::ListUrl
- Defined in:
- lib/debsfromrepos/list_url.rb
Instance Attribute Summary collapse
-
#component ⇒ Object
Returns the value of attribute component.
-
#suite ⇒ Object
Returns the value of attribute suite.
Instance Method Summary collapse
- #get_url ⇒ Object
-
#initialize(url, suite = '', component = '') ⇒ ListUrl
constructor
A new instance of ListUrl.
Constructor Details
#initialize(url, suite = '', component = '') ⇒ ListUrl
6 7 8 9 10 |
# File 'lib/debsfromrepos/list_url.rb', line 6 def initialize(url, suite='', component='') @url = url @suite = suite @component = component end |
Instance Attribute Details
#component ⇒ Object
Returns the value of attribute component.
4 5 6 |
# File 'lib/debsfromrepos/list_url.rb', line 4 def component @component end |
#suite ⇒ Object
Returns the value of attribute suite.
4 5 6 |
# File 'lib/debsfromrepos/list_url.rb', line 4 def suite @suite end |
Instance Method Details
#get_url ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/debsfromrepos/list_url.rb', line 12 def get_url if @suite.empty? $stderr.puts "ERROR: the suite was missing" return nil elsif @component.empty? $stderr.puts "ERROR: the component was missing" return nil end unless @url.match(/(http|ftp)s*:\/\/([\S]*)\/.*/) $stderr.puts "ERROR: the url format is wrong" return nil end "#{@url}/dists/#{@suite}/#{@component}/binary-i386/Packages.gz" end |