01:19
<
FromGitter >
<zsxawerdu> this language is fast as Golang
01:19
<
FromGitter >
<zsxawerdu> eventually parallelism will get it to near the top of web frameworks
01:20
Groogy has quit [Ping timeout: 265 seconds]
02:09
gangstacat has quit [Quit: Ĝis!]
02:52
_whitelogger has joined #crystal-lang
02:55
rohitpaulk has joined #crystal-lang
03:32
gangstacat has joined #crystal-lang
03:43
rohitpaulk has quit [Remote host closed the connection]
03:53
chemist69 has quit [Ping timeout: 276 seconds]
03:55
chemist69 has joined #crystal-lang
04:21
rohitpaulk has joined #crystal-lang
04:34
ht_ has joined #crystal-lang
05:07
ht_ has quit [Remote host closed the connection]
06:26
<
livcd >
zsxawerdu: compile times is a big of a problem
06:27
<
FromGitter >
<Blacksmoke16> i mean not
*that* big of a deal
06:28
<
livcd >
To some it is not
06:28
<
livcd >
To some it is
06:49
DTZUZO has quit [Ping timeout: 265 seconds]
07:30
rohitpaulk has quit [Ping timeout: 245 seconds]
07:42
tdc has joined #crystal-lang
07:51
rohitpaulk has joined #crystal-lang
08:09
<
repo >
why on earth would you change integer operators to produce float values
08:13
<
repo >
ok at least there's a floor division operator
09:02
<
FromGitter >
<kaukas_gitlab> @j8r, your first example does something strange. `before_1` is outside the specs but other befores are inside. Here's an example where all the befores are outside specs (
https://carc.in/#/r/7o1a ). As you can see all befores still run before all specs.
09:03
<
FromGitter >
<j8r> yes, that's normal, I does it to show that it is also possible
09:05
<
FromGitter >
<j8r> I noticed this too :/
09:08
<
FromGitter >
<kaukas_gitlab> I understand that it's possible to call my `before` methods from within the `it` specs. But the whole point of before/after is to extract the repeating logic out of them.
09:09
<
FromGitter >
<j8r> i think the best would be the second example I give
09:09
<
FromGitter >
<j8r> defining custom methods with `it` inside
09:11
<
FromGitter >
<kaukas_gitlab> Thank you for the suggestion! It looks very much DIY…
09:13
<
FromGitter >
<j8r> you're welcome
09:20
<
FromGitter >
<kaukas_gitlab> The lexer example emulates `shared_examples` from RSpec, and it makes sense. What I can't find is `before :all` and even `before :each`. You can achieve that by wrapping `it`s but it's susprisingly unintuitive, especially since `before_each` is present.
09:22
<
FromGitter >
<j8r> `Spec.before_each` is global
09:23
<
FromGitter >
<j8r> It is designed to run something before all specs
09:25
rohitpaulk has quit [Ping timeout: 276 seconds]
10:02
alex`` has joined #crystal-lang
10:24
rohitpaulk has joined #crystal-lang
10:46
<
FromGitter >
<asterite> I'll implement before_each and before_all eventually, though I think they aren't very useful in spec. What exactly you want to do with them?
11:00
DTZUZO has joined #crystal-lang
11:44
<
FromGitter >
<yxhuvud> There is a lot of stuff that they are used for in specs that wouldn't really work in crystal, like setting up shared instance variables between tests
11:46
<
FromGitter >
<yxhuvud> stuff like transactional db handling would be pretty sweet, though perhaps it is better to push the community away from rails style model testing that actually write to and use the db
11:54
<
FromGitter >
<kaukas_gitlab> Re-set up the DB state around each test?
12:15
olbat has quit [Ping timeout: 245 seconds]
12:19
<
repo >
i'm updating shards on a project and when i do i get the warning: GC Warning: Repeated allocation of very large block (appr. size 805310464):
12:19
<
repo >
it then gobbles up more and more ram until it exits with OOM
12:19
<
repo >
is it possible to narrow down which shard is causing this?
12:20
<
repo >
i'm guessing it's a post-install hook
12:20
<
repo >
hmm no maybe not
12:43
<
repo >
j8r: i removed any and all version constraints from shard.yml and removed shard.lock but still get the error
12:43
<
repo >
of course the shards themselves might have version constraints
12:43
<
repo >
in their deps
12:44
<
repo >
so should i try downgrading shards to 0.8.1?
12:46
<
repo >
mh now my libevent is too high
12:48
<
repo >
hm ok it seems i should be constraining versions
12:48
<
repo >
is there a tool to find out the latest version of a given shard?
12:49
<
FromGitter >
<j8r> repo: this error is because of too many clauses, yes
12:51
<
FromGitter >
<j8r> I think not, FYI I'm working on an experimental, alternative package manager that will solve this kind of issues
12:51
<
repo >
how does shards figure out versions of shards? by going through releases? or tags?
12:52
<
FromGitter >
<j8r> yes, `git tags`
12:52
<
FromGitter >
<j8r> from a locally cloned cache, usually `~/.cache/shards`
13:12
rohitpaulk has quit [Remote host closed the connection]
13:34
HumanGeek has joined #crystal-lang
13:36
Human_G33k has quit [Ping timeout: 240 seconds]
13:50
duane has joined #crystal-lang
14:06
<
FromGitter >
<didactic-drunk> How would I do one overflowing integer operation without raising or disabling overflow protection?
14:07
<
FromGitter >
<Blacksmoke16> i think there is like `&+`
14:09
return0e has quit []
14:11
alex`` has quit [Ping timeout: 240 seconds]
14:11
<
repo >
does someone have trouble with postinstall of latest ameba with latest crystal?
14:11
<
repo >
i get: Error target ameba failed to compile:
14:11
<
repo >
In src/ameba/inline_comments.cr:97:7
14:11
<
repo >
97 | commented? = false
14:11
<
repo >
Error: unexpected token: =
14:11
<
FromGitter >
<Blacksmoke16> what version are you using?
14:12
<
FromGitter >
<Blacksmoke16> and what crystal version
14:12
<
FromGitter >
<Blacksmoke16> and what version is in the lock?
14:12
<
repo >
i removed the lock
14:12
<
repo >
so basically clean install
14:12
<
repo >
lib is also empty
14:12
<
FromGitter >
<Blacksmoke16> try clearing your cache `rm -rf ~/.cache/shards`
14:13
alex`` has joined #crystal-lang
14:13
<
repo >
still same error
14:14
<
FromGitter >
<Blacksmoke16> `&**`
14:15
<
FromGitter >
<didactic-drunk> Oh, oops
14:15
<
FromGitter >
<tenebrousedge> good to know, @Blacksmoke16 👍
14:16
<
FromGitter >
<Blacksmoke16> repo hmm
14:16
<
repo >
hmm indeed :)
14:17
<
FromGitter >
<Blacksmoke16> try clearing crystal cache too? `rm -rf ~/.cache/crystal`
14:17
<
FromGitter >
<Blacksmoke16> something has to be cached somewhere as that error was fixed like months ago
14:25
<
FromGitter >
<Blacksmoke16> repo i dont suppose you have another dependency that has ameba locked to a lower version?
14:57
ht_ has joined #crystal-lang
15:02
<
repo >
are development dependencies for dependencies considered as well?
15:03
<
repo >
because i can't imagine any shard would list ameba as a (not development) dependency
15:04
<
FromGitter >
<Blacksmoke16> try doing `shards install --production`
15:04
<
FromGitter >
<Blacksmoke16> which would skip dev deps
15:04
<
FromGitter >
<Blacksmoke16> which should work since it shouldnt try to install your ameba
15:06
<
repo >
yeah, let's see
15:07
<
FromGitter >
<Blacksmoke16> what shards version are you using?
15:07
hightower2 has joined #crystal-lang
15:14
<
FromGitter >
<Blacksmoke16> hmm
15:15
<
FromGitter >
<Blacksmoke16> im out of ideas
15:27
<
FromGitter >
<wontruefree> there is a make command `make clean_cache` if you want
16:51
sorcus has quit [Ping timeout: 276 seconds]
16:54
sorcus has joined #crystal-lang
17:15
<
repo >
is it possible to discard the body of a http request?
17:16
<
repo >
i'm not talking about skip_to_end
17:16
<
repo >
i don't want any data flowing from the server to the client
17:16
<
repo >
just need the headers
17:16
<
FromGitter >
<Blacksmoke16> just do a HEAD request then?
17:17
<
repo >
doesn't the server need to support this?
17:18
return0e has joined #crystal-lang
17:18
<
FromGitter >
<Blacksmoke16> probably
17:19
<
FromGitter >
<Blacksmoke16> id maybe try it, tried it on an API endpoint i made and worked fine using curl
17:19
<
FromGitter >
<tenebrousedge> but not supporting it would be foolish
17:19
<
FromGitter >
<Blacksmoke16> that is using kemal
17:20
<
FromGitter >
<tenebrousedge> since you can get the same information using GET then disabling HEAD is just increasing traffic
17:20
<
FromGitter >
<Blacksmoke16> yea looks like kemal handles it natively
17:20
<
FromGitter >
<Blacksmoke16> adds a corresponding HEAD request for each GET request
17:34
<
FromGitter >
<stronny> if you want to avoid transmitting the body over network you have to close the socket
17:42
bcardiff has joined #crystal-lang
17:43
bcardiff has quit [Client Quit]
18:20
dannyAAM has joined #crystal-lang
18:24
<
FromGitter >
<rmarronnier> Ok I'm stuck with this :
18:25
<
FromGitter >
<rmarronnier> Why can't I change the value of an object variable in an array ?
18:25
<
FromGitter >
<Blacksmoke16> you're using structs would be my guess
18:25
<
FromGitter >
<rmarronnier> Yes !
18:26
<
FromGitter >
<Blacksmoke16> so its changing the value in a copy of the obj
18:26
<
FromGitter >
<rmarronnier> So... I'd have to use class instead of struct to get what I want ?
18:27
<
FromGitter >
<Blacksmoke16> at least for Person
18:27
<
FromGitter >
<Blacksmoke16> since its mutable
18:27
<
FromGitter >
<rmarronnier> mm, understood.
18:27
<
FromGitter >
<rmarronnier> Thanks
18:48
rohitpaulk has joined #crystal-lang
19:11
devil_tux has joined #crystal-lang
19:13
<
devil_tux >
what is the type of `encoding` on File* API? or better yet, how to set it properly
19:13
<
FromGitter >
<bew> it's a String iirc
19:15
<
devil_tux >
i cant figure out how to set it based on remote file
19:15
<
devil_tux >
File.write("#{DATA_STORAGE}/#{remote_filename}", response.body_io, encoding: response.body_io.encoding)
19:16
<
devil_tux >
this doesnt seems to set it properly as:
19:16
<
devil_tux >
file remote_file.txt yields: : Non-ISO extended-ASCII text, with CRLF line terminators
19:16
<
devil_tux >
> response.body_io.encoding yields "utf8"
19:16
<
FromGitter >
<Blacksmoke16> should be `utf-8`
19:17
<
FromGitter >
<Blacksmoke16> would be my guess
19:18
<
devil_tux >
still Non-ISO
19:38
rohitpaulk has quit [Remote host closed the connection]
20:08
ht_ has quit [Quit: ht_]
20:10
user3 has joined #crystal-lang
20:57
<
FromGitter >
<Blacksmoke16> maybe something useful in there @bbaragar ?
21:01
HumanGeek has quit [Quit: Leaving]
21:26
duane has quit [Ping timeout: 240 seconds]
22:10
oprypin has quit [Quit: Bye]
22:10
oprypin has joined #crystal-lang
23:10
hightower2 has quit [Ping timeout: 268 seconds]