ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.19.4 | 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
<FromGitter> <Sophrinix> I'm sure this has been asked 100 times already, but I am not seeing it. How does crystal handle dependencies. Aka does crystal have the equiv of a Gemfile and bundler?
<Papierkorb> We call them "shards"
<FromGitter> <jwoertink> crystalshards.xyz
<FromGitter> <jwoertink> ^ sorta like rubygems.org
<FromGitter> <jwoertink> find one and check out the shard.yml file
<FromGitter> <Sophrinix> okay this is making 100% more sense now
soveran has joined #crystal-lang
<FromGitter> <jwoertink> Nice!
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/vXbfE
<crystal-gh> crystal/master 584060e Bryan Mulvihill: Enum from_value when Flags (#3518)
<FromGitter> <Sophrinix> next n00b question. the unit tests in a shard appear to be modeled after minitest or possibly rspec. Where is this documentation?
<FromGitter> <Sophrinix> for that matter what is the unit test library called?
<Papierkorb> It's Spec, modeled after rspec3 or so, with .should
<Papierkorb> builtin lib
soveran has quit [Ping timeout: 250 seconds]
<FromGitter> <Sophrinix> very nice.
grindhold has quit [Ping timeout: 245 seconds]
<travis-ci> crystal-lang/crystal#584060e (master - Enum from_value when Flags (#3518)): The build has errored. https://travis-ci.org/crystal-lang/crystal/builds/177351158
<DeBot> https://github.com/crystal-lang/crystal/pull/3518 (Enum from_value when Flags)
grindhold has joined #crystal-lang
Philpax has joined #crystal-lang
hako has quit [Ping timeout: 250 seconds]
bjz_ has joined #crystal-lang
bjz has quit [Ping timeout: 256 seconds]
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 250 seconds]
hako has joined #crystal-lang
bjz_ has quit [Ping timeout: 246 seconds]
bjz has joined #crystal-lang
A124 has quit [Remote host closed the connection]
A124 has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 250 seconds]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
Philpax has quit [Ping timeout: 246 seconds]
Philpax has joined #crystal-lang
Philpax has quit [Ping timeout: 246 seconds]
Philpax has joined #crystal-lang
onec has joined #crystal-lang
woodruffw has quit [Ping timeout: 250 seconds]
woodruffw has joined #crystal-lang
Philpax has quit [Ping timeout: 246 seconds]
Philpax has joined #crystal-lang
Philpax has quit [Ping timeout: 246 seconds]
soveran has joined #crystal-lang
Philpax has joined #crystal-lang
soveran has quit [Ping timeout: 250 seconds]
onec has quit [Remote host closed the connection]
pawnbox has quit [Remote host closed the connection]
sane_k_ has joined #crystal-lang
Philpax has quit [Ping timeout: 246 seconds]
Philpax has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has joined #crystal-lang
Philpax_ has joined #crystal-lang
soveran has quit [Ping timeout: 256 seconds]
Philpax has quit [Ping timeout: 246 seconds]
Philpax_ has quit [Ping timeout: 246 seconds]
Philpax has joined #crystal-lang
sane_k_ has quit [Ping timeout: 256 seconds]
pawnbox has joined #crystal-lang
Fichtenstein has joined #crystal-lang
Philpax_ has joined #crystal-lang
Philpax has quit [Ping timeout: 246 seconds]
pawnbox has quit [Remote host closed the connection]
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 256 seconds]
mati_urunda has joined #crystal-lang
triangles has joined #crystal-lang
hako has quit [Ping timeout: 244 seconds]
hako has joined #crystal-lang
<FromGitter> <maiha_twitter> How can I convert `String` to `Symbol`? Expected `to_sym` or `intern` method, but found nothing.
<BlaXpirit> maiha_twitter, if you could convert a string to a symbol, then there would be no point to symbols
<BlaXpirit> a symbol is meant to be a unique identifier, at compile time each symbol is converted to a number. at runtime you can't make up new symbols
<BlaXpirit> (i'm not saying that symbols in ruby are pointless.. but they're pointless xD)
<FromGitter> <maiha_twitter> I see. I want some function like `def symbolize(foo : String)` that returns `Symbol` or raise in runtime.
<BlaXpirit> maiha_twitter, that would be... `case "a": :a case "b": :b`
<BlaXpirit> if you tell more details, maybe we can come up with a neat macro to do this
<FromGitter> <maiha_twitter> Yep, I'd like to call 3rd party library method defined as `def foo(name : Symbol)` via cli argument.
<BlaXpirit> maiha_twitter, that library probably should've used an enum instead of a symbol
soveran has joined #crystal-lang
<BlaXpirit> then you do https://crystal-lang.org/api/0.19.4/Enum.html#parse%28string%29%3Aself-class-method
<BlaXpirit> though the use case may be valid for symbols, i dunn
<BlaXpirit> o
<FromGitter> <maiha_twitter> Specially, I want to create Nokogiri(css parser).cr, so I'd like to define `def css(tag : String)` that calls `Myhtml::Parser.nodes(tag_sym : Symbol)` . ⏎ https://github.com/kostya/myhtml/blob/master/src/myhtml/parser.cr#L36-L38
<BlaXpirit> probably not possible :|
<BlaXpirit> tags are semi-arbitrary strings
<BlaXpirit> you can't create an arbitrary symbol
<FromGitter> <maiha_twitter> yep!
<FromGitter> <maiha_twitter> I'll ask kostya for the API. Thanks @BlaXpirit !
pawnbox has joined #crystal-lang
<FromGitter> <sdogruyol> ugh
<FromGitter> <sdogruyol> FileUtils.rm doesnt exist?
<FromGitter> <sdogruyol> seems like it's File.delete
<FromGitter> <maiha_twitter> exists in `master` branch!
<FromGitter> <sdogruyol> oh ok
<FromGitter> <sdogruyol> arigato maihasan
<FromGitter> <maiha_twitter> can't wait 0.20.0! :smile:
<FromGitter> <sdogruyol> same here
<FromGitter> <sdogruyol> meanwhile i'm removing session from Kemal itself and moving into https://github.com/sdogruyol/kemal-session
mati_urunda has quit [Ping timeout: 256 seconds]
triangles has quit [Quit: Leaving]
soveran has quit [Remote host closed the connection]
Kilo`byte has quit [Quit: ZNC - 1.6.0 - http://znc.in]
Kilo`byte has joined #crystal-lang
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
pawnbox has quit [Remote host closed the connection]
soveran has quit [Remote host closed the connection]
Philpax__ has joined #crystal-lang
Philpax_ has quit [Ping timeout: 246 seconds]
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 260 seconds]
Philpax__ has quit [Ping timeout: 246 seconds]
kulelu88 has joined #crystal-lang
triangles has joined #crystal-lang
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 260 seconds]
triangles has quit [Quit: Leaving]
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/vXb66
<crystal-gh> crystal/master 44bc1dd Ary Borenszweig: Optimization: use memchr for searching a byte inside bytes
<crystal-gh> [crystal] asterite closed pull request #3519: Adds flag statement (TODO, FIXME, ...) parsing for docs (master...doc-todo) https://git.io/vX0ux
pawnbox has joined #crystal-lang
<travis-ci> crystal-lang/crystal#44bc1dd (master - Optimization: use memchr for searching a byte inside bytes): The build has errored. https://travis-ci.org/crystal-lang/crystal/builds/177437309
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 240 seconds]
<travis-ci> crystal-lang/crystal#1928ce5 (master - Adds flag statement (TODO, FIXME, ...) parsing for docs (#3519)): The build has errored. https://travis-ci.org/crystal-lang/crystal/builds/177438299
<DeBot> https://github.com/crystal-lang/crystal/pull/3519 (Adds flag statement (TODO, FIXME, ...) parsing for docs)
<FromGitter> <sdogruyol> @maiha_twitter can this be a nokogiri replacement for Crystal https://github.com/maiha/hq.cr
<FromGitter> <maiha_twitter> Yeah, I hope it should be!
<FromGitter> <sdogruyol> awesome!
<FromGitter> <maiha_twitter> Strictly, we need some parser generator like racc, but I can't find some stuff in Crystal yet.
<FromGitter> <maiha_twitter> So then, I'll manually parse XML by crystal-xml and CSS by myhtml for the first step.
onec has joined #crystal-lang
mester has joined #crystal-lang
<mester> Hi
<FromGitter> <fridgerator> hello
<mester> I have a question about Crystal lang
<mester> How I can read a string from stdin with function like fgets in C?
<mester> if I write this code: "STDIN.gets somevar" the program freezes
<FromGitter> <fridgerator> good question
<mester> And, what is the solution?
<FromGitter> <fridgerator> lol, not sure
<FromGitter> <fridgerator> i'm looking around at some other libraries now to see if I can find an example
<mester> If I write "somevar = STDIN.gets();"
<mester> The program freezes and flushes the output after gets() call
<FromGitter> <fridgerator> i'm not finding anything, someone else will have to answer your question
<tilpner> mester - You just want to store a line from stdin to somevar, right? That will block if no input is available. Try typing something, then pressing enter
<tilpner> I might misunderstand the question here
mester has quit [Ping timeout: 260 seconds]
<tilpner> Well, sorry, no need to quit >.>
<FromGitter> <fridgerator> lol
<FromGitter> <jwoertink> If I had to guess, does LibC.fgets() work?
pawnbox has quit [Remote host closed the connection]
tilpner has quit [Remote host closed the connection]
tilpner has joined #crystal-lang
onec has quit []
onec has joined #crystal-lang
onec has quit []
<FromGitter> <fridgerator> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5831e87623ce1ae73c05cb53]
<FromGitter> <fridgerator> I get `wrong number of arguments for 'Thing#to_json' (given 1, expected 0)`
<BlaXpirit> fridgerator, unfortunately misleading error message. https://github.com/crystal-lang/crystal/blob/master/src/json/to_json.cr
<BlaXpirit> objects are not convertible to json by default, but the "json" module defines to_json on every object which delegates to to_json(io)
<FromGitter> <fridgerator> ok
<FromGitter> <fridgerator> thanks
mati_urunda has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 246 seconds]
<crystal-gh> [crystal] sdogruyol opened pull request #3562: Remove SimpleHash (master...master) https://git.io/vXb76
<FromGitter> <aurelien-ldp> Hi ! I was wondering if it is possible to get attributes of a class' instance at compile time. The same way we do for getting methods with `@type.methods`. Something like `@type.attributes` ?
<BlaXpirit> aurelien-ldp, so.. what's an "attribute"?
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 244 seconds]
Raimondii is now known as Raimondi
<FromGitter> <aurelien-ldp> I mean a class variable
<FromGitter> <aurelien-ldp> instance variable*
<BlaXpirit> aurelien-ldp, so now we can find instance_vars method https://crystal-lang.org/api/0.19.4/Crystal/Macros/TypeNode.html#instance_vars%3ACrystal%3A%3AMacros%3A%3AArrayLiteral%28MetaVar%29-instance-method
<FromGitter> <aurelien-ldp> Perfect, thank you very much :)
sane_k_ has joined #crystal-lang
kulelu88 has left #crystal-lang ["Leaving"]
matp has quit [Remote host closed the connection]
matp has joined #crystal-lang
sane_k_ has quit [Ping timeout: 268 seconds]
<crystal-gh> [crystal] asterite closed pull request #3562: Remove SimpleHash (master...master) https://git.io/vXb76
<travis-ci> crystal-lang/crystal#58c85c0 (master - Remove SimpleHash. Fixes #2331.): The build has errored. https://travis-ci.org/crystal-lang/crystal/builds/177490954
<DeBot> https://github.com/crystal-lang/crystal/issues/2331 (Drop SimpleHash (Was: SimpleHash and other hashes))
<crystal-gh> [crystal] asterite opened pull request #3563: Rename MemoryIO to IO::Memory (master...feature/io_memory) https://git.io/vXbAN
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 250 seconds]
Ven has joined #crystal-lang
<crystal-gh> [crystal] asterite closed pull request #3075: Add HTTP::Request#host and HTTP::Request#host_with_port for convenience (master...master) https://git.io/v6f05
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<travis-ci> crystal-lang/crystal#b6e4744 (master - Add HTTP::Request#host and HTTP::Request#host_with_port for convenience): The build has errored. https://travis-ci.org/crystal-lang/crystal/builds/177504819
bjz has joined #crystal-lang
soveran has joined #crystal-lang
bjz has quit [Read error: Connection reset by peer]
Philpax__ has joined #crystal-lang
bjz has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Philpax__ has quit [Ping timeout: 246 seconds]
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Fichtenstein has quit [Quit: Fichtenstein]
mati_urunda has quit [Ping timeout: 268 seconds]
soveran has quit [Remote host closed the connection]
Philpax has joined #crystal-lang