class Milestoner::Configuration::Transformers::Citations::Label
Conditionally updates project label based on citation details.
Attributes
Public Class Methods
Source
# File lib/milestoner/configuration/transformers/citations/label.rb, line 15 def initialize key = :project_label, path: Pathname.pwd.join("CITATION.cff"), citation: CFF::File @key = key @path = path @citation = citation end
Public Instance Methods
Source
# File lib/milestoner/configuration/transformers/citations/label.rb, line 23 def call attributes attributes.fetch key do value = citation.open(path).title attributes.merge! key => value unless value.empty? end Success attributes end