Updated ruby block with not_if to avoid modifying of file on each run