class Milestoner::Views::Parts::Tag
The tag presentation logic.
Public Instance Methods
Source
# File lib/milestoner/views/parts/tag.rb, line 18 def colored_total_deletions(*custom) custom.push :green if custom.empty? color[total_deletions, *custom] end
Source
# File lib/milestoner/views/parts/tag.rb, line 23 def colored_total_insertions(*custom) custom.push :red if custom.empty? color[total_insertions, *custom] end
Source
# File lib/milestoner/views/parts/tag.rb, line 28 def commit_count = 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 = commits.sum(&:deletions) def duration return 0 if commits.empty? min = commits.min_by(&:created_at) max = commits.max_by(&:updated_at) (max.updated_at - min.created_at).to_i end def empty? = commits.empty? def file_count = commits.sum(&:files_changed) def index? = settings.build_index def insertion_count = commits.sum(&:insertions) def security = 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_duration = duration.zero? ? "0 seconds" : durationer.call(duration) def total_insertions insertion_count.then { |total| "#{total} insertion".pluralize "s", total } end def uri = format settings
Source
# File lib/milestoner/views/parts/tag.rb, line 30 def committed_at fallback: Time.now value.committed_at.then { |at| at ? Time.at(at) : fallback } end
Source
# File lib/milestoner/views/parts/tag.rb, line 34 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 = commits.sum(&:deletions) def duration return 0 if commits.empty? min = commits.min_by(&:created_at) max = commits.max_by(&:updated_at) (max.updated_at - min.created_at).to_i end def empty? = commits.empty? def file_count = commits.sum(&:files_changed) def index? = settings.build_index def insertion_count = commits.sum(&:insertions) def security = 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_duration = duration.zero? ? "0 seconds" : durationer.call(duration) def total_insertions insertion_count.then { |total| "#{total} insertion".pluralize "s", total } end def uri = format settings.project_uri_version
Source
# File lib/milestoner/views/parts/tag.rb, line 36 def committed_datetime = committed_at.strftime "%Y-%m-%dT%H:%M:%S%z" def deletion_count = commits.sum(&:deletions) def duration return 0 if commits.empty? min = commits.min_by(&:created_at) max = commits.max_by(&:updated_at) (max.updated_at - min.created_at).to_i end def empty? = commits.empty? def file_count = commits.sum(&:files_changed) def index? = settings.build_index def insertion_count = commits.sum(&:insertions) def security = 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_duration = duration.zero? ? "0 seconds" : durationer.call(duration) def total_insertions insertion_count.then { |total| "#{total} insertion".pluralize "s", total } end def uri = format settings.project_uri_version,
Source
# File lib/milestoner/views/parts/tag.rb, line 38 def deletion_count = commits.sum(&:deletions) def duration return 0 if commits.empty? min = commits.min_by(&:created_at) max = commits.max_by(&:updated_at) (max.updated_at - min.created_at).to_i end def empty? = commits.empty? def file_count = commits.sum(&:files_changed) def index? = settings.build_index def insertion_count = commits.sum(&:insertions) def security = 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_duration = duration.zero? ? "0 seconds" : durationer.call(duration) def total_insertions insertion_count.then { |total| "#{total} insertion".pluralize "s", total } end def uri = format settings.project_uri_version, id:
Source
# File lib/milestoner/views/parts/tag.rb, line 40 def duration return 0 if commits.empty? min = commits.min_by(&:created_at) max = commits.max_by(&:updated_at) (max.updated_at - min.created_at).to_i end
Source
# File lib/milestoner/views/parts/tag.rb, line 48 def empty? = commits.empty? def file_count = commits.sum(&:files_changed) def index? = settings.build_index def insertion_count = commits.sum(&:insertions) def security = 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_duration = duration.zero? ? "0 seconds" : durationer.call(duration) def total_insertions insertion_count.then { |total| "#{total} insertion".pluralize "s", total } end def uri = format settings.project_uri_version, id: version
Source
# File lib/milestoner/views/parts/tag.rb, line 50 def file_count = commits.sum(&:files_changed) def index? = settings.build_index def insertion_count = commits.sum(&:insertions) def security = 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_duration = duration.zero? ? "0 seconds" : durationer.call(duration) def total_insertions insertion_count.then { |total| "#{total} insertion".pluralize "s", total } end def uri = format settings.project_uri_version, id: version end
Source
# File lib/milestoner/views/parts/tag.rb, line 52 def index? = settings.build_index def insertion_count = commits.sum(&:insertions) def security = 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_duration = duration.zero? ? "0 seconds" : durationer.call(duration) def total_insertions insertion_count.then { |total| "#{total} insertion".pluralize "s", total } end def uri = format settings.project_uri_version, id: version end
Source
# File lib/milestoner/views/parts/tag.rb, line 54 def insertion_count = commits.sum(&:insertions) def security = 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_duration = duration.zero? ? "0 seconds" : durationer.call(duration) def total_insertions insertion_count.then { |total| "#{total} insertion".pluralize "s", total } end def uri = format settings.project_uri_version, id: version end end
Source
# File lib/milestoner/views/parts/tag.rb, line 56 def security = 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_duration = duration.zero? ? "0 seconds" : durationer.call(duration) def total_insertions insertion_count.then { |total| "#{total} insertion".pluralize "s", total } end def uri = format settings.project_uri_version, id: version end end end
Source
# File lib/milestoner/views/parts/tag.rb, line 58 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_duration = duration.zero? ? "0 seconds" : durationer.call(duration) def total_insertions insertion_count.then { |total| "#{total} insertion".pluralize "s", total } end def uri = format settings.project_uri_version, id: version end end end end
Source
# File lib/milestoner/views/parts/tag.rb, line 62 def total_deletions deletion_count.then { |total| "#{total} deletion".pluralize "s", total } end
Source
# File lib/milestoner/views/parts/tag.rb, line 66 def total_duration = duration.zero? ? "0 seconds" : durationer.call(duration) def total_insertions insertion_count.then { |total| "#{total} insertion".pluralize "s", total } end def uri = format settings.project_uri_version, id: version end end
Source
# File lib/milestoner/views/parts/tag.rb, line 60 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_duration = duration.zero? ? "0 seconds" : durationer.call(duration) def total_insertions insertion_count.then { |total| "#{total} insertion".pluralize "s", total } end def uri = format settings.project_uri_version, id: version end end end
Source
# File lib/milestoner/views/parts/tag.rb, line 68 def total_insertions insertion_count.then { |total| "#{total} insertion".pluralize "s", total } end
Source
# File lib/milestoner/views/parts/tag.rb, line 72 def uri = format settings.project_uri_version, id: version end