havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.7.1, 2.6.6, 2.5.8: https://www.ruby-lang.org | Paste 4+ lines of text to https://dpaste.de/ and select Ruby as the language | Rails questions? Ask in #RubyOnRails | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby | Can't talk? Register/identify with Nickserv first!
gdonald has joined #ruby
hassox has joined #ruby
hassox has quit [Client Quit]
quazimodo has joined #ruby
nychtel has joined #ruby
nicholaslyang has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
orbyt_ has quit [Quit: Textual IRC Client: www.textualapp.com]
wald0 has joined #ruby
fercell has quit [Ping timeout: 256 seconds]
orbyt_ has joined #ruby
jenrzzz has quit [Read error: Connection reset by peer]
jenrzzz has joined #ruby
imode has joined #ruby
DTZUZU has quit [Quit: WeeChat 2.8]
teclator has quit [Ping timeout: 260 seconds]
teclator has joined #ruby
chalkmonster has joined #ruby
gell5 has quit [Ping timeout: 246 seconds]
nicholaslyang has joined #ruby
nicholaslyang has quit [Client Quit]
ur5us has quit [Ping timeout: 256 seconds]
tau has quit [Remote host closed the connection]
davispuh has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
cnsvc_ has joined #ruby
cnsvc_ has quit [Ping timeout: 240 seconds]
ur5us has joined #ruby
renich has joined #ruby
lucasb has quit [Quit: Connection closed for inactivity]
gix has quit [Ping timeout: 246 seconds]
davispuh has joined #ruby
gell5 has joined #ruby
gell5 has quit [Ping timeout: 246 seconds]
jetchisel has quit [Ping timeout: 240 seconds]
davispuh has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
gell5 has joined #ruby
chris____ has joined #ruby
renich_ has joined #ruby
renich has quit [Ping timeout: 260 seconds]
renich_ is now known as renich
davispuh has joined #ruby
Xiti` has joined #ruby
Xiti has quit [Ping timeout: 258 seconds]
davispuh has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
howdoi has quit [Quit: Connection closed for inactivity]
nicholaslyang has joined #ruby
renich_ has joined #ruby
renich has quit [Ping timeout: 260 seconds]
renich_ is now known as renich
u0_a300 has joined #ruby
<u0_a300> Hola?
<u0_a300> Alguien esta?
renich has quit [Quit: renich]
cadeskywalker has quit [Read error: Connection reset by peer]
u0_a300 has quit [Quit: WeeChat 2.8]
<havenwood> Sim, sempre.
u0_a309 has joined #ruby
chris____ has quit [Remote host closed the connection]
u0_a300 has joined #ruby
<u0_a300> aqui estoy e.e
u0_a309 is now known as f1t
<u0_a300> Hola? :C
<havenwood> u0_a300: The convos here are mostly in English, but if you have Ruby for code review, to show off, or for help we're happy to assist if we can.
cliluw has quit [Ping timeout: 260 seconds]
<havenwood> u0_a300: Welcome!
<havenwood> u0_a300: Bem-vinda!
ChmEarl has quit [Quit: Leaving]
<u0_a300> ...
<u0_a300> Por ala u.u
<havenwood> u0_a300: Você tem dúvidas sobre Ruby?
<f1t> Hey bros, what are you doing
<havenwood> f1t: I'm not your bro, dude. I'm not your dude, pal.
<havenwood> f1t: Ruby!
<f1t> sorry
<havenwood> f1t: Working on any interesting Ruby?
<havenwood> f1t: Welcome!
<f1t> Now I'm with CPAN of the Curl lenguage
<f1t> Pearl*,sorry
<havenwood> haha
<havenwood> I was wondering what cURL lang was. :)
<havenwood> And how it related to CPAN.
<f1t> Is Comprehensive Perl Archive Network
<f1t> it has 119118 modules to work with
xco has joined #ruby
<havenwood> f1t: I know CPAN, but couldn't have told you what it stood for from memory.
vargonaut has joined #ruby
<f1t> ah thats ok, now im studying the CPAN functions
<havenwood> I would have guessed Camelia's Perl Access Node.
<f1t> And what is ur next project, sir
<havenwood> f1t: Currently trying to raise a human child.
<havenwood> f1t: The last Ruby gem I published actually reminds me of Perl. It's just a proof of concept first stab. https://github.com/havenwood/behold#examples
cliluw has joined #ruby
<havenwood> f1t: I forget the Perl module that did similar.
<havenwood> But I recall one.
<havenwood> I don't think it fuzzed args, but that's crazy anyways.
<f1t> WOW thats a lot of work
<havenwood> A real Ruby::Signature-based solution would be really interesting to me.
jenrzzz has quit [Ping timeout: 246 seconds]
<f1t> That looks like difficult
<u0_a300> I love python3 u.u
<havenwood> u0_a300: Maybe you'll love ruby3 u.u
f1t has quit [Quit: WeeChat 2.8]
<u0_a300> bye bye
<havenwood> o/
u0_a309 has joined #ruby
jenrzzz has joined #ruby
gell5 has quit [Remote host closed the connection]
wald0 has quit [Quit: Lost terminal]
jenrzzz has quit [Ping timeout: 260 seconds]
s2013 has quit [Quit: Textual IRC Client: www.textualapp.com]
vargonaut has quit [Ping timeout: 246 seconds]
jenrzzz has joined #ruby
DTZUZU has joined #ruby
jenrzzz has quit [Ping timeout: 246 seconds]
jenrzzz has joined #ruby
u0_a309 is now known as f3t
u0_a300 has quit [Quit: WeeChat 2.8]
cd has quit [Quit: cd]
f3t has quit [Quit: WeeChat 2.8]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
donofrio has quit [Remote host closed the connection]
t3hyoshi has quit [Quit: ZNC - https://znc.in]
nicholaslyang has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rainmanjam has joined #ruby
nicholaslyang has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
t3hyoshi has joined #ruby
SeepingN has quit [Quit: The system is going down for reboot NOW!]
ur5us has quit [Ping timeout: 256 seconds]
Secret-Fire has quit [Remote host closed the connection]
Secret-Fire has joined #ruby
sauvin has joined #ruby
leah2 has quit [Ping timeout: 260 seconds]
conta has joined #ruby
leah2 has joined #ruby
leah2 has quit [Ping timeout: 256 seconds]
leah2 has joined #ruby
ur5us has joined #ruby
mozzarella has quit [Quit: WeeChat 2.8]
mozzarella has joined #ruby
teclator has quit [Ping timeout: 256 seconds]
mozzarella has quit [Client Quit]
mozzarella has joined #ruby
mistergibson has joined #ruby
nicholaslyang has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
imode has quit [Ping timeout: 264 seconds]
ho0po3 has joined #ruby
sarna has joined #ruby
nicholaslyang has joined #ruby
ur5us has quit [Ping timeout: 260 seconds]
alexherbo2 has joined #ruby
conta1 has joined #ruby
conta has quit [Ping timeout: 246 seconds]
conta1 is now known as conta
alexherbo2 has quit [Remote host closed the connection]
vondruch has joined #ruby
ho0po3 has quit [Quit: Leaving]
jenrzzz has joined #ruby
nicholaslyang has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jenrzzz has quit [Ping timeout: 256 seconds]
teclator has joined #ruby
sergioro has joined #ruby
AndreYuhai has joined #ruby
nicholaslyang has joined #ruby
conta has quit [Quit: conta]
nicholaslyang has quit [Client Quit]
jenrzzz has joined #ruby
sergioro has quit [Quit: leaving]
jenrzzz has quit [Ping timeout: 246 seconds]
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
teclator has quit [Ping timeout: 258 seconds]
nixy37179 has quit [Quit: Ping timeout (120 seconds)]
nixy37179 has joined #ruby
romanlevin3 has joined #ruby
romanlevin has quit [Ping timeout: 272 seconds]
romanlevin3 is now known as romanlevin
nicholaslyang has joined #ruby
nicholaslyang has quit [Client Quit]
grimgnr has quit [Ping timeout: 260 seconds]
ur5us has joined #ruby
roadie has joined #ruby
TomyWork has joined #ruby
nicholaslyang has joined #ruby
fercell has joined #ruby
nicholaslyang has quit [Client Quit]
infinityfye has joined #ruby
CrazyEddy has joined #ruby
arekushi has quit [Quit: Gateway shutdown]
nicholaslyang has joined #ruby
nicholaslyang has quit [Client Quit]
roadie has quit [Ping timeout: 272 seconds]
arekushi has joined #ruby
rkoller has joined #ruby
rkoller has quit [Client Quit]
<sarna> what's the most popular library for making http requests? like python's requests
<_aeris_> http ?
<sarna> thanks!
dionysus69 has joined #ruby
cranq has quit [Ping timeout: 240 seconds]
cranq has joined #ruby
TCZ has joined #ruby
nicholaslyang has joined #ruby
nicholaslyang has quit [Client Quit]
<jhass> there's many many more if it doesn't fit your needs :)
roadie has joined #ruby
<jhass> they have different trade offs between ease of use, flexibility and performance
teclator has joined #ruby
jenrzzz has joined #ruby
<sarna> jhass: well, I'm concerned only with convenience/reliability now
<sarna> it can be slow as heck :D
jenrzzz has quit [Ping timeout: 260 seconds]
Chris__ has joined #ruby
Chris__ has quit [Ping timeout: 246 seconds]
nicholaslyang has joined #ruby
teclator has quit [Ping timeout: 258 seconds]
nicholaslyang has quit [Client Quit]
teclator has joined #ruby
dionysus69 has quit [Remote host closed the connection]
dionysus69 has joined #ruby
belak has quit [Quit: The Lounge - https://thelounge.chat]
cnsvc_ has joined #ruby
belak has joined #ruby
cnsvc_ has quit [Ping timeout: 240 seconds]
TCZ has quit [Quit: Leaving]
conta has joined #ruby
duderonomy has quit [Ping timeout: 260 seconds]
ur5us has quit [Remote host closed the connection]
ur5us has joined #ruby
<sarna> hmm, I think I like HTTParty more
exmortus has quit [Ping timeout: 246 seconds]
ur5us has quit [Ping timeout: 260 seconds]
<yxhuvud> I'd recommend Fahrenheit.
jerme_ has quit [Ping timeout: 256 seconds]
jerme_ has joined #ruby
vondruch has quit [Ping timeout: 256 seconds]
vondruch has joined #ruby
<sarna> yxhuvud: I can't find it, could you post a link?
nicholaslyang has joined #ruby
nicholaslyang has quit [Client Quit]
u0_a309 has joined #ruby
<jhass> sarna: yxhuvud maybe thiking of faraday?
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
vondruch has quit [Remote host closed the connection]
vondruch has joined #ruby
u0_a309 has quit [Quit: WeeChat 2.8]
<sarna> okay I'm sold on faraday :D
<sarna> so many libraries, lol
BTRE has quit [Ping timeout: 246 seconds]
BTRE has joined #ruby
TomyLobo2 has joined #ruby
TomyLobo2 has quit [Remote host closed the connection]
nicholaslyang has joined #ruby
conta has quit [Quit: conta]
nicholaslyang has quit [Client Quit]
conta has joined #ruby
drincruz has joined #ruby
roadie has quit [Ping timeout: 272 seconds]
drincruz has quit [Ping timeout: 246 seconds]
jenrzzz has joined #ruby
<yxhuvud> Ah right, freudian slip, or something.
jenrzzz has quit [Ping timeout: 246 seconds]
vondruch has quit [Ping timeout: 265 seconds]
nicholaslyang has joined #ruby
nicholaslyang has quit [Client Quit]
duderonomy has joined #ruby
troulouliou_div2 has joined #ruby
dionysus69 has quit [Quit: dionysus69]
nicholaslyang has joined #ruby
clemens3 has quit [Quit: WeeChat 2.7]
nicholaslyang has quit [Client Quit]
vondruch has joined #ruby
cnsvc_ has joined #ruby
kinduff has quit [Read error: Connection reset by peer]
kinduff has joined #ruby
nicholaslyang has joined #ruby
nicholaslyang has quit [Client Quit]
ho0po3 has joined #ruby
kaleido has quit [Ping timeout: 260 seconds]
kaleido has joined #ruby
kaleido has quit [Changing host]
kaleido has joined #ruby
duderonomy has quit [Ping timeout: 260 seconds]
duderonomy has joined #ruby
<sarna> I want to log a warning to stderr when something fishy happens - how would I go about it?
<sarna> there's this https://ruby-doc.org/core-2.7.1/Warning.html , but I don't know if it's exactly suited for that kind of stuff
TCZ has joined #ruby
<sarna> alright, I'll use Logger :)
rainmanjam has quit [Read error: Connection reset by peer]
rainmanjam has joined #ruby
<leah2> or just 'warn'
teclator has quit [Ping timeout: 264 seconds]
mistergibson has quit [Quit: Leaving]
sysh has joined #ruby
nicholaslyang has joined #ruby
nicholaslyang has quit [Client Quit]
u0_a309 has joined #ruby
<u0_a309> Hey, anyone knows what happends with ngrok?
cliluw has quit [Ping timeout: 256 seconds]
<jhass> why do you ask?
<u0_a309> Im trying to use it and i cant log in
<jhass> maybe a question for their support
tekk has quit [Quit: ZNC - http://znc.in]
yelloB has joined #ruby
<u0_a309> jhass: Sure, thanks
yelloB has quit [Remote host closed the connection]
cnsvc_ has quit [Ping timeout: 240 seconds]
jenrzzz has joined #ruby
TCZ has quit [Quit: Leaving]
yelloB has joined #ruby
yelloB has quit [Remote host closed the connection]
jenrzzz has quit [Ping timeout: 256 seconds]
u0_a309 is now known as f1T
lazarus1 has joined #ruby
Chris__ has joined #ruby
nicholaslyang has joined #ruby
nicholaslyang has quit [Client Quit]
plutes has quit [Ping timeout: 246 seconds]
Chris__ has quit [Ping timeout: 264 seconds]
u0_a309 has joined #ruby
f1T has quit [Read error: Connection reset by peer]
nicholaslyang has joined #ruby
nicholaslyang has quit [Client Quit]
plutes has joined #ruby
u0_a309 has quit [Quit: WeeChat 2.8]
nofxx__ has quit [Remote host closed the connection]
nofxx__ has joined #ruby
conta has quit [Quit: conta]
nicholaslyang has joined #ruby
nicholaslyang has quit [Client Quit]
sarna has quit [Quit: Connection closed]
donofrio has joined #ruby
donofrio has quit [Remote host closed the connection]
donofrio has joined #ruby
nychtel has quit [Ping timeout: 246 seconds]
ChmEarl has joined #ruby
ho0po3 has quit [Quit: Leaving]
ho0po3 has joined #ruby
<AndreYuhai> when I am trying to save a record in rails, if that record already exists in the DB how can I instead make my foreign key that existing records id instead of trying to add it? Because then I get duplicate error.
mdanielk has joined #ruby
<mdanielk> hello
<mdanielk> ohayyo
mdanielk has left #ruby [#ruby]
ho0po3 has quit [Client Quit]
SeepingN has joined #ruby
nicholaslyang has joined #ruby
duderonomy has quit [Ping timeout: 260 seconds]
nicholaslyang has quit [Client Quit]
quazimodo has quit [Ping timeout: 246 seconds]
duderonomy has joined #ruby
nychtel has joined #ruby
quazimodo has joined #ruby
duderonomy has quit [Ping timeout: 246 seconds]
duderonomy has joined #ruby
infinityfye has quit [Read error: Connection reset by peer]
infinityfye has joined #ruby
duderonomy has quit [Ping timeout: 240 seconds]
cxl has quit [Quit: bye]
nychtel has quit [Read error: Connection reset by peer]
nychtel has joined #ruby
cnsvc_ has joined #ruby
cnsvc_ has quit [Ping timeout: 240 seconds]
jenrzzz has joined #ruby
nicholaslyang has joined #ruby
teclator has joined #ruby
<havenwood> AndreYuhai: #find_or_create_by
dviola has joined #ruby
nicholaslyang has quit [Client Quit]
duderonomy has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
fercell has quit [Quit: WeeChat 2.8]
nicholaslyang has joined #ruby
xco has joined #ruby
renich has joined #ruby
akem has quit [Ping timeout: 246 seconds]
renich has quit [Client Quit]
schne1der has joined #ruby
nicholaslyang has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
renich has joined #ruby
akem has joined #ruby
rippa has joined #ruby
renich has quit [Ping timeout: 256 seconds]
renich has joined #ruby
quazimodo has quit [Ping timeout: 258 seconds]
schne1der has quit [Ping timeout: 246 seconds]
quazimodo has joined #ruby
davispuh has joined #ruby
fercell has joined #ruby
nicholaslyang has joined #ruby
mydog2 has quit [Ping timeout: 265 seconds]
nicholaslyang has quit [Client Quit]
cd has joined #ruby
mydog2 has joined #ruby
cxl has joined #ruby
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
xco has joined #ruby
TomyWork has quit [Remote host closed the connection]
SeepingN has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
lazarus1 has quit [Quit: Leaving]
nicholaslyang has joined #ruby
nicholaslyang has quit [Client Quit]
chris____ has joined #ruby
Secret-Fire has quit [Remote host closed the connection]
doomlist3 has joined #ruby
Xatenev has joined #ruby
Xatenev has left #ruby [#ruby]
<doomlist3> ruby in ubuntu i opened 2*8 gives error
<doomlist3> sorry it doesn't display the output
<adam12> doomlist3: Are you looking for `irb`?
<doomlist3> oh yes
<doomlist3> but why does ruby behave exactly then how to use it
<doomlist3> just wondering why it;s unusable
<doomlist3> is it a script mode
<doomlist3> instead of interactive mode
<adam12> doomlist3: The ruby command normally runs a file. When run without a file, it reads that file from stdin.
<doomlist3> ruby file ; like that
nicholaslyang has joined #ruby
<doomlist3> okay
<adam12> doomlist3: So you could do something similar; run ruby, then type puts 2*8 then press ctrl-d.
<doomlist3> i am learning ruby right now as i talk i am python background
<adam12> doomlist3: Ah yeah. Python will run a REPL when no file is given. I'm not sure why Ruby differs there but it does.
<adam12> doomlist3: Ruby also has more than one REPL; irb being the built-in one and pry being a little more featureful.
SeepingN has joined #ruby
Secret-Fire has joined #ruby
nicholaslyang has quit [Client Quit]
jenrzzz has joined #ruby
Secret-Fire has quit [Max SendQ exceeded]
<phaul> although new irb is really becoming awesome
<phaul> with the multi line edit
<adam12> Definitely.
Secret-Fire has joined #ruby
<doomlist3> phaul: multi line cool
<doomlist3> i see only one line
<doomlist3> can i change it's mode
<adam12> doomlist3: You'll enter multi-line mode if the expression supports it. Ie. inside a block or if statement.
<phaul> first which ruby version are you on. because it's kind of new
<adam12> doomlist3: This also depends on your Ruby version, since only very recent versions of irb support it. Ruby 2.7+ likely.
<doomlist3> python too does the same then i want it to be more line truly browsable like up and down the cells
<doomlist3> just like in a file
<adam12> havenwood: I'll be happy to see arg delegation.
nychtel has quit [Ping timeout: 260 seconds]
<adam12> havenwood: I also wonder if the new 'require' proposal will go anywhere. Seems there's concern of callable's inside $LOAD_PATH for breakage, but load times seems to be an issue for me lately on one of my projects.
<doomlist3> i can't go up if i want to edit the code like with cells
<adam12> doomlist3: What Ruby version?
<doomlist3> i am in ubuntu ruby 2.5
<doomlist3> ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux-gnu]
jenrzzz has quit [Ping timeout: 260 seconds]
<adam12> doomlist3: You're version of irb is too old. You'd need to install a newer version of Ruby.
<adam12> doomlist3: Did you install Ruby through apt or apt-get?
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<doomlist3> what's the shortcut to run https://try.ruby-lang.org/ without clicking run each time
u0_a309 has joined #ruby
<u0_a309> hey
u0_a309 has quit [Client Quit]
<doomlist3> i am just learning ruby and it feels easier than python already because in methods x.method is fine without () as x.method()
<doomlist3> adam12: in browseri am doing
<doomlist3> ruby feels easier than python in terms of typing for these things
<doomlist3> i think i can learn ruby in a day or two
conta has joined #ruby
<baweaver> Ah, yes, one can learn the fundamentals of a language in days
<baweaver> but much like chess it takes years to master
<doomlist3> baweaver: guys i am finding because of the 20 min tutorial learning is much easier than python's tutorial
<doomlist3> this is like child's play 20 minutes maybe 40 minutes but still it's nothing i wasted two months to learn basics of python
<baweaver> Consider the very real chance that it's easy because you know Python.
<baweaver> The two aren't that far apart.
nicholaslyang has joined #ruby
<doomlist3> not really 3months is a lot verses 30 minutes
<doomlist3> the tutorial quality makes or breaks things
nicholaslyang has quit [Client Quit]
gix has joined #ruby
<doomlist3> baweaver: i came here to check the behaviour of ruby
<doomlist3> x=[[1]]*2
<doomlist3> x[0].append(3) what's the syntax for that in ruby
orbyt_ has joined #ruby
conta has quit [Ping timeout: 260 seconds]
conta has joined #ruby
<adam12> doomlist3: XY question. What did you want the end result to be?
<doomlist3> adam12: ok here goes the story
<adam12> doomlist3: Remember that we're in #ruby and not everyone is familiar with Python :)
<doomlist3> in python add=[[1]]*2 gives [[1],[1] ] now add[0].append(3) gives [[1,3],[1,3]] i find this unsettling so how does ruby solve this issue using the principle of least surprise
<doomlist3> add[0] and add[1] are the same objects in py but not in ruby which is cool
<adam12> doomlist3: Oh I see. Interesting scenario.
<adam12> doomlist3: Ruby does pass some things by reference and some things by value.
<adam12> doomlist3: In this case, you're probably going to see the same result as Python.
<adam12> doomlist3: That said, there are ways to work around this, but maybe not for this example. Commonly, Hash and Array will accept a default value in both argument and block form. If you use the argument, there's risk of the same object being re-used as you've shown above. If you use the block form, a new object is returned each time so there's no chance of re-use.
<doomlist3> adam12: no i don't upon multiply the samse list or adding those objects are different
<doomlist3> what's the cmd to check if two objs are different or same
<adam12> doomlist3: some_obj.object_id
<doomlist3> and then obj1.object_id == obj2.object_id is there a shorter way
<doomlist3> a is b ....
<adam12> doomlist3: There might be but I'm not familiar with it. I don't normally care about these things in my day to day :)
<doomlist3> adam12: so ruby users don't check a is b .... unlike python users' ...
<adam12> Maybe Object#equal?
cadeskywalker has joined #ruby
<adam12> obj1.equal?(obj2)
<adam12> doomlist3: A few different ways to check things in Ruby, but normally object_id isn't often one of them (at least for me).
<adam12> doomlist3: If you give an example maybe I could try to come up with one comparable. Ruby has a very powerful case/when construct, which uses ===. So in the same case statement you can pass values, classes, conditions, and soon pattern matches.
<doomlist3> adam12: obj.equal? obj2 ruby is much more complex how long you been into it, you seem like a little down
<adam12> doomlist3: I've been writing Ruby since 2005.
<doomlist3> adam12: you never used .equal?
<adam12> doomlist3: If I went through my code of all my projects, I'd be _shocked_ to see eql? or equal? in any day to day code.
<adam12> doomlist3: Nope. A case/when or ==.
<doomlist3> in python too same but it is basic syntax in python a is b => True is both are same objects
<doomlist3> even python beginners know that syntax
<adam12> doomlist3: When would you need that?
gell5 has joined #ruby
<adam12> if "foo" == "foo" ?
<doomlist3> you need that while investagating the properties of x=[1];a=[1,2,x]+[2,3,x]
<adam12> doomlist3: Then use equal? I think this is XY again.
<doomlist3> as objects can be mutable there are surprises as python doesn't follow least surprise principle
sauvin has quit [Read error: Connection reset by peer]
<al2o3-cr> doomlist3: add[0] and add[1] are the same object in ruby too.
chris____ has quit [Remote host closed the connection]
renich has quit [Quit: renich]
<doomlist3> al2o3-cr: okay then maybe it's not that surprising
nicholaslyang has joined #ruby
renich has joined #ruby
<doomlist3> al2o3-cr: so principle of least surprise does not apply here?
<al2o3-cr> &>> x = [[:y]] * 2; x[0] << :z; [x[0].object_id, x[1].object_id]
<rubydoc> # => [60, 60] (https://carc.in/#/r/98q0)
gell5 has quit [Ping timeout: 256 seconds]
nicholaslyang has quit [Client Quit]
<al2o3-cr> doomlist3: not at all.
<al2o3-cr> &>> x = Array.new(2) { [:y] }; x[0] << :z; [x[0].object_id, x[1].object_id]
<rubydoc> # => [60, 80] (https://carc.in/#/r/98q1)
<al2o3-cr> block form as adam12 said.
<doomlist3> al2o3-cr: Math.srqt does not need require
<al2o3-cr> doomlist3: no
<doomlist3> a newbie query what is p begin *code* end
<doomlist3> fwhy it's needed
<adam12> doomlist3: It's likely not needed, but I'm guessing you're following some sort of tutorial inside irb?
conta has quit [Quit: conta]
<adam12> doomlist3: p is from Kernel (https://rubyapi.org/2.7/o/kernel#method-i-p), and the begin / end is a code block. So it's outputing the inspected output of the block result.
<al2o3-cr> or they're looking at carn.in results, then it's purely for the purpose of the bot.
<adam12> al2o3-cr: Oh interesting! I didn't realize it wrapped it.
<al2o3-cr> adam12: yup.
<doomlist3> there is case, until,when and all that crap it's not clean
<doomlist3> until is just while not
nychtel has joined #ruby
<adam12> doomlist3: Ruby has many ways to write things. Not sure why it wouldn't be clean; the words used portray the semantics of the code. You're free to use the incarnation you want, and use something Rubocop to enforce it team-wide.
<doomlist3> S = Struct.new(:name, :state) does rb seriously has structures like C? i mean it's not minimalistic like python...
<al2o3-cr> &ri Struct doomlist3
<doomlist3> i just discovered single quotes are literal quotes and double quotes not, not same ...crap
<doomlist3> this is getting crappy and it's been just an hour to ruby 40 minutes of which were spent browsing and chatting
<havenwood> doomlist3: Ruby guides you towards the preferred path by gilding it with pretty literals and concise code. If you find it's not lovely, ask here about what you're trying to do.
<havenwood> doomlist3: Structs will get some love in Ruby 3+.
<havenwood> doomlist3: If you don't like more than one way to do it, Ruby is not a language for you.
<havenwood> TIMTOWTDI.
rainmanjam has quit []
<havenwood> doomlist3: It not being what you're used to doesn't make it wrong. Live a little.
<havenwood> doomlist3: If you'd like to reign in options a bit but keep some of the Ruby spirit, try Elixir.
<doomlist3> options?
<havenwood> doomlist3: More than one way to do it.
<havenwood> doomlist3: Aliases, similar functions, and the general principle of There Is More Than One Way To Do It.
u0_a309 has joined #ruby
<doomlist3> havenwood: until is just while not
xco has joined #ruby
<havenwood> doomlist3: Right. And that's fine!
<doomlist3> it's the same way in different tongues
Chris__ has joined #ruby
<havenwood> doomlist3: This language is not Python. It has a different philosophy.
<havenwood> doomlist3: You're telling us that Ruby doesn't follow "The Zen of Python." That is correct.
<doomlist3> i am arguing just saying it's not minimalistic . it's my philosophy nothing to do with python, with common lisp too i say the same thing it's just bloated i say.. i never compare
<havenwood> doomlist3: Some languages like Python explicitly call for no more than one way to do things (see `import this`). "There should be one — and preferably only one — obvious way to do it."
<doomlist3> C++ and common lisp are bloated?
<havenwood> doomlist3: Ruby comes from the LISP tradition.
<havenwood> doomlist3: TIMTOWDI is from Perl.
<doomlist3> ya and the bloatware is from ruby
<havenwood> doomlist3: Whine all you like, but this is an intentional philosophical choice.
<havenwood> doomlist3: You're using a language with more than one way to do it (English) to argue that Ruby should be Python. ¯\_(ツ)_/¯ You do you!
Secret-Fire has quit [Remote host closed the connection]
Chris__ has quit [Ping timeout: 260 seconds]
Secret-Fire has joined #ruby
rainmanjam has joined #ruby
<apotheon> I think doomlist3 should just not use Ruby, then.
jenrzzz has joined #ruby
<apotheon> doomlist3: I like simpler designs, all else being equal, too -- but all else is not equal here, and Ruby has a lot of advantages. If you don't like those advantages, you're using the wrong language, unless you're willing to learn to like those advantages.
<doomlist3> apotheon: i will learn ruby by tommorroow
<apotheon> doomlist3: Another thing I like is consistency, which Python violates pretty badly in some ways. I don't like Python's advantages enough to overcome my distaste for its disadvantages. I'd rather write C (which I also like a lot) than Python for anything that isn't better handled by Ruby, so if your thinking is more Python-oriented, and mine is more C- and Ruby-oriented, I guess we should just
<doomlist3> i was seeing gets.chomp wtf chomp o_0
<apotheon> use different languages, and not pick fights over them.
<apotheon> WTF your insistence on WTFing all over the place
<apotheon> Please be nice.
<doomlist3> o_)
jenrzzz has quit [Ping timeout: 260 seconds]
jenrzzz has joined #ruby
sysh has quit [Remote host closed the connection]
<reyfi9e> what's weird about chomp? ruby isn't the first language to call it that...
Secret-Fire has quit [Remote host closed the connection]
jenrzzz has quit [Ping timeout: 264 seconds]
Secret-Fire has joined #ruby
SuperL4g has joined #ruby
gell5 has joined #ruby
<doomlist3> p looks like an alias for puts what's the cmd to find aliases
SuperLag has quit [Ping timeout: 272 seconds]
umar has joined #ruby
gell5 has quit [Ping timeout: 240 seconds]
<umar> hi
<phaul> they are not aliases they do different things
<phaul> hi umar
howdoi has joined #ruby
<phaul> &ri Kernel#p
<phaul> &ri Kernel#puts
u0_a309 has quit [Quit: WeeChat 2.8]
<phaul> &>> class X; def to_s; 'blah'; end; def inspect; 'foo'; end; end; p X.new
<rubydoc> # => foo... check link for more (https://carc.in/#/r/98qb)
Chris__ has joined #ruby
<phaul> &>> class X; def to_s; 'blah'; end; def inspect; 'foo'; end; end; puts X.new
<rubydoc> # => blah... check link for more (https://carc.in/#/r/98qc)
ncakerlist has joined #ruby
Chris__ has quit [Ping timeout: 260 seconds]
doomlist3 has quit [Ping timeout: 258 seconds]
nicholaslyang has joined #ruby
tau has joined #ruby
tau has quit [Changing host]
tau has joined #ruby
nicholaslyang has quit [Client Quit]
vondruch has quit [Ping timeout: 246 seconds]
jenrzzz has joined #ruby
conta has joined #ruby
conta1 has joined #ruby
conta1 has quit [Client Quit]
nicholaslyang has joined #ruby
SuperLag has joined #ruby
conta has quit [Ping timeout: 256 seconds]
SuperL4g has quit [Ping timeout: 240 seconds]
schne1der has joined #ruby
umar___ has joined #ruby
umar has quit [Read error: Connection reset by peer]
doomlist3 has joined #ruby
ncakerlist has quit [Ping timeout: 246 seconds]
<umar___> exit
umar___ has quit [Quit: Lost terminal]
doomlist3 has quit [Ping timeout: 264 seconds]
fercell has quit [Quit: WeeChat 2.8]
r3m has quit [Quit: WeeChat 2.9-dev]
r3m has joined #ruby
clemens3 has joined #ruby
tau has quit [Ping timeout: 246 seconds]
jenrzzz has quit [Ping timeout: 256 seconds]
nicholaslyang has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
poro has joined #ruby
cstrahan has joined #ruby
nicholaslyang has joined #ruby
infinityfye has quit [Ping timeout: 265 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
TCZ has joined #ruby
<poro> I'm having trouble with openssl
<poro> am I suppposed to save the salt and the iv?
nicholaslyang has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gell5 has joined #ruby
nicholaslyang has joined #ruby
hodbogi has quit [Read error: Connection reset by peer]
hodbogi has joined #ruby
grvgr has quit [Read error: Connection reset by peer]
grvgr has joined #ruby
spark has joined #ruby
jenrzzz has joined #ruby
nicholaslyang has quit [Client Quit]
gell5 has quit [Ping timeout: 265 seconds]
cnsvc_ has joined #ruby
ur5us has joined #ruby
nofxx_ has joined #ruby
chris____ has joined #ruby
cliluw has joined #ruby
nofxx__ has quit [Ping timeout: 256 seconds]
nicholaslyang has joined #ruby
chris____ has quit [Ping timeout: 265 seconds]
nicholaslyang has quit [Client Quit]
spark has left #ruby [#ruby]
nicholaslyang has joined #ruby
schne1der has quit [Ping timeout: 264 seconds]
poro has quit [Quit: Leaving]
AndreYuhai has quit [Quit: Leaving]
cnsvc_ has quit [Remote host closed the connection]
Jonopoly has joined #ruby
gell5 has joined #ruby
tekk has joined #ruby
gell5 has quit [Ping timeout: 256 seconds]
jenrzzz has quit [Ping timeout: 246 seconds]
Jonopoly has quit [Quit: WeeChat 2.8]
imode has joined #ruby
chalkmonster has quit [Quit: WeeChat 2.8]
<voker57> salt, yes
<voker57> iv, you get it back after decryption
<voker57> actually scratch that, yes, for hmac you need the iv too
<voker57> it's needed for authentication
jenrzzz has joined #ruby
orbyt_ has joined #ruby
nicholaslyang has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
TCZ has quit [Quit: Leaving]
nychtel has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
chris____ has joined #ruby
nicholaslyang has joined #ruby
cd has quit [Quit: cd]
chalkmonster has joined #ruby
troulouliou_div2 has quit [Quit: Leaving]
akem_ has joined #ruby
akem has quit [Ping timeout: 246 seconds]
akem__ has joined #ruby
akem_ has quit [Ping timeout: 264 seconds]
quazimodo has quit [Ping timeout: 258 seconds]