Class: Watir::HTML::SpecExtractor

Inherits:
Object
  • Object
show all
Defined in:
lib/watir-webdriver/html/spec_extractor.rb

Defined Under Namespace

Classes: InterfaceNotFound

Instance Method Summary collapse

Constructor Details

#initialize(uri) ⇒ SpecExtractor

Returns a new instance of SpecExtractor.



10
11
12
# File 'lib/watir-webdriver/html/spec_extractor.rb', line 10

def initialize(uri)
  @uri = uri
end

Instance Method Details

#errorsObject



24
25
26
# File 'lib/watir-webdriver/html/spec_extractor.rb', line 24

def errors
  @errors ||= []
end

#fetch_interface(interface) ⇒ Object



45
46
47
# File 'lib/watir-webdriver/html/spec_extractor.rb', line 45

def fetch_interface(interface)
  @interfaces_by_name[interface] or raise InterfaceNotFound, "#{interface} not found in IDL"
end


40
41
42
43
# File 'lib/watir-webdriver/html/spec_extractor.rb', line 40

def print_hierarchy
  process if @interfaces.nil?
  sorter.print
end

#processObject



14
15
16
17
18
19
20
21
22
# File 'lib/watir-webdriver/html/spec_extractor.rb', line 14

def process
  download_and_parse
  extract_idl_parts
  extract_interface_map
  build_result
rescue
  p errors
  raise
end

#sorted_interfacesObject

returns a topoligically sorted array of WebIDL::Ast::Interface objects



32
33
34
35
36
37
38
# File 'lib/watir-webdriver/html/spec_extractor.rb', line 32

def sorted_interfaces
  process if @interfaces.nil?

  sorter.sort.map { |name|
    @interfaces.find { |i| i.name == name } or puts "ignoring interface: #{name}"
  }.compact
end