@@ -1125,8 +1125,8 @@ def has_opaques_with_templates?
11251125 attr_reader :local_loads_symlinks
11261126
11271127 # Handle a load that points to a file in this typekit's source tree
1128- def handle_local_load ( file )
1129- rel = Pathname . new ( file ) . relative_path_from ( Pathname . new ( base_dir ) )
1128+ def handle_local_load ( file , relative_path_from : base_dir )
1129+ rel = Pathname . new ( file ) . relative_path_from ( Pathname . new ( relative_path_from ) )
11301130 return file if rel . each_filename . first == ".."
11311131
11321132 # If the type is within a subdirectory called as the
@@ -1166,11 +1166,7 @@ def handle_local_load(file)
11661166 # the exact offsets for all the fields in the structures).
11671167 #
11681168 # @raises LoadError if the file does not exist
1169- def load ( file , add = true , user_options = Hash . new )
1170- if !user_options . respond_to? ( :to_hash )
1171- raise ArgumentError , "expected an option has as third argument, got #{ user_options . inspect } "
1172- end
1173-
1169+ def load ( file , add = true , relative_path_from : base_dir , **user_options )
11741170 if match = /(\w +)\/ Types\. hpp$/ . match ( file )
11751171 project_name = match [ 1 ]
11761172 if project . has_typekit? ( project_name ) || project . name == project_name
@@ -1184,7 +1180,7 @@ def load(file, add = true, user_options = Hash.new)
11841180 # Get the full path for +file+
11851181 if File . file? ( file ) # Local file
11861182 file = File . expand_path ( file )
1187- include_statement = handle_local_load ( file )
1183+ include_statement = handle_local_load ( file , relative_path_from : relative_path_from )
11881184 else # File from used libraries/task libraries
11891185 dir = include_dirs . find { |dir | File . file? ( File . join ( dir , file ) ) }
11901186 if !dir
@@ -1808,7 +1804,7 @@ def handle_opaques_generation(generated_types)
18081804 render_template 'typekit' , 'marshalling_types.hpp' , binding
18091805
18101806 path = save_automatic_public_header "m_types" , "#{ type . method_name ( true ) } .hpp" , marshalling_code
1811- self . load ( path , true , options )
1807+ self . load ( path , true , relative_path_from : automatic_public_header_dir , ** options )
18121808
18131809 m_type = intermediate_type_for ( type )
18141810 copy_metadata_to_intermediate_type ( type . metadata , m_type . metadata )
0 commit comments