Sha256: 1f607f687d85c75ec255c272a03b5f9d5bba01c020a32027c650e2cceaa8eac2

Contents?: true

Size: 783 Bytes

Versions: 1

Compression:

Stored size: 783 Bytes

Contents

module ProMotion
  class Console
    NAME = "RubyMotion::Console: "
    DEFAULT_COLOR = [ '', '' ]
    RED_COLOR = [ "\e[0;31m", "\e[0m" ] # Must be in double quotes
    GREEN_COLOR = [ "\e[0;32m", "\e[0m" ] 
    PURPLE_COLOR = [ "\e[0;35m", "\e[0m" ] 

    class << self
      def log(log, with_color:color)
        return if RUBYMOTION_ENV == "test"
        puts color[0] + NAME + log + color[1]
      end
      
      def log(log, withColor:color)
        return if RUBYMOTION_ENV == "test"
        warn "[DEPRECATION] `log(log, withColor:color)` is deprecated. Use `log(log, with_color:color)`"
        self.log(log, with_color:color)
      end

      def log(log)
        return if RUBYMOTION_ENV == "test"
        log(log, with_color: DEFAULT_COLOR)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ProMotion-0.5.2 lib/ProMotion/helpers/console.rb