Muddle cranberries and rosemary. Add the rest of the ingredients to a shaker with ice. Shake until chilled and pour into glass, then top with ginger beer.