From 5a5d80d20f7c951b7aff62d1e850f1715c9ddf55 Mon Sep 17 00:00:00 2001 From: Peter Gumeson Date: Fri, 24 May 2013 17:44:07 -0700 Subject: [PATCH] Process font assets in converter --- tasks/converter.rb | 16 ++++++++++++++++ .../fonts/glyphiconshalflings-regular.eot | Bin .../fonts/glyphiconshalflings-regular.svg | 0 .../fonts/glyphiconshalflings-regular.ttf | Bin .../fonts/glyphiconshalflings-regular.woff | Bin 5 files changed, 16 insertions(+) mode change 100755 => 100644 vendor/assets/fonts/glyphiconshalflings-regular.eot mode change 100755 => 100644 vendor/assets/fonts/glyphiconshalflings-regular.svg mode change 100755 => 100644 vendor/assets/fonts/glyphiconshalflings-regular.ttf mode change 100755 => 100644 vendor/assets/fonts/glyphiconshalflings-regular.woff diff --git a/tasks/converter.rb b/tasks/converter.rb index 81f67308..552a1a42 100644 --- a/tasks/converter.rb +++ b/tasks/converter.rb @@ -24,6 +24,7 @@ class Converter def process process_stylesheet_assets process_javascript_assets + process_font_assets end def process_stylesheet_assets @@ -76,6 +77,15 @@ class Converter save_file(path, content) end + def process_font_assets + puts "\nProcessing fonts..." + bootstrap_font_files.each do |name| + file = open("https://raw.github.com/twitter/bootstrap/#{@branch}/fonts/#{name}").read + path = "vendor/assets/fonts/#{name}" + save_file(path, file) + end + end + private # Get the sha of a dir @@ -97,6 +107,12 @@ private files['tree'].select{|f| f['type'] == 'blob' && f['path'] =~ /.js$/ }.map{|f| f['path'] } end + def bootstrap_font_files + files = open("https://api.github.com/repos/twitter/bootstrap/git/trees/#{get_tree_sha('fonts')}").read + files = JSON.parse files + files['tree'].select{|f| f['type'] == 'blob' }.map{|f| f['path'] } + end + def get_mixins_name mixins = [] less_mixins = open("https://raw.github.com/twitter/bootstrap/#{@branch}/less/mixins.less").read diff --git a/vendor/assets/fonts/glyphiconshalflings-regular.eot b/vendor/assets/fonts/glyphiconshalflings-regular.eot old mode 100755 new mode 100644 diff --git a/vendor/assets/fonts/glyphiconshalflings-regular.svg b/vendor/assets/fonts/glyphiconshalflings-regular.svg old mode 100755 new mode 100644 diff --git a/vendor/assets/fonts/glyphiconshalflings-regular.ttf b/vendor/assets/fonts/glyphiconshalflings-regular.ttf old mode 100755 new mode 100644 diff --git a/vendor/assets/fonts/glyphiconshalflings-regular.woff b/vendor/assets/fonts/glyphiconshalflings-regular.woff old mode 100755 new mode 100644