Docs
This commit is contained in:
parent
52aa8e2bba
commit
f5ed57e042
7
Rakefile
7
Rakefile
@ -75,8 +75,13 @@ task :install_gem => [:clean, :package] do
|
||||
sh "sudo gem install --local #{gem}"
|
||||
end
|
||||
|
||||
desc "Delete generated RDoc"
|
||||
task :clobber_docs do
|
||||
FileUtils.rm_rf("doc")
|
||||
end
|
||||
|
||||
desc "Generate RDoc"
|
||||
task :docs do
|
||||
task :docs => :clobber_docs do
|
||||
system "hanna --title 'Webrat #{Webrat::VERSION} API Documentation'"
|
||||
end
|
||||
|
||||
|
@ -7,16 +7,21 @@ module Webrat
|
||||
@@configuration = configuration
|
||||
end
|
||||
|
||||
def self.configuration
|
||||
def self.configuration # :nodoc:
|
||||
@@configuration ||= Webrat::Configuration.new
|
||||
end
|
||||
|
||||
# Webrat can be configured using the Webrat.configure method. For example:
|
||||
#
|
||||
# Webrat.configure do |config|
|
||||
# config.parse_with_nokogiri = false
|
||||
# end
|
||||
class Configuration
|
||||
# Should XHTML be parsed with Nokogiri? Defaults to true, except on JRuby. When false, Hpricot and REXML are used
|
||||
attr_writer :parse_with_nokogiri
|
||||
|
||||
# Webrat's mode, set automatically when requiring webrat/rails, webrat/merb, etc.
|
||||
attr_accessor :mode
|
||||
attr_accessor :mode # :nodoc:
|
||||
|
||||
# Save and open pages with error status codes (500-599) in a browser? Defualts to true.
|
||||
attr_writer :open_error_files
|
||||
|
@ -1,6 +1,6 @@
|
||||
module Webrat
|
||||
|
||||
class Element
|
||||
class Element # :nodoc:
|
||||
|
||||
def self.load_all(session, dom)
|
||||
Webrat::XML.xpath_search(dom, xpath_search).map do |element|
|
||||
|
@ -3,7 +3,7 @@ require "webrat/core/locators/locator"
|
||||
module Webrat
|
||||
module Locators
|
||||
|
||||
class AreaLocator < Locator
|
||||
class AreaLocator < Locator # :nodoc:
|
||||
|
||||
def locate
|
||||
Area.load(@session, area_element)
|
||||
|
@ -3,7 +3,7 @@ require "webrat/core/locators/locator"
|
||||
module Webrat
|
||||
module Locators
|
||||
|
||||
class ButtonLocator < Locator
|
||||
class ButtonLocator < Locator # :nodoc:
|
||||
|
||||
def locate
|
||||
ButtonField.load(@session, button_element)
|
||||
|
@ -3,7 +3,7 @@ require "webrat/core/locators/locator"
|
||||
module Webrat
|
||||
module Locators
|
||||
|
||||
class FieldByIdLocator < Locator
|
||||
class FieldByIdLocator < Locator # :nodoc:
|
||||
|
||||
def locate
|
||||
Field.load(@session, field_element)
|
||||
|
@ -4,7 +4,7 @@ require "webrat/core/locators/locator"
|
||||
module Webrat
|
||||
module Locators
|
||||
|
||||
class FieldLabeledLocator < Locator
|
||||
class FieldLabeledLocator < Locator # :nodoc:
|
||||
|
||||
def locate
|
||||
matching_labels.any? && matching_labels.first.field
|
||||
|
@ -3,7 +3,7 @@ require "webrat/core/locators/locator"
|
||||
module Webrat
|
||||
module Locators
|
||||
|
||||
class FieldLocator < Locator
|
||||
class FieldLocator < Locator # :nodoc:
|
||||
|
||||
def locate
|
||||
FieldByIdLocator.new(@session, @dom, @value).locate ||
|
||||
|
@ -3,7 +3,7 @@ require "webrat/core/locators/locator"
|
||||
module Webrat
|
||||
module Locators
|
||||
|
||||
class FieldNamedLocator < Locator
|
||||
class FieldNamedLocator < Locator # :nodoc:
|
||||
|
||||
def locate
|
||||
Field.load(@session, field_element)
|
||||
|
@ -3,7 +3,7 @@ require "webrat/core/locators/locator"
|
||||
module Webrat
|
||||
module Locators
|
||||
|
||||
class FormLocator < Locator
|
||||
class FormLocator < Locator # :nodoc:
|
||||
|
||||
def locate
|
||||
Form.load(@session, form_element)
|
||||
|
@ -4,7 +4,7 @@ require "webrat/core/locators/locator"
|
||||
module Webrat
|
||||
module Locators
|
||||
|
||||
class LabelLocator < Locator
|
||||
class LabelLocator < Locator # :nodoc:
|
||||
|
||||
def locate
|
||||
Label.load(@session, label_element)
|
||||
|
@ -3,7 +3,7 @@ require "webrat/core/locators/locator"
|
||||
module Webrat
|
||||
module Locators
|
||||
|
||||
class LinkLocator < Locator
|
||||
class LinkLocator < Locator # :nodoc:
|
||||
|
||||
def locate
|
||||
Link.load(@session, link_element)
|
||||
|
@ -1,7 +1,7 @@
|
||||
module Webrat
|
||||
module Locators
|
||||
|
||||
class Locator
|
||||
class Locator # :nodoc:
|
||||
|
||||
def initialize(session, dom, value, *field_types)
|
||||
@session = session
|
||||
|
@ -4,7 +4,7 @@ require "webrat/core/locators/locator"
|
||||
module Webrat
|
||||
module Locators
|
||||
|
||||
class SelectOptionLocator < Locator
|
||||
class SelectOptionLocator < Locator # :nodoc:
|
||||
|
||||
def initialize(session, dom, option_text, id_or_name_or_label)
|
||||
@session = session
|
||||
|
@ -182,7 +182,7 @@ module Webrat
|
||||
end
|
||||
end
|
||||
|
||||
def rewrite_css_and_image_references(response_html) #:nodoc
|
||||
def rewrite_css_and_image_references(response_html) # :nodoc:
|
||||
return response_html unless doc_root
|
||||
response_html.gsub(/"\/(stylesheets|images)/, doc_root + '/\1')
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user