Class: SiSU_Remote::RemoteDownload

Inherits:
Object
  • Object
show all
Defined in:
lib/sisu/remote.rb

Instance Method Summary collapse

Constructor Details

#initialize(requested_file) ⇒ RemoteDownload

Returns a new instance of RemoteDownload.



215
216
217
# File 'lib/sisu/remote.rb', line 215

def initialize(requested_file)
  @requested_file=requested_file
end

Instance Method Details

#dir_stubObject



232
233
234
235
# File 'lib/sisu/remote.rb', line 232

def dir_stub
  re_p_stub=/.+?([^\/]+)$/
  re_p_stub.match(path).captures.join if path
end

#nameObject



239
240
241
# File 'lib/sisu/remote.rb', line 239

def name
  name_source
end

#name_sourceObject



236
237
238
# File 'lib/sisu/remote.rb', line 236

def name_source
  @pod
end

#pathObject



229
230
231
# File 'lib/sisu/remote.rb', line 229

def path
  @pth
end

#podObject



218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
# File 'lib/sisu/remote.rb', line 218

def pod
  re_p_div=/https?:\/\/([^\/]+)(\/\S+)\/(sisupod\.(?:txz|zip)|\S+?(?:\.ss[mt]\.(?:txz|zip))?|[^\/]+?\.ssp)$/
  re_p=/(sisupod\.(?:txz|zip)|\S+?\.ss[mt]\.(?:txz|zip)?|[^\/]+?\.ssp)$/
  if @requested_file =~ re_p_div
    @site,@pth,@pod= re_p_div.match(@requested_file).captures
  elsif @requested_file =~ re_p
    @pod=re_p.match(@requested_file).captures.join
  end
  def site
    @site
  end
  def path
    @pth
  end
  def dir_stub
    re_p_stub=/.+?([^\/]+)$/
    re_p_stub.match(path).captures.join if path
  end
  def name_source
    @pod
  end
  def name
    name_source
  end
  self
end

#siteObject



226
227
228
# File 'lib/sisu/remote.rb', line 226

def site
  @site
end