#-- # Copyright protects this work. # See LICENSE file for details. #++ require 'rake/clean' require 'yaml' INDEX = YAML.load_file('index.yaml') desc 'generate PNGs for tango icons from SVG sources' task :default INDEX.values.grep(/tango-icon-theme/).each do |dst| if dst =~ /(\d+)x\1/ size = $1 src = $` + 'scalable' + $'.ext('.svg') file dst do mkdir_p File.dirname(dst) sh 'inkscape', '-e', dst, '-h', size, src # ensure sources are in repository so everything # works the next time this rake task is run sh 'git', 'add', src, dst end CLOBBER.include dst task :default => dst end end