Sha256: 4292b1cda64328bc4bf266ee6701981b177919a4ad868585966d2eaeaff4d8b0

Contents?: true

Size: 1.02 KB

Versions: 8

Compression:

Stored size: 1.02 KB

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 defined?(RUBYMOTION_ENV) && RUBYMOTION_ENV == "test"
        PM.logger.deprecated "ProMotion::Console.log is deprecated. Use PM.logger (see README)"
        puts color[0] + NAME + log + color[1]
      end

      def log(log, withColor:color)
        return if defined?(RUBYMOTION_ENV) && RUBYMOTION_ENV == "test"
        PM.logger.deprecated "ProMotion::Console.log is deprecated. Use PM.logger (see README)"
        self.log(log, with_color:color)
      end

      def log(log)
        return if defined?(RUBYMOTION_ENV) && RUBYMOTION_ENV == "test"
        PM.logger.deprecated "ProMotion::Console.log is deprecated. Use PM.logger (see README)"
        log(log, with_color: DEFAULT_COLOR)
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
ProMotion-0.7.8 lib/ProMotion/helpers/console.rb
ProMotion-0.7.6 lib/ProMotion/helpers/console.rb
ProMotion-0.7.5 lib/ProMotion/helpers/console.rb
ProMotion-0.7.4 lib/ProMotion/helpers/console.rb
ProMotion-0.7.3 lib/ProMotion/helpers/console.rb
ProMotion-0.7.2 lib/ProMotion/helpers/console.rb
ProMotion-0.7.1 lib/ProMotion/helpers/console.rb
ProMotion-0.7.0 lib/ProMotion/helpers/console.rb