This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
commit 3e5816fcd06568895c2fee1a3d5e1a5821c44a77 | |
Author: jarib <jarib@deaf61b0-630d-0410-ad59-fc55e6353476> | |
Date: Mon Dec 15 20:57:40 2008 +0000 | |
Some camelCase => snake_case renames (with aliasing). | |
Image#fileCreatedDate => file_created_date | |
Image#fileSize => file_size | |
Image#hasLoaded? => loaded? | |
SelectList#getAllContents => options |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "rubygems" | |
require "celerity" | |
Before do | |
@browser = Celerity::Browser.new | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "rubygems" | |
require "celerity" | |
Before do | |
@browser = Celerity::Browser.new | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<meta http-equiv="Content-type" content="text/html; charset=utf-8"> | |
<title>preventDefault() on form submission</title> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js" type="text/javascript" charset="utf-8"></script> | |
<script type="text/javascript" charset="utf-8"> | |
$(document).ready(function() { | |
$("#foo").submit(function (e) { | |
e.preventDefault(); | |
return false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyError < StandardError | |
def to_yaml( opts = {} ) | |
YAML.quick_emit(self, opts) do |out| | |
out.map(taguri, to_yaml_style) do |map| | |
map.add('message', message) | |
map.add('backtrace', backtrace) | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "ruby-debug" | |
Debugger.start | |
Debugger.settings[:autoeval] = true | |
Debugger.settings[:autolist] = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ echo '<div style="display: none;">some text</div>' > test.html | |
$ jirb -Ilib -rcelerity | |
>> c = Celerity::Browser.start "file:///#{File.expand_path "."}/test.html" | |
=> #<Celerity::Browser:0x10bf989e @page=#<HtmlPage:0x365474b4(file:////Users/jarib/src/git/celerity/test.html)> @render_type=:html @charset="UTF-8" @viewer=Celerity::DefaultViewer @error_checkers=[] @last_url=nil> | |
>> puts c.html | |
<div style="display: none;">some text</div> | |
=> nil | |
>> puts c.xml | |
<?xml version="1.0" encoding="ISO-8859-1"?> | |
<html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "celerity" | |
class MyAjaxController < com.gargoylesoftware.htmlunit.AjaxController | |
def processSynchron(page, settings, async) | |
if settings.getUrl.to_s =~ /blah\.google\.com/ | |
super(page, settings, false) | |
else | |
super | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
expected #<Celerity::Listener:0x74b57ce8 @java_object=#<Java::JavaObject:0x7fca5768>, @webclient=#<Spec::Mocks::Mock:0x137e @name="WebClient">, @procs={}> to be a kind of #<Class:01x3a40785c> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File.new("blah.txt", "w+") do |file| | |
file << "hello\n" | |
file << "\tworld\n" | |
end |