14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
# File 'lib/generators/awe/update/update_generator.rb', line 14
def download_and_copy_awe
files = []
javascripts_path = ::Rails.application.config.assets.enabled ? "vendor/assets/javascripts" : "public/javascripts"
say_status("getting", "The AWE file list from #{@@github}/ ...", :green)
open("#{@@github}/files") { |f|
f.each_line { |line| files.push(line.strip) unless line.starts_with?("#") }
}
files.each { |file|
say_status("fetching", "#{@@github}/#{file} into #{javascripts_path} ...", :green)
get "#{@@github}/#{file}", "#{javascripts_path}/#{file}"
}
rescue OpenURI::HTTPError
say_status("error", "error fetching files", :red)
end
|