Sha256: dde9dff03bcf5bdfff6997e61958e3cf47af50444061f6a1edaeb5495d98ced1

Contents?: true

Size: 424 Bytes

Versions: 9

Compression:

Stored size: 424 Bytes

Contents

# frozen_string_literal: true

require 'dotenv/load'

PERCY_LOGLEVEL = ENV['PERCY_LOGLEVEL']
PERCY_DEBUG = PERCY_LOGLEVEL == 'debug'
LABEL = "[\e[35m#{PERCY_DEBUG ? 'percy:ruby' : 'percy'}\e[39m]"

def log(message, on_debug: nil)
  return unless on_debug.nil? || (on_debug.is_a?(TrueClass) && PERCY_DEBUG)

  puts "#{LABEL} #{message}"
end

def hashed(object)
  return object.as_json unless object.is_a?(Hash)

  object
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
percy-appium-app-0.0.6 percy/common/common.rb
percy-appium-app-0.0.5 percy/common/common.rb
percy-appium-app-0.0.5.pre.beta.1 percy/common/common.rb
percy-appium-app-0.0.5.pre.beta.0 percy/common/common.rb
percy-appium-app-0.0.4 percy/common/common.rb
percy-appium-app-0.0.2.pre.beta.0 percy/common/common.rb
percy-appium-app-0.0.3 percy/common/common.rb
percy-appium-app-0.0.2 percy/common/common.rb
percy-appium-app-0.0.1 percy/common/common.rb