Skip to content

Commit

Permalink
Use more succint #then alias instead of #yield_self
Browse files Browse the repository at this point in the history
`Object#yield_self` is available from Ruby 2.6 [1]

[1] - https://ruby-doc.org/core-2.6/Object.html#method-i-yield_self
  • Loading branch information
waiting-for-dev committed Jan 10, 2023
1 parent 3267517 commit e3090f7
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def build_gem_lines(conservative_versioning)
requirement = if is_local
", path: \"#{d.source.path}\""
elsif is_git
", git: \"#{d.git}\"".yield_self { |g| d.ref ? g + ", ref: \"#{d.ref}\"" : g }
", git: \"#{d.git}\"".then { |g| d.ref ? g + ", ref: \"#{d.ref}\"" : g }
elsif conservative_versioning
", \"#{conservative_version(@definition.specs[d.name][0])}\""
else
Expand Down

0 comments on commit e3090f7

Please sign in to comment.