<John_Ivan>
ox1eef, I suppose to the lexical analysis people, elsif is easier to detect than provide two extra state machines to detect what's an else if on it's own :P
<John_Ivan>
\grammar people
<ox1eef>
i think it is a perlism
<ox1eef>
like many things in ruby
<John_Ivan>
I sure do miss my brackets tho
<John_Ivan>
at least I can do File.open(..) do { | fhandle| fhandle.write(...) }
oxfuxxx has joined #ruby
gr33n7007h has quit [Ping timeout: 240 seconds]
Synthead has joined #ruby
oxfuxxx has quit [Ping timeout: 252 seconds]
<Synthead>
I have a rails app I'm running in development mode. When I attempt to load a page locally in a browser (from rails s, puma), I get a 404 on my css:
<Synthead>
ActionController::RoutingError (No route matches [GET] "/assets/application-e2086e7131a4274bb31552c356e4258029bcd14fdb61d04c33c225fffadcdb8a.css"):
<Synthead>
I'm not sure why this is attempting to serve a compiled asset
<Synthead>
what's going on here?
<Synthead>
this seems to be coming from: <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
<ox1eef>
John_Ivan: for that case there's File.write :) but yeah blocks are great
<havenwood>
John_Ivan: Really do just use File.write when it's fine to all be in memory or you'll have it all in memory anyways.
constxd has quit [Ping timeout: 250 seconds]
<John_Ivan>
havenwood, ?
<mooff>
John_Ivan: he's recommending File.write(path, contents) over File.open(path) { f.write(contents) } when you can get away with it
<John_Ivan>
mooff, ah. well, yeah. makes sense. I generally end up relying on a buffer if my data in memory is bigger than 25MB
<John_Ivan>
otherwise, load it all up without worries
duds- has quit [Remote host closed the connection]
duds- has joined #ruby
roadie has quit [Ping timeout: 252 seconds]
oxfuxxx has joined #ruby
robotmay has quit [Quit: Be excellent to each other]
robotmay has joined #ruby
oxfuxxx has quit [Ping timeout: 256 seconds]
goepsilongo has joined #ruby
Tasi__ has joined #ruby
fowl has quit [Quit: cya pals]
lucerne has quit [Remote host closed the connection]
Tasi_ has quit [Ping timeout: 250 seconds]
lucerne has joined #ruby
ollysmith_ has quit [Ping timeout: 250 seconds]
fowl has joined #ruby
roadie has joined #ruby
ollysmith has joined #ruby
roadie has quit [Ping timeout: 252 seconds]
wand_ has quit [Remote host closed the connection]
<nakilon>
I feel like I've found a bug _<> didn't fully localize if it yet but when you do ".map.with_index{ |(_, *), i| " the _ isn't shadowed but permanently overwrites the higher definition
<nakilon>
from 2.3.8 to 3.0.2
wand has joined #ruby
roadie has joined #ruby
<ox1eef>
nakilon: please provide a working example of the bug, i didn't quite get it
<nakilon>
_ = 1
<nakilon>
[[2]].map. tap{ p _ }.
<nakilon>
with_index{ |(_),| _ }.tap{ p _ }
<nakilon>
you'll see that _ became 2; either change |(_),|_ with |(x),|x or replace _ with x everywhere and the issue is gone
<nakilon>
or if you remove the (_) splatting; so I suppose the bug is there
<nakilon>
shorter example: _ = 1; [[2]].tap{ p _ }.map{ |(_)| _ }.tap{ p _ }
<ox1eef>
yeah, looks like a bug to me.
<ox1eef>
i reproduced here too
Exuma has joined #ruby
<nakilon>
_ = 1; [[2]].each{ |(_)| }; p _
Tasi_ has joined #ruby
<leah2>
is there a version of ruby-mode that can indent case..in?