A much-loved historic North Yorkshire pub that has closed is to re-open after been taken over by a local brewery.