Sha256: e7ecf658f492df9041ff21593393b6452a418ae9e71849ca7ac3860e84f45b7b

Contents?: true

Size: 763 Bytes

Versions: 5

Compression:

Stored size: 763 Bytes

Contents

module Cucover
  module CliCommands
    class ShowRecordings
      def initialize(cli_args)
        @store = Store.new
      end
      
      def execute
        unless recordings.any?
          puts "No recordings to show. Run some tests with cucover first."
          return
        end
        
        recordings.each do |recording|
          puts
          puts "#{recording.file_colon_line}" # (#{recording.start_time.strftime('%Y-%m-%d %H:%M:%S')})
          recording.covered_files.each do |covered_file|
            puts "  #{covered_file.to_s}"
          end
        end
        puts
      end
      
      def recordings
        @recordings ||= @store.latest_recordings.sort{ |x, y| x.file_colon_line <=> y.file_colon_line }
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
mattwynne-cucover-0.1.0 lib/cucover/cli_commands/show_recordings.rb
mattwynne-cucover-0.1.1 lib/cucover/cli_commands/show_recordings.rb
cucover-0.1.4 lib/cucover/cli_commands/show_recordings.rb
cucover-0.1.3 lib/cucover/cli_commands/show_recordings.rb
cucover-0.1.2 lib/cucover/cli_commands/show_recordings.rb