Sha256: fe371125ad671233d21b6ff693e85d8706ff6f1a70e3826938a53f668f76896c

Contents?: true

Size: 854 Bytes

Versions: 2

Compression:

Stored size: 854 Bytes

Contents

module WatchmonkeyCli
  module Checkers
    class DevPry < Checker
      self.checker_name = "dev_pry"
      self.maxrt = false

      def enqueue host, opts = {}
        host = app.fetch_connection(:loopback, :local) if !host || host == :local
        host = app.fetch_connection(:ssh, host) if host.is_a?(Symbol)
        app.enqueue(self, host, opts)
      end

      def check! result, host, opts = {}
        if app.opts[:threads] > 1
          result.error! "pry only works properly within the main thread, run watchmonkey with `-t0`"
          return
        end

        begin
          require "pry"
          binding.pry
          1+1 # pry may bug out otherwise if it's last statement
        rescue LoadError => ex
          result.error! "pry is required (gem install pry)! #{ex.class}: #{ex.message}"
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
watchmonkey_cli-1.12.0 lib/watchmonkey_cli/checkers/dev_pry.rb
watchmonkey_cli-1.11.0 lib/watchmonkey_cli/checkers/dev_pry.rb