00:09
senorprogrammer has quit [Quit: senorprogrammer]
00:22
kulelu88 has left #crystal-lang ["Leaving"]
00:23
triangles has quit [Ping timeout: 252 seconds]
00:32
Oliphaunte has joined #crystal-lang
00:42
pawnbox has quit [Remote host closed the connection]
00:52
snsei has joined #crystal-lang
00:52
snsei has quit [Remote host closed the connection]
00:53
snsei has joined #crystal-lang
00:55
Philpax has joined #crystal-lang
00:57
<
crystal-gh >
[crystal] jhass opened pull request #2797: Replace and rename all mentions of SSL with TLS (master...ssl_to_tls)
https://git.io/voZac
00:59
bjz has joined #crystal-lang
01:01
bjz has quit [Max SendQ exceeded]
01:04
senorprogrammer has joined #crystal-lang
01:19
senorprogrammer has quit [Quit: senorprogrammer]
01:22
bjz has joined #crystal-lang
01:36
senorprogrammer has joined #crystal-lang
01:45
<
crystal-gh >
[crystal] jhass closed pull request #2273: resolves segfaults on older kernel versions (master...build_min_version)
https://git.io/v2N5l
01:48
<
jhass >
a JSON array can contain any other JSON type
01:49
<
Davy_CC >
jhass: I saw that, compile-time check it's JSON::Type and runtime is Array(JSON::Type) right?
01:53
Oliphaunte has quit [Remote host closed the connection]
01:53
snsei has quit [Read error: Connection reset by peer]
01:53
<
Davy_CC >
so I have to do `value.map(&.as_a).map do |i|` because JSON::Type does not have `.as_a` method?
01:54
Oliphaunte has joined #crystal-lang
01:54
snsei has joined #crystal-lang
01:54
<
jhass >
yeah dunno, the JSON::Any stuff seems half baked still tbh, I never could get it to work beyond the first level either
01:57
pawnbox has joined #crystal-lang
01:59
Oliphaunte has quit [Remote host closed the connection]
02:01
|2321 has joined #crystal-lang
02:01
pawnbox has quit [Ping timeout: 244 seconds]
02:11
dhk has joined #crystal-lang
02:15
Raimondi has quit [Quit: WeeChat 1.5-dev]
02:15
Raimondi has joined #crystal-lang
02:20
dhk has quit [Quit: Leaving]
02:23
paulcsmith_ has joined #crystal-lang
02:55
pawnbox has joined #crystal-lang
02:59
pawnbox has quit [Ping timeout: 258 seconds]
03:00
snsei has quit [Remote host closed the connection]
03:00
snsei has joined #crystal-lang
03:09
Raimondii has joined #crystal-lang
03:11
Raimondi has quit [Ping timeout: 240 seconds]
03:15
Raimondii is now known as Raimondi
03:43
pawnbox has joined #crystal-lang
03:47
paulcsmith_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
03:47
pawnbox has quit [Ping timeout: 244 seconds]
04:02
snsei_ has joined #crystal-lang
04:04
snsei has quit [Ping timeout: 276 seconds]
04:22
pawnbox has joined #crystal-lang
04:27
pawnbox has quit [Ping timeout: 272 seconds]
04:57
donpdonp has quit [Ping timeout: 252 seconds]
05:10
donpdonp has joined #crystal-lang
05:16
zodiak has joined #crystal-lang
05:19
zodiak_ has quit [Ping timeout: 240 seconds]
05:32
pawnbox has joined #crystal-lang
05:37
pawnbox has quit [Ping timeout: 264 seconds]
05:51
ryanw-se has quit [Quit: Leaving...]
06:20
<
Davy_CC >
Will Crystall support for starting multiple here documents in one line?
06:25
pawnbox has joined #crystal-lang
06:29
pawnbox has quit [Ping timeout: 240 seconds]
06:33
Raimondii has joined #crystal-lang
06:35
zodiak has quit [Read error: Connection reset by peer]
06:36
zodiak has joined #crystal-lang
06:36
Raimondi has quit [Ping timeout: 240 seconds]
06:44
senorprogrammer has quit [Quit: senorprogrammer]
06:45
Raimondii is now known as Raimondi
06:47
soveran has joined #crystal-lang
07:47
<
BlaXpirit >
Davy_CC, why would you do that? I don't understand
08:06
sandelius has joined #crystal-lang
08:15
sandelius has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
08:22
<
BlaXpirit >
hm, can't find any good command line arguments parser
08:23
<
BlaXpirit >
gotta have one like JSON.mapping
08:37
<
Davy_CC >
BlaXpirit: just ruby supports and want to know if crystal will support
08:37
<
BlaXpirit >
Davy_CC, I don't understand
08:39
<
Davy_CC >
Another question for heredoc, how can I call a method like `String#gsub` on the heredoc?
08:40
<
BlaXpirit >
Davy_CC, like normal.. what's the problem?
08:40
<
Davy_CC >
but not in Crystal
08:41
<
BlaXpirit >
actually no, you're probably right, this is a problem
08:42
<
BlaXpirit >
Davy_CC, you have to do it like this
https://carc.in/#/r/118g because opening and closing of a heredoc must be alone on the line
09:16
matp has quit [Remote host closed the connection]
09:30
<
jhass >
regarding multiple methods, we won't just do something because Ruby does it, you gotta show convincing usecases
09:30
<
jhass >
*multiple heredocs I mean
09:42
matp has joined #crystal-lang
09:43
trapped has joined #crystal-lang
09:53
ome has joined #crystal-lang
10:28
<
BlaXpirit >
how can I execute some function when my program is being closed (kill, interrupt, whatever)?
10:29
soveran has quit [Remote host closed the connection]
10:38
<
BlaXpirit >
at_exit, of course
10:41
<
BlaXpirit >
doesn't seem to catch interrupt :(
10:43
<
jhass >
Signal::TERM.trap do ... end
10:50
<
Davy_CC >
I want to keep my code clean and simple that I don't have to create a tmp var for the heredoc
10:55
<
jhass >
Add a comment ;)
10:56
<
BlaXpirit >
how to send a JSON body in a HTTP request?
10:59
<
BlaXpirit >
I guess body: {stuff: 5}.to_json
11:13
jokke has quit [Remote host closed the connection]
11:14
jokke has joined #crystal-lang
11:31
<
BlaXpirit >
found a gotcha: HTTP::Client.get modifies the Headers object passed to it so it can't be reused. bug?
11:50
<
jhass >
BlaXpirit: mmh, adding Content-Length?
11:50
<
BlaXpirit >
jhass, yeah, that and more
11:51
<
jhass >
I mean besides Content-Length it would add those anyway again
11:52
<
jhass >
but makes me wonder whether we can/should make it wrap a NamedTuple
11:53
<
jhass >
I would hate having to copy a hash for every request
11:53
<
BlaXpirit >
jhass, I supplied "Authorization", "Accept", and it permanently added "Host", "Content-Length", "User-agent", "Accept-Encoding"
11:54
<
jhass >
okay I guess Host could be troublesome if you were to reuse it for different clients
11:54
<
BlaXpirit >
jhass, no, making it a tuple would make some things impossible
11:54
<
BlaXpirit >
jhass, content-length is by far the most troublesome, it just makes everything hang
11:56
<
jhass >
I guess we have to copy it :/
12:00
<
BlaXpirit >
I don't think so.. i mean, these things could be added in a separate loop as the last stage instead of modifying the object
12:01
<
BlaXpirit >
now I'm looking for a way to parse streaming JSON. I thought crystal could do it if I supply an IO but it consumes one extra token and expects EOF
12:02
<
BlaXpirit >
>> require "json"; io = MemoryIO.new(%<{"a": [5]}{"b": 6}>); p JSON.parse(io); p JSON.parse(io)
12:02
Philpax_ has joined #crystal-lang
12:03
<
jhass >
BlaXpirit: no that would require redesigning and rewriting HTTP::Client at this point. Not saying that it may not be worth it, but I think fixing the behavior is more important first, the longstanding issue can then be getting rid of the copy again
12:05
Philpax has quit [Ping timeout: 252 seconds]
12:09
ome has quit [Quit: Connection closed for inactivity]
12:21
pawnbox has joined #crystal-lang
12:24
pawnbox has quit [Remote host closed the connection]
12:24
pawnbox has joined #crystal-lang
12:36
<
crystal-gh >
[crystal] jhass opened pull request #2801: Do not mutate the users HTTP::Headers object in HTTP::Client (master...http_client_headers)
https://git.io/voZFC
12:45
ragmaanir has joined #crystal-lang
12:56
<
BlaXpirit >
sigh, couldn't tweak the stdlib JSON after all. unfortunately, the lexer also always reads an extra character and that's too much work to avoid
12:59
Philpax_ is now known as Philpax
13:02
ragmaanir has quit [Quit: Leaving]
13:27
alanwillms has quit [Read error: Connection reset by peer]
13:27
alanwillms has joined #crystal-lang
13:38
pawnbox_ has joined #crystal-lang
13:39
<
BlaXpirit >
>> "\x20" # weird
13:41
<
jhass >
>> 20.chr.to_s
13:42
<
BlaXpirit >
yeah thanks
13:42
pawnbox has quit [Ping timeout: 264 seconds]
13:50
alanwillms93 has joined #crystal-lang
13:52
alanwillms has quit [Ping timeout: 244 seconds]
13:55
<
crystal-gh >
crystal/master 3678687 Ary Borenszweig: Fixed #2798: Playground doesn't show error when it can't listen on port
14:10
senorprogrammer has joined #crystal-lang
14:11
pawnbox_ has quit [Remote host closed the connection]
14:18
<
jhass >
always interesting how you're ignored until you actually do invest work :/
14:20
pawnbox has joined #crystal-lang
14:27
matp has joined #crystal-lang
14:28
<
crystal-gh >
[crystal] asterite opened pull request #2802: Make heredoc end if the end matches and a non-identifier char is found (master...feature/fix_heredoc)
https://git.io/voZxs
15:03
pawnbox has quit [Remote host closed the connection]
15:03
pawnbox has joined #crystal-lang
15:10
pawnbox has quit [Remote host closed the connection]
15:10
pawnbox has joined #crystal-lang
15:11
<
Davy_CC >
I can't alias a generic type like `alias Foo(T) = Hash(Symbol, T)`, can I?
15:11
snsei_ has quit [Remote host closed the connection]
15:12
snsei has joined #crystal-lang
15:15
<
jhass >
well if that doesn't work then no
15:17
<
Davy_CC >
is there any method can do this?
15:20
<
jhass >
you could try writing a wrapper struct that uses macro method_missing to delegate all methods
15:21
<
Davy_CC >
okay, thanks
15:22
Oliphaunte has joined #crystal-lang
15:27
Oliphaunte has quit [Ping timeout: 272 seconds]
15:36
pawnbox_ has joined #crystal-lang
15:38
<
Yxhuvud >
jhass: well, if delegation is what you want, wouldn't forward_missing_to be a better macro to use?
15:39
<
jhass >
oh we got that?
15:39
pawnbox has quit [Ping timeout: 250 seconds]
15:39
<
jhass >
never realized :D
15:39
<
jhass >
well it's just defining the boilerplate macro method_missing
15:40
<
jhass >
aaand will currently break with 0.18
15:40
<
jhass >
asterite: ^ gotta patch up forward_missing_to for the dropped macro method_missing variant
15:44
icezimm has joined #crystal-lang
16:05
snsei_ has joined #crystal-lang
16:05
snsei_ has quit [Remote host closed the connection]
16:06
snsei_ has joined #crystal-lang
16:07
snsei has quit [Ping timeout: 272 seconds]
16:07
<
Davy_CC >
jhass: I dont understand the issue you mentioned
16:07
<
jhass >
mmh, in retrospect it's about doing class Foo(T); alias Bar = Array(T);
16:09
<
Davy_CC >
so, will the generic alias be available in the feture?
16:09
<
jhass >
perhaps, if you suggest it
16:10
<
Davy_CC >
maybe i can open a issue on github to suggest it?
16:13
snsei_ has quit [Ping timeout: 252 seconds]
16:14
Philpax has quit [Ping timeout: 252 seconds]
16:14
snsei has joined #crystal-lang
16:43
Netfeed has quit [Changing host]
16:43
Netfeed has joined #crystal-lang
17:05
Oliphaunte has joined #crystal-lang
17:06
senorprogrammer has left #crystal-lang [#crystal-lang]
17:06
senorprogrammer has joined #crystal-lang
17:15
snsei_ has joined #crystal-lang
17:18
snsei has quit [Ping timeout: 240 seconds]
17:28
no0p has joined #crystal-lang
17:44
tommoor has joined #crystal-lang
17:44
<
tommoor >
any suggested patterns for reloading, particularly with kemal
17:44
<
jhass >
there's no code reloading support
17:47
<
tommoor >
re running the server on change would be okay for now, I was thinking of just using the npm watch module but if there is something written in crystal than I'd happily prefer that :)
17:48
<
jhass >
no idea if/how usable that is
17:52
<
tommoor >
thanks @jhass - those look interesting
17:52
snsei_ has quit [Remote host closed the connection]
17:53
snsei has joined #crystal-lang
17:53
soveran has joined #crystal-lang
17:53
soveran has quit [Changing host]
17:53
soveran has joined #crystal-lang
18:25
<
crystal-gh >
crystal/master c2ae51d Jonne Haß: Do not mutate the users HTTP::Headers object in HTTP::Client
18:25
<
crystal-gh >
crystal/master 9d00831 Jonne Haß: Merge pull request #2801 from jhass/http_client_headers...
18:25
<
jhass >
BlaXpirit: ^ there you go, fixed
18:27
<
crystal-gh >
crystal/master 3c36108 Ary Borenszweig: Compiler: no need to requrie `dl`. Related to #2800
18:33
<
crystal-gh >
[crystal] senorprogrammer opened pull request #2805: Adds Char#swapcase and String#swapcase instance methods. (master...add-swapcase-to-char-and-string)
https://git.io/vonT5
18:35
Oliphaunte has quit [Remote host closed the connection]
18:38
<
jhass >
Yxhuvud: first link in the readme is broken ;)
18:39
<
BlaXpirit >
Yxhuvud, I don't know what it does. Primarily, what is the output format?
18:39
<
jhass >
Yxhuvud: a class can be a namespace too, you don't need to use a module as toplevel namespace and then forward .new
18:41
<
jhass >
I would avoid "short" names such as sigfigs at least on the external names
18:49
<
BlaXpirit >
is there a convenient way to map an array with an external function, not a method
18:49
<
BlaXpirit >
like arr.map &Regex.escape
18:49
<
BlaXpirit >
i.e. shorthand for arr.map { |x| something(x) }
18:52
<
Yxhuvud >
fixed link.
18:54
snsei_ has joined #crystal-lang
18:54
<
Yxhuvud >
jhass: Yeah, I know regarding the class/module, but I kinda expect the root to get some other methods as well eventually.
18:56
<
jhass >
BlaXpirit: I think you could do .map &->Regex.escape, though not sure it actually works and it's probably slow
18:56
<
icezimm >
tommoor: better late than never, I use Guard with crystal
18:56
<
BlaXpirit >
>> ["3*5", "[z]"].map &->Regex.escape
18:57
snsei has quit [Ping timeout: 250 seconds]
18:57
<
BlaXpirit >
>> ["3*5", "[z]"].map &->Regex.escape(String)
18:57
<
BlaXpirit >
I need this often
19:14
snsei_ has quit [Remote host closed the connection]
19:15
snsei has joined #crystal-lang
19:15
<
crystal-gh >
crystal/master c31a86c Ary Borenszweig: Improve a bit error message when accesing a global variable before it's initialized
19:15
Oliphaunte has joined #crystal-lang
19:38
Oliphaunte has quit [Remote host closed the connection]
19:41
Oliphaunte has joined #crystal-lang
19:47
yawniek has quit [Ping timeout: 244 seconds]
19:48
<
shadowshell >
it could stand for some better variable substitution options on the run lines
19:49
<
shadowshell >
but generally has stayed out of my way pretty well
19:49
Raimondi has quit [Quit: WeeChat 1.5-dev]
19:50
Raimondi has joined #crystal-lang
19:50
<
shadowshell >
i've also been using guard gem when i want to use the serverspec gem for testing things in crystal projects
19:50
<
shadowshell >
updated the gist with examples
19:50
<
shadowshell >
using guard-shell
19:51
<
icezimm >
shadowshell: great… thanks for sharing
19:52
<
shadowshell >
anytime :)
19:52
<
icezimm >
I don't worry about features, I'm only using 1 line hahahah
19:52
<
shadowshell >
simple is sweet
19:53
<
icezimm >
really liked your setup, I'm gonna use it, great to use things for the same env, and can help guardian improve :)
19:54
<
shadowshell >
indeed!
19:54
<
shadowshell >
i might take a whack at better subs for the run line if no one beats me too it
19:54
<
shadowshell >
working on things i find more interesting at the moment ;)
19:57
soveran has quit [Remote host closed the connection]
19:59
<
crystal-gh >
crystal/master b488b81 Ary Borenszweig: Improve a bit error message when accessing nilable class variables
19:59
<
crystal-gh >
crystal/master c34db9b Ary Borenszweig: Fixed #2796: Block argument unpacking overwrites local variable
20:01
soveran has joined #crystal-lang
20:01
soveran has quit [Remote host closed the connection]
20:16
snsei_ has joined #crystal-lang
20:19
snsei has quit [Ping timeout: 272 seconds]
20:19
snsei_ has quit [Remote host closed the connection]
20:20
snsei has joined #crystal-lang
20:30
Nik736 has joined #crystal-lang
20:33
<
BlaXpirit >
jhass, well I've rewritten a bridge bot in Crystal. that should be more appealing :D
20:37
<
crystal-gh >
crystal/master 09f90ba Ary Borenszweig: Small fix in IO docs
20:47
senorprogrammer has quit [Quit: senorprogrammer]
20:51
soveran has joined #crystal-lang
20:51
soveran has quit [Changing host]
20:51
soveran has joined #crystal-lang
20:51
<
icezimm >
I thought Array(Int32 | HashierValue) the `|` would indicate can be Int32 OR HashierValue on array
20:52
<
icezimm >
I'm probably missing some concept
20:54
soveran has quit [Remote host closed the connection]
21:04
soveran has joined #crystal-lang
21:09
<
icezimm >
BlaXpirit: thank you very much! :bow: :)
21:21
snsei_ has joined #crystal-lang
21:23
snsei has quit [Ping timeout: 258 seconds]
21:36
ozra_ has joined #crystal-lang
21:41
<
crystal-gh >
[crystal] jhass opened pull request #2807: Remove --cross-compile flags (master...remove_cross_compile_flags)
https://git.io/von3p
21:45
ryanw-se has joined #crystal-lang
21:52
ozra_ has quit [Ping timeout: 240 seconds]
21:53
tommoor has quit [Quit: Connection closed for inactivity]
21:54
paulcsmith_ has joined #crystal-lang
21:58
paulcsmith_ has quit [Client Quit]
22:04
paulcsmith_ has joined #crystal-lang
22:23
bcardiff has joined #crystal-lang
22:23
Oliphaunte has quit [Remote host closed the connection]
22:23
soveran has quit [Remote host closed the connection]
22:26
ozra_ has joined #crystal-lang
22:30
bcardiff has quit [Quit: bcardiff]
22:34
Oliphaunte has joined #crystal-lang
22:43
<
icezimm >
jhass: thanks for the link :)
22:44
<
icezimm >
BlaXpirit jhass If I use some classes, isn't there a kind of "alias"?
22:44
<
BlaXpirit >
icezimm, explain more
22:45
<
icezimm >
usually I just use 2, 3 classes and I write all of them, but in this case I'm gonna use 5 classes, annoying to write 5 all the time
22:45
<
icezimm >
alias MyHash = (String | Int32 | Aclass | AnotherClass)
22:45
<
icezimm >
[] of MyHash
22:45
<
icezimm >
something like this
22:45
<
icezimm >
I'm looking for on doc but haven't found
22:46
<
BlaXpirit >
icezimm, this seems like the wrong approach. why do you need all these types in an array?
22:46
<
BlaXpirit >
icezimm, I think you've just written the right syntax for it, though
22:47
<
icezimm >
yeah, just have tried first :~
22:50
<
icezimm >
I can use Hashier::MyHash on whole code… great!
23:24
soveran has joined #crystal-lang
23:29
paulcsmith_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
23:29
soveran has quit [Ping timeout: 272 seconds]
23:37
ozra_ has quit [Ping timeout: 244 seconds]