Skip to content

Commit

Permalink
Showing 3 changed files with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -3,9 +3,6 @@
# default ../jruby/bin/ruby won't work since activesupport is one more dir deeper
:jruby_truffle_path: '../../jruby/bin/jruby'
:setup:
:after:
# patches from truffle_bundle_path has to be loaded first
- 'echo "$:.unshift \"\#{path}/..\"" >> "#{options[:global][:truffle_bundle_path]}/bundler/setup.rb"'
:file:
shims.rb: |
require 'minitest'
2 changes: 0 additions & 2 deletions tool/truffle/jruby_truffle_runner/gem_configurations/psd.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
---
:setup:
:after:
- 'echo "$:.unshift \"\#{path}/..\"" >> "#{options[:global][:truffle_bundle_path]}/bundler/setup.rb"'
:file:
nokogiri.rb: nil
15 changes: 12 additions & 3 deletions tool/truffle/jruby_truffle_runner/lib/jruby+truffle_runner.rb
Original file line number Diff line number Diff line change
@@ -39,7 +39,9 @@ class JRubyTruffleRunner
'-J-agentlib:jdwp=transport=dt_socket,server=y,address=%d,suspend=y'],
truffle_bundle_path: ['--truffle-bundle-path NAME', 'Bundle path', assign_new_value, 'jruby+truffle_bundle'],
jruby_truffle_path: ['--jruby-truffle-path PATH', 'Path to JRuby+Truffle bin/jruby', assign_new_value,
'../jruby/bin/jruby']
'../jruby/bin/jruby'],
mock_load_path: ['--mock-load-path PATH', 'Root path for all mocks/monkey-patches which is prepended in $:',
assign_new_value, 'mocks']
},
setup: {
help: ['-h', '--help', 'Show this message', assign_new_value, false],
@@ -251,9 +253,16 @@ def subcommand_setup(rest)
FileUtils.rm link_path if File.exist? link_path
execute_cmd "ln -s #{bundle_path}/#{RUBY_ENGINE} #{link_path}"

mock_path = "#{bundle_path}/#{@options[:global][:mock_load_path]}"
FileUtils.mkpath mock_path

@options[:setup][:file].each do |name, content|
puts "creating file: #{name}" if verbose?
File.write "#{bundle_path}/#{name}", content
puts "creating file: #{mock_path}/#{name}" if verbose?
File.write "#{mock_path}/#{name}", content
end

File.open("#{bundle_path}/bundler/setup.rb", 'a') do |f|
f.write %[$:.unshift "\#{path}/../#{@options[:global][:mock_load_path]}"]
end

@options[:setup][:after].each do |cmd|

0 comments on commit 6bb6fe6

Please sign in to comment.