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



55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/shoes/image.rb', line 55

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