Sha256: f65b5332379185eec5bb1906560af0aff53e592e1d1bd5e347c8c76f4e311575

Contents?: true

Size: 725 Bytes

Versions: 56

Compression:

Stored size: 725 Bytes

Contents

module Danger
  class Markdown
    attr_accessor :message, :file, :line

    def initialize(message, file = nil, line = nil)
      self.message = message
      self.file = file
      self.line = line
    end

    def ==(other)
      return false if other.nil?
      return false unless other.kind_of? self.class

      other.message == message &&
        other.file == file &&
        other.line == line
    end

    # @return [Boolean] returns true if is a file or line, false otherwise
    def inline?
      file || line
    end

    def to_s
      extra = []
      extra << "file: #{file}" unless file
      extra << "line: #{line}" unless line

      "Markdown #{message} { #{extra.join ', '.freeze} }"
    end
  end
end

Version data entries

56 entries across 56 versions & 1 rubygems

Version Path
danger-5.1.1 lib/danger/danger_core/messages/markdown.rb
danger-5.1.0 lib/danger/danger_core/messages/markdown.rb
danger-5.0.3 lib/danger/danger_core/messages/markdown.rb
danger-5.0.2 lib/danger/danger_core/messages/markdown.rb
danger-5.0.1 lib/danger/danger_core/messages/markdown.rb
danger-5.0.0 lib/danger/danger_core/messages/markdown.rb
danger-4.3.5 lib/danger/danger_core/messages/markdown.rb
danger-4.3.4 lib/danger/danger_core/messages/markdown.rb
danger-4.3.3 lib/danger/danger_core/messages/markdown.rb
danger-4.3.2 lib/danger/danger_core/messages/markdown.rb
danger-4.3.1 lib/danger/danger_core/messages/markdown.rb
danger-4.3.0 lib/danger/danger_core/messages/markdown.rb
danger-4.2.2 lib/danger/danger_core/messages/markdown.rb
danger-4.2.1 lib/danger/danger_core/messages/markdown.rb
danger-4.2.0 lib/danger/danger_core/messages/markdown.rb
danger-4.1.1 lib/danger/danger_core/messages/markdown.rb
danger-4.1.0 lib/danger/danger_core/messages/markdown.rb
danger-4.0.5 lib/danger/danger_core/messages/markdown.rb
danger-4.0.4 lib/danger/danger_core/messages/markdown.rb
danger-4.0.3 lib/danger/danger_core/messages/markdown.rb