@@ -48,21 +48,31 @@ def initialize(name, root_dir, run_dir, feature_file, mapper_files_dir, csv_file
4848 # Require all simulation mappers in mapper_files_dir
4949 def load_mapper_files
5050 # loads default values from extension gem
51- options = OpenStudio ::Extension ::RunnerConfig . default_config
51+ @ options = OpenStudio ::Extension ::RunnerConfig . default_config ( @root_dir )
5252 # check if runner.conf file exists
5353 if File . exist? ( File . join ( @root_dir , OpenStudio ::Extension ::RunnerConfig ::FILENAME ) )
5454 runner_config = OpenStudio ::Extension ::RunnerConfig . new ( @root_dir )
55- # use the default values overriden with runner.conf values
56- options = options . merge ( runner_config . options )
55+ # use the default values overridden with runner.conf values where not
56+ # nil nor empty strings
57+ @options = @options . merge ( runner_config . options . reject { |k , v | v . nil? || ( v . kind_of? ( String ) && v === '' ) } )
5758 end
5859
5960 # bundle path is assigned from the runner.conf if it exists or is assigned in the root_dir
60- bundle_path = !options . key? ( :bundle_install_path ) || options [ :bundle_install_path ] === '' ? File . join ( @root_dir , '.bundle/install/' ) : options [ :bundle_install_path ]
61+ # if bundle install path is not provided or is empty, it will be placed in root_dir/.bundle/install, otherwise use the provided path
62+ if !@options . key? ( :bundle_install_path ) || @options [ :bundle_install_path ] === ''
63+ @options [ :bundle_install_path ] = File . join ( @root_dir , '.bundle/install/' )
64+ else
65+ @options [ :bundle_install_path ] = Pathname . new ( @options [ :bundle_install_path ] ) . cleanpath . to_s
66+ end
67+ bundle_path = @options [ :bundle_install_path ]
68+
69+ puts "Bundle final path is set to: #{ bundle_path } "
6170
6271 # checks if bundle path doesn't exist or is empty
6372 if !Dir . exist? ( bundle_path ) || Dir . empty? ( bundle_path )
64- # install bundle
65- OpenStudio ::Extension ::Runner . new ( @root_dir )
73+ Bundler . with_unbundled_env do
74+ OpenStudio ::Extension ::Runner . new ( @root_dir , [ ] , @options )
75+ end
6676 end
6777
6878 # find all lib dirs in the bundle path and add them to the path
0 commit comments