<johnjaye>
wow. ruby has the same single quote double quote distinction as python.
<johnjaye>
did both copy that from bash or where did that come from
<ox1eef_>
If it worked, it would print 1. You can run code within a class body as well.
<ox1eef_>
I would say Ruby is inspired by a bunch of languages. Sometimes you can see C, sometimes you can see Perl, sometimes you can see Lisp, ....
jhass has quit [Ping timeout: 255 seconds]
<ox1eef_>
gnight
<johnjaye>
i thought python was clever but then I realized it took a lot of its syntax like the : slicing from other languages
jhass has joined #ruby
<ox1eef_>
Standing on the shoulders of giants. Always.
roadie has quit [Ping timeout: 240 seconds]
roadie has joined #ruby
<sphex>
johnjaye: perl had that. which probably took it from the bourne shell. not sure how Unix shells did it before that... and perl/ruby allow backslash escapes of the delimiter in single-quoted strings, while bourne shell does not.
roadie has quit [Ping timeout: 240 seconds]
jhass has quit [Ping timeout: 240 seconds]
jhass has joined #ruby
cek_ has quit [Quit: Connection closed for inactivity]
hays has joined #ruby
brokkoli_origin has quit [Remote host closed the connection]
brokkoli_origin has joined #ruby
John_Ivan has joined #ruby
neshpion has quit [Quit: neshpion]
Al2O3 has joined #ruby
yetoo has joined #ruby
dorian has quit [Ping timeout: 255 seconds]
Fusl_ has quit [Ping timeout: 255 seconds]
ap4y has quit [Remote host closed the connection]
dorian has joined #ruby
Fusl_ has joined #ruby
caedmon has joined #ruby
NightMonkey has quit [Server closed connection]
NightMonkey has joined #ruby
luca_rtc has quit [Remote host closed the connection]
_ht has joined #ruby
nickjj has quit [Read error: Connection reset by peer]
record64 has joined #ruby
caedmon has quit [Ping timeout: 240 seconds]
caedmon has joined #ruby
record64 has quit [Quit: Best CPUs can count to infinity twice without being bugged out by zero division errors or whatnot.]
caedmon has quit [Ping timeout: 240 seconds]
jhass has quit [Ping timeout: 240 seconds]
jhass has joined #ruby
roadie has joined #ruby
caedmon has joined #ruby
CrazyEddy has joined #ruby
caedmon has quit [Ping timeout: 255 seconds]
roadie has quit [Ping timeout: 240 seconds]
panella32 has joined #ruby
<panella32>
Hi
<panella32>
Is is possible to put erb output tag inside a string? like this: <%= image_tag "some/static/path/<%= movie.bg_path %>"
<panella32>
If it's not, I think I have to use ruby's string interpolation, right? but is it safe?
<panella32>
(Sorry if it's not clear enough. it's a nested erb tag but I forgot the closing tag)
tomtmym has joined #ruby
tomtmym has quit [Changing host]
tomtmym has joined #ruby
roadie has joined #ruby
<sam113101>
why would it be safe?
roadie has quit [Ping timeout: 240 seconds]
rvalue has quit [Ping timeout: 260 seconds]
panella32 has quit [Ping timeout: 240 seconds]
_ht has quit [Quit: _ht]
<sam113101>
why would it *not* be safe?
otisolsen70 has joined #ruby
rvalue has joined #ruby
panella32 has joined #ruby
infinityfye has joined #ruby
roadie has joined #ruby
jprokop has joined #ruby
teclator has joined #ruby
MalusVulgaris has quit [Ping timeout: 240 seconds]
hightower2 has joined #ruby
mynameisdebian has quit [Remote host closed the connection]
mynameisdebian has joined #ruby
mynameisdebian has quit [Remote host closed the connection]
<Bish>
my pry is not accepting utf8 content whats habbending
yassernasc has joined #ruby
FabioPort has quit [Quit: Client closed]
FabioPort has joined #ruby
kaivai has quit [Ping timeout: 255 seconds]
nona has quit [Server closed connection]
nona has joined #ruby
FabioPort has quit [Quit: FabioPort]
FabioPort has joined #ruby
FabioPort has left #ruby [#ruby]
jidar has quit [Quit: Remote host closed the connection]
BazzaBazaa has joined #ruby
kaivai has joined #ruby
dostoyevsky2 has quit [Server closed connection]
dostoyevsky2 has joined #ruby
juuh42dias has quit [Read error: Connection reset by peer]
jhass[m] has quit [Read error: Connection reset by peer]
hsiktas[m] has quit [Read error: Connection reset by peer]
Fernando-Basso has quit [Write error: Connection reset by peer]
hexology has joined #ruby
juuh42dias has joined #ruby
nmollerup has quit [Remote host closed the connection]
nmollerup has joined #ruby
brokkoli_origin has quit [Ping timeout: 240 seconds]
brokkoli_origin has joined #ruby
Fernando-Basso has joined #ruby
jhass[m] has joined #ruby
hsiktas[m] has joined #ruby
Pixi has joined #ruby
BazzaBazaa has quit [Remote host closed the connection]
desnudopenguino has joined #ruby
BazzaBazaa has joined #ruby
mekhami has joined #ruby
<mekhami>
i'm getting a strange activerecord error that i don't know (I'm not a rubyist, so i don't have all the knowledge, but this one makes little sense besides)
<mekhami>
the code is workign but i'm getting 50k of these errors in our error tracker every day
<mekhami>
the code that ends up raising this is using `MyModel.find_or_create_by!`
BazzaBazaa has quit [Remote host closed the connection]
<havenwood>
mekhami: The only thing that stands out to me on first glance is what looks to be a singular table name "user" instead of "users" in `"user"."access_token"`.
<havenwood>
And the other `"user".` instances.
<havenwood>
Someone hear might be able to spot the issue if you can share the model code.
eddof13 has joined #ruby
ox1eef_ has joined #ruby
teclator has quit [Ping timeout: 246 seconds]
nona has quit [Ping timeout: 268 seconds]
heinrich5991 has joined #ruby
hightower2 has quit [Ping timeout: 240 seconds]
<havenwood>
*here
aesthetikx has quit [Server closed connection]
aesthetikx has joined #ruby
lena64t2 has quit [Remote host closed the connection]
roadie has quit [Ping timeout: 240 seconds]
lena64t2 has joined #ruby
dviola has joined #ruby
hightower2 has joined #ruby
ryjo has joined #ruby
markong has quit [Ping timeout: 240 seconds]
_ht has joined #ruby
<heinrich5991>
how do I implicitly convert a variable into a float?
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bambanxx has joined #ruby
kristianpaul has joined #ruby
kristianpaul has left #ruby [WeeChat 2.3]
eddof13 has joined #ruby
interl has joined #ruby
<leftylink>
for an implicit conversion to make sense, there needs to be a situation where the language attempts to implicitly convert. I cannot think of a single situation where the language attempts to implicitly convert to a float
yassernasc has quit [Remote host closed the connection]
yassernasc has joined #ruby
<leftylink>
the question "how do I implicitly convert" already isn't possible. you cannot implicitly convert. you can only put a variable in a situation where an implicit conversion would happen
punche has quit [Quit: Best CPUs can count to infinity twice without being bugged out by zero division errors or whatnot.]
candlestick has joined #ruby
candlestick has left #ruby [#ruby]
henk has quit [Server closed connection]
henk has joined #ruby
<johnjaye>
normally don't you implicitly convert to float if you divide an int by a float
<johnjaye>
like 2 / 5.00000
ixti has joined #ruby
ryjo has quit [Quit: Client closed]
abade has joined #ruby
<abade>
Olá! humanos \o/
ur5us has joined #ruby
ur5us has quit [Client Quit]
<heinrich5991>
leftylink: Math.sin(0) seems to implicitly convert its argument from int to float
<heinrich5991>
"how can I achieve the same thing as an implicit conversion to float?"
ixti has quit [Read error: Connection reset by peer]
ixti has joined #ruby
Thanzex3268 has quit [Ping timeout: 265 seconds]
<weaksauce>
heinrich5991 val = val / 1.0
<weaksauce>
or write the c code that math.sin is doing
<weaksauce>
return DBL2NUM(sin(Get_Double(x)));
<johnjaye>
weaksauce: i'd be afraid to write things like that in C. never know how the compiler will "optimize" your code away
<johnjaye>
like herp derp a number divided by itself is 1, so i delete this lien
<weaksauce>
johnjaye sure in c
<weaksauce>
ruby it is a way to convert to float
<johnjaye>
c also has really weird implicit conversion rules. the weirdest one is just a simple integer literal. it tries signed short, unsigned short, signed int, unsigned int etc until it finds a width that fits
<havenwood>
johnjaye: I like to: 2.fdiv(5)
<johnjaye>
i should use a stock catchphrase along with that. like, "This is what the C standard actually says".
<havenwood>
I'd rather use #fdiv rather than #div or #/ with a Float on one side.
<havenwood>
(Unless there's already a Float.)
Thanzex3268 has joined #ruby
<havenwood>
Rational FTW? I don't actually have many terribly many opportunities to use Float.
<havenwood>
>> 2/5r
<havenwood>
#=> 2/5
ruby[bot] has joined #ruby
<johnjaye>
what do the values of Encoding.aliases mean?
<havenwood>
Even the same object_id, they're aliases.
abade is now known as Spock
Spock is now known as Guest8164
Guest8164 is now known as Spock
Spock is now known as Guest648
Guest648 has quit [Quit: leaving]
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
markong has joined #ruby
tomtmym has quit [Quit: Gone.]
lena64t2 is now known as lena64t
roshanavand_ has quit [Ping timeout: 268 seconds]
desnudopenguino1 has joined #ruby
LispTyro_ has joined #ruby
desnudopenguino has quit [Ping timeout: 246 seconds]
desnudopenguino1 is now known as desnudopenguino
yassernasc has quit [Remote host closed the connection]
dviola has quit [Ping timeout: 240 seconds]
dviola has joined #ruby
jprokop has quit [Quit: Leaving.]
moldorcoder7 has quit [Ping timeout: 260 seconds]
<leftylink>
looks like I was wrong. I yield.
<leftylink>
not `yield` the ruby keyword, but you know, the normal meaning of the word "yield"
<leftylink>
as someone like me, a normal human being, would normally use it
ap4y has joined #ruby
factor has quit [Server closed connection]
factor has joined #ruby
mekhami has quit [Quit: WeeChat 2.8]
LispTyro_ has left #ruby [#ruby]
<ox1eef_>
Ruby had more than way to do it before Rubocop arrived. Now parts of the language are essentially being erased. There's one way, the rubocop way.