These are chat archives for Codcore/amethyst

25th
Jun 2015
Bar Hofesh
@bararchy
Jun 25 2015 08:06
@Codcore Is there a way to specify :expires => 1.hour.from_now for cookies ?
Bar Hofesh
@bararchy
Jun 25 2015 08:49
@Codcore I closed Codcore/Amethyst#20 this is a logical issue not a program bug
Andrej Yaroshuk
@Codcore
Jun 25 2015 09:57
@bararchy oh, it would be great! (To have help with contributing) . For now, new branch is experimental. Maybe I will push it to the main repository today.
@bararchy, unfortunately, there are no way to set expiration time for cookies. You can propose your implementation for it. There are a whole bunch of things that have higher priority ;)
Bar Hofesh
@bararchy
Jun 25 2015 10:19
@Codcore can you point me to where the cookies are configured in the repo ? I'll take a look and see if I can add that
Andrej Yaroshuk
@Codcore
Jun 25 2015 10:22
@bararchy look at Request and Response objects. The code is pretty simple
@bararchy in future cookies can be implemented as a middleware
Bar Hofesh
@bararchy
Jun 25 2015 10:29
@Codcore I see that you build the cookie string using String += String, the performance can be much better if we use StringBuilder, would you mind if I'll create a small PR for this ?
Bar Hofesh
@bararchy
Jun 25 2015 10:50
@Codcore PR sent ;)
Andrej Yaroshuk
@Codcore
Jun 25 2015 13:53
@bararchy, thanks!
Bar Hofesh
@bararchy
Jun 25 2015 16:42
@Codcore I saw other places in the code where String += String is used , get ready for another massive PR .
Also , specs won't run ... Something with missing folder
Andrej Yaroshuk
@Codcore
Jun 25 2015 16:44
@bararchy great! which folder?
Bar Hofesh
@bararchy
Jun 25 2015 16:48
@Codcore
in ./src/amethyst/middleware/middleware.cr:2: while requiring "mime": can't find file 'mime' relative to '/home/unshadow/Desktop/git-projects/Amethyst/src/amethyst/middleware'

require "mime"
Andrej Yaroshuk
@Codcore
Jun 25 2015 16:52
@bararchy hm, strange...
Andrej Yaroshuk
@Codcore
Jun 25 2015 17:19
@bararchy I tried and got the same error. It because you should run crystal spec from amethyst directory. Crystal cannot find a module when running it from other folders. So,
go to the root of amethyst repository and run crystal spec.It should works