Skip to content

Commit

Permalink
fix: ensure bundle install for pact_broker:dev:setup uses correct Gem…
Browse files Browse the repository at this point in the history
…file

Closes: #243
  • Loading branch information
bethesque committed Oct 23, 2018
1 parent 2e9c32a commit 94f3a5f
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions tasks/development.rake
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@

desc 'Set up a dev instance of the Pact Broker'
task 'pact_broker:dev:setup' do
puts "Copying example directory"
FileUtils.cp_r 'example', 'dev'
gemfile_contents = File.read('dev/Gemfile')


puts "Changing source of pact_broker gem from rubygems.org to local file system"
new_gemfile_contents = gemfile_contents.gsub(/^.*gem.*pact_broker.*$/, "gem 'pact_broker', path: '../'")
File.open('dev/Gemfile', "w") { |file| file << new_gemfile_contents }
bundle_install = "BUNDLE_GEMFILE=dev/Gemfile bundle install"
puts bundle_install
puts `#{bundle_install}`

Dir.chdir("dev") do
Bundler.with_clean_env do
puts "Executing bundle install"
puts `bundle install`
end
end
end

0 comments on commit 94f3a5f

Please sign in to comment.