added ruby dependencies and extracted validator