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

Version Path
juicer-1.0.13 lib/juicer/datafy/datafy.rb
psyho_juicer-1.0.11 lib/juicer/datafy/datafy.rb
juicer-1.0.12 lib/juicer/datafy/datafy.rb
juicer-1.0.11 lib/juicer/datafy/datafy.rb
juicer-1.0.10 lib/juicer/datafy/datafy.rb
psyho_juicer-1.0.9 lib/juicer/datafy/datafy.rb
juicer-1.0.9 lib/juicer/datafy/datafy.rb
juicer-1.0.8 lib/juicer/datafy/datafy.rb
juicer-1.0.7 lib/juicer/datafy/datafy.rb
psyho_juicer-1.0.7 lib/juicer/datafy/datafy.rb
juicer-1.0.6 lib/juicer/datafy/datafy.rb
juicer-1.0.5 lib/juicer/datafy/datafy.rb
juicer-1.0.4 lib/juicer/datafy/datafy.rb
juicer-1.0.3 lib/juicer/datafy/datafy.rb
juicer-1.0.2 lib/juicer/datafy/datafy.rb
juicer-1.0.1 lib/juicer/datafy/datafy.rb
psyho_juicer-1.0.0 lib/juicer/datafy/datafy.rb
juicer-1.0.0 lib/juicer/datafy/datafy.rb
ktheory-juicer-1.0.0.ktheory1 lib/juicer/datafy/datafy.rb