1
0
Fork 0
mirror of https://github.com/twbs/bootstrap-sass.git synced 2022-11-09 12:27:02 -05:00

converter: network

This commit is contained in:
Gleb Mazovetskiy 2014-06-29 20:58:36 +02:00
parent 540ad23430
commit 07923942e5
2 changed files with 4 additions and 3 deletions

View file

@ -32,6 +32,7 @@ class Converter
end
def log_http_get_files(files, from, cached = false)
return if files.empty?
s = " #{'CACHED ' if cached}GET #{files.length} files from #{from} #{files * ' '}..."
if cached
puts dark green s

View file

@ -14,8 +14,8 @@ class Converter
log_http_get_files files, full_path, false
files.map do |name|
Thread.start {
content = open("#{full_path}/#{name}").read
Thread.exclusive { write_cached_files path, name => content }
contents[name] = open("#{full_path}/#{name}").read
Thread.exclusive { write_cached_files path, name => contents[name] }
}
end.each(&:join)
contents
@ -29,8 +29,8 @@ class Converter
path = "#{full_path}/#{name}"
contents[name] = File.read(path, mode: 'rb') if File.exists?(path)
end
contents
end
contents
end
def write_cached_files(path, files)