lib/homebrew_automation/formula.rb
def update_field field, value
      Formula.new update(
        @ast,
        [ by_type('begin'),
          by_both(
            by_type('send'),
            by_msg(field)),
          by_type('str')],
        -> (n) { n.updated(nil, [value]) })
    end
# Update a top-level field in the Formula
#
# @param field [String] Name of the Formula field, e.g. +url+
# @param value [String] Value of the Formula field, e.g. +https://github.com/easoncxz/homebrew-automation+
# @return [Formula] a new instance of Formula with the changes applied
Update a top-level field in the Formula
Update a top - level field in the Formula
def update_field field, value
      Formula.new update(
        @ast,
        [ by_type('begin'),
          by_both(
            by_type('send'),
            by_msg(field)),
          by_type('str')],
        -> (n) { n.updated(nil, [value]) })
    end
def update_field field , value Formula . new update ( @ast , [ by_type ( 'begin' ) , by_both ( by_type ( 'send' ) , by_msg ( field ) ) , by_type ( 'str' ) ] , -> ( n ) { n . updated ( nil , [ value ] ) } ) end
Update a top-level field in the Formula
Update a top - level field in the Formula
a new instance of Formula with the changes applied
a new instance of Formula with the changes applied
Formula
field
Name of the Formula field, e.g. +url+
Name of the Formula field e . g . + url +
value
Value of the Formula field, e.g.
Value of the Formula field e . g .