Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
seleniumhq
GitHub Repository: seleniumhq/selenium
Path: blob/trunk/rake_tasks/selenium_rake/ie_generator.rb
2884 views
1
# frozen_string_literal: true
2
3
# This file auto-generates code for the IE driver. To make different language
4
# bindings easier to maintain, it generates code for mapping numeric return
5
# type identifiers (returned from wdGetScriptResultType) to a meaningful
6
# string identifier.
7
module SeleniumRake
8
class IEGenerator
9
include Rake::DSL
10
11
def generate_type_mapping(args)
12
types_mapping_file = args[:src]
13
generated_file = args[:out].to_s
14
15
file generated_file => args[:src] do
16
generator = TypeDefinitionsGenerator.new types_mapping_file
17
method_name = "generate_#{args[:type]}_definitions"
18
if generator.respond_to?(method_name)
19
generator.send(method_name, generated_file)
20
else
21
puts "Cannot generate definitions for #{args[:type]}"
22
end
23
end
24
25
task args[:name].to_s => generated_file
26
end
27
end
28
end
29
30