supermarket
supermarket copied to clipboard
Be more permissive of formats for chef_versions and ohai_versions in metadata.rb
Currently a user must define the chef_versions or ohai_versions as an array of arrays (for the reasons behind this, please see #1201).
While we would like to continue using this data structure in the db, we need to be more permissive about what form a user can use in their cookbook's metadata.rb to define these attributes. We can use our implementation to transform the user input into an array of arrays for storing in the DB.
i.e.
User defines chef_versions or ohai_versions as a string ">= 12.4.1" in a cookbook version's metadata User uploads cookbook to supermarket Supermarket parses the chef_versions or ohai_versions and converts it into [[">= 12.4.1"]].
We should also consider adding formatting validations for chef_versions and ohai_versions attributes - i.e. they must have an operator and be a number.
">= 12.4.1" is valid "12.4.1" is not valid ">= rhubarb" is not valid