Class: Aranha::Fixtures::Download

Inherits:
Object
  • Object
show all
Defined in:
lib/aranha/fixtures/download.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Download

Returns a new instance of Download.



12
13
14
15
16
17
# File 'lib/aranha/fixtures/download.rb', line 12

def initialize(options)
  @prefix = options.fetch(:prefix)
  @prefix = '' if @prefix.blank?
  @download = options.fetch(:download)
  @pending = options.fetch(:pending)
end

Instance Attribute Details

#pendingObject (readonly)

Returns the value of attribute pending.



10
11
12
# File 'lib/aranha/fixtures/download.rb', line 10

def pending
  @pending
end

Instance Method Details

#runObject



19
20
21
22
23
24
# File 'lib/aranha/fixtures/download.rb', line 19

def run
  url_files.each do |f|
    Rails.logger.info(relative_path(f))
    download(url(f), target(f)) if @download
  end
end