ruby_ has quit [Remote host closed the connection]
ruby_ has joined #crystal-lang
ylluminate has joined #crystal-lang
ruby_ has quit [Ping timeout: 272 seconds]
eizua has joined #crystal-lang
mark_66 has quit [Remote host closed the connection]
soveran has quit [Remote host closed the connection]
<FromGitter>
<mverzilli> :)
ruby_ has joined #crystal-lang
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
<pduncan>
sorry if this is documented somewhere, but I haven't been able to find it. does crystal have the "*" operator for arrays? like `otherlist = [3, 4]; puts [1, 2, *otherlist, 5] #=> [1, 2, 3, 4, 5]`
<pabs>
pduncan: it's called the splat operator, by the way
<pduncan>
ah, right. I was searching for the "spread operator"
<pduncan>
@johnjansen: looks like gitter borked the formatting, I had a "*" just before "otherlist"
<FromGitter>
<johnjansen> haha, yeah splat doesnt work … (now that i can see the *)
<pduncan>
@johnjansen: thanks though, that is very helpful, i'd forgotten about .flatten
<FromGitter>
<johnjansen> just keep in mind that the array you are working with is of type `Array(Array(Int32) | Int32)`
<FromGitter>
<johnjansen> Int32 => whatever the real data is
<asterite>
johnjansen: there's a proposal https://github.com/crystal-lang/crystal/issues/462 but it never got implemented, we couldn't decide if it was a good idea (because `*` splats tuples right now, not arrays)
<FromGitter>
<johnjansen> @asterite in that case would `[1, *{2,3}]` would work for @pduncan ?
<asterite>
right now no, with that proposal yes
<FromGitter>
<johnjansen> ive never had cause to splat in that context in Ruby, so maybe someone who has used the functionality could weigh in
Philpax_ has quit [Ping timeout: 244 seconds]
<pabs>
i've never splatted a range (i usually just use to_a or one of the Enumerable methods on them)
<pabs>
but splatting an array is useful, if that's the question
<FromGitter>
<johnjansen> @pabs my example was a Tuple, have you ever splatted an array into another array ?
<pabs>
johnjansen: right, i was responding to range because that's what the issue linked above uses
<pabs>
i can't think of a specific time that i've splatted an array into another array, but i'm sure that i have
<pabs>
whether it's useful in crystal or not is another matter
<pabs>
s/useful/useful and appropriate/
<FromGitter>
<johnjansen> yeah @pabs i see that now ;-) NOTE TO SELF: look before commenting
<FromGitter>
<johnjansen> @asterite seems like a reasonable proposal in #462 if you can sort out the typing issues
<FromGitter>
<barisbalic> I was working with elixir for ages, during that time I dipped and out of crystal and when I last checked there was a heroku app that did this and I think in chan people said they weren't that keen. I'm glad to see I was wrong
<BlaXpirit>
barisbalic, aww, you have to do it manually and even download a client :(
<FromGitter>
<johnjansen> @sdogruyol i feel like i should do it, just because
<FromGitter>
<barisbalic> @BlaXpirit that was intentional, to avoid docs continually being broken as crystal progresses, also you dont have to download client, you can just rsync straight up
<FromGitter>
<barisbalic> Client is just a convenience
<BlaXpirit>
barisbalic, so then, can you upload anything there?
<FromGitter>
<barisbalic> Intention was to make as minimal as possible
<RX14>
what if I upload malware?
<RX14>
large files?
<FromGitter>
<barisbalic> There's a restriction on file size
<RX14>
is there a quota?
<FromGitter>
<barisbalic> ANd each user has limited capacity
<FromGitter>
<barisbalic> Indeed
<RX14>
what about mime types
<RX14>
do you serve executables as executable?
<BlaXpirit>
i dunno, sounds not so different from any other host such as gh-pages
<FromGitter>
<barisbalic> You could upload rubbish if you wanted, but there's no index, people will not find it unless they go look for it
<RX14>
yes
<RX14>
i've been running a 100gb+ public file hosting for a while
soveran has joined #crystal-lang
soveran has joined #crystal-lang
<RX14>
and there's no index
<RX14>
i still get malware reports
<FromGitter>
<johnjansen> anyone want to build a cli command to open the appropriate docs for the shards in the project you are working on
<FromGitter>
<sdogruyol> @RX14 so you have experience about this kind of stuff
<RX14>
lol thats just excedingly lazy
<RX14>
btw
<BlaXpirit>
it would need artificial intelligence anyway
<RX14>
crystal-dcos publish publishes to what?
<FromGitter>
<johnjansen> ^^^^^^^^^^ can be lazy
<RX14>
like, how does that even work
<FromGitter>
<barisbalic> @RX14 what do you mean? It rsyncs files to dir
<FromGitter>
<barisbalic> On server
<RX14>
it's just arbitrary folders, right
<FromGitter>
<barisbalic> Yes
<RX14>
so `crystal-docs upload foobar` wonn't update the main page
<RX14>
nice
<BlaXpirit>
the problem is your site can't be fully trusted. if i see a link under http://readthedocs.org/ i know i will see documentation and not some porn
<RX14>
^
<FromGitter>
<sdogruyol> lol
<FromGitter>
<barisbalic> Yeah, there are some obvious drawbacks, but I'd rather see if anyone used it first
<RX14>
well
<RX14>
github pages seems to be mostly OK
<FromGitter>
<sdogruyol> let's think about that later :D
<BlaXpirit>
i'll stick to git push instead of rsync, w/e
<RX14>
yeah, just be aware
<RX14>
sign up for google webmaster toolkit
<FromGitter>
<barisbalic> @BlaXpirit @RX14 it's true you could upload rubbish, but only if you are the author of your lib, otherwise no-one will be looking at the docs
<RX14>
so you get blacklist notifications
soveran has quit [Ping timeout: 244 seconds]
<RX14>
if you get people uploading viruses, I can help with that
<FromGitter>
<barisbalic> I'm happy to have any kind of help
<RX14>
@sdogruyol, can you test multipart in kemal master, so I can see if I need to do/fix anything before 0.1.0 release
<RX14>
I've written some pieces of software to monitor directories and keep them malware-free
<RX14>
using clamd and inotify
<RX14>
handles over 600gb of data, and 300,000+ files at the moment
<RX14>
and performs well
<RX14>
written in crystal of course
<FromGitter>
<barisbalic> @RX14 that could be very useful, and also very interesting
<FromGitter>
<sdogruyol> @RX14 gonna check it out now
<FromGitter>
<sdogruyol> and yeah that sounds badass
<RX14>
thanks
<RX14>
the directory's so big it takes a while to binary insert all the files :/
<BlaXpirit>
is `crystal docs` guaranteed to not do anything but write a few files into a `docs` folder? what's the worst that could happen?
<RX14>
like, 30s to start up lol
<RX14>
no
<FromGitter>
<sdogruyol> just 1 directory?
<RX14>
it runs macros
<RX14>
yes
<RX14>
1 directory
<BlaXpirit>
ow that sucks
<RX14>
not really
<RX14>
it
<RX14>
's great
<BlaXpirit>
no i'm talking about a different thing
<RX14>
oh, yeah
<BlaXpirit>
but you could store the files in folders by a few first letters of their hashes
<RX14>
i should really optimise startup with a bulk insert
<RX14>
yeah no
<RX14>
then you loose the short names
<RX14>
all the files have 6*alpha names
<BlaXpirit>
well nobody said the URLs have to directly map to files
<RX14>
and if you hash them you loose just being able to server the folder with nginx
<BlaXpirit>
if only it want such an expensive endeavor to run a service like docrystal
<BlaXpirit>
wasn't
<RX14>
i'm not sure it would be, really
<RX14>
10s of execution time is honestly enough
<RX14>
the crystal compiler takes 0.8s to run crystal docs on
<BlaXpirit>
the only unfixable problem with it was that it ... died
<RX14>
yes
<RX14>
the problem is lack of work
<RX14>
not lack of resources
<BlaXpirit>
not even work, it would take an hour to set up official docker images instead of the ancient one
<RX14>
yeah, I emailed them
<RX14>
about taking it over
<RX14>
but I got no reply
<BlaXpirit>
barisbalic, you know what would be neat? preparing instructions to deploy these docs from travis on each tag or whatever
<RX14>
yeah
<FromGitter>
<barisbalic> @BlaXpirit that is a great idea
<RX14>
maybe a small script
<FromGitter>
<barisbalic> Also guys, I realise there is a lot of room for improvement, and I need the smarter bods to help suggest
<BlaXpirit>
barisbalic, i will look into what i said right now
<FromGitter>
<barisbalic> I got the homebrew recipe for mac users too
<RX14>
for example, on tag, deploy to the tag and the root
<RX14>
hmmmm
<RX14>
in a refactor, woulkdn't yeou get a lot of old files
<RX14>
if everything changed names
<RX14>
and if you tell rsync to delete old, then it'll just clean out the subdirectories
<RX14>
maybe it's better to have a /default folder that / goes to
<RX14>
so you can tell rsync to delete files in the destination
<BlaXpirit>
there are a lot of things that suck about doc html files :(
<BlaXpirit>
what GitHub says: This application will be able to list and see private details for your public SSH keys. Public keys provide SSH access to repository content.
<BlaXpirit>
so... how exactly do public keys provide access to anything? I don't get it
<RX14>
i mean, your keys are listed already
<FromGitter>
<barisbalic> @BlaXpirit Your key is used on server to allow you to rsync without signup/in
<RX14>
BTW
<BlaXpirit>
what are the "private details"? i'm completely confused by this description
<RX14>
@barisbalic you should create a token system
<RX14>
so you don't need to set up ssh keys on travis to use it
<RX14>
because encrypting ssh keys is a bit of a pain
<FromGitter>
<barisbalic> @BlaXpirit i don't know, I used the scope thats just for public keys :P
<BlaXpirit>
yeah... might as well forget about these instructions for travis because then you have to give your keys to travis basically
<RX14>
well
<FromGitter>
<barisbalic> @RX14 I like that idea but then that would also mean storing/having db
<RX14>
oh yess
<RX14>
because
<FromGitter>
<barisbalic> Right now there is no persistence
<RX14>
to be able to push
<FromGitter>
<barisbalic> And nothing to leak/lose
<RX14>
those keys need to push to github too
<RX14>
so basically, you need to provide push to all your repos to push to docs
<RX14>
which is bad
<BlaXpirit>
definitely no-go at the moment
<RX14>
well... the current system for discordcr is using a ssh key and github pages
<RX14>
so it's not *less* secure
<FromGitter>
<sdogruyol> @RX14 require "http/multipart" Error in ./src/kemal.cr:2: while requiring "http/multipart": can't find file 'http/multipart' relative t
<RX14>
it's not a change for basically no gain
<RX14>
uhh
<RX14>
damn thats a pain
<RX14>
yes...
<RX14>
i need to create a multipart.cr that requires everything
<FromGitter>
<sdogruyol> probably
<FromGitter>
<sdogruyol> like an intro
onethirtyfive has quit [Remote host closed the connection]
onethirtyfive has joined #crystal-lang
<RX14>
@sdogruyol fixed
<FromGitter>
<sdogruyol> @RX14 so fast
<RX14>
i know
<RX14>
:)
<RX14>
@barisbalic so can you make a deploy token thing, so you can provide access to crystal-docs without push to all your repos?
<FromGitter>
<barisbalic> @RX14 When you say access what do you mean? Having the capacity to push without using rsync?
<RX14>
no
<RX14>
currently, access is with ssh keys right
<FromGitter>
<barisbalic> Correct
<RX14>
so you have to add your ssh keys to github to be able to push
<RX14>
which means any ssh key that can push to docs has push access to ALL your repositories
<RX14>
which makes crystal-doc unsuitable for travis/CI
<RX14>
because it's just too big of a secret
<RX14>
you essentially have to entrust your private keys to your CI
<RX14>
I'm suggesting you imlement a docs-only push token in addition
<BlaXpirit>
or keep manually pushing from your computer
<RX14>
BlaXpirit, or that but thats no fun
<RX14>
so that you can grant CI access to push to docs without pushing to ALL your github repos
<FromGitter>
<sdogruyol> i've tried with multiple files e.g
<FromGitter>
<sdogruyol> but is there a way to access a certain field?
pawnbox has quit [Read error: Connection reset by peer]
pawnbox has joined #crystal-lang
<RX14>
yes
<FromGitter>
<sdogruyol> this loops through all the fields right?
<RX14>
what do you mean?
<RX14>
if you implemented random-access you would need to buffer the whole request in memeory
<RX14>
which isn't feasible
<FromGitter>
<sdogruyol> something like parser.field("image1") { |data| }
<RX14>
just use a switch case
<FromGitter>
<sdogruyol> i see
<RX14>
it's really not that bad
<RX14>
i mena, it's actually shorter code
<RX14>
mean*
<FromGitter>
<sdogruyol> it's great
<FromGitter>
<sdogruyol> i'm just asking some questions :P
<RX14>
np
<FromGitter>
<barisbalic> @RX14 you only need to put your public keys in a repo (also you don't have to they can be ENV vars configured in the CI of your choosing), I don;t think either is great, but that's how I've handed it in teams before
<FromGitter>
<barisbalic> Well not this, but similar things
<RX14>
"you only need to put your public keys in a repo"?
<RX14>
you need to use the private key to rsync
<FromGitter>
<barisbalic> Ah yes of course, sorry
<FromGitter>
<barisbalic> Then I 100% agree
<RX14>
the very fact that the CI then has the possibility to push to the github repos is bad
<FromGitter>
<barisbalic> And yes tokens seem like a reasonable idea
<RX14>
thanks
<RX14>
I tend to give quite a few people push access to my github repo
<RX14>
so it's not really good to trust them with my pkey
<FromGitter>
<sdogruyol> @RX14 it really fast
<FromGitter>
<sdogruyol> i mean it seems to parse 2 files of total 1MB at around 1 -2 ms
<RX14>
yeah, we benchmarked it
<RX14>
about 200MB/s i think
<RX14>
mainly in the IO::Delimited
<FromGitter>
<sdogruyol> that's pretty cool
<RX14>
well we benchmarked IO::Delimited
<RX14>
i guess it's the mian overhead
<RX14>
i can't really think of a way to improve the speed...
pawnbox has quit [Read error: Connection reset by peer]
pawnbox has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 244 seconds]
<FromGitter>
<sdogruyol> It's awesome
LastWhisper____ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
onethirtyfive has quit [Remote host closed the connection]
onethirtyfive has joined #crystal-lang
onethirtyfive has quit [Remote host closed the connection]
<FromGitter>
<crisward> Crystal Spec - is there a beforeEach?
<FromGitter>
<jwoertink> this is the only place I've seen it
pawnbox has quit [Remote host closed the connection]
dom96 has quit [Changing host]
dom96 has joined #crystal-lang
<FromGitter>
<piedoom> do you guys think it would be not a good idea to use the `active_record` shard seeing as it hasn't been updated in 2 months? Is there any alternative that's being actively developed?