jhass changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.18.7 | Fund Crystals development: http://is.gd/X7PRtI | Paste > 3 lines of text to https://gist.github.com | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Logs: http://irclog.whitequark.org/crystal-lang
devinacosta has quit [Ping timeout: 250 seconds]
sp4rrow has joined #crystal-lang
trapped has quit [Ping timeout: 244 seconds]
sp4rrow has quit [Ping timeout: 250 seconds]
sp4rrow has joined #crystal-lang
zodiak_ has quit [Ping timeout: 264 seconds]
fedruantine has joined #crystal-lang
Oliphaunte has joined #crystal-lang
kulelu88 has quit [Quit: Leaving]
Oliphaunte has quit [Ping timeout: 260 seconds]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
greengriminal has joined #crystal-lang
pawnbox has quit [Ping timeout: 244 seconds]
Raimondii has joined #crystal-lang
greengriminal has quit [Ping timeout: 264 seconds]
greengriminal has joined #crystal-lang
Raimondi has quit [Ping timeout: 240 seconds]
Raimondii is now known as Raimondi
Philpax has joined #crystal-lang
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 244 seconds]
sp4rrow has quit [Quit: The Internet needs a break and I need a cookie]
Dreamer3 has joined #crystal-lang
Dreamer3 has quit [Client Quit]
pawnbox has joined #crystal-lang
Oliphaunte has joined #crystal-lang
pawnbox has quit [Ping timeout: 258 seconds]
Oliphaunte has quit [Ping timeout: 240 seconds]
zodiak has joined #crystal-lang
sp4rrow has joined #crystal-lang
greengriminal has quit [Quit: Leaving]
fridgerator has joined #crystal-lang
sp4rrow has quit [Quit: The Internet needs a break and I need a cookie]
sp4rrow has joined #crystal-lang
zodiak has quit [Ping timeout: 260 seconds]
zodiak has joined #crystal-lang
sp4rrow_ has joined #crystal-lang
djdarkbeat has joined #crystal-lang
<djdarkbeat> Hello
sp4rrow has quit [Ping timeout: 240 seconds]
<fridgerator> hi
Oliphaunte has joined #crystal-lang
<djdarkbeat> I’m looking for some guidance working with Slice and unpacking bitstrings.
<djdarkbeat> I have a protocol that has mixed Endian-ness, bitpacked, UInt16, UInt32 and other stuff.
<djdarkbeat> So far I have been able to read the file, create a slice fo UInt8, dump to hex etc.
<djdarkbeat> But I am a little lost with trying to get the whole packet as a slice with mixed types in it.
Oliphaunte has quit [Ping timeout: 258 seconds]
<djdarkbeat> Would I want to byte_slice(0,2) to get my first UInt16 from the packet?
<djdarkbeat> can I create a grammar to define the packing order of the UInt16, UInt32 and bitpacked elements of my data?
fridgerator has quit [Ping timeout: 250 seconds]
<djdarkbeat> I’ll go read the message_pack library or something to get some ideas.
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 258 seconds]
ome has joined #crystal-lang
djdarkbeat has quit [Ping timeout: 258 seconds]
djdarkbeat has joined #crystal-lang
snsei_ has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 264 seconds]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
sp4rrow_ has quit [Quit: Textual]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
matp has quit [Excess Flood]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 276 seconds]
<jhass> djdarkbeat: well, you likely don't want to read the whole packet into a slice and then extract stuff, but rather read each field from the IO directly and perhaps assemble a struct that holds the data while doing that
<jhass> IO has some facility to read various types in either endianess directly from it
ponga has joined #crystal-lang
pawnbox has joined #crystal-lang
<jhass> specifically you can do things like UInt16.from_io(socket, IO::ByteFormat::BigEndian)
snsei_ has joined #crystal-lang
snsei has quit [Ping timeout: 252 seconds]
onethirtyfive has joined #crystal-lang
<onethirtyfive> hi everyone. noobie question! If I wanna bind to an `unsigned` field in a struct in a C lib, what type do I declare in my crystal `struct`? As I understand it, unsigned is platform-dependent.
<onethirtyfive> I feel like if I figure out what `unsigned` is on my computer, and then use the corresponding UInt* type in my declaration, it might break on someone else's arch?
<jhass> onethirtyfive: huh, just unsigned, not unsigned int or unsigned short or anything?
<jhass> onethirtyfive: looks like unsigned is the same as unsigned int, so you can use LibC::UInt
<onethirtyfive> well, derp. :) thank you!
<onethirtyfive> I am but a rubyist in this strange (awesome) new country.
<jhass> ;)
onethirt_ has joined #crystal-lang
onethirtyfive has quit [Quit: Page closed]
onethirt_ is now known as onethirtyfive
onethirtyfive has quit [Remote host closed the connection]
onethirtyfive has joined #crystal-lang
wmoxam has quit [Remote host closed the connection]
onethirtyfive has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
onethirtyfive has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 244 seconds]
onethirtyfive has quit [Ping timeout: 244 seconds]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox_ has joined #crystal-lang
pawnbox has quit [Ping timeout: 276 seconds]
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 244 seconds]
onethirtyfive has joined #crystal-lang
onethirtyfive has quit [Ping timeout: 276 seconds]
pawnbox_ has quit [Remote host closed the connection]
Philpax_ has joined #crystal-lang
pawnbox has joined #crystal-lang
Philpax has quit [Ping timeout: 252 seconds]
matp has joined #crystal-lang
Oliphaunte has joined #crystal-lang
ome has quit [Quit: Connection closed for inactivity]
Oliphaunte has quit [Ping timeout: 276 seconds]
Raimondi has quit [Quit: All hail WeeChat 1.5-dev!]
Raimondi has joined #crystal-lang
onethirtyfive has joined #crystal-lang
onethirtyfive has quit [Ping timeout: 252 seconds]
<FromGitter> <sdogruyol> MetaRuby now has a Crystal Forum https://metaruby.com/c/crystal-forum
snsei_ has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
snsei has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 240 seconds]
trapped has joined #crystal-lang
<FromGitter> <kofno> :+1:
bazaar has quit [Quit: leaving]
bazaar has joined #crystal-lang
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
snsei_ has joined #crystal-lang
snsei has quit [Ping timeout: 252 seconds]
Oliphaunte has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
snsei_ has quit [Remote host closed the connection]
snsei has joined #crystal-lang
Ven has joined #crystal-lang
Philpax_ has quit [Ping timeout: 252 seconds]
onethirtyfive has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
onethirtyfive has quit [Ping timeout: 250 seconds]
pawnbox has quit [Remote host closed the connection]
rolha has joined #crystal-lang
trapped has quit [Read error: Connection reset by peer]
rolha has quit [Quit: Textual IRC Client: www.textualapp.com]
Oliphaunte has joined #crystal-lang
snsei_ has joined #crystal-lang
<crystal-gh> [crystal] asterite pushed 4 new commits to master: https://git.io/vKSB8
<crystal-gh> crystal/master bb2cfbc Jonne Haß: Use read(Slice(UInt8)) in 2048 sample
<crystal-gh> crystal/master 161452a Jonne Haß: Add io/console methods to IO::FileDescriptor only
<crystal-gh> crystal/master d7865a3 Jonne Haß: Remove IO#read_nonblock
snsei has quit [Ping timeout: 258 seconds]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 260 seconds]
snsei has joined #crystal-lang
snsei has quit [Client Quit]
snsei_ has quit [Ping timeout: 258 seconds]
snsei has joined #crystal-lang
<travis-ci> crystal-lang/crystal#c7b7e2c (master - Merge pull request #3036 from jhass/remove_nonblock): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/147004021
snsei has quit [Remote host closed the connection]
Oliphaunte has quit [Remote host closed the connection]
snsei has joined #crystal-lang
Oliphaunte has joined #crystal-lang
rolha has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
snsei_ has joined #crystal-lang
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
snsei has quit [Ping timeout: 244 seconds]
nakilon has joined #crystal-lang
kulelu88 has joined #crystal-lang
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 276 seconds]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 265 seconds]
sooli has joined #crystal-lang
sooli has quit [Remote host closed the connection]
sooli has joined #crystal-lang
pawnbox has joined #crystal-lang
kulelu88 has quit [Quit: Leaving]
pawnbox_ has joined #crystal-lang
pawnbox has quit [Ping timeout: 244 seconds]
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 265 seconds]
<crystal-gh> [crystal] puppetpies opened pull request #3038: Added tail UNIX like functionality (master...tailfunc) https://git.io/vKSwZ
sooli has quit [Remote host closed the connection]
sooli has joined #crystal-lang
sooli has quit [Remote host closed the connection]
sooli has joined #crystal-lang
onethirtyfive has joined #crystal-lang
sooli has quit [Remote host closed the connection]
sooli has joined #crystal-lang
sooli has quit [Read error: Connection reset by peer]
sooli has joined #crystal-lang
sooli has quit [Remote host closed the connection]
sooli has joined #crystal-lang
sooli has quit [Read error: Connection reset by peer]
sooli has joined #crystal-lang
sooli has quit [Remote host closed the connection]
sooli has joined #crystal-lang
kulelu88 has joined #crystal-lang
kulelu88 has quit [Max SendQ exceeded]
kulelu88 has joined #crystal-lang
kulelu88 has quit [Max SendQ exceeded]
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 250 seconds]
<onethirtyfive> Are macros usable with C bindings?
<RX14> onethirtyfive, macros to generate lib declarations?
<onethirtyfive> yep!
<RX14> they should do
<onethirtyfive> great, thanks!
pawnbox_ has quit [Remote host closed the connection]
sooli has quit [Ping timeout: 260 seconds]
Oliphaunte has joined #crystal-lang
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 250 seconds]
<FromGitter> <jwoertink> When writing a spec, how do you use `expect_raises`? I keep getting an error
<FromGitter> <jwoertink> macro 'expect_raises' must be defined before this point but is defined later
<BlaXpirit> jwoertink, show code. and for an example just browse crystal repository
<FromGitter> <jwoertink> ```it "raises an error" do ⏎ expect_raises(Exception) do ⏎ raise "error" ⏎ end ⏎ end``` [https://gitter.im/crystal-lang/crystal?at=57952a5e9d9e974a7f7c7bc3]
<BlaXpirit> jwoertink, could be that you didnt require spec or sth
<FromGitter> <jwoertink> lol. yup. good call ;)
onethirtyfive has quit [Remote host closed the connection]
<FromGitter> <jwoertink> Sweet! Test passes... got a weird error, but I'll see if I can work that out
<FromGitter> <jwoertink> thanks!
<FromGitter> <sdogruyol> @jwoertink this is great :) https://github.com/jwoertink/fez
<FromGitter> <jwoertink> haha thanks
<FromGitter> <jwoertink> that's what I'm working on now
<FromGitter> <sdogruyol> realized that
<FromGitter> <sdogruyol> hope it turns out to be something really useful
<FromGitter> <jwoertink> I'd love some help if anyone wants to contribute!
<FromGitter> <jwoertink> my company is starting to port over all our mini rails projects to crystal, so it's gonna be a very consistent thing for us
<FromGitter> <sdogruyol> well, we have something like-ish to this but it's internal
<FromGitter> <sdogruyol> and was written in bash :worried:
<FromGitter> <sdogruyol> so i'm really rooting for Fez, cool idea @jwoertink
<FromGitter> <jwoertink> thanks! :D
<FromGitter> <sdogruyol> i can help you along the way
<FromGitter> <jwoertink> sweet. That'd be awesome
<FromGitter> <sdogruyol> sure!
<crystal-gh> [crystal] endSly opened pull request #3039: BigInts should use gmp implementation of gcd and lcm (master...master) https://git.io/vKSPk
onethirtyfive has joined #crystal-lang
devinacosta has joined #crystal-lang
onethirtyfive has quit [Remote host closed the connection]
onethirtyfive has joined #crystal-lang
onethirtyfive has quit [Ping timeout: 240 seconds]
Oliphaunte has quit [Remote host closed the connection]
onethirtyfive has joined #crystal-lang
dannluciano has joined #crystal-lang
<devinacosta> Just curious what your methods would be, if you have a program that needs to SSH into a box and run a command and then capture the output, return code, what is the best method that you would use to do that?
<jhass> if you can get datanoise/ssh2 working (again), that
<jhass> else Process.run
<devinacosta> ok that's what i concluded to.
snsei_ has quit [Remote host closed the connection]
Raimondii has joined #crystal-lang
<RX14> parsing content-disposition is just a massive pain
Raimondi has quit [Ping timeout: 240 seconds]
<RX14> parsing the k=v thing itself is a pain because of where you can put whitespace
<RX14> why can't they make their RFCs machine readable
<RX14> its the whitespace, why can't they just specify no whitespace
Raimondii is now known as Raimondi
devinacosta has quit [Ping timeout: 250 seconds]
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Oliphaunte has joined #crystal-lang
<crystal-gh> [crystal] asterite pushed 2 new commits to master: https://git.io/vKSyM
<crystal-gh> crystal/master 20ebc25 Ary Borenszweig: Fix in `pp` macro: don't paste single expression
<crystal-gh> crystal/master afff13c Ary Borenszweig: Compiler: more simplifications and docs
onethirtyfive has quit [Remote host closed the connection]
Philpax_ has joined #crystal-lang
Philpax_ has quit [Ping timeout: 252 seconds]
snsei has joined #crystal-lang
<travis-ci> crystal-lang/crystal#afff13c (master - Compiler: more simplifications and docs): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/147067229
snsei has quit [Ping timeout: 240 seconds]
<FromGitter> <jwoertink> Has anyone done a `require` from inside a macro yet? It's not working the way I'd expect
<FromGitter> <jwoertink> ```macro my_require(file) ⏎ require "../src/thing/#{ {{file}} }" ⏎ end``` [https://gitter.im/crystal-lang/crystal?at=5795543067c448730efbff00]
<FromGitter> <jwoertink> can't find file '../src/thing/my_file' relative to 'expanded macro: my_require'
<FromGitter> <jwoertink> it seems that `__FILE__` inside of the macro returns `expanded macro: my_require`
rolha has quit [Read error: Connection reset by peer]
Philpax_ has joined #crystal-lang
rolha has joined #crystal-lang
<FromGitter> <Sija> Hi! Is there any reason for `String` class to *not* include `#<<` method?
pawnbox has joined #crystal-lang
<FromGitter> <jwoertink> @Sija not sure if this is correct or not, but might be the same reason `String` doesn't include `#length`
<FromGitter> <jwoertink> Something about not making a bunch of alias methods?