jhass changed the topic of #crystal-lang to: The Crystal programming language | https://crystal-lang.org | Crystal 0.35.1 | Fund Crystal's development: https://crystal-lang.org/sponsors | GH: https://github.com/crystal-lang/crystal | Docs: https://crystal-lang.org/docs | Gitter: https://gitter.im/crystal-lang/crystal
<FromGitter> <Blacksmoke16> wew, pretty fancy :p
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5f86463499e1ab4dd1fa39ea]
<FromGitter> <Blacksmoke16> wish there was a way to link to another section in the api docs
<FromGitter> <grkek> Damn that looks really lovely
<FromGitter> <Blacksmoke16> thanks :)
<FromGitter> <Blacksmoke16> (is also a code based approach for those that dont like annoations)
<FromGitter> <grkek> I did annotations in my code
<FromGitter> <grkek> I implemented swagger, the annotation stuff is really powerful
<FromGitter> <Blacksmoke16> indeed, i have an issue about adding something like that to athena
<FromGitter> <Blacksmoke16> pretty sure i can also lift a fair bit of info from the method itself, save on # of annotations required
<FromGitter> <grkek> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5f8655c86e1aa94de7fa5284]
<FromGitter> <grkek> that is an odd formatting
<FromGitter> <grkek> wait let me do something
<FromGitter> <grkek> here
<FromGitter> <grkek> That does look a bit messy but it works and it doesn't break the standard swagger definitions
<FromGitter> <Blacksmoke16> is a good start
<FromGitter> <grkek> I would lift a fair bit info from the method as well but then it would be problematic the way I have arranged my DSL is a bit clumsy its only good at what its doing and it doesn't really need anything more
<FromGitter> <grkek> so I added another macro for the swagger docs generation
<FromGitter> <Blacksmoke16> yup, way i have things setup like: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ You inherently know the method, url, arguments (their types, if its required, and default value if any), and return type [https://gitter.im/crystal-lang/crystal?at=5f86569899e1ab4dd1fa5dc1]
<FromGitter> <Blacksmoke16> all w/o any additional annotations
<FromGitter> <grkek> Oh my that is really nicely done!
<FromGitter> <Blacksmoke16> prob could get fancy with refs and models as well
<FromGitter> <grkek> Yeah but the current swagger implementation is a bit weird
<FromGitter> <grkek> I found couple of bugs
<FromGitter> <Blacksmoke16> have some way to wire up your ORM models or something
<FromGitter> <Blacksmoke16> :shrug: haven't really put a lot of thought into it yet
<FromGitter> <grkek> Swagger is nice but its a bit poorly executed
<FromGitter> <Blacksmoke16> Game i play uses swagger for their API, has been working out quite well for them
<FromGitter> <Blacksmoke16> (a lot better than the XML API they had before :p)
<FromGitter> <grkek> XML API is a nightmare
<FromGitter> <Blacksmoke16> i assume you're using the 3.x spec?
<FromGitter> <grkek> Yes
<FromGitter> <Blacksmoke16> 👍
f1reflyylmao has joined #crystal-lang
f1refly has quit [Ping timeout: 264 seconds]
<FromGitter> <grkek> Nice ;)
<FromGitter> <Blacksmoke16> thoughts on being able to do something like `SomeType@sub-section`?
<FromGitter> <Blacksmoke16> and that generating a link like `/path/to/SomeType.html#sub-section`
<FromGitter> <grkek> Would be handy indeed
<FromGitter> <Blacksmoke16> i agree :)
<FromGitter> <grkek> Do you know any good crystal validatior shards?
<FromGitter> <Blacksmoke16> mine? :p
<FromGitter> <grkek> Link it
<FromGitter> <Blacksmoke16> is a `doc-pass` branch that has some docs
<FromGitter> <Blacksmoke16> working on the constraint specific documents atm, planning on having a `v0.1.0` by this weekend, but the getting started docs are done https://athena-framework.github.io/validator/Athena/Validator.html#getting-started
<FromGitter> <grkek> Yeah I saw that
<FromGitter> <grkek> pretty nice IMO
<FromGitter> <Blacksmoke16> <3 i like to think so
<FromGitter> <Blacksmoke16> is pretty robust
<FromGitter> <grkek> Yeah I see it is really easy to setup and gives a lot of power and control
<FromGitter> <grkek> gg
<FromGitter> <Blacksmoke16> indeed
deavmi has quit [Ping timeout: 272 seconds]
<FromGitter> <Blacksmoke16> one thing i also started doing that this includes is a `Spec` module
<FromGitter> <grkek> so you can do testing with the validator as well right?
<FromGitter> <Blacksmoke16> file:///home/george/dev/git/athena-framework/validator/docs/Athena/Validator/Spec.html which can be included into your `spec_helper` that defines helpful test utilities for the type
<FromGitter> <Blacksmoke16> can do something like this:
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5f86620178d7f20c9faaa309]
<FromGitter> <grkek> right, that is awesome
<FromGitter> <Blacksmoke16> includes an abstraction for testing your validators
<FromGitter> <Blacksmoke16> uses a more unit testy approach that reduces duplication and allows reuse/abstract methods and such
<FromGitter> <Blacksmoke16> boils down to `Spec` module stuff so is just syntax sugar
<FromGitter> <grkek> I love me some good syntax sugar tbh
deavmi has joined #crystal-lang
<FromGitter> <Blacksmoke16> same, the data provider concept is really cool
<FromGitter> <Blacksmoke16> basically runs the given test method for each value that data provider methods returns
<FromGitter> <Blacksmoke16> it'll also run tests in parent type in each child type, when paired with abstract defs makes for pretty easy testing
<FromGitter> <Blacksmoke16> should the link keep the `@some-section` text tho?
<FromGitter> <Blacksmoke16> i think so
<FromGitter> <grkek> We definitely need a new way to design the crystal docs
<FromGitter> <Blacksmoke16> current one is sufficient for me, esp with these little QoL things
<FromGitter> <Blacksmoke16> a more extensible/flexible setup would be helpful but i cant say i had a need for one yet
<FromGitter> <Blacksmoke16> granted im not familiar with Ruby/other lang stuff to know what im missing :p
avane has quit [Quit: ZNC - https://znc.in]
avane has joined #crystal-lang
<FromGitter> <Blacksmoke16> now i forget what i need that for...
<FromGitter> <grkek> :DDD
<FromGitter> <grkek> funny
<FromGitter> <Blacksmoke16> oh yea i remember
<FromGitter> <Blacksmoke16> perfect
<FromGitter> <Blacksmoke16> part of me thinks this is redundant (esp the type/default) since its in the constructor def, but part of me links having everything together in a more readable format
<FromGitter> <Blacksmoke16> guess this is where a fancier doc sys would be nice as you could do like `@include("group")` or something :shrug:
<FromGitter> <grkek> I am restructuring the grip code so it can be self contained
<FromGitter> <rishavs> A question on kemal; ⏎ How does one adds multiple fragments to a layout? I want to have a sidebar which comes in a few pages and not in others. Kemal docs only talks about adding a single child view to the layout
<FromGitter> <grkek> Its mostly about the rendering engine
<FromGitter> <grkek> view Kilt docs
<FromGitter> <grkek> that is what kemal uses :)
<FromGitter> <rishavs> Thanks
_whitelogger has joined #crystal-lang
<FromGitter> <grkek> Well I was able to officially remove the cancer caused by Kemal in the first place from Grip
<FromGitter> <grkek> the INSTANCE = new
<FromGitter> <grkek> cancer has been removed from grip
<FromGitter> <grkek> Grip is now able to host as many application as you want with separate routers, handlers, pipelines and filters.
<FromGitter> <grkek> I just need to push the changes :P
fifr is now known as lyro
lyro is now known as fifr[m]
fifr[m] is now known as fifr
yukai has quit [Ping timeout: 246 seconds]
deimos_ has quit [Quit: leaving]
deimos_ has joined #crystal-lang
deavmi_ has joined #crystal-lang
deavmi has quit [Read error: Connection reset by peer]
<FromGitter> <ImAHopelessDev_gitlab> https://play.crystal-lang.org/#/r/9txg/edit ⏎ ⏎ MIND BLOWN
<FromGitter> <grkek> Why?
<FromGitter> <j8r> that's logic
<FromGitter> <j8r> structs are passed by copy
<FromGitter> <grkek> Oh
<FromGitter> <grkek> yeah
<FromGitter> <j8r> data immutability is also a feature - depends on the case
f1reflyylmao has quit [Remote host closed the connection]
f1refly has joined #crystal-lang
_whitelogger has joined #crystal-lang
alexherbo2 has joined #crystal-lang
<oprypin> grkek, usually you want to force a struct to be immutable. if you dont, you always need to really be sure what you're doing with the struct
alexherbo2 has quit [Ping timeout: 260 seconds]
Liothen has quit [Ping timeout: 240 seconds]
Liothen has joined #crystal-lang
alexherbo2 has joined #crystal-lang
<FromGitter> <j8r> exactly
<FromGitter> <j8r> with a struct you can only modify it on the same scope, after that if passed to a method, it will be copied to it