Sha256: 8cc390040f7428101014d130c2bb1972f780023c96af4c94e98190b6b007b008
Contents?: true
Size: 706 Bytes
Versions: 69
Compression:
Stored size: 706 Bytes
Contents
module Danger class PrySetup def initialize(cork) @cork = cork end def setup_pry(dangerfile_path) return dangerfile_path if dangerfile_path.empty? validate_pry_available 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 Kernel.require "pry" rescue LoadError cork.warn "Pry was not found, and is required for 'danger pr --pry'." cork.print_warnings abort end end end
Version data entries
69 entries across 69 versions & 1 rubygems