<FromGitter>
<moe:busyloop.net> yup i have used it for some smaller production things. it works ok but agree it has a bunch of rough corners. ⏎ ORMs are sadly hard and i think it's just one guy working on it. and not many alternatives on crystal, yet (there's also jennifer.cr but i've found that even rougher).
<FromGitter>
<Blacksmoke16> Packt is currently running a promotion from 13th December to 17th January where all eBooks are only $5 when purchased via Packt’s website. This would be a perfect time to pickup a copy of the "Crystal Programming" book if anyone hasn’t already done so! ⏎ ⏎ https://packt.link/VPmw7
<FromGitter>
<moe:busyloop.net> @Blacksmoke16: what do i put in front of athena validator to validate strings? it seems to expect input values in the right type (e.g. GreaterThan won't work on a string).
<FromGitter>
<Blacksmoke16> like the length of the string?
<FromGitter>
<moe:busyloop.net> no, i have "3" and want to validate with GreaterThan
<FromGitter>
<Blacksmoke16> `"3.".to_i`
<FromGitter>
<moe:busyloop.net> yea can crystal do that for me or should i look elsewhere? :P
<FromGitter>
<moe:busyloop.net> s/crystal/athena/
<FromGitter>
<Blacksmoke16> where does the value come from?
<FromGitter>
<moe:busyloop.net> ARGV
<FromGitter>
<moe:busyloop.net> it's always a string, just looking for a cast & validate
<FromGitter>
<moe:busyloop.net> or parse & validate rather
<FromGitter>
<moe:busyloop.net> i assume athena does sth like that for request params, but dunno if it's pluggable for standalone use
<FromGitter>
<Blacksmoke16> iirc its just like `Int64.new(value)` or whatever numeric type you want
<FromGitter>
<Blacksmoke16> which calls the related `to_*` method on it
<FromGitter>
<moe:busyloop.net> yea athena has some cool stuff and looks clean and is well maintained, that's why i thought about it first
<FromGitter>
<Blacksmoke16> ❤️
<FromGitter>
<moe:busyloop.net> but for this case i don't need all that fancy stuff. i just need it to look at a string and tell me if it's value meets some constraint (and interpret it accordingly if it's a numeric constraint)
<FromGitter>
<Blacksmoke16> if thats all you want to do prob dont even need a shard in that case
<FromGitter>
<Blacksmoke16> `abort "Input must be an integer" unless ARGV[1].matches? /number_regex/`
<FromGitter>
<moe:busyloop.net> the validations are user configurable. so some abstraction is needed. like... well, i have a shard now :)