Sha256: 7116ccf83ae5a627106f67d2157ca8578e64df5f7a4b0123d2875c061b3f25f3
Contents?: true
Size: 466 Bytes
Versions: 19
Compression:
Stored size: 466 Bytes
Contents
#!/usr/bin/env ruby -w # Datafy code lifted from http://segment7.net/projects/ruby/datafy/ require 'base64' require 'cgi' module Datafy def Datafy::make_data_uri(content, content_type) outuri = 'data:' + content_type unless content_type =~ /^text/i # base64 encode if not text outuri += ';base64' content = Base64.encode64(content).gsub("\n", '') else content = CGI::escape(content) end outuri += ",#{content}" end end
Version data entries
19 entries across 19 versions & 3 rubygems