Sha256: 49a57556d2ea8ea73a4688d470143103396c7733b33f5860188b0102a7315ac4

Contents?: true

Size: 780 Bytes

Versions: 21

Compression:

Stored size: 780 Bytes

Contents

module Calabash
  module Cucumber
    # @!visibility private
    class LogTailer

      # @!visibility private
      def self.tail_in_terminal(path)
        if !File.exist?(path)
          raise RuntimeError, %Q[
Cannot tail a file that does not exist:

#{path}

]
        end

        term_part = %Q[xcrun osascript -e 'tell application "Terminal" to do script]
        tail_part = %Q["tail -n 10000 -F #{path} | grep -v \\"Default: \\\\*\\""']
        cmd = "#{term_part} #{tail_part}"

        if !LogTailer.run_command(cmd)
          raise RuntimeError, %Q[
Could not tail file:

#{path}

with command:

#{cmd}

]
        end

        true
      end

      private

      # @!visibility private
      def self.run_command(cmd)
        system(cmd)
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
calabash-cucumber-0.23.7 lib/calabash-cucumber/log_tailer.rb
calabash-cucumber-0.23.6 lib/calabash-cucumber/log_tailer.rb
calabash-cucumber-0.23.5 lib/calabash-cucumber/log_tailer.rb
calabash-cucumber-0.23.4 lib/calabash-cucumber/log_tailer.rb
calabash-cucumber-0.23.3 lib/calabash-cucumber/log_tailer.rb
calabash-cucumber-0.23.2 lib/calabash-cucumber/log_tailer.rb
calabash-cucumber-0.23.1 lib/calabash-cucumber/log_tailer.rb
calabash-cucumber-0.23.0 lib/calabash-cucumber/log_tailer.rb
calabash-cucumber-0.22.2 lib/calabash-cucumber/log_tailer.rb
calabash-cucumber-0.21.10 lib/calabash-cucumber/log_tailer.rb
calabash-cucumber-0.21.8 lib/calabash-cucumber/log_tailer.rb
calabash-cucumber-0.21.7 lib/calabash-cucumber/log_tailer.rb
calabash-cucumber-0.21.6 lib/calabash-cucumber/log_tailer.rb
calabash-cucumber-0.21.5 lib/calabash-cucumber/log_tailer.rb
calabash-cucumber-0.21.4 lib/calabash-cucumber/log_tailer.rb
calabash-cucumber-0.21.2 lib/calabash-cucumber/log_tailer.rb
calabash-cucumber-0.21.1 lib/calabash-cucumber/log_tailer.rb
calabash-cucumber-0.20.5 lib/calabash-cucumber/log_tailer.rb
calabash-cucumber-0.20.4 lib/calabash-cucumber/log_tailer.rb
calabash-cucumber-0.20.3 lib/calabash-cucumber/log_tailer.rb