Module: Removers
- Defined in:
- lib/tasks/helpers/removers.rb
Overview
This file is distributed under New Relic’s license terms. See github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details. frozen_string_literal: true
Instance Method Summary collapse
- #remove_generated_gemfile_lockfiles ⇒ Object
- #remove_generated_gemfiles ⇒ Object
- #remove_local_multiverse_databases ⇒ Object
Instance Method Details
#remove_generated_gemfile_lockfiles ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/tasks/helpers/removers.rb', line 26 def remove_generated_gemfile_lockfiles file_path = File.('test/environments') Dir.glob(File.join(file_path, '**', 'Gemfile.lock')).each do |fn| puts "Removing #{fn.gsub(file_path, '.../environments')}" FileUtils.rm(fn) end end |
#remove_generated_gemfiles ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/tasks/helpers/removers.rb', line 18 def remove_generated_gemfiles file_path = File.('test/multiverse/suites') Dir.glob(File.join(file_path, '**', 'Gemfile*')).each do |fn| puts "Removing #{fn.gsub(file_path, '.../suites')}" FileUtils.rm(fn) end end |
#remove_local_multiverse_databases ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/tasks/helpers/removers.rb', line 6 def remove_local_multiverse_databases list_databases_command = %(echo "show databases" | mysql -u root) databases = `#{list_databases_command}`.chomp!.split("\n").select { |s| s.include?('multiverse') } databases.each do |database| puts "Dropping #{database}" `echo "drop database #{database}" | mysql -u root` end rescue => error puts 'ERROR: Cannot get MySQL databases...' puts error. end |