Sha256: 58a10fe30e3685fa2f7b50475c36352f553366cb03b55435370542851193653c
Contents?: true
Size: 1.59 KB
Versions: 1
Compression:
Stored size: 1.59 KB
Contents
load "Rakefile.base" desc "Run the tests" task :test => :spec begin require 'rspec/core/rake_task' RSpec::Core::RakeTask.new rescue puts 'WARNING: rspec tasks not loaded"' end task :environment do require 'rubygems' require 'bundler' Bundler.require end desc "Get all dem fonts" task :get_dem_fonts, [:src_csv_path, :storage_path] => [:environment] do |t, args| require 'csv' csv_file_path = args[:src_csv_path] storage_path = args[:storage_path] csv = CSV.read(csv_file_path) csv_rows = csv[0..-1] row_count = csv_rows.size index = 20530 csv_rows = csv[index..-1] #TypeTogether,Givry,Givry,Regular,000000000000000000018a8a,c6ae973aa7e2fa4f36e10594d052a885 #row_count = csv_rows.size csv_rows.each do |csv_row| raise if csv_row.size != 6 index += 1 vendor = csv_row[0] vendor_name = vendor.gsub("/", " ") vendor_name.gsub!("'", "") vendor_name.gsub!("(","") vendor_name.gsub!(")","") vendor_dir = Pathname.new(storage_path) + vendor_name vendor_dir.mkdir unless vendor_dir.exist? fam_name = csv_row[1] fam_dir = vendor_dir + fam_name fam_dir.mkdir unless fam_dir.exist? file = fam_dir + "#{csv_row[2]}#{csv_row[3]}.otf" next if file.exist? # out_name = csv_row[columns[:out_name]] # out_file = File.join(storage_path, out_name) puts "#{index.to_s} of #{row_count.to_s}) Fetching s3://typekit-production-source-fonts/#{csv_row[5]} and storing it in #{file.expand_path}" path_as_str = file.expand_path.to_s.gsub(" ", "\\ ") `aws s3 cp s3://typekit-production-source-fonts/#{csv_row[5]} #{path_as_str}` end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
fontprocessor-27.1.3 | Rakefile |