Sha256: 30fb886d741f0a35ab18f1db10f614f081e682125a6a0d8d8bbf17bca78ea95d

Contents?: true

Size: 1.05 KB

Versions: 26

Compression:

Stored size: 1.05 KB

Contents

module IRT
  module Commands
    module Log

      def log(limit=nil)
        ensure_session
        IRT.log.print limit || IRT.log.tail_size
        IRT.log.print_status
      end
      alias_method :l, :log

      def full_log
        ensure_session
        IRT.log.print
        IRT.log.print_status
      end
      alias_method :ll, :full_log

      def status
        ensure_session
        IRT.log.print_status
      end
      alias_method :ss, :status

      def print_lines
        ensure_session
        lines_str = IRT.log.last.lines_str
        return if lines_str.empty?
        puts
        puts lines_str
        puts
      end
      alias_method :pl, :print_lines

      def print_all_lines
        ensure_session
        lines = []
        IRT.log.reject{|h| h.class == IRT::Log::FileHunk }.each do |h|
          ls = h.lines_str
          lines << ls unless ls.empty?
        end
        unless lines.empty?
          puts
          puts lines.join("\n\n")
          puts
        end
      end
      alias_method :pll, :print_all_lines

    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
irt-1.3.3 lib/irt/commands/log.rb
irt-1.3.2 lib/irt/commands/log.rb
irt-1.3.1 lib/irt/commands/log.rb
irt-1.3.0 lib/irt/commands/log.rb
irt-1.2.12 lib/irt/commands/log.rb
irt-1.2.11 lib/irt/commands/log.rb
irt-1.2.10 lib/irt/commands/log.rb
irt-1.2.9 lib/irt/commands/log.rb
irt-1.2.8 lib/irt/commands/log.rb
irt-1.2.7 lib/irt/commands/log.rb
irt-1.2.6 lib/irt/commands/log.rb
irt-1.2.5 lib/irt/commands/log.rb
irt-1.2.4 lib/irt/commands/log.rb
irt-1.2.3 lib/irt/commands/log.rb
irt-1.2.2 lib/irt/commands/log.rb
irt-1.2.1 lib/irt/commands/log.rb
irt-1.2.0 lib/irt/commands/log.rb
irt-1.2.0.p02 lib/irt/commands/log.rb
irt-1.2.0.p01 lib/irt/commands/log.rb
irt-1.1.7 lib/irt/commands/log.rb