<apeiros>
yorickpeterse: glad I'm not the only one who doesn't like metric tools too much
<apeiros>
IMO an indicator at best
<yorickpeterse>
I used it in the past but had to tweak like 15 settings to make it bearable
symm- has quit [Ping timeout: 240 seconds]
<apeiros>
I'd also require a whitelist option
<yorickpeterse>
also some of the rules it enforce are purely arbitrary
<apeiros>
i.e. "yes, this one is ugly, but it has been seen, don't mention it again"
<tsou>
what's wrong with a tool like rubocop to mention redundant returns?
<yorickpeterse>
e.g. "put _ between every 3 digits" <- like what the fuck?
<yorickpeterse>
tsou: define redundant. Technically they are not required, but that doesn't mean you shouldn't include them
<yorickpeterse>
I happen to be from the school of "I prefer explicit returns because it's easier to grok"
<apeiros>
ah, yeah, I do that. 10_000_000 is easier to read than 10000000
<yorickpeterse>
I know you can tweak a lot but ugh
<maloik>
I didn't know you could do that until a couple weeks ago
<tsou>
yorickpeterse: that's the difference between 'redundant' and 'forbidden/illegal/disallowed' in this case
<tsou>
so i don't get the fuss..
<maloik>
definately something I'm going to try to use more often in the future
<yorickpeterse>
tsou: if it's a pedantic it shouldn't be there by default
mechanicles has joined #ruby-lang
<yorickpeterse>
But again that's me, I hate tools that enforce made up rules out of the box
<yorickpeterse>
also
<tsou>
i thought it was more of a guide to check how much you conform to the usual style
<yorickpeterse>
Fuck the MRI profiler
<yorickpeterse>
fuck it for not letting me redirect output
nathanstitt has joined #ruby-lang
<tsou>
but i dunno, i've never used it, pretty much for the annoyances it's giving you right now :P
rahul_j has joined #ruby-lang
mr-fooba_ has joined #ruby-lang
esad has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
yfeldblum has joined #ruby-lang
brunowg has joined #ruby-lang
mr-foobar has quit [Ping timeout: 268 seconds]
Cakey has joined #ruby-lang
yfeldblum has quit [Ping timeout: 265 seconds]
johnny_rugger has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
kitak has quit [Remote host closed the connection]
Cakey has quit [Ping timeout: 264 seconds]
robmiller has quit [Quit: Leaving.]
Cakey has joined #ruby-lang
joonty has quit [Read error: Connection reset by peer]
johnny_rugger has joined #ruby-lang
matp has joined #ruby-lang
alexju has quit [Remote host closed the connection]
brunowg has quit [Quit: leaving]
<eam>
yorickpeterse: agreed re: explicit returns. I actually really like style enforcement (necessary, coming from Perl), I just don't like rubocop's choices
<eam>
a lot of the suggested style appears to remove information
benlovell has joined #ruby-lang
luiz_lha has joined #ruby-lang
tylersmith has joined #ruby-lang
<yorickpeterse>
well yeah, enforcing things upon a certain level when it comes to style is good
<yorickpeterse>
and often needed
<yorickpeterse>
In fact, I'm writing some analysis atm
<yorickpeterse>
but it's very specific to this one project
<Xzyx987X>
this is probably the most trivial question I've ever asked here, but I'd like to know if ruby has a way of writing two line if/else statement. I really like how one like if statements make my code more clean, compact, and readable, and it's getting so that I cringe at the wasted space when I have to spend 5 lines on a single if/else
alexju has joined #ruby-lang
<Xzyx987X>
*one line
<toretore>
if ... then
<yorickpeterse>
if foo then bar end
<yorickpeterse>
foo if bar
<yorickpeterse>
errr wait missed the else bit
<yorickpeterse>
if foo then bar else baz end
<yorickpeterse>
or
<yorickpeterse>
foo ? bar : baz
<Xzyx987X>
I said two line. if I stick it on one line the code gets too long and won't fit on the screen
seanlinsley has quit [Quit: …]
<yorickpeterse>
well, you can break the ternary
<yorickpeterse>
foo ?
<tsou>
Xzyx987X: you can break a line of code in ruby, but strictly two lines for your example seems bad-looking, of course i have no idea what your code looks like
<yorickpeterse>
bar : baz
<toretore>
you mean in your quest for fewer loc you're making the code less readable? imagine that..
<yorickpeterse>
However, I would just write it out
<yorickpeterse>
if foo
<yorickpeterse>
else
<yorickpeterse>
end
<yorickpeterse>
etc
Cakey has quit [Ping timeout: 255 seconds]
<Xzyx987X>
would if ... then ... \n else ... end work?
<yorickpeterse>
don't do that, that looks hideous
<toretore>
just write the damn lines
<yorickpeterse>
also you'd have to escape the newline with a \
<Xzyx987X>
yea... I dunno, it still seems less bad than the alternatives...
<toretore>
you can use `then` in place of a newline
<toretore>
as in `if foo then bar\nelse ...`
loincloth has joined #ruby-lang
<Xzyx987X>
I dunno, I tried "if foo then bar\nelse ..." to see how it would look at my code and I don't like it. it's difficult to read when the most important part of the statement gets squished in at the end
<Xzyx987X>
the nice thing about the one line if is that the actual important code that does stuff is always first
guns has joined #ruby-lang
Siyfion has quit [Remote host closed the connection]
Siyfion has joined #ruby-lang
toastynerd has joined #ruby-lang
devgiant has joined #ruby-lang
<tsou>
Xzyx987X: you do realize that the example code you pasted perfectly fits in one line, so suggestions for styling your actual code cannot really come from foo/bar/baz, right?
dik_dak has joined #ruby-lang
robbyoconnor has quit [Ping timeout: 268 seconds]
yatish27 has quit []
nathanstitt has quit [Quit: I growing sleepy]
yfeldblum has joined #ruby-lang
tbuehlmann has quit [Quit: Leaving]
[spoiler] has quit [Quit: Leaving]
mistym has joined #ruby-lang
simono has joined #ruby-lang
yfeldblum has quit [Ping timeout: 265 seconds]
nathanstitt has joined #ruby-lang
bjh13 has joined #ruby-lang
mistym has quit [Remote host closed the connection]
seanlinsley has joined #ruby-lang
simono has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jmeeuwen has quit [Ping timeout: 240 seconds]
nanno77 has joined #ruby-lang
seanlinsley has quit [Ping timeout: 265 seconds]
slawrence has joined #ruby-lang
jmeeuwen has joined #ruby-lang
toastynerd has quit [Remote host closed the connection]
ascarter has joined #ruby-lang
seanlinsley has joined #ruby-lang
relix has joined #ruby-lang
bzalasky has quit [Remote host closed the connection]
marcdel_ has quit []
bzalasky has joined #ruby-lang
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
|jemc| has joined #ruby-lang
Asher has joined #ruby-lang
arBmind has quit [Quit: Leaving.]
mistym has joined #ruby-lang
charliesome has joined #ruby-lang
ngw has joined #ruby-lang
bzalasky has quit [Remote host closed the connection]
jsullivandigs has joined #ruby-lang
digs has joined #ruby-lang
johnny_rugger has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
digs is now known as Guest98002
johnny_rugger has joined #ruby-lang
tectonic has joined #ruby-lang
jsullivandigs has quit [Ping timeout: 265 seconds]
diegoviola has joined #ruby-lang
bzalasky has joined #ruby-lang
bzalasky has quit [Read error: Connection reset by peer]
Guest98002 has quit [Ping timeout: 240 seconds]
bzalasky has joined #ruby-lang
Voker57 has joined #ruby-lang
jsullivandigs has joined #ruby-lang
solars has quit [Ping timeout: 240 seconds]
bzalasky has quit [Remote host closed the connection]
guns has quit [Quit: guns]
Atw has joined #ruby-lang
workmad3 has quit [Ping timeout: 265 seconds]
esad has joined #ruby-lang
jsullivandigs has quit [Ping timeout: 252 seconds]
havenwood has joined #ruby-lang
Onixs_ has quit [Read error: Connection reset by peer]
yfeldblum has joined #ruby-lang
yfeldblum has quit [Remote host closed the connection]
yfeldblum has joined #ruby-lang
Cakey has joined #ruby-lang
shinnya has joined #ruby-lang
tylersmith has quit [Remote host closed the connection]
Onixs has joined #ruby-lang
tylersmith has joined #ruby-lang
mistym has quit [Remote host closed the connection]
yatish27 has joined #ruby-lang
luiz_lha has quit [Ping timeout: 240 seconds]
yatish27 has quit [Client Quit]
Onixs_ has joined #ruby-lang
Onixs has quit [Ping timeout: 265 seconds]
tylersmith has quit [Ping timeout: 265 seconds]
johnny_rugger has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Cakey has quit [Ping timeout: 255 seconds]
macmartine has joined #ruby-lang
macmartine has quit [Remote host closed the connection]
wallerdev has joined #ruby-lang
toastynerd has joined #ruby-lang
rippa has joined #ruby-lang
luiz_lha has joined #ruby-lang
michaeldeol has joined #ruby-lang
futilegames has quit [Quit: futilegames]
yatish27 has joined #ruby-lang
RobertBirnie has joined #ruby-lang
AncientAmateur has quit [Remote host closed the connection]
toastynerd has quit [Remote host closed the connection]
ascarter has joined #ruby-lang
ascarter has quit [Max SendQ exceeded]
Olipro has quit [Ping timeout: 246 seconds]
skammer has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ascarter has joined #ruby-lang
ascarter has quit [Max SendQ exceeded]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ascarter has joined #ruby-lang
ascarter has quit [Max SendQ exceeded]
olivererxleben has quit [Quit: Leaving...]
yatish27 has quit [Remote host closed the connection]
ascarter has joined #ruby-lang
ascarter has quit [Max SendQ exceeded]
toastynerd has joined #ruby-lang
ascarter has joined #ruby-lang
apeiros has quit [Remote host closed the connection]
esad has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ascarter has quit [Max SendQ exceeded]
apeiros has joined #ruby-lang
tectonic has quit []
ascarter has joined #ruby-lang
ascarter has quit [Max SendQ exceeded]
jbee has quit [Ping timeout: 265 seconds]
nathanstitt has quit [Quit: I growing sleepy]
ascarter has joined #ruby-lang
ascarter has quit [Max SendQ exceeded]
Coincidental has joined #ruby-lang
__butch__ has joined #ruby-lang
retro|cz has joined #ruby-lang
apeiros has quit [Ping timeout: 264 seconds]
ascarter has joined #ruby-lang
ascarter has quit [Max SendQ exceeded]
lcdhoffman has joined #ruby-lang
ascarter has joined #ruby-lang
dstynchula has joined #ruby-lang
ascarter_ has joined #ruby-lang
DEac- has joined #ruby-lang
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
toastynerd has quit [Remote host closed the connection]
yetanotherdave has joined #ruby-lang
toastynerd has joined #ruby-lang
bradcliffe has joined #ruby-lang
loincloth has joined #ruby-lang
elia has quit [Ping timeout: 240 seconds]
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
dagobah has quit [Quit: Leaving...]
victorbjelkholm has quit [Quit: Leaving]
johnny_rugger has joined #ruby-lang
ascarter has joined #ruby-lang
mistym has joined #ruby-lang
ascarter has quit [Max SendQ exceeded]
ascarter has joined #ruby-lang
hahuang65 has joined #ruby-lang
Johz has joined #ruby-lang
MedicalJaneParis has joined #ruby-lang
<MedicalJaneParis>
http://pastebin.com/PryGRicy - trying to reuse route definitions across padrino/sinatra, but using instance_eval only allows me to go one level deep. this feels like a code smell but hoping someone has an idea on how to do it
hahuang61 has joined #ruby-lang
chichou has quit [Remote host closed the connection]
brettwea_ has joined #ruby-lang
brettweavnet has quit [Ping timeout: 240 seconds]
Ins_ has quit [Quit: Page closed]
johnny_rugger has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
heftig has quit [Quit: Quitting]
riffraff has quit [Quit: Leaving]
chichou has joined #ruby-lang
ikrima has joined #ruby-lang
skade has quit [Quit: Computer has gone to sleep.]
zanion has joined #ruby-lang
CaptainJet has joined #ruby-lang
LMity has joined #ruby-lang
chichou has quit [Read error: Connection reset by peer]
chichou has joined #ruby-lang
Xzyx987X has quit [Read error: Connection reset by peer]
jonathanmarvens has quit [Remote host closed the connection]
futilegames has joined #ruby-lang
Xzyx987X has joined #ruby-lang
Voker57 has quit [Ping timeout: 240 seconds]
robmiller has quit [Quit: Leaving.]
LMity has quit [Ping timeout: 240 seconds]
symm- has joined #ruby-lang
johnny_rugger has joined #ruby-lang
nathanstitt has quit [Quit: I growing sleepy]
cnivolle_ has quit [Remote host closed the connection]
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
cnivolle has joined #ruby-lang
fragamus has joined #ruby-lang
davidae has quit [Ping timeout: 268 seconds]
davidae has joined #ruby-lang
sepp2k1 has joined #ruby-lang
sepp2k has quit [Ping timeout: 255 seconds]
MichD is now known as michd
arBmind has joined #ruby-lang
mbj has quit [Quit: leaving]
Mon_Ouie has joined #ruby-lang
rue|w has quit [Read error: Connection reset by peer]
rue_XIW has joined #ruby-lang
jonathanmarvens has joined #ruby-lang
esad has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mehlah has quit [Quit: Leaving...]
loincloth has quit [Remote host closed the connection]
tbuehlmann has joined #ruby-lang
rue_XIW has quit [Ping timeout: 255 seconds]
loincloth has joined #ruby-lang
brettwea_ has quit [Ping timeout: 255 seconds]
diegoviola has quit [Read error: Connection reset by peer]
michaeldeol has joined #ruby-lang
fragamus has quit [Ping timeout: 255 seconds]
gix has quit [Ping timeout: 240 seconds]
brettweavnet has joined #ruby-lang
luiz_lha has quit [Ping timeout: 240 seconds]
rahul_j has quit [Quit: rahul_j]
gix has joined #ruby-lang
wallerdev has quit [Quit: wallerdev]
luiz_lha has joined #ruby-lang
wallerdev has joined #ruby-lang
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
gix has quit [Ping timeout: 265 seconds]
bradcliffe has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bradcliffe has joined #ruby-lang
gix has joined #ruby-lang
fragamus has joined #ruby-lang
fragamus has quit [Client Quit]
toastynerd has quit [Remote host closed the connection]
centrx has joined #ruby-lang
LMity has joined #ruby-lang
esad has joined #ruby-lang
luiz_lha has quit [Quit: Saindo]
zz_dlu has quit [Ping timeout: 252 seconds]
GaelanAintAround has quit [Ping timeout: 264 seconds]
GaelanAintAround has joined #ruby-lang
johnny_rugger has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jonathanmarvens has quit [Remote host closed the connection]
zz_dlu has joined #ruby-lang
jonathanmarvens has joined #ruby-lang
mechanicles has quit [Remote host closed the connection]
ikrima has quit [Ping timeout: 255 seconds]
imperator has joined #ruby-lang
johnny_rugger has joined #ruby-lang
jonathanmarvens has quit [Remote host closed the connection]
LMity has quit [Ping timeout: 240 seconds]
LMity has joined #ruby-lang
alakra has quit [Quit: WeeChat 0.4.1]
arBmind has quit [Quit: Leaving.]
jonathanmarvens has joined #ruby-lang
<imperator>
yo
guns has joined #ruby-lang
momomomomo has quit [Quit: momomomomo]
elliotec has joined #ruby-lang
<centrx>
Ahoy
retro|cz has quit [Ping timeout: 255 seconds]
toastynerd has joined #ruby-lang
michaeldeol has joined #ruby-lang
enebo has quit [Quit: enebo]
havenwood has quit []
yalue has quit [Quit: Leaving]
bradcliffe has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
cored has quit [Ping timeout: 268 seconds]
toastynerd has quit [Remote host closed the connection]
houhoulis has quit [Remote host closed the connection]
vlad_starkov has quit []
cored has joined #ruby-lang
michaeldeol has joined #ruby-lang
bradcliffe has joined #ruby-lang
toastynerd has joined #ruby-lang
lcdhoffman has quit [Quit: lcdhoffman]
cnivolle has quit [Read error: Operation timed out]
jonathanmarvens has quit [Remote host closed the connection]
jonathanmarvens has joined #ruby-lang
fragamus has joined #ruby-lang
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
mehlah has joined #ruby-lang
cored has quit [Ping timeout: 264 seconds]
tharindu has quit [Ping timeout: 265 seconds]
momomomomo has joined #ruby-lang
Fushi has quit [Quit: Connection closed for inactivity]
elliotec has quit [Remote host closed the connection]
lcdhoffman has joined #ruby-lang
alexju_ has joined #ruby-lang
alexju has quit [Ping timeout: 268 seconds]
symm- has quit [Read error: Connection reset by peer]
alexju_ has quit [Remote host closed the connection]
momomomomo has quit [Quit: momomomomo]
alexju has joined #ruby-lang
symm- has joined #ruby-lang
lcdhoffman has quit [Quit: lcdhoffman]
jonathanmarvens has quit [Remote host closed the connection]
jonathanmarvens has joined #ruby-lang
zanion_ has joined #ruby-lang
<zanion_>
So I want to begin adding models to a GLI scaffolded application. Should I create a new Models directory in root or create it in lib?
fragamus has quit [Quit: Computer has gone to sleep.]
relix has joined #ruby-lang
epitron is now known as pookie
<fowl>
zanion, #rubyonrails
guns has quit [Quit: guns]
pookie is now known as epitron
<zanion_>
its not a rails app but I get the point. I'll try to find a more relevant irc
cnivolle has joined #ruby-lang
LMity has quit [Ping timeout: 240 seconds]
elliotec has joined #ruby-lang
zanion_ has left #ruby-lang [#ruby-lang]
stardiviner has quit [Ping timeout: 255 seconds]
loincloth has quit [Remote host closed the connection]
jason__ has joined #ruby-lang
lcdhoffman has joined #ruby-lang
ascarter has joined #ruby-lang
ur5us has joined #ruby-lang
jason__ has quit [Ping timeout: 245 seconds]
kyb3r_ has joined #ruby-lang
<lianj>
is there a ruby http client that can drop the socket connection after reading the response headers and if they don't match his request accept header?
pr0ton_ has joined #ruby-lang
pr0ton_ has left #ruby-lang [#ruby-lang]
loincloth has joined #ruby-lang
johnny_rugger has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
momomomomo has joined #ruby-lang
toastynerd has quit [Remote host closed the connection]
AncientAmateur has quit [Remote host closed the connection]
imperator has quit [Quit: Leaving]
<drbrain>
lianj: wouldn't that mean the server is broken?
toastynerd has joined #ruby-lang
heftig has joined #ruby-lang
<lianj>
lots of scumbag servers out there
<lianj>
like almost all
momomomomo has quit [Quit: momomomomo]
leandrosnunes has quit [Ping timeout: 255 seconds]
gix has quit [Quit: Client exiting]
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<drbrain>
I don't know of one
<drbrain>
(a client)
<lianj>
ok thanks anyway. what about size limits?
<drbrain>
size limits on reading?
<lianj>
yes
<drbrain>
Net::HTTP allows you to implement it yourself using block mode
<drbrain>
let me find the example…
<lianj>
yea i remember seeing that some time back. just curious if it really closes the socket then or still finishes