Class: Percy::Capybara::Loaders::BaseLoader
- Inherits:
-
Object
- Object
- Percy::Capybara::Loaders::BaseLoader
- Defined in:
- lib/percy/capybara/loaders/base_loader.rb
Direct Known Subclasses
Constant Summary collapse
- URL_REGEX =
Modified version of Diego Perini’s URL regex. gist.github.com/dperini/729294
Regexp.new( # protocol identifier "((?:https?:)?//)" + "(" + # IP address exclusion # private & local networks "(?!(?:10|127)(?:\\.\\d{1,3}){3})" + "(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})" + "(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})" + # IP address dotted notation octets # excludes loopback network 0.0.0.0 # excludes reserved space >= 224.0.0.0 # excludes network & broacast addresses # (first & last IP address of each class) "(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])" + "(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}" + "(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))" + "|" + # host name "(?:(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)" + # domain name "(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*" + ")" + # port number "(:\\d{2,5})?" + # resource path "(/[^\\s\"']*)?" )
Instance Attribute Summary collapse
-
#page ⇒ Object
readonly
Returns the value of attribute page.
Instance Method Summary collapse
- #build_resources ⇒ Object
-
#initialize(options = {}) ⇒ BaseLoader
constructor
A new instance of BaseLoader.
- #snapshot_resources ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ BaseLoader
Returns a new instance of BaseLoader.
38 39 40 |
# File 'lib/percy/capybara/loaders/base_loader.rb', line 38 def initialize( = {}) @page = [:page] end |
Instance Attribute Details
#page ⇒ Object (readonly)
Returns the value of attribute page.
35 36 37 |
# File 'lib/percy/capybara/loaders/base_loader.rb', line 35 def page @page end |
Instance Method Details
#build_resources ⇒ Object
42 43 44 |
# File 'lib/percy/capybara/loaders/base_loader.rb', line 42 def build_resources raise NotImplementedError.new('subclass must implement abstract method') end |
#snapshot_resources ⇒ Object
46 47 48 |
# File 'lib/percy/capybara/loaders/base_loader.rb', line 46 def snapshot_resources raise NotImplementedError.new('subclass must implement abstract method') end |