class Danger::PrySetup
Constants
- DANGERFILE_COPY
Attributes
cork[R]
Public Class Methods
new(cork)
click to toggle source
# File lib/danger/commands/local_helpers/pry_setup.rb, line 3 def initialize(cork) @cork = cork end
Public Instance Methods
setup_pry(dangerfile_path, command)
click to toggle source
# File lib/danger/commands/local_helpers/pry_setup.rb, line 7 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 Instance Methods
validate_pry_available(command)
click to toggle source
# File lib/danger/commands/local_helpers/pry_setup.rb, line 24 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