Sha256: c0dfa2d4894fbc428fe73830ea1b0354ef1c7347afcbb4a80a8d6e361b55ad4a

Contents?: true

Size: 623 Bytes

Versions: 26

Compression:

Stored size: 623 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

26 entries across 26 versions & 1 rubygems

Version Path
sfn-3.0.28 lib/sfn/utils/debug.rb
sfn-3.0.26 lib/sfn/utils/debug.rb
sfn-3.0.24 lib/sfn/utils/debug.rb
sfn-3.0.22 lib/sfn/utils/debug.rb
sfn-3.0.20 lib/sfn/utils/debug.rb
sfn-3.0.18 lib/sfn/utils/debug.rb
sfn-3.0.16 lib/sfn/utils/debug.rb
sfn-3.0.14 lib/sfn/utils/debug.rb
sfn-3.0.12 lib/sfn/utils/debug.rb
sfn-3.0.10 lib/sfn/utils/debug.rb
sfn-3.0.8 lib/sfn/utils/debug.rb
sfn-3.0.6 lib/sfn/utils/debug.rb
sfn-3.0.4 lib/sfn/utils/debug.rb
sfn-3.0.2 lib/sfn/utils/debug.rb
sfn-3.0.0 lib/sfn/utils/debug.rb
sfn-2.2.0 lib/sfn/utils/debug.rb
sfn-2.1.12 lib/sfn/utils/debug.rb
sfn-2.1.10 lib/sfn/utils/debug.rb
sfn-2.1.8 lib/sfn/utils/debug.rb
sfn-2.1.6 lib/sfn/utils/debug.rb