DRYed up "@foo=self.class.foo unless @foo" statements
DRYed up "@foo=self.class.foo unless @foo" statements

Using the example from the existing code:

  CHECKSUM_TYPES.each do |type|
    if !instance_variable_defined?("@#{type}")
      class_value = self.class.send(type)
      instance_variable_set("@#{type}", class_value) if class_value
    end
  end

I extracted that block into a method 'set_instance_variable' which I
then used in all places where this behavior was being used.

reelsense/brew,Homebrew/brew,muellermartin/dist,alyssais/brew,mistydemeo/homebrew,zmwangx/brew,tonyg/homebrew,muellermartin/dist,pseudocody/brew,mahori/brew,konqui/brew,vitorgalvao/brew,rwhogg/brew,maxim-belkin/brew,maxim-belkin/brew,reitermarkus/brew,zmwangx/brew,sjackman/homebrew,Linuxbrew/brew,vitorgalvao/brew,vitorgalvao/brew,mahori/brew,DomT4/brew,Homebrew/brew,sjackman/homebrew,gordonmcshane/homebrew,JCount/brew,alyssais/brew,mistydemeo/homebrew,nandub/brew,nandub/brew,zmwangx/brew,bfontaine/brew,palxex/brew,konqui/brew,amar-laksh/brew_sudo,staticfloat/brew,konqui/brew,DomT4/brew,mgrimes/brew,ilovezfs/brew,claui/brew,gordonmcshane/homebrew,EricFromCanada/brew,jmsundar/brew,toonetown/homebrew,mistydemeo/homebrew,vitorgalvao/brew,palxex/brew,ilovezfs/brew,Homebrew/brew,reitermarkus/brew,mahori/brew,JCount/brew,gregory-nisbet/brew,EricFromCanada/brew,rwhogg/brew,toonetown/homebrew,reitermarkus/brew,reitermarkus/brew,rwhogg/brew,nandub/brew,mgrimes/brew,aw1621107/brew,hanxue/linuxbrew,tonyg/homebrew,AnastasiaSulyagina/brew,mgrimes/brew,staticfloat/brew,reelsense/brew,MikeMcQuaid/brew,MikeMcQuaid/brew,MikeMcQuaid/brew,toonetown/homebrew,palxex/brew,DomT4/brew,pseudocody/brew,maxim-belkin/brew,claui/brew,JCount/brew,EricFromCanada/brew,JCount/brew,aw1621107/brew,konqui/brew,amar-laksh/brew_sudo,pseudocody/brew,AnastasiaSulyagina/brew,tonyg/homebrew,EricFromCanada/brew,claui/brew,MikeMcQuaid/brew,bfontaine/brew,sjackman/homebrew,jmsundar/brew,gordonmcshane/homebrew,jmsundar/brew,hanxue/linuxbrew,gregory-nisbet/brew,muellermartin/dist,mahori/brew,staticfloat/brew,Linuxbrew/brew,amar-laksh/brew_sudo,hanxue/linuxbrew,Homebrew/brew,Linuxbrew/brew,sjackman/homebrew,DomT4/brew,AnastasiaSulyagina/brew,alyssais/brew,ilovezfs/brew,bfontaine/brew,gregory-nisbet/brew,aw1621107/brew,reelsense/brew,claui/brew,Linuxbrew/brew,nandub/brew