Sha256: 1549f1f8fb6f756abac9e83636183fc12c3994276ef4f472641cafaca38707fd
Contents?: true
Size: 796 Bytes
Versions: 6
Compression:
Stored size: 796 Bytes
Contents
require 'rubygems' require 'bundler' Bundler.setup require 'spec' require 'chunky_png' require 'oily_png/oily_png_ext' class OilyCanvas < ChunkyPNG::Canvas extend OilyPNG::PNGDecoding include OilyPNG::PNGEncoding end module ResourceHelper def resource_files Dir[File.join(File.dirname(__FILE__), 'resources', '*.png')] end end module CanvasHelper def resource_file(name) File.join(File.dirname(__FILE__), 'resources', name) end def display(canvas) filename = resource_file('_tmp.png') canvas.to_datastream.save(filename) `open #{filename}` end def reference_canvas(name) ChunkyPNG::Canvas.from_file(resource_file("#{name}.png")) end end Spec::Runner.configure do |config| config.extend ResourceHelper config.include CanvasHelper end
Version data entries
6 entries across 6 versions & 1 rubygems