Class: Watir::Generator::Base::SpecExtractor
- Inherits:
-
Object
- Object
- Watir::Generator::Base::SpecExtractor
show all
- Defined in:
- lib/watir-webdriver/generator/base/spec_extractor.rb
Defined Under Namespace
Classes: InterfaceNotFound
Constant Summary
collapse
- IDL_SELECTOR =
"//pre[@class='idl']"
Instance Method Summary
collapse
Constructor Details
Returns a new instance of SpecExtractor.
9
10
11
|
# File 'lib/watir-webdriver/generator/base/spec_extractor.rb', line 9
def initialize(uri)
@uri = uri
end
|
Instance Method Details
24
25
26
|
# File 'lib/watir-webdriver/generator/base/spec_extractor.rb', line 24
def errors
@errors ||= []
end
|
#fetch_interface(interface) ⇒ Object
45
46
47
|
# File 'lib/watir-webdriver/generator/base/spec_extractor.rb', line 45
def fetch_interface(interface)
@interfaces_by_name[interface] or raise InterfaceNotFound, "#{interface} not found in IDL"
end
|
#print_hierarchy ⇒ Object
40
41
42
43
|
# File 'lib/watir-webdriver/generator/base/spec_extractor.rb', line 40
def print_hierarchy
process if @interfaces.nil?
sorter.print
end
|
13
14
15
16
17
18
19
20
21
22
|
# File 'lib/watir-webdriver/generator/base/spec_extractor.rb', line 13
def process
download_and_parse
drop_issued_interfaces
build_result
rescue
p errors
raise
end
|
#sorted_interfaces ⇒ Object
returns a topoligically sorted array of WebIDL::Ast::Interface objects
32
33
34
35
36
37
38
|
# File 'lib/watir-webdriver/generator/base/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
|