Sha256: dbe17dd510e9e538b575812dccf930af6a32ce61403c4a3beac3656371d493bf

Contents?: true

Size: 621 Bytes

Versions: 6

Compression:

Stored size: 621 Bytes

Contents

require "sfn"

module Sfn
  module Utils
    # Debug helpers
    module Debug
      # Output helpers
      module Output
        # Write debug message
        #
        # @param msg [String]
        def debug(msg)
          if ENV["DEBUG"] || (respond_to?(:config) && config[:debug])
            puts "<sfn - debug>: #{msg}"
          end
        end
      end

      class << self
        # Load module into class
        #
        # @param klass [Class]
        def included(klass)
          klass.class_eval do
            include Output
            extend Output
          end
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
sfn-3.1.8 lib/sfn/utils/debug.rb
sfn-3.1.6 lib/sfn/utils/debug.rb
sfn-3.1.4 lib/sfn/utils/debug.rb
sfn-3.1.2 lib/sfn/utils/debug.rb
sfn-3.1.0 lib/sfn/utils/debug.rb
sfn-3.0.32 lib/sfn/utils/debug.rb