class Mechanize::File
@!visibility private
Public Class Methods
read_local(path)
click to toggle source
# File lib/grubby/mechanize/file.rb, line 4 def self.read_local(path) uri_path = File.expand_path(path).gsub(%r"[^/\\]+"){|component| CGI.escape(component) } self.new(URI::File.build(path: uri_path), nil, File.read(path), "200") end
Public Instance Methods
content_hash()
click to toggle source
# File lib/grubby/mechanize/file.rb, line 9 def content_hash @content_hash ||= self.body.to_s.sha1 end