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.



213
214
215
# File 'lib/sisu/remote.rb', line 213

def initialize(requested_file)
  @requested_file=requested_file
end

Instance Method Details

#dir_stubObject



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

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

#nameObject



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

def name
  name_source
end

#name_sourceObject



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

def name_source
  @pod
end

#pathObject



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

def path
  @pth
end

#podObject



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

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



224
225
226
# File 'lib/sisu/remote.rb', line 224

def site
  @site
end