module Calabash::Cucumber

The base sub module for Calabash iOS

Constants

MIN_SERVER_VERSION

@!visibility public The minimum required version of the Calabash embedded server.

VERSION

@!visibility public The Calabash iOS gem version.

Public Class Methods

log_to_file(message) click to toggle source

!@visibility private

# File lib/calabash-cucumber/logging.rb, line 8
    def self.log_to_file(message)
      timestamp = self.timestamp

      begin
        File.open(self.calabash_log_file, "a:UTF-8") do |file|
          message.split($-0).each do |line|
            file.write("#{timestamp} #{line}#{$-0}")
          end
        end
      rescue => e
        message =
          %Q{Could not write:

#{message}

to calabash.log because:

#{e}
}
        RunLoop.log_debug(message)
      end
    end

Private Class Methods

calabash_log_file() click to toggle source

@!visibility private

# File lib/calabash-cucumber/logging.rb, line 46
def self.calabash_log_file
  path = File.join(self.logs_directory, "calabash.log")
  if !File.exist?(path)
    FileUtils.touch(path)
  end
  path
end
logs_directory() click to toggle source

@!visibility private

# File lib/calabash-cucumber/logging.rb, line 39
def self.logs_directory
  path = File.join(Calabash::Cucumber::DotDir.directory, "logs")
  FileUtils.mkdir_p(path)
  path
end
timestamp() click to toggle source

@!visibility private

# File lib/calabash-cucumber/logging.rb, line 34
def self.timestamp
  Time.now.strftime("%Y-%m-%d_%H-%M-%S")
end