Sha256: 98c4784372e4e8007ee2baf885fa49f511166652897367bbb18f066f5747e358
Contents?: true
Size: 1.62 KB
Versions: 3
Compression:
Stored size: 1.62 KB
Contents
module Squib module Sprues UNIT_REGEX = /^(\d*[.])?\d+(in|cm|mm)$/ 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, 'position_reference' => ClassyHash::G.enum(:topleft, :center), 'rotate' => [ :optional, Numeric, ClassyHash::G.enum(:clockwise, :counterclockwise, :turnaround), ROTATE_REGEX ], 'crop_line' => { 'style' => [ ClassyHash::G.enum(:solid, :dotted, :dashed), Sprues::CropLineDash::VALIDATION_REGEX ], 'width' => UNIT_REGEX, 'color' => [String, Symbol], 'overlay' => ClassyHash::G.enum( :on_margin, :overlay_on_cards, :beneath_cards ), 'lines' => [[{ 'type' => ClassyHash::G.enum(:horizontal, :vertical), 'position' => UNIT_REGEX, 'style' => [ :optional, ClassyHash::G.enum(:solid, :dotted, :dashed) ], 'width' => [:optional, UNIT_REGEX], 'color' => [:optional, String, Symbol], 'overlay_on_cards' => [:optional, TrueClass] }]] }, 'cards' => [[{ 'x' => COORD_REGEX, 'y' => COORD_REGEX, 'rotate' => [ :optional, Numeric, ClassyHash::G.enum(:clockwise, :counterclockwise, :turnaround), ROTATE_REGEX ], 'flip_vertical' => [ :optional, FalseClass ], 'flip_horizontal' => [ :optional, FalseClass ], }]] }.freeze end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
squib-0.19.0 | lib/squib/sprues/sprue_schema.rb |
squib-0.19.0b | lib/squib/sprues/sprue_schema.rb |
squib-0.19.0a | lib/squib/sprues/sprue_schema.rb |