<FromGitter>
<Blacksmoke16> issue was when you were defining the @@commands type/return type
<FromGitter>
<Blacksmoke16> since it would be a union then since it also gets inherited
<FromGitter>
<Blacksmoke16> @botanicus
<FromGitter>
<botanicus> @Blacksmoke16 wow, thanks! It does work. I'm still failing to understand why though. I don't understand where is the union coming from?
<FromGitter>
<Blacksmoke16> `self.class`
ua has joined #crystal-lang
<FromGitter>
<Blacksmoke16> since that method also gets inherited the compiler doesnt know which class it is referring to. at least thats what im thinking
<FromGitter>
<Blacksmoke16> but if you define the type statically, it will always be that type, vs something that can change depending on where it was called
<FromGitter>
<botanicus> That makes sense. Thanks!
<FromGitter>
<Blacksmoke16> welp, apparently it wants to be nil
<FromGitter>
<dscottboggs_gitlab> lol wtf
<FromGitter>
<Blacksmoke16> yea i dunno, is just for this one, the others that do like legit the same thing are fine
<FromGitter>
<whitenoiseoss> $ crystal run mdma_lua.cr ⏎ Pointer(Void)@0x558cc41c73c8
<FromGitter>
<whitenoiseoss> what do you know.
jemc has joined #crystal-lang
<FromGitter>
<Blacksmoke16> night
<FromGitter>
<whitenoiseoss> o/
jemc has quit [Client Quit]
okami has joined #crystal-lang
faitswulff has quit [Remote host closed the connection]
return0e_ has joined #crystal-lang
return0e has quit [Ping timeout: 255 seconds]
<FromGitter>
<rishavs> Just added my lunch money on BountySource. Need Windows support so I can start on sweet sweet games and abandon it after a few months :3
DTZUZO has joined #crystal-lang
<FromGitter>
<bararchy> XD
<livcd>
rishavs: something big will be announced for ruby in April
<FromGitter>
<drum445> How exciting
<FromGitter>
<bararchy> for Ruby? not for crystal? :)
<livcd>
yeah
ashirase has quit [Ping timeout: 268 seconds]
ashirase has joined #crystal-lang
<hightower3>
What could it be!
<hightower3>
bararchy: maybe livcd is preparing us for April 1st :)
<FromGitter>
<bararchy> hahahha
<FromGitter>
<bararchy> TBH we (NeuraLegion) got something planned for the Crystal community, but it's also a bit soon to talk about it
laaron- has joined #crystal-lang
laaron has quit [Remote host closed the connection]
<livcd>
RubyMotion will be opensourced
ternarysolo has joined #crystal-lang
faitswulff has joined #crystal-lang
mntmn has joined #crystal-lang
<FromGitter>
<j8r> Hi, anyone interested on a part-time job on a Crystal Web project?
<hightower3>
j8r not me but just asking out of interest, is any framework used?
<FromGitter>
<j8r> that's a new project - you are free to use any framework to build the API server like Kemal, Onyx or other. (but Amber and Lucky would be overkill for this)
<FromGitter>
<j8r> on the client side, you're free to - React, Vue.js or other :)
Creatornator has joined #crystal-lang
lucasb has joined #crystal-lang
<FromGitter>
<mehmetc> what is the difference between the first c and the second c definition? I’m getting an "no overload matches” error if I use the first. ⏎ `#c = {} of String => Array(String) | Array(Hash(String, String)) ⏎ c = {} of String => Array(String | Hash(String, String)) ⏎ d = [] of String | Hash(String, String) ⏎ d << "1" ... [https://gitter.im/crystal-lang/crystal?at=5c77f1674a65f754733fb8e3]
<FromGitter>
<dscottboggs_gitlab> I think that could be a bug
<FromGitter>
<cserb> Is there a convenience macro to not have to write the initialize method? Similar to JSON.mapping that would also generate a `.new` constructor? ⏎ So instead of: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5c77f45ee8ea1437378c9bcb]
<FromGitter>
<mehmetc> @dscottboggs_gitlab can I/we do something to be sure?
<FromGitter>
<Blacksmoke16> iirc i dont think it is, is just how unioned arrays work?
<FromGitter>
<Blacksmoke16> i remember having to deal with something like that, but maybe post something on the forums?
<FromGitter>
<mehmetc> will do!
<FromGitter>
<mehmetc> Do you remember how you worked around this?
<FromGitter>
<Blacksmoke16> prob just use the 2nd?
<FromGitter>
<Blacksmoke16> id have to mess around with it more
<FromGitter>
<j8r> the two aren't similar
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter>
<j8r> The first defined an Union of two different types of Array, the second one type of Array, that includes an Union
Creatornator has joined #crystal-lang
jemc has joined #crystal-lang
<jokke>
hey
<jokke>
how would one implement a http(s) proxy server in crystal? i want to be able to set it either system wide or from a browser so all http and https traffic goes through the server
<jokke>
the server should then be able to determine what protocol, host and path was requested, request the content with HTTP::Client and modify it before sending it forward to the client
<hightower3>
jokke: I would say that HTTP::Server (which must be client-facing side of this proxy) has very elegant options to accept incoming client connections and process them through Handlers. After that, how are you going to service those requests, is up to the code you would add, of course
<jokke>
yeah sure
<jokke>
but how would i tell firefox (or any other browser) to use that as a proxy?
<jokke>
also how would it deal with the different protocols? http/https
<hightower3>
jokke: you can do this in preferences -> advanced -> network proxy. Alternatively you might check whether they respect the http_proxy environment variable, and or you can see if they have a command line option for this
<hightower3>
jokke, regardin http/https, if you set a proxy to be http://your-proxy, then all requests will go to your proxy using http, like you specified, and you can handle from there
<hightower3>
jokke and regarding e.g. forcing all traffic to go through proxy, you could either do some iptables manipulation to do this, or you can look into Linux distributions like cubes and subgraph which approach the issue by having virtual hosts which handle network, and they route all traffic through them
<jokke>
hightower3: ah okay nice
<jokke>
but how how do i know if the client requested HTTPS?
<hightower3>
I wouldn't know -- and on a second thought I'm not even sure if proxy is a http listener, or it has something to do with SOCKS etc.
<jokke>
yeah :/
<jokke>
thought so
<jokke>
SOCKS is a bit more complicated
<hightower3>
jokke, I also advise you check the good/old Squid proxy. Maybe it has all the features you need and you can replace your programming task with a squid configuration task
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
RX14 has quit [Ping timeout: 245 seconds]
Creatornator has joined #crystal-lang
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Creatornator has joined #crystal-lang
<FromGitter>
<Blacksmoke16> np
<FromGitter>
<Blacksmoke16> i refactored how exception handling works in athena
<FromGitter>
<Blacksmoke16> ```code paste, see link``` ⏎ ⏎ `/article` would return a 400 error because it catches the divisionbyzero error in the custom exception handler. ⏎ `/user` would return a 500 now because it is unhandled. ⏎ ... [https://gitter.im/crystal-lang/crystal?at=5c781e6e8a7def0752f023f0]
<FromGitter>
<Blacksmoke16> Provides a pretty flexible way to manage errors
<FromGitter>
<Blacksmoke16> actually could prob make it cleaner by not having to pass in `ctx`...WIP :P
ua has quit [Ping timeout: 255 seconds]
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
RX14 has joined #crystal-lang
Creatornator has joined #crystal-lang
Creatornator has quit [Ping timeout: 250 seconds]
ua has joined #crystal-lang
jemc has quit [Ping timeout: 244 seconds]
hightower3 has quit [Ping timeout: 244 seconds]
<FromGitter>
<dscottboggs_gitlab> 💯
jemc has joined #crystal-lang
ternarysolo has quit [Ping timeout: 245 seconds]
marmotini_ has joined #crystal-lang
<FromGitter>
<Blacksmoke16> rethought of some of it, will now be passing the exception and action name thru, then add a `raise` or something similar method to replace the `halt`
<FromGitter>
<Blacksmoke16> where the `raise` method will be a protected method on `Athena::Routing::StructController` that can just call `get_response` to set response body/code
<FromGitter>
<Blacksmoke16> cleans it up a bit
marmotini_ has quit [Ping timeout: 255 seconds]
<FromGitter>
<Blacksmoke16> future iteration could be passing an `Action` object thru, so you would have access to like action/controller name, params etc
hightower2 has joined #crystal-lang
<FromGitter>
<bararchy> @j8r how about posting it in crystal jobs?