TomyLobo has quit [Read error: Connection reset by peer]
bsdbandit-01 has quit [Quit: -a- Connection Timed Out]
bsdbandit-01 has joined #ruby
JohanP has quit [Ping timeout: 258 seconds]
Swyper has quit [Remote host closed the connection]
NODE has quit [Remote host closed the connection]
hipertracker has joined #ruby
NODE has joined #ruby
ur5us has quit [Ping timeout: 260 seconds]
<dorian>
hey question: is there a way to detect if a method is called in void context?
<dorian>
ie if the return value is going to be thrown away or not
ur5us has joined #ruby
<dorian>
suppose i have a method like a mutator that also returns a value, and in so doing it does some extra work to format it or something
<dorian>
but if the return value of the method isn't going to be used for anything, i want to avoid it doing that extra work
JohanP has joined #ruby
<dorian>
(eg in perl, wantarray returning undef means the sub was called in void context)
<mozzarella>
I don't think there's such a thing, but I could be wrong
turbo_choo has joined #ruby
JohanP has quit [Ping timeout: 260 seconds]
meinside has joined #ruby
<dorian>
hm, all the goog searches in the vicinity seem to land on rubocop
<dorian>
but if i'm not mistaken that's checking the actual syntax rather than runtime isn't it
<dorian>
oh well, not a big deal
renich has quit [Quit: renich]
budonyc has joined #ruby
skryking has quit [Ping timeout: 240 seconds]
skryking_ has joined #ruby
skryking_ has quit [Client Quit]
markopasha has quit [Remote host closed the connection]
JohanP has joined #ruby
JohanP has quit [Ping timeout: 258 seconds]
hipertracker has quit [Remote host closed the connection]
dasher00 has quit [Ping timeout: 260 seconds]
gix has quit [Ping timeout: 268 seconds]
Swyper has joined #ruby
Swyper has quit [Remote host closed the connection]
alex has quit [Ping timeout: 258 seconds]
Swyper has joined #ruby
_whitelogger has joined #ruby
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
alex has joined #ruby
Swyper has quit [Remote host closed the connection]
JohanP has joined #ruby
JohanP has quit [Ping timeout: 265 seconds]
pwnd_nsfw has quit [Quit: Leaving]
brool has joined #ruby
mossplix has joined #ruby
AJA4350 has quit [Quit: AJA4350]
JohanP has joined #ruby
JohanP has quit [Ping timeout: 260 seconds]
mossplix has quit [Remote host closed the connection]
bsdbandit-01 has quit [Quit: -a- Connection Timed Out]
bsdbandit-01 has joined #ruby
JohanP has joined #ruby
JohanP has quit [Ping timeout: 268 seconds]
<adam12>
dorian: If it's expensive then you could return a value that has to be unwrapped? If the value is never unwrapped (ie, returned_object.value is never called) then expensive work to prepare value is never done.
budonyc has quit [Quit: Leaving]
howdoi has joined #ruby
NODE has quit [Remote host closed the connection]
NODE has joined #ruby
thejs has joined #ruby
JohanP has joined #ruby
JohanP has quit [Ping timeout: 258 seconds]
Swyper has joined #ruby
jenrzzz has joined #ruby
Creatornator has joined #ruby
skx86 has quit [Quit: Connection closed for inactivity]
Swyper has quit [Remote host closed the connection]
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
phaul has joined #ruby
Swyper has joined #ruby
iNs_ has quit [Ping timeout: 240 seconds]
thejs has quit [Quit: Leaving]
JohanP has joined #ruby
iNs has joined #ruby
thewrinklyninja has joined #ruby
JohanP has quit [Ping timeout: 240 seconds]
BTRE has quit [Ping timeout: 265 seconds]
BTRE has joined #ruby
thewrinklyninja has quit [Quit: Leaving]
alex has quit [Ping timeout: 260 seconds]
ur5us has quit [Ping timeout: 260 seconds]
BTRE has quit [Ping timeout: 260 seconds]
BTRE has joined #ruby
mossplix has joined #ruby
JohanP has joined #ruby
JohanP has quit [Ping timeout: 258 seconds]
mossplix has quit [Remote host closed the connection]
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
Swyper has quit [Remote host closed the connection]
ur5us has joined #ruby
ur5us has quit [Ping timeout: 260 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<zema>
1:45 spending hitting my head against the wall on that line
<zema>
:(
Emmanuel_Chanel has quit [Read error: Connection reset by peer]
<uplime>
node[:role] == 'web'
<adam12>
zema: What about if node[:role] == 'web'
<havenwood>
zema if node[:role] == 'web'
<adam12>
Heh
Emmanuel_Chanel has joined #ruby
Emmanuel_Chanel has quit [Max SendQ exceeded]
JohanP` has joined #ruby
Emmanuel_Chanel has joined #ruby
<uplime>
zema: foo = [a, b, c, d]; foo.each do |bar| ... end # in this case, bar is a, then b, then c, then d (the actual elements of the array), not the index
Fuzzy76 has left #ruby ["In the words of the great philosopher Eric Cartman - screw you guys, I'm going home!"]
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<gitter1234>
adam12: Basically just remove the parentheses?
pwnd_nsfw` has joined #ruby
<gitter1234>
or is it parenthesis I always forget :)
<adam12>
gitter1234: Not necessarily. I abbreviated some of the arguments since I figured you'd just assume what went inside them.
<gitter1234>
but yeah i expect some real hires images to be uploaded to my rails blog app
<adam12>
gitter1234: Not using parens for link_to is an old habit of mine, but I don't write much Rails anymore.
<gitter1234>
haha
<gitter1234>
pretty wrong assumption to say the least :)
<gitter1234>
i'll look over it again though
<gitter1234>
out of curiosity, what do you write in these days?
<gitter1234>
heard a lot of people saying rails is dead, but then point at some solution that looks way way more complicated
<adam12>
gitter1234: I'm just saying, the method arguments for link_to is "content of a element", "href value". You can pass an image tag as the first argument (content of element), but href value should be a URL to the image and not the image tag you're passing.
<adam12>
gitter1234: Rails and/or Ruby has been dying forever. Not sure why it's always had that reputation but maybe it's because it was the first well-known RAD style framework for the web back when Java reigned king. First to market type of problems?
* havenwood
waves a "Roda" banner and chants, "Roda! Roda!"
pwnd_nsfw has quit [Ping timeout: 260 seconds]
iNs has quit [Ping timeout: 240 seconds]
<adam12>
gitter1234: I meant to quote "dying". It's not dying at all. Neither Rails or Ruby is dying. I'd say both are actually well just behind the hype phase and quite healthy.
<gitter1234>
i figured it was something like that :)
iNs has joined #ruby
<adam12>
gitter1234: Most of my projects now use a homebrew style of Roda. It's worked well for me tho I'm noticing some issues that aren't working well in teams (ala, a lack of a config/routes.rb file for one). I enjoy Roda+Sequel more than Rails but you shave more yaks at the benefit of more control.
<gitter1234>
also, the overwhelming majority of the people who claim rails is dying have never actually tried it so...
<adam12>
gitter1234: Hanami looks promising but it won't upset Rails.
spacesuitdiver has joined #ruby
infinityfye has quit [Quit: Leaving]
<gitter1234>
cool stuff!
<gitter1234>
i see hanami is japanese for "flower watching", what a nice name
duckpuppy has joined #ruby
reber__ has joined #ruby
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Excess Flood]
<gitter1234>
adam12: thanks for the help, gonna see if it makes banging my head against the wall less painful :) just gotta run to the store first, brb
reber_ has quit [Ping timeout: 268 seconds]
chalkmonster has quit [Quit: WeeChat 2.7]
alex`` has quit [Ping timeout: 258 seconds]
chalkmonster has joined #ruby
fphilipe has quit [Read error: Connection reset by peer]
fphilipe has joined #ruby
spacesuitdiver has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
priodev has quit [Ping timeout: 265 seconds]
priodev has joined #ruby
reber_ has joined #ruby
reber__ has quit [Ping timeout: 268 seconds]
<guzzlefry>
How important is this `#frozen_string_literal: true` thing?
zema has quit [Remote host closed the connection]
orbyt_ has joined #ruby
<havenwood>
guzzlefry: It's a common preference for frozen string literals by default. I like to use it across the board, *but* it's not terribly important.
<havenwood>
guzzlefry: RuboCop will rightly suggest using it, and it matters most when you want to reduce memory usage without littering your code with `.freeze` on every string literal.
<guzzlefry>
I'm confused on what it actually does. Does it just make string variables immutable?
<havenwood>
guzzlefry: Yup.
Emmanuel_Chanel has quit [Remote host closed the connection]
<ytti>
it may be also useful to evaluate if you needed string, or if symbol would have done
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
JohanP` has joined #ruby
alex`` has joined #ruby
JohanP` has quit [Remote host closed the connection]
JohanP`` has joined #ruby
JohanP`` has quit [Ping timeout: 268 seconds]
chalkmonster has quit [Quit: WeeChat 2.7]
reber__ has joined #ruby
reber_ has quit [Ping timeout: 265 seconds]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bsdbandit-01 has joined #ruby
bsdbandit-01 has quit [Excess Flood]
pwnd_nsfw` has quit [Ping timeout: 260 seconds]
pwnd_nsfw has joined #ruby
bmurt has joined #ruby
chalkmonster has joined #ruby
Emmanuel_Chanel has joined #ruby
Emmanuel_Chanel has quit [Max SendQ exceeded]
davidw has joined #ruby
davidw has joined #ruby
davidw has quit [Changing host]
markopasha has quit [Remote host closed the connection]
markopasha has joined #ruby
<gitter1234>
adam12: Hello hello :)
<adam12>
gitter1234: ohai
<gitter1234>
adam12: you were absolutely right. matter of fact "image" was enough for the second argument, seems rails handles the rest by itself!
<gitter1234>
thank you :)
<adam12>
gitter1234: Awesome.
alex`` has quit [Ping timeout: 268 seconds]
reber_ has joined #ruby
reber__ has quit [Ping timeout: 265 seconds]
subfj has joined #ruby
TCZ has joined #ruby
yokel has quit [Ping timeout: 260 seconds]
subfj_ has joined #ruby
suukim has joined #ruby
JohanP`` has joined #ruby
NODE has quit [Remote host closed the connection]
subfj has quit [Ping timeout: 265 seconds]
NODE has joined #ruby
NODE has quit [Remote host closed the connection]
suukim has quit [Client Quit]
<gitter1234>
what a joyous day. i think it's time for a movie
<NL3limin4t0r>
havenwood: I don't think that's true. Like the name sugests it makes string freezes string literals, not string variables. A string can still be mutable.
<havenwood>
NL3limin4t0r: I was going to explain in detail, but decided "yes" was closer to true than "no" without caveat. ¯\_(ツ)_/¯
<NL3limin4t0r>
that's true
<havenwood>
NL3limin4t0r: The *string* is immutable once frozen, at least.
<NL3limin4t0r>
yep, but receiving a mutable string from somewhere and assigning it to a variable doesn't freeze it
Eiam has joined #ruby
<NL3limin4t0r>
Mutable strings can still be created with `String.new` or `+'some string'`.