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
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 265 seconds]
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/vXtyK
<crystal-gh> crystal/master 13733dc Ary Borenszweig: Compiler: fixed incorrect metaclass type id. Fixes #3490
<travis-ci> crystal-lang/crystal#13733dc (master - Compiler: fixed incorrect metaclass type id. Fixes #3490): The build is still failing. https://travis-ci.org/crystal-lang/crystal/builds/171873584
tomchapin has joined #crystal-lang
tomchapin has quit [Quit: Textual IRC Client: www.textualapp.com]
txdv has quit [Ping timeout: 245 seconds]
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/vXtSo
<crystal-gh> crystal/master cc62eac Ary Borenszweig: Re-format some files
tomchapin has joined #crystal-lang
<travis-ci> crystal-lang/crystal#cc62eac (master - Re-format some files): The build is still failing. https://travis-ci.org/crystal-lang/crystal/builds/171877303
txdv has joined #crystal-lang
<crystal-gh> [crystal] ysbaddaden opened pull request #3491: WIP: AArch64 support (ARMv8-A) (master...aarch64-support) https://git.io/vXtHe
Davy_CC has joined #crystal-lang
soveran has joined #crystal-lang
tomchapin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
soveran has quit [Ping timeout: 260 seconds]
dev0urer has joined #crystal-lang
dev0urer has quit [Ping timeout: 252 seconds]
pawnbox has joined #crystal-lang
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
pawnbox has quit [Ping timeout: 256 seconds]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 268 seconds]
pawnbox has joined #crystal-lang
hako has joined #crystal-lang
hako has quit [Client Quit]
hako has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
soveran has quit [Remote host closed the connection]
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 260 seconds]
bjz has joined #crystal-lang
bjz has quit [Read error: Connection reset by peer]
lacour has quit [Quit: Leaving]
bjz has joined #crystal-lang
bjz_ has joined #crystal-lang
bjz has quit [Ping timeout: 260 seconds]
metacollin has joined #crystal-lang
<metacollin> I love you guys
<metacollin> thank you for developing crystal
<FromGitter> <sdogruyol> @metacollin awesome :)
<FromGitter> <greentornado> hi
<FromGitter> <greentornado> which db out there stable with crystal :d
<FromGitter> <sdogruyol> @greentornado PostgreSQL and MysQL?
<FromGitter> <greentornado> yep only 2 of them ?
<FromGitter> <greentornado> :D
<FromGitter> <sdogruyol> sqlite also
<FromGitter> <sdogruyol> what are you looking for?
<FromGitter> <greentornado> i'm looking for a nosql one if possible
hako has quit [Ping timeout: 260 seconds]
mark_66 has joined #crystal-lang
<metacollin> Hashes? ;)
<FromGitter> <sdogruyol> @greentornado redis is your best choice
<FromGitter> <greentornado> :D can i use redis as a replacement for mongo in this case :D
<FromGitter> <greentornado> just use it for pubsub ealier
<FromGitter> <sdogruyol> redis is great at pub sub stuff
<FromGitter> <greentornado> well so if i have to go with persistant data, pgsql/mysql is the choice then ?
<FromGitter> <sdogruyol> yep
<metacollin> :o 680,000 commands per second single thread
<FromGitter> <greentornado> another option is using rest api with couchbase/firebase :D
<FromGitter> <greentornado> crystall http client is quite good
<FromGitter> <greentornado> is crystal support params string ?
<metacollin> hmm, is web/database stuff kind of the primary usage case you've been seeing for crystal? As much as you can for something in alpha anyway? Personally, I'm using it to write a parser generator, very much like treetop. But hopefully fast enough to be useful lol
<FromGitter> <greentornado> Lol, i'm experimental a new api app in crystal
<FromGitter> <greentornado> but i'm testing pubsub with redis and couchbase as backend db with good result
<FromGitter> <greentornado> how to check JSON::Any object has a key ?
gloscombe has joined #crystal-lang
dev0urer has joined #crystal-lang
metacollin has quit [Quit: metacollin]
<FromGitter> <sdogruyol> .has_key?("some_key")
<FromGitter> <greentornado> it says undefined method 'has_key?' for JSON::Any
<FromGitter> <greentornado> :D
<FromGitter> <sdogruyol> can you share some code please
<FromGitter> <greentornado> yep
<FromGitter> <sdogruyol> if you are using Kemal env.params.json["key"]? will do the job
<FromGitter> <sdogruyol> check http://kemalcr.com/docs/context/
<FromGitter> <greentornado> i'm parsing json from http client call
<FromGitter> <greentornado> the json is like this
hako has joined #crystal-lang
<Papierkorb> please don't share screenshots. Share code through services like gist.github.com instead.
<FromGitter> <greentornado> Yep
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/vXq3m
<crystal-gh> crystal/master 1f49199 Ary Borenszweig: Re-format one more file
gloscombe has quit [Ping timeout: 252 seconds]
gloscombe has joined #crystal-lang
dev0urer has quit [Ping timeout: 256 seconds]
<greenbigfrog> good day
<greenbigfrog> am I jsut missing it, or is there no shard for google's URL shortener yet?
<greenbigfrog> there is shorturl but it expands URLs by actually visiting the site. I'd like to expand the URL via the API
<FromGitter> <luislavena> @askn BTW, opened a issue about the extend with generics, it was expected behavior after all: https://github.com/crystal-lang/crystal/issues/3487
<FromGitter> <International> hi everyone, when running crystal spec, i get back just a F. Is there a way to get a more detailed description of what failed, and on what line ?
<FromGitter> <luislavena> @International in the output you should see the failed spec file and line where it failed, like this:
<FromGitter> <luislavena> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=58173c6b806316005ddbd992]
<FromGitter> <luislavena> if you want to get a more *verbose* output, use `-v`: `crystal spec -v`
<FromGitter> <International> this is how it appears to me
<FromGitter> <International> and if i run with -v , i get this:
<FromGitter> <luislavena> @International I only get 0 examples when indicated an incorrect line number. Please run without filename indicating the line number and check again.
<FromGitter> <luislavena> Also check that you're using latest version of Crystal, since built-in spec should display `0 examples, 0 failures, 0 errors, 0 pending`
<FromGitter> <International> i'm running `Crystal 0.19.4 (2016-10-21)`
<FromGitter> <luislavena> @International I will suggest try on a clean empty project (`cd ..; crystal init app myapp; cd myapp; crystal spec`)
<FromGitter> <International> i'm also using ` mocks: ⏎ github: waterlink/mocks.cr ⏎ spec2: ⏎ github: waterlink/spec2.cr ⏎ spec2-mocks: ... [https://gitter.im/crystal-lang/crystal?at=58173fba7b15d16e55c9ec74]
<FromGitter> <International> might be that the shards are doing smth to the formatter
<FromGitter> <luislavena> @International not sure about spec2 syntax to invoke file:line individual specs, please check the docs of that project just in case.
<FromGitter> <International> i think the syntax's the same, cause it's only running the specified test ( tried simplifying it more, just to be sure )
elomatreb has quit [Quit: mep mep]
elomatreb has joined #crystal-lang
<FromGitter> <luislavena> @International I mean how is required in `spec_helper.cr` and other changes that you might need to apply.
<FromGitter> <International> @luislavena got it, thanks!
Philpax__ has joined #crystal-lang
Philpax_ has quit [Ping timeout: 260 seconds]
matp_ is now known as matp
Philpax__ is now known as Philpax
<FromGitter> <sdogruyol> oh god please give me {} and [] of Object
avdi has quit [Read error: Connection reset by peer]
avdi has joined #crystal-lang
oniifiv has quit [Quit: Who turned this off?! D:<]
<FromGitter> <alex-lairan> :+1: :)
<FromGitter> <citizen428> i'm trying to write a spec for a macro that dynamically defines a module but get the following error `can't declare module dynamically` the macro seems to work fine in a playground, and reading through various github tickets regarding this error message i'm not wiser than before :/ any hints appreciated
<FromGitter> <citizen428> hm, i guess i got my module defined now... but there's many other things that don't work. sometimes it's confusing that crystal is so close to ruby ;)
mark_66 has quit [Remote host closed the connection]
<FromGitter> <luislavena> @citizen428 please gist the code (guess some macro) and the spec you're getting the error so we can help.
pawnbox has joined #crystal-lang
<FromGitter> <luislavena> BTW, you can't do `module ... end` within a `it` block, any module needs to be defined outside as `it` captures the sample block and later is run.
<FromGitter> <luislavena> https://play.crystal-lang.org/#/r/1d26
bjz_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Philpax has quit [Ping timeout: 268 seconds]
mhib has joined #crystal-lang
dev0urer has joined #crystal-lang
dev0urer has quit [Read error: Connection reset by peer]
idev0urer has joined #crystal-lang
idev0urer has quit [Client Quit]
dev0urer has joined #crystal-lang
dev0urer has quit [Read error: Connection reset by peer]
dev0urer has joined #crystal-lang
dev0urer has quit [Read error: Connection reset by peer]
dev0urer has joined #crystal-lang
dev0urer has quit [Client Quit]
dev0urer has joined #crystal-lang
dev0urer has quit [Client Quit]
dev0urer has joined #crystal-lang
dev0urer has quit [Client Quit]
dev0urer has joined #crystal-lang
dev0urer has quit [Client Quit]
dev0urer has joined #crystal-lang
dev0urer has quit [Client Quit]
dev0urer has joined #crystal-lang
<FromGitter> <johnjansen> @citizen428 following on from @luislavena , you cant define a module or class inside your spec, do it outside the describe
dev0urer has quit [Client Quit]
dev0urer has joined #crystal-lang
dev0urer has quit [Ping timeout: 244 seconds]
dev0urer has joined #crystal-lang
dev0urer has quit [Remote host closed the connection]
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 260 seconds]
Raimondii is now known as Raimondi
no0p has joined #crystal-lang
mhib has quit [Quit: Leaving]
hako has quit [Read error: Connection reset by peer]
hako has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
kulelu88 has joined #crystal-lang
pawnbox has joined #crystal-lang
matp has quit [Excess Flood]
<FromGitter> <johnjansen> anyone know how to use `missing_option` and `invalid_option` on `OptionParser`
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 244 seconds]
Raimondii is now known as Raimondi
matp has joined #crystal-lang
gloscombe has quit [Quit: Lost terminal]
<FromGitter> <johnjansen> all, is there a standard for the organization of a top level module, such that the code within it does not run whilst in test. ⏎ i.e. does spec setup something i can test (within a macro) … im assuming so, otherwise i can obviously add something, but id like to use any predescribed standard, if there is one
bjz has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
am_ has joined #crystal-lang
bjz_ has joined #crystal-lang
bjz has quit [Ping timeout: 268 seconds]
<FromGitter> <iDev0urer> Does `Class` not have any kind of send method like [this](http://ruby-doc.org/core-2.3.1/Object.html#send-method)
<RX14> @iDev0urer no, crystal is compiled
<FromGitter> <iDev0urer> Yeah I guess that wouldn't work with it being compiled, huh
<RX14> @johnjansen most people put code in ModuleName.run, then have a file which requires "./src/foo" then runs that method
<FromGitter> <johnjansen> thanks @RX14 thats what i figured, but it turned out to be completely obvious, although not the default config. ⏎ essentially the top level module is not tested (since the act of testing would start the process), and repointing spec helper down one level … so i test the components, but not the CLI parser etc
<FromGitter> <johnjansen> consider this ⏎ ```module MyCliApp ⏎ # Parse any options ⏎ run(with_options) ⏎ end``` ⏎ The default in spec helper will load this module and unavoidably run this of course. ⏎ I was forgetting that! the specs dont exercise this code, but the loading of it was enough to waste my time for a little while ;-) [https://gitter.im/crystal-lang/crystal?at=5817a76b8ed1c0ff5c4c3502]
vikaton has joined #crystal-lang
bjz_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<FromGitter> <luislavena> You use `missing_option` and `invalid_option` as callbacks of the parsing process
no0p has quit [Read error: No route to host]
<FromGitter> <johnjansen> Thanks @luislavena that's what I was missing
<A124> Any IDE/editor recommendations specificaly for crystal?
<A124> Cleaning up, refactoring work, management, storage and life and seems crystal is going to stick.
<FromGitter> <iDev0urer> @A124 I'm using VSCode right now
<A124> It runs Linux. Surprised. Well, did not know about this one, suggestion welcome, got to try.
<RX14> A124, the vim plugin for crystal works pretty well
<RX14> I don't think you're going to get completion or refactoring and the such
<FromGitter> <johnjansen> @A124 SublimeText with the Crystal package is very good
<FromGitter> <johnjansen> the same is true about completion and refactoring tho
<FromGitter> <iDev0urer> Someone eventually needs to create an intellij plugin for Crystal
<RX14> people keep saying that, but honestly the intellij codebase is a mess
<RX14> it's not easy to make plugins for, and making a plugin for intellij doesn't mangically guarantee it's intellij quality
no0p has joined #crystal-lang
bjz has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
lacour has joined #crystal-lang
am_ has quit [Ping timeout: 256 seconds]
am_ has joined #crystal-lang
am_ has quit [Ping timeout: 244 seconds]
<FromGitter> <phoffer> I’m alos using the Crystal package for Sublime
bjz has joined #crystal-lang