lib/squib/sprues/sprue_schema.rb in squib-0.17.0 vs lib/squib/sprues/sprue_schema.rb in squib-0.17.1
- old
+ new
@@ -1,9 +1,10 @@
module Squib
module Sprues
UNIT_REGEX = /^(\d*[.])?\d+(in|cm|mm)$/
- ROTATE_REGEX = /^(\d*[.])?\d+(deg|rad)?$/
+ COORD_REGEX = /^\-?(\d*[.])?\d+(in|cm|mm)$/
+ ROTATE_REGEX = /^\-?(\d*[.])?\d+(deg|rad)?$/
SCHEMA = {
'sheet_width' => UNIT_REGEX,
'sheet_height' => UNIT_REGEX,
'card_width' => UNIT_REGEX,
'card_height' => UNIT_REGEX,
@@ -33,11 +34,11 @@
'color' => [:optional, String, Symbol],
'overlay_on_cards' => [:optional, TrueClass]
}]]
},
'cards' => [[{
- 'x' => UNIT_REGEX,
- 'y' => UNIT_REGEX,
+ 'x' => COORD_REGEX,
+ 'y' => COORD_REGEX,
'rotate' => [
:optional, Numeric,
ClassyHash::G.enum(:clockwise, :counterclockwise, :turnaround),
ROTATE_REGEX
],