Sha256: 2fb7b59f7ea5dfd2df797218b3dc5c5158e618ed3f8cb9b42a5b4f9cbc9a2162

Contents?: true

Size: 864 Bytes

Versions: 91

Compression:

Stored size: 864 Bytes

Contents

# Copyright (c) 2015 Sqreen. All Rights Reserved.
# Please refer to our terms for more information: https://www.sqreen.io/terms.html

require 'sqreen/rule_callback'

module Sqreen
  module Rules
    class InspectRuleCB < RuleCB
      def pre(_inst, *args, &_block)
        Sqreen.log.debug { "<< #{@klass} #{@method} #{Thread.current}" }
        Sqreen.log.debug { args.map(&:inspect).join(' ') }
      end

      def post(rv, _inst, *_args, &_block)
        Sqreen.log.debug { ">> #{rv.inspect} #{@klass} #{@method} #{Thread.current}" }
        byebug if defined? byebug && @data.is_a?(Hash) && @data[:break] == 1
      end

      def failing(rv, _inst, *_args, &_block)
        Sqreen.log.debug { "># #{rv.inspect} #{@klass} #{@method} #{Thread.current}" }
        byebug if defined? byebug && @data.is_a?(Hash) && @data[:break] == 1
      end
    end
  end
end

Version data entries

91 entries across 91 versions & 2 rubygems

Version Path
sqreen-1.11.0-java lib/sqreen/rules_callbacks/inspect_rule.rb
sqreen-alt-1.11.0 lib/sqreen/rules_callbacks/inspect_rule.rb
sqreen-1.11.0 lib/sqreen/rules_callbacks/inspect_rule.rb
sqreen-1.10.5-java lib/sqreen/rules_callbacks/inspect_rule.rb
sqreen-alt-1.10.5 lib/sqreen/rules_callbacks/inspect_rule.rb
sqreen-1.10.5 lib/sqreen/rules_callbacks/inspect_rule.rb
sqreen-1.10.4-java lib/sqreen/rules_callbacks/inspect_rule.rb
sqreen-alt-1.10.4 lib/sqreen/rules_callbacks/inspect_rule.rb
sqreen-1.10.4 lib/sqreen/rules_callbacks/inspect_rule.rb
sqreen-1.10.3-java lib/sqreen/rules_callbacks/inspect_rule.rb
sqreen-alt-1.10.3 lib/sqreen/rules_callbacks/inspect_rule.rb
sqreen-1.10.3 lib/sqreen/rules_callbacks/inspect_rule.rb
sqreen-1.10.2-java lib/sqreen/rules_callbacks/inspect_rule.rb
sqreen-alt-1.10.2 lib/sqreen/rules_callbacks/inspect_rule.rb
sqreen-1.10.2 lib/sqreen/rules_callbacks/inspect_rule.rb
sqreen-1.10.1-java lib/sqreen/rules_callbacks/inspect_rule.rb
sqreen-alt-1.10.1 lib/sqreen/rules_callbacks/inspect_rule.rb
sqreen-1.10.1 lib/sqreen/rules_callbacks/inspect_rule.rb
sqreen-1.10.0-java lib/sqreen/rules_callbacks/inspect_rule.rb
sqreen-alt-1.10.0 lib/sqreen/rules_callbacks/inspect_rule.rb