Class: Milestoner::Configuration::Transformers::Gems::Label
- Inherits:
-
Object
- Object
- Milestoner::Configuration::Transformers::Gems::Label
- Defined in:
- lib/milestoner/configuration/transformers/gems/label.rb
Overview
Conditionally updates project label based on specification label.
Instance Method Summary collapse
- #call(attributes) ⇒ Object
-
#initialize(key = :project_label, path: "#{Pathname.pwd.basename}.gemspec") ⇒ Label
constructor
A new instance of Label.
Constructor Details
#initialize(key = :project_label, path: "#{Pathname.pwd.basename}.gemspec") ⇒ Label
Returns a new instance of Label.
15 16 17 18 19 |
# File 'lib/milestoner/configuration/transformers/gems/label.rb', line 15 def initialize(key = :project_label, path: "#{Pathname.pwd.basename}.gemspec", **) super(**) @key = key @path = path end |
Instance Method Details
#call(attributes) ⇒ Object
21 22 23 24 25 26 27 28 |
# File 'lib/milestoner/configuration/transformers/gems/label.rb', line 21 def call attributes attributes.fetch key do value = spec_loader.call(path).label attributes.merge! key => value unless value.empty? end Success attributes end |