Class: Shoes::Types::App

Inherits:
Object
  • Object
show all
Defined in:
lib/shoes/download.rb,
lib/shoes/inspect.rb,
lib/shoes/image.rb

Overview

Monkey patch over the 'C' code.

Instance Method Summary collapse

Instance Method Details

#download(url, options = {}, &blk) ⇒ Object

Shoes::Types::App seems wrong but it works.



118
119
120
121
# File 'lib/shoes/download.rb', line 118

def download (url, options = {}, &blk)
  #puts "download #{url} #{options} "
  Shoes::Download.new(url, options, &blk)
end

#inspect(hits = nil) ⇒ Object



125
126
127
# File 'lib/shoes/inspect.rb', line 125

def inspect(hits = nil)
  "(#{self.class} #{name.dump})"
end

#snapshot(options = {}, &block) ⇒ Object



69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/shoes/image.rb', line 69

def snapshot(options = {}, &block)
  options[:format]   ||= :svg

  options[:filename] ||= ( tf_path = ( require 'tempfile'
               tf = Tempfile.new(File.basename(__FILE__)).path ))

  _snapshot options do
    block.call
  end
  return File.read(options[:filename])
ensure
  File.unlink(tf_path) if tf_path
end