mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-28 01:56:01 -05:00
pre-stage our locales as well
This commit is contained in:
parent
7ec0288c85
commit
fcbc77d0cd
1 changed files with 13 additions and 8 deletions
|
@ -5,16 +5,21 @@ task 'assets:prestage' => :environment do |t|
|
||||||
require "net/https"
|
require "net/https"
|
||||||
require "uri"
|
require "uri"
|
||||||
|
|
||||||
config = YAML::load(File.open("#{Rails.root}/config/cdn.yml"))
|
def get_assets(path)
|
||||||
|
a = Dir.glob("#{Rails.root}/public/assets/#{path}*").map do |f|
|
||||||
|
if f =~ /[a-f0-9]{16}\.(css|js)$/
|
||||||
|
"/assets/#{path}#{f.split('/')[-1]}"
|
||||||
|
end
|
||||||
|
end.compact
|
||||||
|
end
|
||||||
|
|
||||||
# pre-stage css/js only for now
|
# pre-stage css/js only for now
|
||||||
a = Dir.glob("#{Rails.root}/public/assets/*").map do |f|
|
a = get_assets("locales/") + get_assets("")
|
||||||
if f =~ /[a-f0-9]{16}\.(css|js)$/
|
|
||||||
"/assets/#{f.split('/')[-1]}"
|
|
||||||
end
|
|
||||||
end.compact
|
|
||||||
|
|
||||||
puts "pre staging: #{a.join(' ')}"
|
puts "pre staging: #{a.join(' ')}"
|
||||||
|
|
||||||
|
# makes testing simpler leaving this here
|
||||||
|
config = YAML::load(File.open("#{Rails.root}/config/cdn.yml"))
|
||||||
|
|
||||||
start = Time.now
|
start = Time.now
|
||||||
|
|
||||||
uri = URI.parse("https://client.cdn77.com/api/prefetch")
|
uri = URI.parse("https://client.cdn77.com/api/prefetch")
|
||||||
|
|
Loading…
Reference in a new issue