Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
32 changed files
with
1,028 additions
and
9 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,4 @@ email.txt | |
log | ||
.project | ||
.loadpath | ||
*.swp |
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,10 @@ def text | |
str.squeeze!(" ") | ||
str | ||
end | ||
|
||
def for_id | ||
@element['for'] | ||
end | ||
|
||
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
$:.unshift(File.dirname(__FILE__)) unless $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__))) | ||
|
||
module RubyHtmlUnit | ||
Jars = Dir[File.dirname(__FILE__) + '/ruby_html_unit/htmlunit/*.jar'] | ||
end | ||
|
||
if RUBY_PLATFORM =~ /java/ | ||
require 'java' | ||
RubyHtmlUnit::Jars.each { |jar| require(jar) } | ||
|
||
module HtmlUnit | ||
include_package 'com.gargoylesoftware.htmlunit' | ||
end | ||
JavaString = java.lang.String | ||
else | ||
raise "RubyHtmlUnit only works on JRuby at the moment." | ||
end | ||
|
||
|
||
Dir[File.join(File.dirname(__FILE__), "ruby_html_unit", "*.rb")].each do |file| | ||
require File.expand_path(file) | ||
end | ||
|
||
|
||
# Deal with the test server | ||
if `uname`.chomp == "Darwin" | ||
TEST_SERVER_PORT = '3001' | ||
|
||
if `ps ax`.match(/^\s*(\d*).*-e test -p #{TEST_SERVER_PORT}/) | ||
puts "A test server was found running on port #{TEST_SERVER_PORT} (PID #{$1})" | ||
else | ||
puts "A test server was not found running (looking for -e test -p #{TEST_SERVER_PORT})" | ||
puts "Please start a new test server using the command below:" | ||
puts | ||
|
||
command_string = "ruby #{RAILS_ROOT}/script/server -e test -p #{TEST_SERVER_PORT}" | ||
|
||
puts command_string | ||
exit | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module RubyHtmlUnit | ||
|
||
class AlertHandler | ||
def handleAlert(html_unit_page, alert_message) | ||
alert_messages << alert_message | ||
end | ||
|
||
def alert_messages | ||
@alert_messages ||= [] | ||
end | ||
end | ||
|
||
end |
Oops, something went wrong.