Class: Homebrew::Cmd::Pin

Inherits:
AbstractCommand show all
Defined in:
cmd/pin.rb

Instance Attribute Summary

Attributes inherited from AbstractCommand

#args

Instance Method Summary collapse

Methods inherited from AbstractCommand

command, command_name, #initialize, parser

Constructor Details

This class inherits a constructor from Homebrew::AbstractCommand

Instance Method Details

#runvoid

This method returns an undefined value.



23
24
25
26
27
28
29
30
31
32
33
# File 'cmd/pin.rb', line 23

def run
  args.named.to_resolved_formulae.each do |f|
    if f.pinned?
      opoo "#{f.name} already pinned"
    elsif !f.pinnable?
      onoe "#{f.name} not installed"
    else
      f.pin
    end
  end
end