<crystal-gh>
[crystal] andrewhamon closed pull request #3711: Check formatting early in CI (master...travis-fail-fast) https://git.io/v19dA
vivus-ignis has quit [Ping timeout: 245 seconds]
<FromGitter>
<fridgerator> the point?
sp4rrow has joined #crystal-lang
pawnbox has joined #crystal-lang
mgarciaisaia has quit [Ping timeout: 256 seconds]
mgarciaisaia has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
mgarciaisaia has quit [Ping timeout: 260 seconds]
soveran has joined #crystal-lang
mgarciaisaia has joined #crystal-lang
soveran has quit [Ping timeout: 258 seconds]
pawnbox has joined #crystal-lang
mgarciaisaia has quit [Ping timeout: 265 seconds]
<FromGitter>
<bcardiff> @jots_twitter you can use rails returning pattern for that. http://apidock.com/rails/Object/returning (or just Object#tap like in the last example of the page)
pawnbox has quit [Remote host closed the connection]
vivus-ignis has joined #crystal-lang
vivus-ignis has quit [Ping timeout: 250 seconds]
<FromGitter>
<jots_twitter> because you may not want to automatically return the last statement. if you do, don't use the result variable.
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
bjz has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 248 seconds]
vivus-ignis has joined #crystal-lang
vivus-ignis has quit [Ping timeout: 250 seconds]
sp4rrow has quit [Read error: Connection reset by peer]
sp4rrow has joined #crystal-lang
pawnbox has joined #crystal-lang
lacour has quit [Quit: Leaving]
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has joined #crystal-lang
vivus-ignis has joined #crystal-lang
akwiatkowski has joined #crystal-lang
sp4rrow has quit [Quit: The Internet needs a break and I need a cookie]
sp4rrow has joined #crystal-lang
sp4rrow has quit [Client Quit]
sp4rrow has joined #crystal-lang
sp4rrow has quit [Client Quit]
sp4rrow has joined #crystal-lang
sp4rrow has quit [Client Quit]
sp4rrow has joined #crystal-lang
sp4rrow has quit [Client Quit]
sp4rrow has joined #crystal-lang
sp4rrow has quit [Client Quit]
sp4rrow has joined #crystal-lang
sp4rrow has quit [Client Quit]
sp4rrow has joined #crystal-lang
sp4rrow has quit [Client Quit]
sp4rrow has joined #crystal-lang
sp4rrow has quit [Client Quit]
sp4rrow has joined #crystal-lang
sp4rrow has quit [Client Quit]
sp4rrow has joined #crystal-lang
sp4rrow has quit [Client Quit]
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
vivus-ignis has quit [Ping timeout: 250 seconds]
mark_66 has joined #crystal-lang
bjz has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bjz has joined #crystal-lang
<FromGitter>
<piyush_ranjan_twitter> is there any way I can compile for linux from my mac os machine ?
gloscombe has joined #crystal-lang
<BlaXpirit>
piyush_ranjan_twitter, I think it is possible to do all except the final step where you just need LLVM on the target platform. but i don't know about this.
<FromGitter>
<piyush_ranjan_twitter> okay. I have a server on which I have a huge log file which I do not want to have locally. Therefore I was thinking if there is some way I could compile here and push the binary. I do not have sudo access on that server to install crystal
<BlaXpirit>
you certainly dont need sudo access to use crystal
<BlaXpirit>
though it can get annoying especially if you cant even install dependencies
<BlaXpirit>
but hey if you invest enough time, even all the dependencies can be installed and used from local folders
<FromGitter>
<splattael> @piyush_ranjan_twitter You may use docker for this if you have docker-engine installed on your Mac ;)
<FromGitter>
<piyush_ranjan_twitter> yes That is what I am doing now
<FromGitter>
<piyush_ranjan_twitter> wanted to know if there is an easier way :)
<FromGitter>
<splattael> For me, docker seems to be the easiest :D
<FromGitter>
<splattael> In our company, we have the opposite. Devs have Macs and do not have Crystal installed but want to use the binary (statically compiled with Crystal). So we ship the binary (only the bare binary) as a docker image. Problem solved ;)
<FromGitter>
<piyush_ranjan_twitter> Devs don't have sudo access !!! :worried:
pawnbox has quit [Remote host closed the connection]
soveran has quit [Remote host closed the connection]
mark_66 has quit [Remote host closed the connection]
<FromGitter>
<asterite> Yxhuvud: advent of code? ;-)
<Yxhuvud>
yeah!
soveran has joined #crystal-lang
Philpax has joined #crystal-lang
Exilor has joined #crystal-lang
<Exilor>
does anybody know what the compiler option --single-module does?
<crystal-gh>
[crystal] maiha opened pull request #3714: Fix doc typo for Atomic#add (master...fix-doc) https://git.io/v1HS6
bjz_ has quit [Ping timeout: 268 seconds]
bjz has joined #crystal-lang
<FromGitter>
<asterite> It creates a single LLVM module instead of one per "compilation unit"
<FromGitter>
<asterite> It's mostly there for debugging purposes
<Exilor>
and what are the implications when running a program compiled that way?
<Exilor>
because i tried it, not knowing what it would do, and compilation time went from 2+ minutes to about 7 seconds
<Exilor>
and the program ran fine
<Exilor>
(the codegen bc+obj part of it)
akwiatkowski has quit [Ping timeout: 264 seconds]
<FromGitter>
<asterite> Are you on linux?
<FromGitter>
<asterite> There's a known issue in linux that the compiler does one fork per compilation unit, and fork seems to be slower in linux than mac, so it might be faster not to fork at all in that case... but I don't know
<Exilor>
sort of, on the bash for windows thing
<FromGitter>
<asterite> 2+ minutes? What program is that? It's also strange that it goes down to 7 seconds
<Exilor>
it takes less than 1 minute on a mac
<Exilor>
a mmorpg server
<FromGitter>
<asterite> Cool!
<FromGitter>
<asterite> I think there's a general optimization to be done regardless of the platform, that I noticed the other day...
Ven has joined #crystal-lang
<Exilor>
so, for my purposes, --single-module could be considered the opposite of --release?
<FromGitter>
<asterite> When you pass --release, --single-module becomes true
<Exilor>
then i have no idea what's going on
<Exilor>
but it compiles much faster so i'm happy
<Exilor>
lol
<Exilor>
thanks asterite!
<FromGitter>
<asterite> Exilor: I'll try to optimize it for the next release, I think I found out a way
<Exilor>
optimize what exactly?
Ven has quit [Read error: Connection reset by peer]
<FromGitter>
<sdogruyol> compile time
Ven has joined #crystal-lang
Exilor has quit [Quit: Page closed]
triangles has quit [Quit: Leaving]
<FromGitter>
<Exilor> that'd be cool but i didn't mean to complain about it taking too long
<FromGitter>
<Exilor> i was surprised that the compilation time was so drastically different with and without --single-module
Philpax has quit [Ping timeout: 240 seconds]
<FromGitter>
<asterite> I think it's because of forking in linux... so I'll try to reduce the number of forks
<FromGitter>
<asterite> but generally reduce them, not only in linux... hopefully the first time will take longer (like now) but next compilations will take less than now
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter>
<paulcsmith> When I run this with `crystal command.cr --help` It prints the banner and help for `crystal run` instead of for the `command.cr`
<FromGitter>
<paulcsmith> My end goal is to create different tasks that I can create without a complicated library. So basically rake tasks with a regular crystal file
Ven has joined #crystal-lang
<FromGitter>
<sdogruyol> @Exilor is that oss or something anywhere?
pduncan has quit [Ping timeout: 240 seconds]
<FromGitter>
<Exilor> @sdogruyol the server? hell no, the github repo with the java code i was porting from got taken down because of copyright https://github.com/L2J/L2J_Server
<Papierkorb>
Thankfully, git is fully decentralized
<FromGitter>
<sdogruyol> @Exilor how does the Crystal server performs compared to Java
<FromGitter>
<Exilor> it's way waaaay to early to tell. it's a very big project and i'm just one guy
<FromGitter>
<Exilor> also i don't have a few thousand players to test performance :P
<FromGitter>
<sdogruyol> @Exilor that's still awesome
<FromGitter>
<Exilor> @sdogruyol :blush: thanks man
<Papierkorb>
Question is, will you make the source code public?
<Papierkorb>
I can understand if not
akwiatkowski has joined #crystal-lang
<FromGitter>
<Exilor> wouldn't the same thing that happened to them happen to me?
<Papierkorb>
That's why I could understand if you wouldn't bother :)
<FromGitter>
<Exilor> @asterite i tried that and it didn't work
<FromGitter>
<paulcsmith> @asterite Worked beautifully. Thank you :)
<FromGitter>
<Exilor> papierkorb: other than that reason i have no feelings for or against it
<RX14>
maybe just don't use github
<FromGitter>
<Exilor> yeah, that's what the original devs did afterwards
<RX14>
but was it their code or what?
<FromGitter>
<Exilor> the code was theirs, the mmorpg for which the server was for wasn't
<RX14>
isn't that legal though?
<FromGitter>
<Exilor> i was under the impression that it was. but i'm not a lawyer :/
<FromGitter>
<molovo> @RX14 yeah, if the source code is original, it’s yours and you can do what you like with it, regardless of what it’s for
<FromGitter>
<molovo> Unless of course, that something is illegal itself
<RX14>
@Exilor056798
<RX14>
oops
<FromGitter>
<molovo> It only gets messy if there are references to characters/areas in the game hardcoded into the source code, and *those* are subject to copyright or trademarks, in which case you can’t use them.
<FromGitter>
<Exilor> that must be it. there are plenty of those
<Papierkorb>
Well, all of that depends on the jurisdiction you're under
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter>
<molovo> @papierkorb if it’s on github, it’s subject to US jurisdiction as that’s where they’re registered
<Papierkorb>
yes, though I'd be surprised if NPC or area names fall under a trademark already
<FromGitter>
<Exilor> there's also the texts that NPCs say which are also server-side
<FromGitter>
<Exilor> might be considered something akin to the content of a book
vivus-ignis has joined #crystal-lang
<FromGitter>
<molovo> Depends if they’re original or not. Granted, I don’t know this game, but a lot of games license the rights to the characters and stories they use, so they may be trademarked by another party
<Papierkorb>
Exilor, yes for quest texts I can understand it
<FromGitter>
<paulcsmith> Seems like it must be doing something strange when replacing the `?` with `10` in the first version
<FromGitter>
<Exilor> that has happened to me too and i never found out why
<FromGitter>
<Exilor> i ended up replacing ? with %s and formatting the string...
<FromGitter>
<paulcsmith> Yeah I used regular string interpolation and that worked, but then I think that will allow for SQL injection attacks since it's not being escaped
<FromGitter>
<paulcsmith> In this particular case that's probably fine because the query I'm making is not using data from a user, but for other queries that would be a big deal
<FromGitter>
<Exilor> maybe you should open an issue at the crystal-db repo
gloscombe has quit [Remote host closed the connection]
<FromGitter>
<Exilor> or wait for somebody who knows what's the issue here
<FromGitter>
<paulcsmith> Yeah I think I will. I'll make a repo that demonstrates the problem so it's easier to see what the problem is
pawnbox has quit [Remote host closed the connection]
vivus-ignis has joined #crystal-lang
pawnbox has joined #crystal-lang
vivus-ignis has quit [Ping timeout: 250 seconds]
sp4rrow has quit [Quit: The Internet needs a break and I need a cookie]
A124 has quit [Quit: '']
<crystal-gh>
[crystal] RX14 opened pull request #3716: Make File.expand_path trailing / test more robust (master...bugfix/home-fixes) https://git.io/v17e5
A124 has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
<FromGitter>
<paulcsmith> Still needs lots of improvement, but here are some basic crystal tasks for working with databases https://github.com/paulcsmith/migrate.cr
pawnbox has joined #crystal-lang
<FromGitter>
<paulcsmith> Trying to figure out a good way to have configuration so you don't need to type the db name for all the commands, but for now passing the db name works
<FromGitter>
<bcardiff> https://github.com/juanedi/micrate use just ENV["PG_URL"] to setup de database. You could go with an DATABASE_URL for sure and for extensibility work from a `DB::Database` instance maybe.
vivus-ignis has joined #crystal-lang
vivus-ignis has quit [Ping timeout: 250 seconds]
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]