ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.21.1 | Fund Crystal's 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> <jsilverMDX> what does {% do again
<FromGitter> <jsilverMDX> @bew local mode already works. im working on github mode
<FromGitter> <jsilverMDX> lol
<FromGitter> <bew> great, local mode wasn't too hard ? :P
<FromGitter> <jsilverMDX> i literally mostly copied and pasted the code from ruby
<FromGitter> <jsilverMDX> it ran without modifications
<FromGitter> <bew> {% is a macro statement
<FromGitter> <bew> I don't think you'll need that
<FromGitter> <jsilverMDX> yeah i dont think i need it either
<FromGitter> <jsilverMDX> i decided to crack open http/client.cr
<FromGitter> <jsilverMDX> notbad
<FromGitter> <bew> ahah, that's the best documentation and learning material to learn!
<FromGitter> <codenoid> hi, can i ask something ?,, how to get my column value as single result & foreach result,, https://s24.postimg.org/8iwqgdgbp/kemalcr7.png
pabs has quit [Ping timeout: 240 seconds]
<FromGitter> <jsilverMDX> hey @bew. my app is done. lol
<FromGitter> <bew> github link? I want to star :)
<FromGitter> <jsilverMDX> okay one sec haha
<FromGitter> <fridgerator> @codenoid the way you're doing it is a single result, if you want to in a block you do MYSql.query("query string").each do |result_set|; code... ;end
<cerulean> bet you guys didn't know the true version of rails
<cerulean> it's rails v396.55
<cerulean> known limitations: cant do insanely huge projects like torvalds/linux and bootstrap/bootstrap
<FromGitter> <bew> why?
<FromGitter> <jsilverMDX> it's too big maybe
<FromGitter> <jsilverMDX> maybe you can help me fix it
<FromGitter> <jsilverMDX> the code is coming now
<FromGitter> <jsilverMDX> run it in a directory with no args to find out it's real version
<FromGitter> <jsilverMDX> run it with "rails/rails" for instance to find out the version of a github app
<FromGitter> <bew> nice, but you shouldn't use APP_NAME & VERSION names for that, because CAPITAL names are 'reserved' for constants (rtfd)
<FromGitter> <jsilverMDX> oh
<FromGitter> <jsilverMDX> fixed
<FromGitter> <jsilverMDX> i just liked how a constant could be set to a dynamic value, you can't do that in ruby
<FromGitter> <jsilverMDX> it evaluated it perfectly when it needed the constant
<FromGitter> <jsilverMDX> is it immutable after setting a constant?
<FromGitter> <bew> I think you cant reassign it to sth else
<cerulean> yeah
<cerulean> that makes sense
<cerulean> my usage was proper. but i changed it and now it's better
<cerulean> haha
<FromGitter> <bew> yes that's it you can't reassign
<FromGitter> <drosehn> I suspect it's too soon to try to write a serious ruby->crystal translator. When you first start with crystal it seems like there are only a few minor differences, but the more you do with it the more "little things" you find which are different.
<FromGitter> <drosehn> Also, once you get used to crystal, you start to find things where it's better to rewrite the logic in your program than it is to make simple changes to ruby code which is just enough to get it to compile in crystal. IMO.
<FromGitter> <bew> +1
<FromGitter> <drosehn> And I think that will happen even more once crystal's multi-processing support is fully implemented.
<FromGitter> <codingphasedotcom> @sdogruyol just read you finally got multi thread in nice!!!!
ragmaanir_ has joined #crystal-lang
ragmaanir has quit [Ping timeout: 268 seconds]
bjz_ has quit [Quit: Textual IRC Client: www.textualapp.com]
bjz has joined #crystal-lang
pabs has joined #crystal-lang
ragmaanir_ has quit [Quit: Leaving]
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<FromGitter> <codingphasedotcom> @fridgerator adding crecto to the ROCKY stack
bjz has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<FromGitter> <fridgerator> @codingphasedotcom awesome!
bjz has joined #crystal-lang
<FromGitter> <khepin> Can I specify the return type of a proc when using a proc literal?
bjz has quit [Client Quit]
<FromGitter> <khepin> The compiler knows my proc returns `Array(Int32)`, but I need it to be considered as a `Array(Int32 | Symbol)` in some places
bjz has joined #crystal-lang
<FromGitter> <bew> you can, but why not return a symbol from this proc? (so the type will be correctly inferred)
<FromGitter> <khepin> I have a hash of proc, some of which will return an array of ints, some an array of symbols, some a mixture of those. I want to tell the compiler that all of them return “the same type” which is an array of either ints or symbols
<FromGitter> <khepin> How would I specify the return type?
<FromGitter> <khepin> Seems unlikely to work, ⏎ ⏎ ```[1].as(Array(Int32|Nil))``` ⏎ ⏎ Returns an error “Can’t cast `Array(Int32)` to `Array(Int32|Nil)`" [https://gitter.im/crystal-lang/crystal?at=58f437168fcce56b200bb1ad]
<FromGitter> <khepin> oh, I had missed the part I needed!
<FromGitter> <khepin> let’s see
<FromGitter> <bew> `[1] of Int32?`
<FromGitter> <bew> creates an array that can contain Int32 or Nil
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bjz has joined #crystal-lang
<cerulean> how does crystalshards.xyz know about my shard already if i never uploaded it?
zipR4ND has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bjz has joined #crystal-lang
<cerulean> btw, guys
<cerulean> i do believe in a ruby->crystal migration helper
<cerulean> we did this successfully in rubymotion with my hokkaido tool
<cerulean> it's not automatic
<cerulean> it's possible to alert on EVERY difference tho
<cerulean> the mitigation is by hand
<cerulean> however the result is HIGH code reuse
<FromGitter> <drosehn> I'm just saying that you should probably wait until after crystal 1.0 is released.
Raimondii has joined #crystal-lang
<FromGitter> <codenoid> hi sir, i have a question, how to send data to rendered view (.ecr),, and how to each result in the view file
Raimondi has quit [Ping timeout: 268 seconds]
Raimondii is now known as Raimondi
<FromGitter> <codenoid> ok, let me try
<FromGitter> <codenoid> yassss
xmonader3 has joined #crystal-lang
vdmo has joined #crystal-lang
McSoFake has joined #crystal-lang
McSoFake has quit [Remote host closed the connection]
McSoFake has joined #crystal-lang
xmonader2 has joined #crystal-lang
xmonader3 has quit [Ping timeout: 258 seconds]
zipR4ND has quit [Ping timeout: 240 seconds]
Qchmqs has joined #crystal-lang
<BlaXpirit> cerulean, i believe in it about as much as a javascript -> java migration helper
<cerulean> i'm not sure yet BlaXpirit
<cerulean> rubymotion was a tigher integration with ruby
<cerulean> only APIs were different
<cerulean> syntax was 100% ruby
<cerulean> we'll see
<cerulean> i will wait for crystal 1.0
<FromGitter> <bew> cerulean, about crystalshard website, it's because it search github every hour for new projects using crystal iirc
<FromGitter> <drosehn> Well, here's one example. When I started working with crystal, it had global variables the same way ruby did. Well, even more flexible in some ways than ruby's. Now it has no global variables, except the few special variables like `$~`, `$1`, etc. So for some ruby programs that is a pretty major change, and that change happened in the last few months. There may be more changes like that which will happen befor
<FromGitter> ... crystal.
<cerulean> wow bew
<cerulean> thats neat
<cerulean> is crystalshard built in crystal
<cerulean> drosehn, yes.. but... ive been working with ruby for years and almost never see those variables used. its considered bad practice
<cerulean> i agree about the constant changes tho
<FromGitter> <codenoid> Error in src/reseller.cr:53: instantiating 'DB::Database#query(String)' https://s14.postimg.org/d70g9sx1d/kemalrc12.png
<FromGitter> <bew> cerulean, yes of course https://github.com/f/crystalshards
McSoFake has quit [Ping timeout: 260 seconds]
<FromGitter> <codenoid> please ,, help :worried:
<Yxhuvud> How do I find out the memory size of a value? For structs I want the struct size, for references the size of the reference, not what it points to.
<FromGitter> <bew> Yxhuvud, `sizeof` ?
<BlaXpirit> Yxhuvud, that sounds like the definition of `instance_sizeof` unless im missing something
<Yxhuvud> ah, great.
<BlaXpirit> oh if you want size of the reference, that's actually `sizeof`
<BlaXpirit> so like size of the pointer
<Yxhuvud> right.
<Yxhuvud> good to know of instance_sizeof too though. Is that one recursive? I guess not but the documentation doesn't go into what it returns for the reference instance variable case.
<FromGitter> <bew> @codenoid, you have an example of `rs.each` here https://github.com/crystal-lang/crystal-db/blob/master/README.md
Ven has joined #crystal-lang
Ven is now known as Guest88951
<FromGitter> <bew> The errors says that `rs.each` must be used with `do; code..; end` not `do |payment|; code..; end`
<FromGitter> <bew> To retrieve
<FromGitter> <codenoid> hang on
<FromGitter> <bew> You need to know what you are selecting, and there types, then read then one by one
bjz_ has joined #crystal-lang
bjz has quit [Ping timeout: 258 seconds]
Philpax has joined #crystal-lang
Guest88951 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/vSd2R
<crystal-gh> crystal/master d6a2269 Ary Borenszweig: Fixed #4302: missing Spec module attached to doc comments
Qchmqs is now known as Qchmqs_
Qchmqs_ is now known as Qchmqs__
Qchmqs__ is now known as Qchmqs
hako has joined #crystal-lang
bjz_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<FromGitter> <bew> How to use `Spec.before_each` & `Spec.after_each` ?
<FromGitter> <bew> found, the docs are wrong..
<FromGitter> <bew> yeah, from the docs `regardless of where this method is invoked.` isn't true
sz0 has joined #crystal-lang
Qchmqs has quit [Ping timeout: 260 seconds]
hako has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hako has joined #crystal-lang
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 268 seconds]
Raimondii is now known as Raimondi
vdmo has quit [Ping timeout: 252 seconds]
McSoFake has joined #crystal-lang
bungoman_ has joined #crystal-lang
bungoman has quit [Ping timeout: 240 seconds]
j2k has joined #crystal-lang
sz0 has quit [Quit: Connection closed for inactivity]
<FromGitter> <KCreate> Am I supposed to add the shard.lock file to my gitignore?
<FromGitter> <fridgerator> no
<FromGitter> <fridgerator> you would want the depedencies to install the same version on another computer
<FromGitter> <fridgerator> shard.lock will ensure that
hako has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
xmonader2 is now known as xmonader
<Papierkorb> KCreate, for a lib, ignore it. For an application, keep it
<FromGitter> <KCreate> alright thanks
<Papierkorb> KCreate, it's the applications responsibility to choose a version of all dependencies everyone is satisfied with. It's not on the library to choose.
<FromGitter> <fridgerator> yeah, that
<FromGitter> <KCreate> Makes sense
<crystal-gh> [crystal] luislavena opened pull request #4306: Fully honor no color option when running specs (master...fully-colorless-spec) https://git.io/vSFRG
j2k has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
McSoFake has quit [Quit: No reason]
bjz has joined #crystal-lang
xmonader has quit [Ping timeout: 252 seconds]
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<FromGitter> <eliasjpr> It seems that the only active web framework st the moment is Kemal. Any other highly used framework for the awesome list?
<cerulean> is Amethyst worth it?
<cerulean> it has more stars
<FromGitter> <eliasjpr> Not sure if I can trust it
<FromGitter> <eliasjpr> For production I mean
<FromGitter> <eliasjpr> Also what is the interest of the community to have a more well rounded framework?
<FromGitter> <eliasjpr> https://github.com/Codcore/amethyst/issues/65 it seems to be abandoned
<cerulean> why not fork it and fix what's wrong and add what you need
<cerulean> do you need 24/7 support and coddling from the developer?
<cerulean> if not, steal the project
<cerulean> otherwise
<cerulean> use kemal
<cerulean> :D
<cerulean> i AM interested in having a rails clone with generators and such. but i'll take a kemal any day if its easier and works better
<cerulean> or atleast, and MVC thing
<FromGitter> <ltran> what about https://github.com/drujensen/kemalyst ?
<cerulean> i've seen it, it looks like the new solution to rails for crystal and we should probably update that
<cerulean> looks maintained
<FromGitter> <ltran> last update 23hours :O
<cerulean> rails is real complicated. without proper debugging support in crystal, it cant reach rails5 level easil
<cerulean> still i believe in it
<FromGitter> <eliasjpr> I actually started to create a framework borrowing concepts from Kemal rails Phoenix and other frames including kemalyst
<cerulean> add websockets and ill use it
<cerulean> haha
<FromGitter> <eliasjpr> :)
<wmoxam> Rails was created by building an app, then extracting a framework
<FromGitter> <eliasjpr> Okay
<FromGitter> <eliasjpr> Im still getting things together but will let you guys know
<RX14> i'm going sort of the rails way with my framework
<RX14> i have a framework but it's part of my app
<RX14> so it'll be open sourced when i've learnt way more from my app
<cerulean> i'm afraid we'll end up with 5 rails clones with only 1/5th of the features of rails 5
<cerulean> wmoxam: can you elaborate on the extraction process? if you know
<RX14> i hope we have no succesful rails clones at all
<FromGitter> <eliasjpr> I would like for the community to have 5 clones
<RX14> rails does a lot wrong
<FromGitter> <eliasjpr> One well maintained framework
<FromGitter> <eliasjpr> GitHub.com/eliasjpr/amber
<FromGitter> <eliasjpr> Again this is still being prototyped
<FromGitter> <eliasjpr> Planning to move it to an organization when is more concrete and invite people@from@the community and organize the project around the community goals and desires
<FromGitter> <eliasjpr> Websockets
<cerulean> invite me
<cerulean> i can already contribute
<cerulean> lol
<FromGitter> <eliasjpr> Typos lol?
<cerulean> yeah lol
<cerulean> no big deal, looks good
<FromGitter> <eliasjpr> I said is work in progress :)
<cerulean> no prob
<cerulean> i actually do hide and prepare secret invetions tho
<cerulean> lol
<cerulean> but ... it grew into a team anyway
<cerulean> so no problol
<cerulean> so you have websockets already?
<FromGitter> <eliasjpr> lol it will be easy to add websockets
<FromGitter> <eliasjpr> it just needs a websocket handler
<FromGitter> <eliasjpr> sorry pipe
<FromGitter> <fridgerator> nice, I like the pipeline concept like phoenix
<FromGitter> <eliasjpr> :)