<FromGitter>
<kingsleyh> hello - for the db api - query("select * from table where id in (#{list}})") works where list is "v1,v2,v3" etc - but passing query("select * from table where id in (?)", [v1,v2]) says list is unsupported here - and if I use the string I was using in the first version - the statement returns everything
<FromGitter>
<kingsleyh> I guess passing an array to query is not supported
<FromGitter>
<kingsleyh> but I guess for this type of query you have to use string interpolation instead of the ? approach
<FromGitter>
<grkek> Might be probably because of that
<FromGitter>
<grkek> Nice I got it working
<FromGitter>
<grkek> -_-
<FromGitter>
<grkek> No one said that the JWT library automagically converts your things into json
_whitelogger has joined #crystal-lang
alexherbo2 has joined #crystal-lang
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Quit: Ping timeout (120 seconds)]
rohitpaulk has joined #crystal-lang
<FromGitter>
<Blacksmoke16> @grkek i approved that PR, still need someone else to approve it tho
rohitpaulk has quit [Ping timeout: 265 seconds]
alexherbo21 has joined #crystal-lang
alex`` has quit [Ping timeout: 268 seconds]
alexherbo2 has quit [Ping timeout: 268 seconds]
alexherbo21 is now known as alexherbo2
alex`` has joined #crystal-lang
<FromGitter>
<Blacksmoke16> actually, you have CI setup but no specs. Would be nice to add some specs/sample project to make sure its working as intended
<FromGitter>
<grkek> I test it by hand
<FromGitter>
<grkek> I dont believe in automation
<FromGitter>
<grkek> sorry
<FromGitter>
<Blacksmoke16> 😬
<FromGitter>
<grkek> I am not super hackerman like
<FromGitter>
<grkek> I believe everythin is pretty siccko mode
<FromGitter>
<Blacksmoke16> idk how you manage manually testing everything
<FromGitter>
<Blacksmoke16> isnt that a pain?
rohitpaulk has joined #crystal-lang
<FromGitter>
<grkek> Not really
<FromGitter>
<grkek> When you have autism it is not pain at all
<FromGitter>
<grkek> it is fun
<FromGitter>
<grkek> instead of pain
rohitpaulk has quit [Ping timeout: 240 seconds]
<FromGitter>
<Blacksmoke16> i suppose
<FromGitter>
<grkek> Corona virus is comming my dudes
<FromGitter>
<grkek> NOTHING MATTERs
<FromGitter>
<tenebrousedge> ever play Plague, Inc. ? It's a pretty good time waster
<FromGitter>
<tenebrousedge> it models the world (to some degree); your goal is to design a pathogen to kill off the entire world
<FromGitter>
<Blacksmoke16> *Madagascar has closed their port*
<FromGitter>
<tenebrousedge> yeah, that is obnoxious. And screw Greenland
<FromGitter>
<grkek> Yeah I play it a lot
<FromGitter>
<grkek> Killed the planet many times
<FromGitter>
<grkek> Not obnoxious but clever
<FromGitter>
<grkek> For example if I die with corona virus
<FromGitter>
<grkek> Ill have grip
<FromGitter>
<grkek> alive to stay
<FromGitter>
<grkek> I guess
alexherbo27 has joined #crystal-lang
alexherbo2 has quit [Ping timeout: 265 seconds]
alexherbo27 is now known as alexherbo2
alex`` has quit [Ping timeout: 268 seconds]
alex`` has joined #crystal-lang
ua_ has quit [Ping timeout: 240 seconds]
alexherbo27 has joined #crystal-lang
ua_ has joined #crystal-lang
alexherbo2 has quit [Ping timeout: 240 seconds]
alexherbo27 is now known as alexherbo2
alex`` has quit [Ping timeout: 260 seconds]
alex`` has joined #crystal-lang
<FromGitter>
<j8r> We can name the pathogen "Crystal": *Crystal is taking over the world* :)
<FromGitter>
<j8r> every time an object is received, it will loop again and wait
<sorcus>
j8r: Yes, this is what i done currently. See line#7. But i'm worried that is not a good code.
<FromGitter>
<j8r> not really
<FromGitter>
<j8r> it is done more in a more complicated way
<FromGitter>
<j8r> I'm thinking
<sorcus>
j8r: In a short way i want to send some object to web socket and get response for them. But server can return any object in any time. Not only for my request.
<FromGitter>
<j8r> ok
<FromGitter>
<j8r> don't know :/
<sorcus>
j8r: Code on gist works as expected (i think). But not sure. :-D
<sorcus>
j8r: Maybe i should to find JSON-RPC implementation on crystal as example.
<FromGitter>
<tenebrousedge> you should probably read a file at either runtime or compile-time, depending on what you want the behavior to be
<FromGitter>
<oren> so i want to be able to ask my coach for a few tips around getting stronger, learning to dance cuban salsa, and learn to surf
<FromGitter>
<oren> at first i am ok with a very basic coach. everything in one file. later on i would like to have a file per domain. surfing tips on it's own file. salsa dance on it's own etc.
<FromGitter>
<oren> the filst thing i believe i should do is `crystal init app coach`
<FromGitter>
<oren> since it looks like it create a structure for me
<FromGitter>
<oren> but i don't know where to continue after the init command. I do have ruby experience.
<FromGitter>
<oren> but i need a refresher on proper folder structure and modules.
<FromGitter>
<tenebrousedge> the rest of that library looks fine from a structural standpoint
<FromGitter>
<oren> i noticed that the init command created a module Coach inside coach.cr
<FromGitter>
<oren> but the todo app doesn't have module in the todo.cr file
<FromGitter>
<oren> so i am curious, do i need a module?
<FromGitter>
<oren> basically how do i start building a proper CLI?
<FromGitter>
<oren> i don't want to copy random code that might not be great, like you pointed earlier with the 'dirty' line
<FromGitter>
<tenebrousedge> you should do all of your "work" inside a module. The entry point can do things like load configuration files. It's okay for it to set a version number as well: ⏎ ⏎ ```module Todo ⏎ VERSION = "0.1.0" ⏎ end``` [https://gitter.im/crystal-lang/crystal?at=5e2cc55401914e3e044afeb3]
<FromGitter>
<Blacksmoke16> It's a good practice to namespace your code, so I'd keep the module
<FromGitter>
<tenebrousedge> the entrypoint should do the minimum necessary to hand off execution to the rest of the code
<FromGitter>
<oren> i have an empty git repo i want to dedicate for this project. `crystal init app coach` created another folder with git project inside. so now i have coach/coach folder structure (:
<FromGitter>
<oren> sounds a bit convoluted.
<FromGitter>
<oren> what am i doing wrong?
<FromGitter>
<oren> also why does the init command create a git repo?
<FromGitter>
<oren> i already have one so it's redundant and confusing
<raz>
yea but frankly, if i'm to switch away from stock spec, i'd prefer to switch to something simpler, rather than something even more magical
<FromGitter>
<Blacksmoke16> You can do like
<FromGitter>
<Blacksmoke16> 1) should be > 5
<raz>
i like the describe/before/after scoping. but for the tests itself, i wish i could just do plain older "assert <expression>"
<FromGitter>
<tenebrousedge> well, you can
<raz>
oh, it works!
<raz>
ah, crystal has assert?
<FromGitter>
<Blacksmoke16> No
<raz>
well, i don't really want to divert from the beaten path too far either. then my tests will look different from everyone elses and i get mocked :<
<raz>
i'm just tired of never remembering if it's should be_nil, should be nil, should_be(nil) or whatnot
<FromGitter>
<tenebrousedge> `assert` is a one-liner, and I really doubt you would get mocked
<raz>
right, i may look into that
<FromGitter>
<Blacksmoke16> There's an issue for it
<raz>
i assume you mean just make a helper method for it?