00:12
Philpax has joined #crystal-lang
00:19
ponga has quit [Quit: Connection closed for inactivity]
00:39
Oliphaunte has joined #crystal-lang
00:39
Philpax has quit [Ping timeout: 258 seconds]
00:41
pawnbox has joined #crystal-lang
00:43
Philpax has joined #crystal-lang
00:45
pawnbox has quit [Ping timeout: 240 seconds]
00:56
pawnbox has joined #crystal-lang
01:00
Philpax has quit [Ping timeout: 240 seconds]
01:01
pawnbox has quit [Ping timeout: 244 seconds]
01:03
Philpax has joined #crystal-lang
01:05
kulelu88 has quit [Quit: Leaving]
01:52
Oliphaunte has quit [Remote host closed the connection]
02:03
Oliphaunte has joined #crystal-lang
02:33
pawnbox has joined #crystal-lang
02:37
pawnbox has quit [Ping timeout: 250 seconds]
03:03
pawnbox has joined #crystal-lang
03:08
pawnbox has quit [Ping timeout: 260 seconds]
03:21
snsei has joined #crystal-lang
03:22
x0f_ has joined #crystal-lang
03:24
x0f has quit [Ping timeout: 258 seconds]
03:29
x0f has joined #crystal-lang
03:29
x0f_ has quit [Ping timeout: 258 seconds]
03:35
Oliphaunte has quit [Remote host closed the connection]
03:41
snsei has quit [Remote host closed the connection]
03:42
pawnbox has joined #crystal-lang
03:42
snsei has joined #crystal-lang
03:46
snsei has quit [Remote host closed the connection]
03:53
Oliphaunte has joined #crystal-lang
04:04
Oliphaunte has quit [Remote host closed the connection]
04:24
snsei has joined #crystal-lang
04:49
Oliphaunte has joined #crystal-lang
04:53
Oliphaunte has quit [Ping timeout: 258 seconds]
05:26
pawnbox has quit [Remote host closed the connection]
05:27
soveran has joined #crystal-lang
05:27
soveran has quit [Changing host]
05:27
soveran has joined #crystal-lang
05:46
soveran has quit [Remote host closed the connection]
05:48
pawnbox has joined #crystal-lang
05:58
soveran has joined #crystal-lang
06:08
pawnbox_ has joined #crystal-lang
06:09
pawnbox has quit [Ping timeout: 240 seconds]
06:20
pawnbox_ has quit [Remote host closed the connection]
06:21
pawnbox has joined #crystal-lang
06:33
snsei has quit [Remote host closed the connection]
06:37
Oliphaunte has joined #crystal-lang
06:41
Oliphaunte has quit [Ping timeout: 240 seconds]
06:46
akwiatkowski has joined #crystal-lang
06:49
mark_66 has joined #crystal-lang
07:10
Philpax has quit [Ping timeout: 240 seconds]
07:14
pawnbox has quit [Remote host closed the connection]
07:15
pawnbox has joined #crystal-lang
07:28
alsm has joined #crystal-lang
07:28
bjz has joined #crystal-lang
07:31
Oliphaunte has joined #crystal-lang
07:37
Oliphaunte has quit [Ping timeout: 276 seconds]
07:41
ponga has joined #crystal-lang
07:43
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
07:48
bjz has joined #crystal-lang
07:51
bjz has quit [Client Quit]
08:31
pawnbox has quit [Remote host closed the connection]
08:33
snsei has joined #crystal-lang
08:38
snsei has quit [Ping timeout: 276 seconds]
08:52
Cidan has quit [Ping timeout: 264 seconds]
08:55
latemus has joined #crystal-lang
09:18
zz_Cidan has joined #crystal-lang
09:18
zz_Cidan is now known as Cidan
09:18
Cidan has quit [Changing host]
09:18
Cidan has joined #crystal-lang
09:19
Oliphaunte has joined #crystal-lang
09:24
Oliphaunte has quit [Ping timeout: 246 seconds]
09:57
pawnbox has joined #crystal-lang
10:10
Philpax has joined #crystal-lang
10:11
soveran has quit [Remote host closed the connection]
10:14
Oliphaunte has joined #crystal-lang
10:18
Philpax has quit [Read error: Connection reset by peer]
10:18
Oliphaunte has quit [Ping timeout: 240 seconds]
10:25
Philpax has joined #crystal-lang
10:25
Philpax has quit [Read error: Connection reset by peer]
10:29
psylone has joined #crystal-lang
10:29
psylone has quit [Client Quit]
10:32
Raimondii has joined #crystal-lang
10:35
Raimondi has quit [Ping timeout: 240 seconds]
10:39
buggs has joined #crystal-lang
10:42
Raimondii is now known as Raimondi
10:42
pawnbox has quit [Remote host closed the connection]
10:43
pawnbox has joined #crystal-lang
10:52
soveran has joined #crystal-lang
10:52
soveran has quit [Changing host]
10:52
soveran has joined #crystal-lang
11:28
<
FromGitter >
<sdogruyol> hey all
11:29
<
FromGitter >
<mose> hey hey
11:35
trapped has joined #crystal-lang
11:53
<
j2k >
Is it possible to have variables in kemal's layout view (and its subviews)? sdogruyol ?
11:55
<
FromGitter >
<sdogruyol> what do you mean?
11:55
<
FromGitter >
<sdogruyol> you can have variable in your views
11:55
<
j2k >
but wat about the layout view?
11:56
<
FromGitter >
<sdogruyol> you can yield the subview via content
11:56
<
FromGitter >
<sdogruyol> you can also use content_for / yield_content for view specific conditinal stuff
11:56
<
FromGitter >
<sdogruyol> e.g custom javascript, html
12:00
<
j2k >
Aha this is almost what I need.
12:00
<
j2k >
sdogruyol: I'm basically trying to add a login/logout button in my navbar.ecr, which is a partial of my layout.ecr
12:04
<
FromGitter >
<sdogruyol> ugh
12:04
<
FromGitter >
<sdogruyol> you yield your own io
12:12
pawnbox has quit [Remote host closed the connection]
12:19
Oliphaunte has joined #crystal-lang
12:25
pawnbox has joined #crystal-lang
12:30
pawnbox has quit [Ping timeout: 264 seconds]
12:33
pawnbox has joined #crystal-lang
13:15
pawnbox has quit [Ping timeout: 246 seconds]
13:26
pawnbox has joined #crystal-lang
13:30
pawnbox has quit [Ping timeout: 250 seconds]
13:32
Philpax has joined #crystal-lang
13:34
Oliphaunte has quit [Remote host closed the connection]
13:37
<
jhass >
j2k: well, it doesn't install apt-transport-https
13:37
<
jhass >
so on a very very minimal system it fails, yeah
13:38
<
j2k >
Ok, that means someone changed the runner image
13:38
<
jhass >
mainly because debian thinks its a good idea to split every line of code into its own package ;)
13:38
<
j2k >
crystal on openbsd
_when_
13:38
<
jhass >
which runner image?
13:38
<
j2k >
gitlab's whatever docker image
13:39
<
jhass >
I don't follow
13:39
<
j2k >
Gitlab compiles/tests my crystal app
13:40
<
jhass >
no idea what the setup is there
13:40
<
j2k >
they run it in a docker image for ruby :P
13:40
<
jhass >
the repo recently switched to https
13:40
<
jhass >
so that's why we need apt https support now
13:46
<
FromGitter >
<sdogruyol> meh
13:47
<
FromGitter >
<sdogruyol> yet we can store `Box` without any type then what's the point of boxing :/
13:48
<
FromGitter >
<sdogruyol> cant*
13:48
<
jhass >
you can, just get a pointer to it
13:48
<
jhass >
its point is that it's a class, so on the heap
13:48
<
jhass >
so you can box struct's into it
13:49
<
FromGitter >
<sdogruyol> well i want to store any `T` within STORE
13:50
<
jhass >
how do you know which one it is?
13:50
<
FromGitter >
<sdogruyol> well
13:50
<
FromGitter >
<sdogruyol> this is kinda hacky but something like this
13:51
<
FromGitter >
<sdogruyol> i need some kind of thread local storage for context
13:52
<
FromGitter >
<sdogruyol> nvm the constant btw just for quick try
13:52
<
jhass >
fiber local rather?
13:53
<
FromGitter >
<sdogruyol> yeah fiber in our case
13:59
<
FromGitter >
<f> Hi everyone!
14:00
<
jhass >
mh, there was a question on fiber/thread local storage somewhere but I can't find it anymore
14:00
<
jhass >
Until we allow Object as generic type argument, there's no sane generic solution
14:01
<
jhass >
Ary's recommendation for now was to monkey patch custom accessors into Thread or Fiber
14:01
<
jhass >
and then use Fiber#current/Thread#current to access it
14:14
<
FromGitter >
<sdogruyol> still how i can store `T` in somewhere
14:14
<
FromGitter >
<sdogruyol> i'd like a `HTTP::Context` storage that can hold any object
14:15
Oliphaunte has joined #crystal-lang
14:18
Raimondii has joined #crystal-lang
14:19
<
j2k >
its free for private repos, so quite cool
14:19
<
jhass >
keep in mind to rebuild that imagine shortly after each release (after I rebuilt the base)
14:20
<
jhass >
or does it get rebuild on each run?
14:21
Raimondi has quit [Ping timeout: 240 seconds]
14:21
<
jhass >
I see, great
14:22
Raimondii is now known as Raimondi
14:42
mark_661 has joined #crystal-lang
14:43
<
FromGitter >
<sdogruyol> is there a way to constantize a string a.la `"Asd".constantize" => Asd : Class`
14:44
mark_66 has quit [Ping timeout: 240 seconds]
14:54
<
RX14 >
jhass, i removed the leftover comment
14:55
mark_661 has quit [Read error: Connection reset by peer]
14:55
mark_66 has joined #crystal-lang
14:56
<
jhass >
sdogruyol: no really sane one
14:57
<
RX14 >
jhass, i wonder what the cost of using the active_delimiter_buffer rather than just a offset in delimiter_buffer as an int is
14:58
<
leafybasil >
Hey crew, where are getter/setter documented? I can't seem to find in docs
14:58
<
leafybasil >
RX14: thanks, that makes sense now that you say it
14:59
<
leafybasil >
Also 18.7!? OMGEE.
14:59
<
RX14 >
what crystal version are you on?
14:59
<
leafybasil >
Some version of 17.4
14:59
<
leafybasil >
I'll update later today
14:59
<
RX14 >
at least its not 0.15.0
14:59
<
RX14 >
or something like that
15:01
<
FromGitter >
<sdogruyol> ah crap
15:01
<
FromGitter >
<sdogruyol> i really hope that `T` as generic type argument comes soon
15:02
<
jhass >
you mean Object?
15:02
<
RX14 >
just the generic stuff
15:03
<
jhass >
well Ary decided to work on parallelism first
15:03
<
RX14 >
just being able to hold an object reference and dispatch inspect and to_s on it regardless of type
15:10
<
leafybasil >
I wanted to wrap an API, but their keys are annoyingly camelCased so using the JSON mapping macro would result in deep rage. This leaves me three obvious options, 1) use the macro but map the fields with methods, 2) parse the json and set values by hand 3) write a custom PullParser that modifies the keys while parsing. Any other suggestions?
15:11
<
FromGitter >
<sdogruyol> practically we can't store an Object :/
15:14
<
jhass >
leafybasil: JSON.mapping has the form of foo_bar: {key: "fooBar", type: String}
15:14
<
leafybasil >
Beautiful
15:14
<
leafybasil >
jhass: beautiful.
15:15
<
jhass >
I think it was key, there's something like it at least
15:16
<
leafybasil >
I didn't see it but I have a habit of scanning too quickly
15:17
mark_66 has quit [Quit: Leaving.]
15:40
Philpax has quit [Ping timeout: 252 seconds]
15:47
kulelu88 has joined #crystal-lang
15:47
kulelu88 has quit [Changing host]
15:47
kulelu88 has joined #crystal-lang
15:55
<
FromGitter >
<alex-lairan> Hi everyones, I have a problem with File writing.
15:58
* jhass
waits for the question
15:58
<
FromGitter >
<alex-lairan> ho sorry x)
15:59
<
FromGitter >
<alex-lairan> Why this don't write on the log file?
15:59
<
FromGitter >
<alex-lairan> On normal time, this write on the daily.log file?
16:00
<
FromGitter >
<alex-lairan> But it's just create the file without write inside
16:00
<
jhass >
mh, probably because you don't call .close
16:02
<
jhass >
well we already had this discussion, no?
16:02
<
jhass >
I remember something like that, yes
16:02
<
FromGitter >
<alex-lairan> Ok thank ! Does I need to close each time I want to write?
16:02
<
jhass >
no, just at the end of your program
16:03
<
jhass >
btw did you see the Logger class in stdlib?
16:03
<
jhass >
RX14: anyway, I can't confidently argue either side either
16:03
<
FromGitter >
<alex-lairan> No I didn't see this class
16:03
p0nce has left #crystal-lang [#crystal-lang]
16:03
<
FromGitter >
<alex-lairan> I go see the documentation of it !
16:04
<
FromGitter >
<alex-lairan> Thank !
16:05
<
RX14 >
jhass, found it
16:06
alsm has quit [Ping timeout: 244 seconds]
16:13
soveran has quit [Remote host closed the connection]
16:21
pawnbox has joined #crystal-lang
16:39
ponga has quit [Quit: Connection closed for inactivity]
16:46
triangles has quit [Quit: Leaving]
16:59
tomchapin has joined #crystal-lang
17:12
tomchapin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
17:14
soveran has joined #crystal-lang
17:14
soveran has quit [Changing host]
17:14
soveran has joined #crystal-lang
17:20
soveran has quit [Ping timeout: 276 seconds]
17:24
snsei has joined #crystal-lang
17:26
Oliphaunte has quit [Remote host closed the connection]
17:32
Yxhuvud has quit [Remote host closed the connection]
17:33
Yxhuvud has joined #crystal-lang
17:36
<
RX14 >
jokke, PR'ed crouter to make it work with crystal 0.18.0+
17:38
<
jokke >
I don't have my pc with me right now but I'll look into it later alright?
17:38
<
RX14 >
yeah, thats ok
17:38
<
RX14 >
travis passes though
17:39
<
jokke >
Yeah it's just that i can't log into github from my phone
17:40
<
RX14 >
i always manage
17:40
<
jokke >
Yeah it's complicated. New phone and such
17:40
tomchapin has joined #crystal-lang
17:40
<
RX14 >
heh, i understand
17:41
<
jokke >
I see crystal dropped support for "string": foo hash syntax...
17:42
<
RX14 >
named tuple now
17:42
<
jokke >
Alright then
17:42
<
RX14 >
which is immutable, and what people should be using for option hashes
17:42
Oliphaunte has joined #crystal-lang
17:42
<
jokke >
But why not force usage of symbols for keys
17:43
<
RX14 >
because each k:v pair can have a different type
17:43
<
RX14 >
what do you mean force usage of symbols as keys?
17:43
<
jokke >
For option hashes
17:44
<
RX14 >
the idea is that {k: v, "key": v} is always a named tuple
17:44
<
RX14 >
and => is always hash
17:44
<
jhass >
second external names can have spaces
17:44
<
RX14 >
it's unifying the syntax
17:44
<
jhass >
third you might want to create a named tuple from json with keys having spaces
17:44
<
RX14 >
is named tuple json-compatible?
17:45
zodiak_ has quit [Ping timeout: 252 seconds]
17:45
<
jhass >
oh, we lack Nil.from_json?
17:45
<
RX14 >
i was saying if you pasted in json
17:45
<
RX14 >
as a named tuple
17:46
<
RX14 >
null would have to be renamed as nil
17:46
<
jhass >
oh you mean like that
17:46
<
jhass >
>> NamedTuple(foo: String).from_json(%("foo": "bar"))
17:46
<
jhass >
+ require but you get
17:46
pawnbox has quit [Read error: No route to host]
17:47
pawnbox has joined #crystal-lang
17:47
<
RX14 >
also forgot {}
17:47
<
RX14 >
around the object
17:47
<
jhass >
and half the words in my last sentences
17:49
pawnbox_ has joined #crystal-lang
17:50
<
jokke >
Oh so now we have to write { :foo => bar}
17:51
<
RX14 >
yeah but hash literals aren't used as much in crystal
17:51
<
RX14 >
so its not as big a deal
17:51
<
jokke >
Yeah I guess so
17:51
<
RX14 >
crystal's community seems to favour immutability, plus NamedTuple is kinda more useful because of the different types for different keys
17:51
<
RX14 >
and the whole compile time error stuff
17:51
pawnbox has quit [Ping timeout: 240 seconds]
18:11
zodiak has joined #crystal-lang
18:28
<
crystal-gh >
crystal/master 6102cb8 Ary Borenszweig: Fixed #2982: incorrect type lookup
18:30
triangles has joined #crystal-lang
18:43
tomchapin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
18:46
pawnbox_ has quit [Remote host closed the connection]
18:46
pawnbox has joined #crystal-lang
18:57
tomchapin has joined #crystal-lang
19:13
tomchapin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
19:17
soveran has joined #crystal-lang
19:22
soveran has quit [Ping timeout: 264 seconds]
19:29
<
RX14 >
jhass, is there any way to require everything in a directory apart from one
19:29
<
RX14 >
because crystal is complaining that a util macro I have is defined after a piece of code
19:29
<
RX14 >
but it's actually required both before and after
19:29
<
jhass >
I'm not sure how that would even look like syntax wise
19:29
<
RX14 >
and i can't reduce the bug
19:30
<
RX14 >
it's just so annoying
19:30
<
RX14 >
i do a require "./util/**" then require "./**"
19:30
<
RX14 >
and it still complains a util method is defined after
19:31
<
RX14 >
which is just dumb
19:31
<
RX14 >
it's a macro expansion in an expansion and all pretty much an edge case i guess
19:32
<
RX14 >
i guess i'll have to rename util to aaautil
19:40
<
asterite >
RX14: does it work if you require the file that defines the macro in the file that uses it?
19:40
<
RX14 >
asterite, nope
19:40
<
RX14 >
and i simply can't preproduce it
19:41
<
RX14 >
it worked in 0.15.0
19:41
<
RX14 >
now i'm upgrading this project its broken
19:41
<
asterite >
then it worked out of pure luck in 0.15
19:41
<
asterite >
if you can reduce it and report it, great :)
19:41
<
asterite >
otherwise there's not much we can do
19:42
<
RX14 >
what do you mean worked out of pure luck
19:42
<
asterite >
well, even without reducing, just a link to the repo
19:42
<
RX14 >
it's private
19:42
<
RX14 >
so i would have to reduce it quite a bit
19:42
<
asterite >
it means that using a macro that is found after the code that uses it sometimes work and sometimes it crashed the compiler
19:42
<
RX14 >
well at least strip bits out and anonymise it
19:43
<
RX14 >
well its a pretty simple macro
19:43
<
RX14 >
plus it was expended in some sort of tripply nested macro fudge
19:43
<
RX14 >
so it's probably run on like the third macro pass
19:44
<
RX14 >
because it's in a proc in a crouter route
19:49
tomchapin has joined #crystal-lang
19:49
<
RX14 >
i assume require doesn't track the files it's required previously
19:49
<
RX14 >
because if it did then it wouldn't be required twice and have the error
19:49
<
RX14 >
thats interesting
19:50
<
RX14 >
verry interesting
19:51
<
RX14 >
so i need to move the require for crouter after my util code
19:51
<
RX14 >
thats an easy enoguh work around
19:59
<
RX14 >
its just bugged
19:59
<
RX14 >
i literally can't compile my code
20:04
tomchapin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
20:06
<
crystal-gh >
crystal/master 7fd2b33 Ary Borenszweig: Added `Class#nilable?` and `Union.nilable?`
20:06
<
crystal-gh >
crystal/master dc9f526 Ary Borenszweig: Fixed #2983: `JSON.mapping` doesn't work with nilable type when missing key
20:21
akwiatkowski has quit [Ping timeout: 244 seconds]
20:28
willl has joined #crystal-lang
20:29
ssvb has quit [Remote host closed the connection]
20:29
soveran has joined #crystal-lang
20:34
Guest10105 has joined #crystal-lang
20:35
<
Guest10105 >
Is there any way in Crystal to transform a block of code to a string?
20:36
<
Guest10105 >
similar to the Ruby 'sourcify' gem's `to_source` method
20:38
<
Guest10105 >
but it would need some different trick, since (AFAIK) that gem actually reads the source code of the current file
20:42
akwiatkowski has joined #crystal-lang
20:42
<
RX14 >
asterite, wow thts quite a reduction
20:48
sebler_ has quit [Remote host closed the connection]
20:49
sebler has joined #crystal-lang
20:49
pawnbox has quit [Ping timeout: 258 seconds]
21:04
<
crystal-gh >
crystal/master 177828e Ary Borenszweig: Fixed #2984: Macros not correctly working inside proc literals and other places
21:04
tomchapin has joined #crystal-lang
21:09
pawnbox has joined #crystal-lang
21:09
Renich has joined #crystal-lang
21:11
Guest10105 has quit [Quit: Guest10105]
21:16
tomchapin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
21:57
<
RX14 >
do you know whay?
21:58
<
RX14 >
also will the macro fix make it into a 0.18.0 fix?
21:59
snsei has quit [Remote host closed the connection]
22:00
<
jhass >
I think the current plan is to have no 0.18.x anymore
22:02
Oliphaunte has quit [Remote host closed the connection]
22:06
<
RX14 >
but i can't compile on 0.18.x
22:06
<
RX14 >
what do I do?
22:06
<
RX14 >
build my own custom compiler version?
22:06
<
RX14 >
this is a major bug
22:06
<
RX14 >
like, macros don't work in procs!
22:07
<
RX14 >
thats something that requires a bugfix release to me
22:11
<
jhass >
RX14: I forgot which distro you're on
22:12
<
RX14 >
but i'm running this project using docker
22:12
<
RX14 >
so i'd have to build my own crystal docker container release
22:12
<
RX14 >
which is kinda a pain
22:12
<
jhass >
mh yeah, you have to then
22:12
<
RX14 >
considering I use the unofficial alpine linux package
22:13
<
RX14 >
which i don't even know how its build
22:14
Renich has quit [Quit: leaving]
22:27
soveran has quit [Remote host closed the connection]
22:35
<
crystal-gh >
[crystal] beno opened pull request #2985: suppress newlines (master...suppress-new-lines)
https://git.io/vKcRn
22:43
tomchapin has joined #crystal-lang
23:01
tomchapin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
23:01
Oliphaunte has joined #crystal-lang
23:11
ylluminate has joined #crystal-lang
23:15
jsaak_ has quit [Ping timeout: 264 seconds]
23:34
Oliphaunte has quit [Remote host closed the connection]
23:39
Oliphaunte has joined #crystal-lang
23:55
Doug__ has joined #crystal-lang
23:56
deverly has joined #crystal-lang