Class: Aranha::Rails::FixturesDownload
- Inherits:
-
Object
- Object
- Aranha::Rails::FixturesDownload
- Defined in:
- lib/aranha/rails/fixtures_download.rb
Constant Summary collapse
- DEFAULT_EXTENSION =
'.html'
Instance Method Summary collapse
Instance Method Details
#download? ⇒ Boolean
15 16 17 |
# File 'lib/aranha/rails/fixtures_download.rb', line 15 def download? [OPTION_DOWNLOAD] ? true : false end |
#extension ⇒ Object
19 20 21 |
# File 'lib/aranha/rails/fixtures_download.rb', line 19 def extension [OPTION_EXTENSION].if_present(DEFAULT_EXTENSION) end |
#pending? ⇒ Boolean
23 24 25 |
# File 'lib/aranha/rails/fixtures_download.rb', line 23 def pending? [OPTION_PENDING] ? true : false end |
#prefix ⇒ Object
27 28 29 |
# File 'lib/aranha/rails/fixtures_download.rb', line 27 def prefix [OPTION_PREFIX].if_present('') end |
#run ⇒ Object
31 32 33 34 35 36 |
# File 'lib/aranha/rails/fixtures_download.rb', line 31 def run url_files.each do |f| ::Rails.logger.info(relative_path(f)) download(url(f), target(f)) if download? end end |