Class: AssetLink::Loader
- Inherits:
-
Object
- Object
- AssetLink::Loader
- Defined in:
- lib/asset_link/loader.rb
Instance Method Summary collapse
Instance Method Details
#download(files) ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/asset_link/loader.rb', line 16 def download(files) files.each do |f| next if !File.file?(f) || File.extname(f) != '.link' puts "Downloading: #{f}" link = read_file(f) download_file(f, link) File.delete(f) end end |
#upload(files) ⇒ Object
6 7 8 9 10 11 12 13 14 |
# File 'lib/asset_link/loader.rb', line 6 def upload(files) files.each do |f| next unless File.file?(f) puts "Uploading: #{f}" link = upload_file(f) create_link_file(f, link) File.delete(f) end end |