jhass changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.10.0 | Fund Crystals development: http://is.gd/X7PRtI | Paste > 3 lines of text to https://gist.github.com | GH: https://github.com/manastech/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Logs: http://irclog.whitequark.org/crystal-lang
danzilio_ has joined #crystal-lang
guilleiguaran__ has quit [Ping timeout: 240 seconds]
Kilobyte22 has quit [Ping timeout: 240 seconds]
danzilio has quit [Ping timeout: 240 seconds]
RX14 has quit [Ping timeout: 240 seconds]
wminor has quit [Ping timeout: 240 seconds]
emmanueloga has quit [Ping timeout: 240 seconds]
iamstef has quit [Ping timeout: 240 seconds]
avdi has quit [Ping timeout: 240 seconds]
Dreamer3 has quit [Read error: Connection reset by peer]
Kilo`byte has joined #crystal-lang
aemadrid has quit [Ping timeout: 240 seconds]
danzilio_ is now known as danzilio
Dreamer3 has joined #crystal-lang
RX14 has joined #crystal-lang
aemadrid has joined #crystal-lang
wminor has joined #crystal-lang
sorbo_ has quit [Remote host closed the connection]
emmanueloga has joined #crystal-lang
guilleiguaran__ has joined #crystal-lang
fka has quit [Remote host closed the connection]
avdi has joined #crystal-lang
fka has joined #crystal-lang
fka has quit [Ping timeout: 272 seconds]
iamstef has joined #crystal-lang
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 246 seconds]
fowlduck has joined #crystal-lang
dfdfdf has quit [Ping timeout: 250 seconds]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 260 seconds]
codingcan has joined #crystal-lang
sorbo_ has joined #crystal-lang
codingcan has quit [Remote host closed the connection]
codingcan has joined #crystal-lang
codingcan has quit [Remote host closed the connection]
codingcan has joined #crystal-lang
codingcan has quit [Remote host closed the connection]
codingcan has joined #crystal-lang
badeball_ is now known as badeball
sorbo_ has quit [Remote host closed the connection]
codingcan has quit []
waterlin1 has joined #crystal-lang
waterlink has quit [Ping timeout: 265 seconds]
fowlduck has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 245 seconds]
Philpax_ has joined #crystal-lang
Philpax has quit [Ping timeout: 256 seconds]
sorbo_ has joined #crystal-lang
jiriki has quit [Ping timeout: 260 seconds]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 255 seconds]
shama has quit [Remote host closed the connection]
rkeene has joined #crystal-lang
fowlduck has joined #crystal-lang
waterlin1 has quit [Ping timeout: 250 seconds]
pawnbox has joined #crystal-lang
sorbo_ has quit [Ping timeout: 265 seconds]
vikaton has joined #crystal-lang
pawnbox has quit [Ping timeout: 260 seconds]
sorbo_ has joined #crystal-lang
tremendo has joined #crystal-lang
fowlduck has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 255 seconds]
pawnbox has joined #crystal-lang
sorbo_ has quit [Remote host closed the connection]
pawnbox has quit [Ping timeout: 256 seconds]
<rkeene> Is there any hope of adding SHA256 to the OpenSSL Digests ?
tremendo has quit [Quit: Leaving]
fka has joined #crystal-lang
fka has quit [Ping timeout: 264 seconds]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 260 seconds]
<rkeene> Attempting to use OpenSSL::Digest.new("sha1").update("test").hexdigest gives me an error: Error in /root/crystal-0.10.0-1/src/openssl/digest/digest.cr:6: undefined constant OpenSSL::Error
<rkeene> Seems like it should require openssl/openssl.cr ?
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 256 seconds]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox_ has joined #crystal-lang
pawnbox has quit [Ping timeout: 260 seconds]
jiriki has joined #crystal-lang
<rkeene> Had a small issue with type determination, I had: if upstreamURL === nil ... raise ... end and after the "end" upstreamURL's type was (String | Nil), changing that to if upstreamURL.is_a?(Nil) addressed it, but it was never really a problem anyway
<jhass> rkeene: === is not special cased in the compiler, only is_a? and "if foo"/"unless foo" are
<rkeene> My observation is merely that it could be, in this case, deduced so that could likely be added to the compiler.
<rkeene> I do have an actual problem though... I'm trying to download a file with HTTP::Client and not being successful. I am new to Crystal (but not new to software development)
<jhass> rkeene: https://carc.in/#/r/pbi SHA256 seems to be available?
<jhass> ?code
<DeBot> We can't help you without your code, please post it to https://gist.github.com
<rkeene> The file whose name is stored in the variable "tempFileName" is created, but nothing is written to it
<jhass> make sure to properly close the temp file
<rkeene> That won't happen when the object goes out of scope and the program terminates ?
<jhass> (or flush and rewind it if you want to reuse the file handle)
<jhass> it should, but still...
<rkeene> Closing the file wrote the contents I was expecting
<rkeene> So something is not flushing before exit :-(
trapped has joined #crystal-lang
fka has joined #crystal-lang
fka has quit [Remote host closed the connection]
fka has joined #crystal-lang
fka_ has joined #crystal-lang
fka has quit [Read error: Connection reset by peer]
apotheon has quit [Read error: Connection reset by peer]
fka_ has quit [Ping timeout: 264 seconds]
apotheon has joined #crystal-lang
vikaton has quit [Quit: Connection closed for inactivity]
<rkeene> I'm having another problem, this time with OpenSSL::Digest. I have the following 3 lines: checkHash = OpenSSL::Digest.new(hashMethod); checkHash.file(fileName); puts checkHash.hexdigest
<rkeene> The output keeps changing even though the input file never does
<jhass> oh, didn't pay close attention
<rkeene> Right, notice they're different ?
<jhass> mmh
<rkeene> I think it's hashing the object pointer
<jhass> I guess #update(IO) has a bug
<jhass> and I think I see it
<rkeene> #update(IO) ?
<rkeene> Not #file(fileName) ?
<jhass> no
<rkeene> Okay
<rkeene> Excellent
<rkeene> Is there some way I can conditionally compile this, e.g., if I'm linking in a particular version of the Crystal standard library ?
<crystal-gh> [crystal] jhass opened pull request #1987: Fix OpenSSL::DigestBase#update(IO) (master...digest_update_io) http://git.io/vukbR
<jhass> mmh, nothing practical
<jhass> atm you'll need to keep up with each new version anyhow
<rkeene> Bug: `outputFile` at /root/stuff/hashcache.cr:132:5 has no type Error: you've found a bug in the Crystal compiler. Please open an issue, including source code that will allow us to reproduce the bug: https://github.com/manastech/crystal/issues
<jhass> so just drop it with the next release
<jhass> the message has it all, these should never happen. It would be awesome if you reduce the code to the minimal reproducing example, but please include at least some code to reproduce
<rkeene> #1988
<DeBot> https://github.com/manastech/crystal/issues/1988 (Compiler bug in Crystal 0.10.0)
<jhass> thanks
<rkeene> Splitting the && into two `if's fixes it
ssvb_ has quit [Read error: Connection reset by peer]
ssvb_ has joined #crystal-lang
ssvb_ has quit [Read error: Connection reset by peer]
ssvb_ has joined #crystal-lang
pawnbox_ has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
HakanD_ has joined #crystal-lang
HakanD_ has quit [Ping timeout: 260 seconds]
kulelu88 has joined #crystal-lang
kulelu88 has quit [Changing host]
kulelu88 has joined #crystal-lang
pawnbox has quit [Ping timeout: 260 seconds]
fka has joined #crystal-lang
fka has quit [Remote host closed the connection]
fka has joined #crystal-lang
<vegai> are there mechanisms for multiple inheritance-type thingies?
<jhass> vegai: include MyAwesomeModule
<vegai> ah, thanks
waterlink has joined #crystal-lang
kulelu88 has quit [Ping timeout: 246 seconds]
<fka> Hey everyone!
<fka> I've problem with listening running processes I run
<fka> it should be something like that actually:
<fka> Process.run "someutildoesntend" do |stdout|
<fka> better one : Process.new "some-util-doesnt-end" { |stdout| puts stdout }
kulelu88 has joined #crystal-lang
<jhass> fka: I'm looking for a question ...
Philpax_ has quit [Ping timeout: 256 seconds]
sdogruyol has joined #crystal-lang
<sdogruyol> fka is probably talking about listening the stdout output of a process while it's running
<jhass> yeah, I just miss a clear question
<sdogruyol> :)
<sdogruyol> only 1 way of doing that comes to my mind..spawning another fiber to listen that stdout but it's too cumbersome
<jhass> Process.new should allow exactly the API they showed
<jhass> it forks off the process and yields a bunch of pipes for 1,2,3 of the forked process
<sdogruyol> they?
<sdogruyol> oh lol
<jhass> English is amazing in that regard :)
<sdogruyol> why dont you just refer with name :P
<sdogruyol> i couldnt get that 'they' :)
<sdogruyol> hehe
<jhass> they is easier after a short while
<jhass> and not causing unnecessary highlights
<sdogruyol> actually it's my first time seeing it used like this
<fka> @jhass sorry i couldnt finish my question :D
<fka> yeah, i need to listen stdout of another process, how can I do that?
<jhass> Process.new didn't work?
<fka> e.g. I cannot handle output of Process.new "tail -f /some.log"
<fka> because it never finishes
<fka> I need to forward the stdout of tail -f to the process i created in crystal
<fka> could not figure out how to.
<jhass> "the process created in crystal"?
<fka> i mean my program :)
<fka> the instance
<jhass> you just want a streaming read in your program?
<fka> YES
<fka> :)
<jhass> no need to shell out there
<fka> tail -f is a just an example to show unfinished process
<jhass> well, my question was not precise there, I meant "just a streaming read of a file"
<fka> it's actually "streaming read of a stdout of an another process"
<fka> i'm actually looking for an equivalent of https://nodejs.org/api/child_process.html#child_process_child_stdout
<jhass> fka: I would expect Process.run("tail -f ...", output: true) do |tail| loop do print tail.output.gets end end to work, but I'm getting nil for output and can't figure out why atm
<fka> i also tried this kind of code but cannot make it run :/
<sdogruyol> seems like we dont have multipart handling in HTTP::Request
fka has quit [Remote host closed the connection]
waterlink has quit [Ping timeout: 260 seconds]
fka has joined #crystal-lang
fka has quit [Ping timeout: 255 seconds]
sdogruyol has quit [Quit: Leaving...]
codingcan has joined #crystal-lang
fka has joined #crystal-lang
kulelu88 has left #crystal-lang ["Leaving"]
vegai has left #crystal-lang [#crystal-lang]
vikaton has joined #crystal-lang
fka has quit [Remote host closed the connection]
sdogruyol has joined #crystal-lang
<sdogruyol> what's $`
<sdogruyol> and how do i convert this to Crystal :P
<sdogruyol> $' contains the string after the actual matched string of the previous successful pattern match.
<sdogruyol> oh lol
waterlink has joined #crystal-lang
sdogruyol has quit [Quit: Leaving...]
fka has joined #crystal-lang
<fka> @jhass any news?
<fka> or did you give up? :)
<jhass> didn't further look into it, sorry
fka has quit [Remote host closed the connection]
fka has joined #crystal-lang
fka has quit [Remote host closed the connection]
fka has joined #crystal-lang
fka has quit [Remote host closed the connection]
fka has joined #crystal-lang
fka has quit [Remote host closed the connection]
fka has joined #crystal-lang
codingcan has quit [Remote host closed the connection]
fka has quit [Remote host closed the connection]
fka has joined #crystal-lang
<fka> @jhass your code works when i say `output: nil`
<fka> thanks!
<jhass> interesting
fka has quit [Remote host closed the connection]
fka has joined #crystal-lang
fka has quit [Ping timeout: 246 seconds]
codingcan has joined #crystal-lang
fka has joined #crystal-lang
vikaton has quit [Quit: Connection closed for inactivity]
fka has quit [Remote host closed the connection]
fka has joined #crystal-lang
codingcan has quit [Remote host closed the connection]
fka has quit [Remote host closed the connection]
sorbo_ has joined #crystal-lang
fka has joined #crystal-lang
Ven has joined #crystal-lang
Ven has quit [Client Quit]
codingcan has joined #crystal-lang
trapped has quit [Read error: Connection reset by peer]
fka has quit [Remote host closed the connection]
fka has joined #crystal-lang
fka has quit [Remote host closed the connection]
fka has joined #crystal-lang
fka has quit [Remote host closed the connection]