Class: Watir::Generator::Base::SpecExtractor
- Inherits:
-
Object
- Object
- Watir::Generator::Base::SpecExtractor
show all
- Defined in:
- lib/watir/generator/base/spec_extractor.rb
Defined Under Namespace
Classes: InterfaceNotFound
Constant Summary
collapse
- IDL_SELECTOR =
"//pre[contains(@class, 'idl')]"
Instance Method Summary
collapse
Constructor Details
Returns a new instance of SpecExtractor.
11
12
13
|
# File 'lib/watir/generator/base/spec_extractor.rb', line 11
def initialize(uri)
@uri = uri
end
|
Instance Method Details
26
27
28
|
# File 'lib/watir/generator/base/spec_extractor.rb', line 26
def errors
@errors ||= []
end
|
#fetch_interface(interface) ⇒ Object
47
48
49
|
# File 'lib/watir/generator/base/spec_extractor.rb', line 47
def fetch_interface(interface)
@interfaces_by_name[interface] || raise(InterfaceNotFound, "#{interface} not found in IDL")
end
|
#print_hierarchy ⇒ Object
42
43
44
45
|
# File 'lib/watir/generator/base/spec_extractor.rb', line 42
def print_hierarchy
process if @interfaces.nil?
idl_sorter.print
end
|
15
16
17
18
19
20
21
22
23
24
|
# File 'lib/watir/generator/base/spec_extractor.rb', line 15
def process
download_and_parse
drop_issued_interfaces
build_result
rescue StandardError
p errors
raise
end
|
#sorted_interfaces ⇒ Object
returns a topoligically sorted array of WebIDL::Ast::Interface objects
34
35
36
37
38
39
40
|
# File 'lib/watir/generator/base/spec_extractor.rb', line 34
def sorted_interfaces
process if @interfaces.nil?
idl_sorter.sort.filter_map do |name|
@interfaces.find { |i| i.name == name } || puts("ignoring interface: #{name}")
end
end
|