jhass changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.8.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
Doug_ has quit [Ping timeout: 246 seconds]
Philpax has joined #crystal-lang
nietzschette has joined #crystal-lang
havenwood has quit [Quit: Textual IRC Client: www.textualapp.com]
Philpax has quit [Read error: Connection reset by peer]
Philpax has joined #crystal-lang
sferik has joined #crystal-lang
tomchapin has joined #crystal-lang
Philpax has quit [Read error: Connection reset by peer]
nietzschette has left #crystal-lang [#crystal-lang]
Philpax has joined #crystal-lang
tomchapin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
lex has joined #crystal-lang
sferik has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
lex is now known as Guest89627
<Guest89627> puts "hello"
Guest89627 has quit [Quit: Page closed]
Philpax has quit [Read error: Connection reset by peer]
n0xff has joined #crystal-lang
Philpax has joined #crystal-lang
Philpax has quit [Read error: Connection reset by peer]
Philpax has joined #crystal-lang
Philpax_ has joined #crystal-lang
Philpax__ has joined #crystal-lang
Philpax has quit [Ping timeout: 240 seconds]
rmosolgo has quit [Remote host closed the connection]
Philpax_ has quit [Ping timeout: 255 seconds]
Philpax has joined #crystal-lang
Philpax__ has quit [Ping timeout: 260 seconds]
rmosolgo has joined #crystal-lang
rmosolgo has quit [Remote host closed the connection]
buggs has quit [Quit: WeeChat 0.4.2]
sfcgeorg_ has quit [Quit: Textual IRC Client: www.textualapp.com]
rmosolgo has joined #crystal-lang
rmosolgo has quit [Remote host closed the connection]
rmosolgo has joined #crystal-lang
rmosolgo has quit [Remote host closed the connection]
rmosolgo has joined #crystal-lang
willl has joined #crystal-lang
rmosolgo has quit [Remote host closed the connection]
rmosolgo has joined #crystal-lang
rmosolgo has quit [Remote host closed the connection]
rmosolgo has joined #crystal-lang
rmosolgo has quit [Remote host closed the connection]
rmosolgo has joined #crystal-lang
rmosolgo has quit [Remote host closed the connection]
rmosolgo has joined #crystal-lang
rmosolgo has quit [Remote host closed the connection]
NeverDie has quit [Quit: http://radiux.io/]
_jungh4ns has joined #crystal-lang
andrew-l` has joined #crystal-lang
andrew-l has quit [Ping timeout: 256 seconds]
pawnbox has joined #crystal-lang
buggs has joined #crystal-lang
Philpax has quit [Read error: Connection reset by peer]
Philpax has joined #crystal-lang
Philpax has quit [Read error: Connection reset by peer]
Philpax has joined #crystal-lang
Philpax has quit [Read error: Connection reset by peer]
Philpax has joined #crystal-lang
sferik has joined #crystal-lang
Philpax has quit [Read error: Connection reset by peer]
Philpax has joined #crystal-lang
gamemanj has joined #crystal-lang
sferik has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Philpax has quit [Read error: Connection reset by peer]
Philpax has joined #crystal-lang
<crystal-gh> [crystal] jhass pushed 2 new commits to master: http://git.io/vcv1T
<crystal-gh> crystal/master 93002f1 Adler: Add methods documentation to File class
<crystal-gh> crystal/master a87b984 Jonne Haß: Merge pull request #1610 from adlerhsieh/master...
kulelu88 has joined #crystal-lang
kulelu88 has quit [Changing host]
kulelu88 has joined #crystal-lang
Philpax has quit [Read error: Connection reset by peer]
Philpax has joined #crystal-lang
Philpax has quit [Client Quit]
Philpax has joined #crystal-lang
<travis-ci> manastech/crystal#a87b984 (master - Merge pull request #1610 from adlerhsieh/master): The build passed. https://travis-ci.org/manastech/crystal/builds/82392685
<DeBot> https://github.com/manastech/crystal/pull/1610 (Add methods documentation to File class)
<crystal-gh> [crystal] jhass pushed 2 new commits to master: http://git.io/vcv9r
<crystal-gh> crystal/master 48e0b50 Jonne Haß: Merge pull request #1606 from rhysd/spec-no-color...
<crystal-gh> crystal/master 5177026 rhysd: Add --no-color option to 'crystal spec' subcommand...
trapped has joined #crystal-lang
apt-get has joined #crystal-lang
ozra has quit [Ping timeout: 246 seconds]
kulelu88 has quit [Ping timeout: 264 seconds]
kulelu88 has joined #crystal-lang
<crystal-gh> [crystal] technorama opened pull request #1612: Mutex and thread attribute enhancements (master...f/mutex) http://git.io/vcfTv
toydestroyer has quit [Remote host closed the connection]
toydestroyer has joined #crystal-lang
kulelu88 has quit [Ping timeout: 264 seconds]
pawnbox has quit [Read error: Connection reset by peer]
toydestroyer has quit [Remote host closed the connection]
toydestroyer has joined #crystal-lang
kulelu88 has joined #crystal-lang
sferik has joined #crystal-lang
pawnbox has joined #crystal-lang
sferik has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<pawnbox> jhass: how do i check if something is send to STDERR
<pawnbox> in specs
<jokke> pawnbox: you can mock STDERR
<jokke> ah no
<jokke> but you can redirect STDERR to a file for example
<pawnbox> jokke: I don't how i would do that.
<pawnbox> `STDERR.puts "file or directory #{name} already exists"`
<jhass> mmh, yeah redirect it to a pipe
<jokke> STDERR.reopen(File.open('tmp/test_stderr'))
<jhass> but get a backup first
<jokke> yeah
<pawnbox> lemme try that
<jokke> that should give you something to start with
<jokke> pawnbox: in your case: `stderr = File.open("/dev/null"); stderr.reopen(STDERR); STDERR.reopen(File.open("tmp/test_stderr")); "do your stuff here"; STDERR.reopen(stderr)`
<jhass> I'd use a pipe though
<jokke> you're right
<jokke> a pipe is nicer
<jhass> and package it up in a neat capture_stderr method or so
<jokke> then you can just use stringio
<jhass> nah, no need for stringio
<jokke> no?
<jhass> a pipe is already an IO
<jokke> ah
<jokke> true
Philpax_ has joined #crystal-lang
Philpax__ has joined #crystal-lang
Philpax has quit [Ping timeout: 264 seconds]
Philpax_ has quit [Ping timeout: 255 seconds]
Philpax__ has quit [Ping timeout: 260 seconds]
<trapped> so i'm getting a segfault when calling .inspect()
<trapped> i'll try and open an issue
<trapped> but if anyone wants to give a look at the core dump it'd probably be helpful
<jokke> jhass: how are getters for bools defined?
<jokke> do i have to write a method foo? for @foo?
<jokke> or is there some nice macro i can use? :)
<jhass> getter? ?
<jokke> aah!
<jokke> awesome
<jokke> crystal > ruby in that case :)
BlaXpirit has joined #crystal-lang
Philpax has joined #crystal-lang
<jokke> jhass: how do you handle global gems on arch?
<jhass> I usually package them
<jokke> jhass: gem2arch?
<jhass> copy paste an existing one :P
<jokke> mmh
<jhass> but fine too I guess
<jokke> problem is, i have many packages that way that aren't available in the aur
<jhass> well I also just install stuff into my home
<crystal-gh> [crystal] technorama opened pull request #1613: ConditionVariable enhancements. (master...f/condition_variable) http://git.io/vcflw
<jhass> install: -n ~/.bin/
<jhass> got that in my ~/.gemrc
<jhass> and added it to my PATH
<jokke> jhass: yeah
<jokke> i think that's way less hassle
<crystal-gh> [crystal] asterite pushed 1 new commit to master: http://git.io/vcf8q
<crystal-gh> crystal/master efca897 Ary Borenszweig: BigInt: create from float, and `**`
sferik has joined #crystal-lang
<travis-ci> manastech/crystal#efca897 (master - BigInt: create from float, and `**`): The build passed. https://travis-ci.org/manastech/crystal/builds/82411505
<pawnbox> jhass: I tried redirecting STDERR to a file but it doesn't seem to be working. Am i missing something? https://gist.github.com/vjdhama/c1a0fc972e38c8dd04db
<jhass> pawnbox: STDERR.flush perhaps
sferik has quit [Quit: Textual IRC Client: www.textualapp.com]
<pawnbox> And where should i flush? before puts?
<jhass> after
<jhass> before read
<pawnbox> On compilation it says `Could not raise`
<jhass> uh
<jhass> guess we destroyed stderr and it's raising an exception?
<pawnbox> haha
<pawnbox> yeah lloks like it
<jhass> mmh, default mode for open is read only, no?
<pawnbox> yes
<pawnbox> oh
<pawnbox> jhass: got it.
<pawnbox> jhass: is there a way to mock `exit 1`
<jhass> I guess you could monkey patch Crystal::Init and define a stub exit there
ssvb has quit [Ping timeout: 246 seconds]
<pawnbox> stub in Crystal::Init?
<pawnbox> ok i'll try
Philpax has quit [Quit: Leaving]
<jokke> is there some reason not to have map! in Slice?
<BlaXpirit> jokke, real reason is Array has too much stuff that should be generic but nobody got around to
<BlaXpirit> there should be a random access container module, then Array, Slice and others could use it
<jokke> mmh i see
<jokke> so no point in implementing map! specifically for Slice
<jokke> that module sounds like lots of work though
<jokke> which is probably why no one has got around to it
<BlaXpirit> meh, just move some stuff from array into it and call it done
<jokke> i'll take a look
<BlaXpirit> jokke, well, first you'd have to make sure it's not against language creators' wishes
<BlaXpirit> i'm just hypothesising here
<jokke> mmh
<jokke> i think it's easier to implement it and provide a pull request
<jokke> if they don't like it they can reject it
<crystal-gh> [crystal] technorama opened pull request #1615: Futures on objects. Solves some issues raised in #1589. (master...f/object_futures) http://git.io/vcf13
<BlaXpirit> jokke, there are many interesting issues with this. for example, should there be a distinction for mutable/immutable random access container?
apt-get has quit [Ping timeout: 240 seconds]
<jokke> mmh
<jokke> i was thinking about that myself
<BlaXpirit> also, we could just start with one that assumes mutable, then if needed add a general one, again move some functionality from mutable to it
<BlaXpirit> i dunno
apt-get has joined #crystal-lang
ssvb has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
rmosolgo has joined #crystal-lang
pawnbox has joined #crystal-lang
<pawnbox> jhass: I am not able to figure out how to monkey patch exit. I want to be able to exit from `Crystal::Init.run(["lib", "#{__DIR__}/tmp"])` and not the whole spec run instance.
<jhass> class Crystal::Init; def exit(status=0); end; end; ?
<pawnbox> status 0
<pawnbox> ohk
<jokke> jhass: how are backreferences of regexes used in crystal?
<jhass> >> "foo".gsub(/(.{2})/, "b\\1")
<DeBot> jhass: # => "b\\1o" - http://carc.in/#/r/h4r
<jhass> mmh
<jokke> ah
<jokke> \\
<jhass> >> "foo".gsub(/(.{2})/, "b\1")
<DeBot> jhass: # => "b\u{1}o" - http://carc.in/#/r/h4s
<jhass> idk
<jokke> yeah..
<jhass> I guess its broken
<jokke> >> "Foo".gsub(/(.{2})/, "b#{$1}")
<DeBot> jokke: Nil assertion failed (Exception) - http://carc.in/#/r/h4t
<jokke> mmh
<jhass> >> "foo".gsub(/(.{2})/) {|m| "b#{m[1]}")
<DeBot> jhass: Syntax error in eval:20: unexpected token: ) - http://carc.in/#/r/h4u
<jhass> >> "foo".gsub(/(.{2})/) {|m| "b#{m[1]}" }
<DeBot> jhass: # => "boo" - http://carc.in/#/r/h4v
<jokke> yeah cool
<jokke> ah
<jokke> not in macro
<pawnbox> File.read("#{__DIR__}/test_stderr").should eq("file or directory #{__DIR__}/tmp already exists")
<pawnbox> jhass: I tried you version that also doesn't work. Above line does not execute.
<pawnbox> *your
<jhass> guess you have to use `crystal init foo` then and evaluate $?
<jokke> any way to get the type variables of a @type in macro context?
<jokke> asterite: ^
<pawnbox> jhass: this is what i am trying : https://gist.github.com/vjdhama/c1a0fc972e38c8dd04db
<pawnbox> what do you mean by using `crystal init foo`?
<jokke> oh
<jokke> type_vars
<jokke> :D
<jokke> hm no
<crystal-gh> [crystal] rmosolgo opened pull request #1617: fix(alias) add alias keyword to example (gh-pages...alias-typo) http://git.io/vcJLg
rmosolgo has quit [Remote host closed the connection]
rmosolgo has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
NeverDie has joined #crystal-lang
<crystal-gh> [crystal] jreinert opened pull request #1618: add type_vars method for type nodes in macros (master...type-vars) http://git.io/vcJ8a
rmosolgo has quit [Remote host closed the connection]
<crystal-gh> [crystal] jhass closed pull request #1617: fix(alias) add alias keyword to example (gh-pages...alias-typo) http://git.io/vcJLg
<jhass> pawnbox: I'm confused, your spec and the code doesn't go together
<jhass> the spec calls Crystal::Init.run(["lib", "#{__DIR__}/tmp"]) like I expect
<jhass> but "the code" and the the monkey patch makes no sense in relation to it
<jhass> so I have no clue as to what you're actually trying
<grindhold> what's the crystal-pendant to mutex.synchronize do ?
<crystal-gh> [crystal] adlerhsieh opened pull request #1619: Add documentation to Colorize class (master...master) http://git.io/vcJEj
<grindhold> s/pendant/equivalent/
<BlaXpirit> grindhold, same thing..?
<grindhold> BlaXpirit: i get "undefined method 'synchronize' for Mutex:Class" for "Mutex.synchronize do"
<grindhold> aand i know what i got wrong
<BlaXpirit> grindhold, no, u need to use an instance of mutex
<grindhold> yeah it werks :)
<grindhold> thanks
<pawnbox> jhass: i just updated the PR. https://github.com/manastech/crystal/pull/1600
havenwood has joined #crystal-lang
Ven has joined #crystal-lang
bmcginty has quit [Ping timeout: 250 seconds]
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<crystal-gh> [crystal] jhass closed pull request #1613: ConditionVariable enhancements. (master...f/condition_variable) http://git.io/vcflw
gamemanj has quit [Remote host closed the connection]
gamemanj has joined #crystal-lang
bmcginty has joined #crystal-lang
rmosolgo has joined #crystal-lang
Ven has joined #crystal-lang
<travis-ci> manastech/crystal#8d4ed16 (master - Merge pull request #1613 from technorama/f/condition_variable): The build passed. https://travis-ci.org/manastech/crystal/builds/82447173
<DeBot> https://github.com/manastech/crystal/pull/1613 (ConditionVariable enhancements.)
rmosolgo has quit [Ping timeout: 268 seconds]
Ven has quit [Ping timeout: 260 seconds]
<crystal-gh> [crystal] jhass closed pull request #1600: Modified crystal init to check for pre-existing files and folders. (master...issue-1472-1555) http://git.io/vnNQ1
havenwood has quit [Quit: Textual IRC Client: www.textualapp.com]
Ven has joined #crystal-lang
<travis-ci> manastech/crystal#667008b (master - Merge pull request #1600 from vjdhama/issue-1472-1555): The build passed. https://travis-ci.org/manastech/crystal/builds/82453571
<DeBot> https://github.com/manastech/crystal/pull/1600 (Modified crystal init to check for pre-existing files and folders.)
<jokke> why is working with enums so painful?
<jokke> foo & MyEnum::FOO
<jokke> not working
<jokke> i need to add .value
<jokke> why? :/
tomchapin has joined #crystal-lang
<jhass> jokke: I think if you mark it with @[Flags] you don't
<jokke> ooh
tomchapin has quit [Client Quit]
havenwood has joined #crystal-lang
tomchapin has joined #crystal-lang
<jokke> jhass: hm
<jokke> nope
<jhass> well at least |-ing works then
<jokke> no overload matches 'UInt8#&' with types HTTP::WebSocketFrame::Flags
<jokke> what use is it if you can't check if the flag is set?
Ven has quit [Read error: No route to host]
Ven has joined #crystal-lang
tomchapin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<jokke> jhass: yeah sure
<jokke> jhass: http://carc.in/#/r/h51
tomchapin has joined #crystal-lang
tomchapin has quit [Client Quit]
Ven has quit [Ping timeout: 265 seconds]
Ven has joined #crystal-lang
apt-get has quit [Remote host closed the connection]
gamemanj has quit [Ping timeout: 252 seconds]
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
pawnbox has quit [Remote host closed the connection]
ssvb has quit [Ping timeout: 246 seconds]
tomchapin has joined #crystal-lang
ssvb has joined #crystal-lang
havenwood has quit [Quit: Textual IRC Client: www.textualapp.com]
trapped has quit [Read error: Connection reset by peer]
rmosolgo has joined #crystal-lang
rmosolgo has quit [Remote host closed the connection]
rmosolgo has joined #crystal-lang
BlaXpirit has quit [Quit: Konversation]
rmosolgo has quit [Remote host closed the connection]
tomchapin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<asterite> jokke: http://carc.in/#/r/h5s
rmosolgo has joined #crystal-lang
rmosolgo has quit []
<crystal-gh> [crystal] asterite closed pull request #1585: add has_constant? macro method (master...has-constant) http://git.io/vnHTK