class Milestoner::Views::Parts::Tag

The tag presentation logic.

Public Instance Methods

avatar_url(user) click to toggle source
# File lib/milestoner/views/parts/tag.rb, line 18
def avatar_url user
  warn "`#{self.class}##{__method__}` is deprecated, use user scope instead.",
       category: :deprecated

  format settings.avatar_uri, id: user.external_id
end
commit_count(= value.commits.size) click to toggle source
# File lib/milestoner/views/parts/tag.rb, line 25
def commit_count = value.commits.size

def committed_at fallback: Time.now
  value.committed_at.then { |at| at ? Time.at(at) : fallback }
end

def committed_date = committed_at.strftime "%Y-%m-%d"

def committed_datetime = committed_at.strftime "%Y-%m-%dT%H:%M:%S%z"

def deletion_count = value.commits.sum(&:deletions)

def empty? = value.commits.empty?

def profile_url user
  warn "`#{self.class}##{__method__}` is deprecated, use user scope instead.",
       category: :deprecated

  format settings.profile_uri, id: user.handle
end

def file_count = value.commits.sum(&:files_changed)

def insertion_count = value.commits.sum(&:insertions)

def security = value.signature ? "🔒 Tag (secure)" : "🔓 Tag (insecure)"

def total_commits = commit_count.then { |total| "#{total} commit".pluralize "s", total }

def total_files = file_count.then { |total| "#{total} file".pluralize "s", total }

def total_deletions
  deletion_count.then { |total| "#{total} deletion".pluralize "s", total }
end

def total_insertions
  insertion_count.then { |total| "#{total} insertion".pluralize "s", total }
end

def uri = format settings.project_uri_version, id: 
committed_at(fallback: Time.now) click to toggle source
# File lib/milestoner/views/parts/tag.rb, line 27
def committed_at fallback: Time.now
  value.committed_at.then { |at| at ? Time.at(at) : fallback }
end
committed_date(= committed_at.strftime "%Y-%m-%d") click to toggle source
# File lib/milestoner/views/parts/tag.rb, line 31
def committed_date = committed_at.strftime "%Y-%m-%d"

def committed_datetime = committed_at.strftime "%Y-%m-%dT%H:%M:%S%z"

def deletion_count = value.commits.sum(&:deletions)

def empty? = value.commits.empty?

def profile_url user
  warn "`#{self.class}##{__method__}` is deprecated, use user scope instead.",
       category: :deprecated

  format settings.profile_uri, id: user.handle
end

def file_count = value.commits.sum(&:files_changed)

def insertion_count = value.commits.sum(&:insertions)

def security = value.signature ? "🔒 Tag (secure)" : "🔓 Tag (insecure)"

def total_commits = commit_count.then { |total| "#{total} commit".pluralize "s", total }

def total_files = file_count.then { |total| "#{total} file".pluralize "s", total }

def total_deletions
  deletion_count.then { |total| "#{total} deletion".pluralize "s", total }
end

def total_insertions
  insertion_count.then { |total| "#{total} insertion".pluralize "s", total }
end

def uri = format settings.project_uri_version, id: value.
committed_datetime(= committed_at.strftime "%Y-%m-%dT%H:%M:%S%z") click to toggle source
# File lib/milestoner/views/parts/tag.rb, line 33
def committed_datetime = committed_at.strftime "%Y-%m-%dT%H:%M:%S%z"

def deletion_count = value.commits.sum(&:deletions)

def empty? = value.commits.empty?

def profile_url user
  warn "`#{self.class}##{__method__}` is deprecated, use user scope instead.",
       category: :deprecated

  format settings.profile_uri, id: user.handle
end

def file_count = value.commits.sum(&:files_changed)

def insertion_count = value.commits.sum(&:insertions)

def security = value.signature ? "🔒 Tag (secure)" : "🔓 Tag (insecure)"

def total_commits = commit_count.then { |total| "#{total} commit".pluralize "s", total }

def total_files = file_count.then { |total| "#{total} file".pluralize "s", total }

def total_deletions
  deletion_count.then { |total| "#{total} deletion".pluralize "s", total }
end

def total_insertions
  insertion_count.then { |total| "#{total} insertion".pluralize "s", total }
end

def uri = format settings.project_uri_version, id: value.version
deletion_count(= value.commits.sum(&:deletions)) click to toggle source
# File lib/milestoner/views/parts/tag.rb, line 35
  def deletion_count = value.commits.sum(&:deletions)

  def empty? = value.commits.empty?

  def profile_url user
    warn "`#{self.class}##{__method__}` is deprecated, use user scope instead.",
         category: :deprecated

    format settings.profile_uri, id: user.handle
  end

  def file_count = value.commits.sum(&:files_changed)

  def insertion_count = value.commits.sum(&:insertions)

  def security = value.signature ? "🔒 Tag (secure)" : "🔓 Tag (insecure)"

  def total_commits = commit_count.then { |total| "#{total} commit".pluralize "s", total }

  def total_files = file_count.then { |total| "#{total} file".pluralize "s", total }

  def total_deletions
    deletion_count.then { |total| "#{total} deletion".pluralize "s", total }
  end

  def total_insertions
    insertion_count.then { |total| "#{total} insertion".pluralize "s", total }
  end

  def uri = format settings.project_uri_version, id: value.version
end
empty?(= value.commits.empty?) click to toggle source
# File lib/milestoner/views/parts/tag.rb, line 37
  def empty? = value.commits.empty?

  def profile_url user
    warn "`#{self.class}##{__method__}` is deprecated, use user scope instead.",
         category: :deprecated

    format settings.profile_uri, id: user.handle
  end

  def file_count = value.commits.sum(&:files_changed)

  def insertion_count = value.commits.sum(&:insertions)

  def security = value.signature ? "🔒 Tag (secure)" : "🔓 Tag (insecure)"

  def total_commits = commit_count.then { |total| "#{total} commit".pluralize "s", total }

  def total_files = file_count.then { |total| "#{total} file".pluralize "s", total }

  def total_deletions
    deletion_count.then { |total| "#{total} deletion".pluralize "s", total }
  end

  def total_insertions
    insertion_count.then { |total| "#{total} insertion".pluralize "s", total }
  end

  def uri = format settings.project_uri_version, id: value.version
end
    
file_count(= value.commits.sum(&:files_changed)) click to toggle source
# File lib/milestoner/views/parts/tag.rb, line 46
    def file_count = value.commits.sum(&:files_changed)

    def insertion_count = value.commits.sum(&:insertions)

    def security = value.signature ? "🔒 Tag (secure)" : "🔓 Tag (insecure)"

    def total_commits = commit_count.then { |total| "#{total} commit".pluralize "s", total }

    def total_files = file_count.then { |total| "#{total} file".pluralize "s", total }

    def total_deletions
      deletion_count.then { |total| "#{total} deletion".pluralize "s", total }
    end

    def total_insertions
      insertion_count.then { |total| "#{total} insertion".pluralize "s", total }
    end

    def uri = format settings.project_uri_version, id: value.version
  end
end
insertion_count(= value.commits.sum(&:insertions)) click to toggle source
# File lib/milestoner/views/parts/tag.rb, line 48
      def insertion_count = value.commits.sum(&:insertions)

      def security = value.signature ? "🔒 Tag (secure)" : "🔓 Tag (insecure)"

      def total_commits = commit_count.then { |total| "#{total} commit".pluralize "s", total }

      def total_files = file_count.then { |total| "#{total} file".pluralize "s", total }

      def total_deletions
        deletion_count.then { |total| "#{total} deletion".pluralize "s", total }
      end

      def total_insertions
        insertion_count.then { |total| "#{total} insertion".pluralize "s", total }
      end

      def uri = format settings.project_uri_version, id: value.version
    end
  end
end
profile_url(user) click to toggle source
# File lib/milestoner/views/parts/tag.rb, line 39
def profile_url user
  warn "`#{self.class}##{__method__}` is deprecated, use user scope instead.",
       category: :deprecated

  format settings.profile_uri, id: user.handle
end
security(= value.signature ? "🔒 Tag (secure)" : "🔓 Tag (insecure)") click to toggle source
# File lib/milestoner/views/parts/tag.rb, line 50
        def security = value.signature ? "🔒 Tag (secure)" : "🔓 Tag (insecure)"

        def total_commits = commit_count.then { |total| "#{total} commit".pluralize "s", total }

        def total_files = file_count.then { |total| "#{total} file".pluralize "s", total }

        def total_deletions
          deletion_count.then { |total| "#{total} deletion".pluralize "s", total }
        end

        def total_insertions
          insertion_count.then { |total| "#{total} insertion".pluralize "s", total }
        end

        def uri = format settings.project_uri_version, id: value.version
      end
    end
  end
end
total_commits(= commit_count.then { |total| " click to toggle source
# File lib/milestoner/views/parts/tag.rb, line 52
      def total_commits = commit_count.then { |total| "#{total} commit".pluralize "s", total }

      def total_files = file_count.then { |total| "#{total} file".pluralize "s", total }

      def total_deletions
        deletion_count.then { |total| "#{total} deletion".pluralize "s", total }
      end

      def total_insertions
        insertion_count.then { |total| "#{total} insertion".pluralize "s", total }
      end

      def uri = format settings.project_uri_version, id: value.version
    end
  end
end
total_deletions() click to toggle source
# File lib/milestoner/views/parts/tag.rb, line 56
def total_deletions
  deletion_count.then { |total| "#{total} deletion".pluralize "s", total }
end
total_files(= file_count.then { |total| " click to toggle source
# File lib/milestoner/views/parts/tag.rb, line 54
    def total_files = file_count.then { |total| "#{total} file".pluralize "s", total }

    def total_deletions
      deletion_count.then { |total| "#{total} deletion".pluralize "s", total }
    end

    def total_insertions
      insertion_count.then { |total| "#{total} insertion".pluralize "s", total }
    end

    def uri = format settings.project_uri_version, id: value.version
  end
end
total_insertions() click to toggle source
# File lib/milestoner/views/parts/tag.rb, line 60
def total_insertions
  insertion_count.then { |total| "#{total} insertion".pluralize "s", total }
end
uri(= format settings.project_uri_version, id: value.version) click to toggle source
# File lib/milestoner/views/parts/tag.rb, line 64
  def uri = format settings.project_uri_version, id: value.version
end