00:17
joto has quit [Read error: Connection reset by peer]
00:18
joto has joined #ruby
00:53
cappy has joined #ruby
01:15
joast has joined #ruby
01:16
itaipu has quit [Ping timeout: 260 seconds]
01:19
cherryramatisdev has quit [Quit: WeeChat 4.7.1]
01:33
itaipu has joined #ruby
01:40
itaipu has quit [Ping timeout: 258 seconds]
01:45
manveru has quit [Server closed connection]
01:45
manveru has joined #ruby
01:55
itaipu has joined #ruby
02:06
TomyWork has quit [Remote host closed the connection]
02:10
ftajhii has joined #ruby
02:22
cappy has quit [Ping timeout: 260 seconds]
03:17
<
Hammdist >
in sinatra, how do I do to return an HTML file with a certain substring replaced?
03:18
<
Hammdist >
return IO.binread("./index.html").gsub("{USERNAME}", username); <-- something like this, but with the correct content type
03:19
<
Hammdist >
and somehow specifying :cache => false
03:33
<
havenwood >
Hammdist: You can explicitly `content_type 'text/html'` and `cache_control :no_cache`.
03:33
<
havenwood >
I'd `File.read` since it's hopefully UTF-8 not binary.
03:38
<
havenwood >
If you can make it an ERB template, that'd be preferred to gsubbing the file directly.
04:06
_whitelogger has joined #ruby
04:45
constxd has quit [Server closed connection]
04:46
constxd has joined #ruby
05:56
grenierm has joined #ruby
06:47
jmcantrell_ has quit [Quit: WeeChat 4.7.0]
06:49
jmcantrell_ has joined #ruby
06:59
schne1der has joined #ruby
07:05
jmcantrell_ has quit [Ping timeout: 260 seconds]
07:16
Linux_Kerio has joined #ruby
07:17
Linux_Kerio has quit [Read error: Connection reset by peer]
07:39
The_Camel_ has joined #ruby
07:41
chair1 has joined #ruby
08:55
Munto has quit [Ping timeout: 248 seconds]
08:59
Munto has joined #ruby
09:00
grenierm has quit [Ping timeout: 250 seconds]
09:08
<
Hammdist >
havenwood: nice but if I return a string from sinatra wouldn't that autodetect html (if it is) and automatically apply no-cache since it can only assume it's dynamic?
09:53
TomyWork has joined #ruby
10:03
jtperreault has quit [Server closed connection]
10:04
jtperreault has joined #ruby
10:48
ghostbuster has quit [Server closed connection]
10:49
ghostbuster has joined #ruby
11:02
kenyon has quit [Server closed connection]
11:02
kenyon has joined #ruby
11:11
Manouchehri has quit [Server closed connection]
11:12
Manouchehri has joined #ruby
11:21
chair38 has joined #ruby
11:25
chair1 has quit [Ping timeout: 250 seconds]
11:26
chair38 is now known as chair1
11:37
jmjl has quit [Server closed connection]
11:37
jmjl has joined #ruby
11:45
<
o0x1eef >
Sinatra doesn't do any of that magic (thank God :))
11:57
itaipu has quit [Ping timeout: 258 seconds]
12:20
itaipu has joined #ruby
12:25
twopoint718 has quit [Server closed connection]
12:25
twopoint718 has joined #ruby
12:43
schne1der has quit [Quit: schne1der]
12:57
user71 has joined #ruby
13:30
<
havenwood >
Hammdist: A `send_file` detects the File mime but Sinatra knowns not where a String came from.
13:31
The_Camel_ has quit [Ping timeout: 260 seconds]
13:51
nmollerup has quit [Quit: Leaving]
14:11
<
nakilon >
coworkers were making json via erb
14:11
<
nakilon >
it was awful idea
14:23
mange has quit [Quit: Zzz...]
14:41
Javier has joined #ruby
14:44
Javier has quit [Client Quit]
14:44
flurp has joined #ruby
14:52
<
o0x1eef >
Usually works alright for YAML so you could be forgiven for that mistake
15:16
Jordan has quit [Server closed connection]
15:16
Jordan has joined #ruby
15:22
Byteflux has quit [Server closed connection]
15:22
Byteflux has joined #ruby
15:48
<
Hammdist >
havenwood: um, so what content type is returned to the client when a handler evalutes to "Hello World"?
15:50
cherryramatisdev has joined #ruby
15:59
jhass has quit [Remote host closed the connection]
15:59
jhass_ has joined #ruby
16:00
jhass_ has quit [Remote host closed the connection]
16:00
jhass has joined #ruby
16:01
cappy has joined #ruby
16:06
blacknova has joined #ruby
16:08
The_Camel_ has joined #ruby
16:08
chair1 has quit [Quit: Client closed]
16:09
msv has quit [Remote host closed the connection]
16:10
rvalue has quit [Ping timeout: 248 seconds]
16:13
jhass has quit [Remote host closed the connection]
16:27
jhass has joined #ruby
16:28
<
o0x1eef >
text/plain
16:29
<
o0x1eef >
Let me check though
16:32
cappy has quit [Quit: Leaving]
16:32
<
o0x1eef >
text/html appears to be
17:05
rvalue has joined #ruby
17:10
___nick___ has joined #ruby
17:31
cherryramatisdev has quit [Ping timeout: 260 seconds]
17:32
cherryramatisdev has joined #ruby
17:34
jmcantrell_ has joined #ruby
17:38
cherryramatisdev has quit [Ping timeout: 260 seconds]
17:44
cherryramatisdev has joined #ruby
18:03
jmcantrell_ has quit [Quit: WeeChat 4.7.1]
18:05
jmcantrell_ has joined #ruby
18:05
jmcantrell_ is now known as jmcantrell
18:41
cherryramatisdev has quit [Ping timeout: 260 seconds]
18:45
TomyWork has quit [Remote host closed the connection]
18:58
CRISPR has joined #ruby
19:04
CRISPR has quit [Ping timeout: 260 seconds]
19:08
msv has joined #ruby
19:26
nmollerup has joined #ruby
19:33
user71 has quit [Quit: Leaving]
19:44
cherryramatisdev has joined #ruby
19:46
___nick___ has joined #ruby
19:47
___nick___ has quit [Client Quit]
19:47
<
kjetilho >
nakilon: erb has access to the JSON module, so I don't see the problem?
19:48
<
kjetilho >
(mush everything together in a hash, then dump it in JSON format.)
19:49
___nick___ has joined #ruby
20:07
cherryramatisdev has quit [Quit: WeeChat 4.7.1]
20:17
cherryramatisdev has joined #ruby
20:22
cherryramatisdev has quit [Client Quit]
20:26
rvalue has quit [Read error: Connection reset by peer]
20:27
rvalue has joined #ruby
20:36
<
o0x1eef >
Probably more like: {"foo": "<%= bar %>"} but you can get much more complex than that and I can see how it would become a mess
20:43
WhiteNoise has joined #ruby
21:14
The_Camel_ has quit [Ping timeout: 260 seconds]
21:19
WhiteNoise has quit [Quit: WeeChat 4.7.1]
22:00
ruby[bot] has quit [Remote host closed the connection]
22:00
ruby[bot] has joined #ruby
23:17
ox is now known as oz