Sha256: c64fe3738fea88bc060d902601ee2e57b42bc7287ea9242de648fcd461f4ada1
Contents?: true
Size: 742 Bytes
Versions: 46
Compression:
Stored size: 742 Bytes
Contents
module Danger class PrySetup def initialize(cork) @cork = cork end def setup_pry(dangerfile_path, command) return dangerfile_path if dangerfile_path.empty? validate_pry_available(command) FileUtils.cp dangerfile_path, DANGERFILE_COPY File.open(DANGERFILE_COPY, "a") do |f| f.write("\nbinding.pry; File.delete(\"#{DANGERFILE_COPY}\")") end DANGERFILE_COPY end private attr_reader :cork DANGERFILE_COPY = "_Dangerfile.tmp".freeze def validate_pry_available(command) Kernel.require "pry" rescue LoadError cork.warn "Pry was not found, and is required for 'danger #{command} --pry'." cork.print_warnings abort end end end
Version data entries
46 entries across 46 versions & 2 rubygems