faustinoaq changed the topic of #amber to: Welcome to Amber Framework community! | https://amberframework.org | Developer happiness, productivity and bare metal performance | GH: https://github.com/amberframework | Docs: https://docs.amberframework.org | Gitter: https://gitter.im/amberframework/amber | IRC Logger: https://irclog.whitequark.org/amber | Amber::Server.start
_whitelogger has joined #amber
<FromGitter> <kvirani> Is there a way to DRY this up? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/amberframework/amber?at=5cb2a07fbd70a40d5f4766bc]
<FromGitter> <kvirani> (^^ Asking in crystal gitter channel)
_whitelogger has joined #amber
_whitelogger has joined #amber
_whitelogger has joined #amber
zbaylin has quit [Ping timeout: 256 seconds]
_whitelogger has joined #amber
_whitelogger has joined #amber
feepbot has quit [Ping timeout: 246 seconds]
feepbot has joined #amber
<FromGitter> <eliasjpr> The two constructors are the same.
<FromGitter> <eliasjpr> What exactly you are trying to do?
<FromGitter> <mixflame> that was my thought
<FromGitter> <mixflame> by the well hello @eliasjpr
<FromGitter> <mixflame> /s/well/way
<FromGitter> <eliasjpr> Hello everyone
<FromGitter> <Blacksmoke16> they're not, constraints is diff
<FromGitter> <Blacksmoke16> one is `Hash(Symbol, Regex)`, other is `Hash(String, Regex)`
<FromGitter> <eliasjpr> String | Symbol union instead
<FromGitter> <eliasjpr> Maybe
<FromGitter> <Blacksmoke16> that and make it nilable and nil by default would prob be easiest
<FromGitter> <mixflame> my crystal isn't advanced enough yet, i need to pick up the new changes and learn the stuff I don't know like macros
<FromGitter> <eliasjpr> I think it would be best to define a constraints type
<FromGitter> <eliasjpr> Class Route::Constraints end
<FromGitter> <kvirani> hmm, but the end goal is to allow Hash and NamedTuple based constraints in the routes file
<FromGitter> <kvirani> I'm not sure I understand the point of the class
<FromGitter> <mixflame> @damianham I forked Datanoise's broken Mongo.cr to the Amber Community organization. It will need either @sam0x17 fixes and any other additional fixes he recommends (I only needed the one in 0x17's repository though). Merge those fixes, and we can have our first official package. Thanks.
<FromGitter> <mixflame> I plan to add SSL to my app and check the documentation status in a while when morning wears off 😁 @elorest
<FromGitter> <eliasjpr> Alias Constrains = Hash(String | Symbol, Regex)
<FromGitter> <eliasjpr> I think that should do it
<FromGitter> <eliasjpr> The alias is almost as defining a constraint
<FromGitter> <eliasjpr> Also why a hash for contraints? Is it to hold all the contraints for the all the url params?
<FromGitter> <Blacksmoke16> eys
<FromGitter> <Blacksmoke16> key being the named param in the path, value being the constraint for it
<FromGitter> <eliasjpr> I think defining a constraint type would be better to encapsulate all of the logic to aplying the constraints for each
<FromGitter> <valamorgon> is there any way to destroy all sessions a user has?
<FromGitter> <nsuchy> I'm reading over the documental for crystal then amber today
<FromGitter> <nsuchy> Crystal looks almost identical to ruby with a few suttle differences and then the fact it's compiled has a different standard library and package ecosystem and its own community
<FromGitter> <nsuchy> is there a compare and contrast of Amber to Rails
<FromGitter> <Blacksmoke16> @nsuchy Also forgetting that Ruby is dynamically typed while crystal is statically typed
<FromGitter> <Blacksmoke16> which is the bigger difference imo
<FromGitter> <Blacksmoke16> https://github.com/crystal-lang/crystal/wiki/Crystal-for-Rubyists would be a good place to start
<FromGitter> <nsuchy> oh that looks nice
<FromGitter> <nsuchy> and yeah I like type inference
<FromGitter> <nsuchy> C# doesn't have that and its a pain
<FromGitter> <nsuchy> Crystal's type inference makes getting started less intimidating
<FromGitter> <nsuchy> Is there a template engine similar to ERB
<FromGitter> <nsuchy> I dislike slang as it makes it difficult to drop in ERB and start porting it over
<FromGitter> <nsuchy> E.g. I can take the ruby parts and make minor changes
<FromGitter> <Blacksmoke16> are also some shards that are similar
<FromGitter> <nsuchy> are shards like gems?
<FromGitter> <mixflame> yes
<FromGitter> <nsuchy> in theory, could I take a ruby gem, make minor changes and publish as a shard
<FromGitter> <mixflame> ECR is what you want
<FromGitter> <mixflame> not really no
<FromGitter> <nsuchy> thank you for mentioning ECR
<FromGitter> <nsuchy> I'll check that out
<FromGitter> <mixflame> it's a similar language syntax-wise but there are a lot of differences
<FromGitter> <mixflame> if the ruby code was simple and didnt use metaprogramming, potentially
<FromGitter> <mixflame> if it called the ruby stdlib, you'd need to port those calls to Crystal stdlib
<FromGitter> <mixflame> if it used a bunch of weird gems, probably not
<FromGitter> <mixflame> depends on the code
<FromGitter> <mixflame> porting will be easier though because the syntax is nearly the exact same
<FromGitter> <nsuchy> fair point, right now at my organization we're considering creating some micro services in crystal/amber
<FromGitter> <nsuchy> We're using a monolithic rails app currently
<FromGitter> <mixflame> ah cool
<FromGitter> <nsuchy> what documentation is available about converting a rails schema to crystal?
<FromGitter> <Blacksmoke16> https://docs.amberframework.org/amber/getting-started prob would be the place to start
<FromGitter> <Blacksmoke16> current rails app server views or api only?
<FromGitter> <nsuchy> I want something similar to activerecord
<FromGitter> <nsuchy> would granite or crecto be most similar?
<FromGitter> <Blacksmoke16> crecto isnt maintained anymore
<FromGitter> <Blacksmoke16> Granite would be kinda similar?
<FromGitter> <nsuchy> sounds like it's my only choice
<FromGitter> <nsuchy> 😂
<FromGitter> <Blacksmoke16> `Article.where(:deleted_at, :neq, nil).where(:user_id, :eq, self.current_user.id).select`
<FromGitter> <nsuchy> that's perfect
<FromGitter> <nsuchy> :
<FromGitter> <Blacksmoke16> when using the query builder portion of it
<FromGitter> <nsuchy> that looks great
<FromGitter> <mixflame> welp, just killed my development server on accident, lol
<FromGitter> <mixflame> i'm an frp n00b
<FromGitter> <mixflame> server owner is aslee
<FromGitter> <mixflame> attempting certbot on dev machine
<FromGitter> <mixflame> or something
<FromGitter> <Blacksmoke16> just use self signed locally?
<FromGitter> <mixflame> good idea
<FromGitter> <mixflame> alright SSL is enabled in dev with self signed
<FromGitter> <mixflame> thats progress
<FromGitter> <Blacksmoke16> nice
<FromGitter> <mixflame> let's check the manual out
<FromGitter> <mixflame> @elorest https://github.com/amberframework/docs/pull/149 @eliasjpr
<FromGitter> <mixflame> amber SSL doc written
vivus has joined #amber
vivus has quit [Remote host closed the connection]
vivus has joined #amber
vivus has quit [Remote host closed the connection]