Module: PageEz

Defined in:
lib/page_ez.rb,
lib/page_ez/page.rb,
lib/page_ez/errors.rb,
lib/page_ez/options.rb,
lib/page_ez/version.rb,
lib/page_ez/parameters.rb,
lib/page_ez/null_logger.rb,
lib/page_ez/delegates_to.rb,
lib/page_ez/page_visitor.rb,
lib/page_ez/configuration.rb,
lib/page_ez/pluralization.rb,
lib/page_ez/has_one_result.rb,
lib/page_ez/has_many_result.rb,
lib/page_ez/selector_evaluator.rb,
lib/page_ez/visitors/debug_visitor.rb,
lib/page_ez/visitors/depth_visitor.rb,
lib/page_ez/visitors/registered_name_visitor.rb,
lib/page_ez/visitors/matcher_collision_visitor.rb,
lib/page_ez/visitors/macro_pluralization_visitor.rb,
lib/page_ez/method_generators/has_one_composed_class.rb,
lib/page_ez/method_generators/has_one_static_selector.rb,
lib/page_ez/method_generators/has_many_static_selector.rb,
lib/page_ez/method_generators/has_one_dynamic_selector.rb,
lib/page_ez/method_generators/has_many_dynamic_selector.rb,
lib/page_ez/method_generators/has_many_ordered_selector.rb,
lib/page_ez/method_generators/define_has_one_result_methods.rb,
lib/page_ez/method_generators/define_has_many_result_methods.rb,
lib/page_ez/method_generators/define_has_one_predicate_methods.rb,
lib/page_ez/method_generators/has_many_ordered_dynamic_selector.rb

Defined Under Namespace

Modules: DelegatesTo, MethodGenerators, Visitors Classes: Configuration, DuplicateElementDeclarationError, Error, HasManyResult, HasOneResult, InvalidSelectorError, MatcherCollisionError, NullLogger, Options, Page, PageVisitor, Parameters, Pluralization, PluralizationMismatchError, SelectorEvaluator

Constant Summary collapse

VERSION =
"0.2.0"

Class Method Summary collapse

Class Method Details

.configurationObject



34
35
36
# File 'lib/page_ez.rb', line 34

def self.configuration
  @configuration ||= Configuration.new
end

.configure {|configuration| ... } ⇒ Object

Yields:



38
39
40
# File 'lib/page_ez.rb', line 38

def self.configure
  yield configuration if block_given?
end

.reraise_selector_error(selector) ⇒ Object



12
13
14
15
16
# File 'lib/page_ez/errors.rb', line 12

def self.reraise_selector_error(selector)
  yield
rescue Nokogiri::CSS::SyntaxError => e
  raise InvalidSelectorError, "Invalid selector '#{selector}':\n#{e.message}"
end