Sha256: d2dac0e64869968714a98ac4303958b5af11ade5fa459773b5e0c68b96b8c957

Contents?: true

Size: 565 Bytes

Versions: 17

Compression:

Stored size: 565 Bytes

Contents

# frozen_string_literal: true

require "refinements/arrays"

module Pennyworth
  module Presenters
    # Renders a standard error into a compatible format for use in Alfred script filters.
    class StandardError
      using Refinements::Arrays

      def initialize record
        @record = record
      end

      def id = label

      def label = record.name.to_s

      def path = file_path.empty? ? "" : [file_path, record.line_number].compress.join(":")

      private

      attr_reader :record

      def file_path = record.file_path.to_s
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
pennyworth-15.4.1 lib/pennyworth/presenters/standard_error.rb
pennyworth-15.4.0 lib/pennyworth/presenters/standard_error.rb
pennyworth-15.3.0 lib/pennyworth/presenters/standard_error.rb
pennyworth-15.2.0 lib/pennyworth/presenters/standard_error.rb
pennyworth-15.1.1 lib/pennyworth/presenters/standard_error.rb
pennyworth-15.1.0 lib/pennyworth/presenters/standard_error.rb
pennyworth-15.0.3 lib/pennyworth/presenters/standard_error.rb
pennyworth-15.0.2 lib/pennyworth/presenters/standard_error.rb
pennyworth-15.0.1 lib/pennyworth/presenters/standard_error.rb
pennyworth-15.0.0 lib/pennyworth/presenters/standard_error.rb
pennyworth-14.3.0 lib/pennyworth/presenters/standard_error.rb
pennyworth-14.2.1 lib/pennyworth/presenters/standard_error.rb
pennyworth-14.2.0 lib/pennyworth/presenters/standard_error.rb
pennyworth-14.1.2 lib/pennyworth/presenters/standard_error.rb
pennyworth-14.1.1 lib/pennyworth/presenters/standard_error.rb
pennyworth-14.1.0 lib/pennyworth/presenters/standard_error.rb
pennyworth-14.0.0 lib/pennyworth/presenters/standard_error.rb