diff options
author | Stuart Preston <stuart@chef.io> | 2018-06-23 22:50:19 +0100 |
---|---|---|
committer | Stuart Preston <stuart@chef.io> | 2018-06-23 22:50:19 +0100 |
commit | acb4c6adc451ff72eab8512bafe63fb16ea22856 (patch) | |
tree | 35520593cea4c17ab9b9abbfe19c8ab6d8be0b25 /Gemfile | |
parent | eaac3e8f2fb695b47cde9b595e87d83e3b23d984 (diff) | |
download | chef-acb4c6adc451ff72eab8512bafe63fb16ea22856.tar.gz |
Move bindir copy logic into Gemfile to be used by Bundler
Signed-off-by: Stuart Preston <stuart@chef.io>
Diffstat (limited to 'Gemfile')
-rw-r--r-- | Gemfile | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -65,3 +65,17 @@ instance_eval(ENV["GEMFILE_MOD"]) if ENV["GEMFILE_MOD"] # If you want to load debugging tools into the bundle exec sandbox, # add these additional dependencies into Gemfile.local eval_gemfile(__FILE__ + ".local") if File.exist?(__FILE__ + ".local") + +# These lines added for Windows development only. +# For FFI to call into PowerShell we need the binaries and assemblies located +# in the Ruby bindir. +# +# We copy (and overwrite) these files every time "bundle <exec|install>" is +# executed, just in case they have changed. +if RUBY_PLATFORM =~ /mswin|mingw|windows/ + instance_eval do + ruby_exe_dir = RbConfig::CONFIG["bindir"] + assemblies = Dir.glob(File.expand_path("distro/ruby_bin_folder", Dir.pwd) + "/*.dll") + FileUtils.cp_r assemblies, ruby_exe_dir + end +end |