joshuacronemeyer has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
tpanarch1st has joined #ruby
fphilipe_ has quit [Ping timeout: 257 seconds]
DaRock has joined #ruby
lucasb_ has quit [Quit: Connection closed for inactivity]
<AndreYuhai>
phaul: I wrote the setter for my instance variable as you suggested. But why can I not use it in my initialize? I mean it didn't work this way.
bradleyprice has joined #ruby
CCDelivery has joined #ruby
CCDelivery has quit [Max SendQ exceeded]
jenrzzz_ has quit [Ping timeout: 272 seconds]
CCDelivery has joined #ruby
AJA4351 has joined #ruby
tdy has joined #ruby
AJA4350 has quit [Ping timeout: 245 seconds]
AJA4351 is now known as AJA4350
bradleyprice has quit [Ping timeout: 252 seconds]
ricekrispie has quit [Quit: YEET]
Exuma has joined #ruby
CCDelivery has quit [Read error: Connection reset by peer]
CCDelivery has joined #ruby
patronus has joined #ruby
brool has joined #ruby
tpanarch1st_ has joined #ruby
tpanarch1st has quit [Ping timeout: 272 seconds]
CCDelivery has quit [Read error: Connection reset by peer]
rafadc has quit [Read error: Connection reset by peer]
rafadc has joined #ruby
CCDelivery has joined #ruby
AJA4351 has joined #ruby
fphilipe_ has joined #ruby
AJA4350 has quit [Ping timeout: 258 seconds]
AJA4351 is now known as AJA4350
rsh has joined #ruby
rsh has quit [Ping timeout: 245 seconds]
Guest83989 has quit [Read error: Connection reset by peer]
Guest83989 has joined #ruby
CCDelivery has quit [Read error: Connection reset by peer]
CCDelivery has joined #ruby
code_zombie has quit [Quit: Leaving]
CCDelivery has quit [Read error: Connection reset by peer]
CCDelivery has joined #ruby
duderonomy has joined #ruby
CCDelivery has quit [Read error: Connection reset by peer]
CCDelivery has joined #ruby
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 272 seconds]
AJA4351 is now known as AJA4350
fphilipe_ has quit [Ping timeout: 258 seconds]
bambanx has quit [Quit: Leaving]
CCDelivery has quit [Read error: Connection reset by peer]
CCDelivery has joined #ruby
CCDelivery has quit [Remote host closed the connection]
<baweaver>
My thoughts on the new pipeline operator:
dar123 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
goldbox has joined #ruby
vondruch has joined #ruby
rsh has quit [Ping timeout: 258 seconds]
mayurvpatil has joined #ruby
goldbox has quit [Remote host closed the connection]
NL3limin4t0r_afk is now known as NL3limin4t0r
conta1 has joined #ruby
conta has quit [Ping timeout: 244 seconds]
conta1 is now known as conta
goldbox has joined #ruby
dellavg_ has joined #ruby
aupadhye has joined #ruby
vondruch has quit [Ping timeout: 268 seconds]
jenrzzz has quit [Ping timeout: 245 seconds]
fphilipe_ has quit [Read error: Connection reset by peer]
aupadhye has quit [Client Quit]
aupadhye has joined #ruby
fphilipe_ has joined #ruby
vondruch has joined #ruby
jenrzzz has joined #ruby
dellavg_ has quit [Ping timeout: 268 seconds]
Swyper has joined #ruby
dellavg_ has joined #ruby
crankharder has quit [Ping timeout: 245 seconds]
mayurvpatil has quit [Quit: This computer has gone to sleep]
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Swyper has quit [Ping timeout: 246 seconds]
al2o3-cr has quit [Quit: If the universe is a machine where the future is uniquely determined by its present state, it would not be possible to calculate what the future will be.]
jenrzzz has quit [Ping timeout: 248 seconds]
crankharder has joined #ruby
bradleyprice has joined #ruby
al2o3-cr has joined #ruby
bradleyprice has quit [Ping timeout: 248 seconds]
mayurvpatil has joined #ruby
mayurvpatil has quit [Remote host closed the connection]
old_relik has joined #ruby
<old_relik>
I have a list of maps like this: [{"id"=>"3e8f493a-5662-4f10-9ac7-04fff7988009", "data"=>87}]
andikr has joined #ruby
<old_relik>
how can I easily turn this into {"3e8f493a-5662-4f10-9ac7-04fff7988009" => {"data" => 87}, "2312f493a-5662-4f10-1831-04fff7988009" => {"data" => 81}}
tdy has quit [Read error: Connection reset by peer]
tdy has joined #ruby
jenrzzz has joined #ruby
bradleyprice has joined #ruby
<phaul>
AndreYuhai: probably you were setting a local variable. class X; attr_accessor :blah; def foo; blah=13; end; end; end here blah is a local variable. self.blah = 13 would set the instance variable
<phaul>
looks good to me, do you have an issue with it?
ur5us has joined #ruby
ur5us has quit [Client Quit]
<AndreYuhai>
phaul: Yes, this does not work. It simply assigns the values to the instance variables without evaluating them with my setter methods as if they don't exist.
<AndreYuhai>
phaul: When I set the value using the method like obj.file_date = '04/01/2019' then it works and gives me => '2019-04-01' but I don't know why in initialization it does not work.
<phaul>
it does
<AndreYuhai>
phaul: oh let me check. I hadn't change the methods in initializer
<phaul>
I just demonstrated it
<AndreYuhai>
to self.method
queip has quit [Ping timeout: 248 seconds]
unixcat has quit [Quit: ZNC 1.7.2+deb2~bpo9+1 - https://znc.in]
unixcat has joined #ruby
<AndreYuhai>
phaul: Now it works. Thank you. But what is the difference between using self.method and @variable_name? Because one uses the setter method we wrote and the other one just assigns the value and I didn't even have a attr_accessor
<AndreYuhai>
or attr_writer
<phaul>
I explained it already, please read back .. │092331 phaul | difference is that ...
xco has quit [Quit: xco]
<phaul>
I really recommend watching that video about the object model too, there you will learn that there is no class methods. Like in the matrix. There is no spoon :)
<NL3limin4t0r>
baweaver: You could also use the coposition operator as pipe.
xco has joined #ruby
queip has joined #ruby
<NL3limin4t0r>
baweaver: You could also use the coposition operator as pipe.
<AndreYuhai>
phaul: Hahaha thank you, I added it to my watch list! :) Thanks for the help!
marz_d`ghostman has quit [Ping timeout: 256 seconds]
<adam12>
What happens if you do it manually with the 3 execs on their own line?
GodFather has quit [Ping timeout: 248 seconds]
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Vaevictus>
i'm just about there.
<adam12>
I just did this exact same thing a few days ago without issue. I can't share the code because it's propietary but I call ssh.exec! 3 times in a row, near sequential. I doubt this is your use of Net::SSH.
<adam12>
(near sequential because I do update a progress bar around each)
kapilp has quit [Quit: Connection closed for inactivity]
joshuacronemeyer has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
<Vaevictus>
closed stream (IOError)
<adam12>
Vaevictus: Out of curiosity, what is the SSH version on the router? Is it an OpenSSH release like Juniper would be?
<Vaevictus>
on the 2nd exec!
<Vaevictus>
uh
<Vaevictus>
it's a catalyst
<Vaevictus>
doesn't run unix
<adam12>
Juniper just repackages FreeBSD
<Vaevictus>
or openssh i'd guess
<adam12>
Ah.
<adam12>
I feel like these commands aren't SSH commands
<adam12>
Like a shell.
<Vaevictus>
it's telnet over ssh
<adam12>
Sounds like it might be something interactive where you'd have better luck with Expect?
<adam12>
or rather, exec! first, then expect on the IO stream provided by it.
reaVer has quit [Remote host closed the connection]
reaVer has joined #ruby
<Vaevictus>
apparently in old net::ssh there was a "shell" service
<adam12>
Vaevictus: Net::SSH::Telnet was a thing at one time
GodFather has joined #ruby
<adam12>
Vaevictus: Can you type out those commands manually and paste their output in a gist?
<adam12>
The idea being, the only command actually run as SSH is `conf t`. Once that command is run it's an interactive session and you need to feed it data.
<adam12>
When data is recieved on the channel, it's compared. From your paste, it looks like maybe config and config-if are safe stages to send more data.
<Vaevictus>
i wonder how the data buffers
<adam12>
If that works.. then I'd look at some sort of `expect` library that works on Net::SSH.
<adam12>
If this doesn't work .. perhaps look at generating a list of commands into a temporary file on the router, then sourcing them.
cliluw has quit [Read error: Connection reset by peer]
<adam12>
This is just my guess.
<adam12>
Good luck.
CCDelivery has quit [Read error: Connection reset by peer]
cliluw has joined #ruby
<Vaevictus>
doing this in irb only gets me a => nil
fphilipe_ has joined #ruby
<Vaevictus>
anyway, i'll work along those lines
rsh has quit [Quit: Lost terminal]
shansen has joined #ruby
houhoulis has joined #ruby
kyrylo has joined #ruby
nowhere_man has quit [Ping timeout: 258 seconds]
houhoul__ has joined #ruby
houhoulis has quit [Ping timeout: 245 seconds]
tdy has joined #ruby
houhoulis has joined #ruby
houhoul__ has quit [Ping timeout: 248 seconds]
kyrylo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kyrylo has joined #ruby
<Vaevictus>
guess i could pitch the net-ssh lib and just wrap an ssh client
<Vaevictus>
ugh
bradleyprice has quit [Remote host closed the connection]
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<adam12>
Vaevictus: Does just using ssh work?
bradleyprice has joined #ruby
<Vaevictus>
just using ssh?
sameerynho has quit [Ping timeout: 272 seconds]
<Vaevictus>
i saw no signs that any of my subsequent commands have ever executed
<adam12>
Vaevictus: Maybe use the normal ssh client and use expect to drive it.
<Vaevictus>
yeah, well, i expected to have better luck with this and probably wont' feel like it's tested enough to give to a tech in 75 minutes
<Vaevictus>
even if i have success at this point
<Vaevictus>
and vacation in 76 minutes :D
<Vaevictus>
i'm going to attempt a pty version
kyrylo has quit [Ping timeout: 245 seconds]
dviola has joined #ruby
<adam12>
Vaevictus: Enjoy your vacation.
<Vaevictus>
yeah, thanks for the hel
<Vaevictus>
help
bradleyprice has quit [Ping timeout: 246 seconds]
jinie has quit [Ping timeout: 248 seconds]
<Vaevictus>
oh man
<Vaevictus>
looks like the cisco gem actually works
<Vaevictus>
cisco-0.0.1 lol
bradleyprice has joined #ruby
<Vaevictus>
well, i haven't really tested it yet
griffindy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
griffindy has joined #ruby
thebetrayer has joined #ruby
dar123 has joined #ruby
AJA4350 has joined #ruby
jenrzzz has joined #ruby
fphilipe_ has quit [Ping timeout: 248 seconds]
doodleb22 has quit [Read error: Connection reset by peer]
<Vaevictus>
dang, i'm getting different results from irb as i do from running it in the script
Creatornator has joined #ruby
<Vaevictus>
actually, no, it's working
doodlebug has joined #ruby
doodlebug has quit [Excess Flood]
jenrzzz has quit [Ping timeout: 248 seconds]
JoeA2552 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tdy has quit [Ping timeout: 268 seconds]
joshuacronemeyer has joined #ruby
queip has quit [Ping timeout: 245 seconds]
doodlebug has joined #ruby
doodlebug has quit [Excess Flood]
<Vaevictus>
adam12: i don't know what this ciscolib is doing differently, but it appears to work
joshuacronemeyer has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
Freshnuts has joined #ruby
queip has joined #ruby
doodlebug has joined #ruby
Ai9zO5AP has quit [Quit: WeeChat 2.4]
Freshnuts has quit [Max SendQ exceeded]
Freshnuts has joined #ruby
fphilipe_ has joined #ruby
drale2k_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
miskatonic has joined #ruby
cschneid has joined #ruby
jinie has joined #ruby
jinie has quit [Client Quit]
jeremycw has quit [Ping timeout: 244 seconds]
miskatonic has quit [Remote host closed the connection]
joshuacronemeyer has joined #ruby
tpanarch1st_ has quit [Quit: Thanks for your help, nice to see you, take care.]
joshuacronemeyer has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
fphilipe_ has quit [Ping timeout: 248 seconds]
jinie has joined #ruby
orbyt_ has quit [Read error: Connection reset by peer]
thebetrayer has quit [Ping timeout: 248 seconds]
zapata has quit [Ping timeout: 258 seconds]
greypack has quit [Read error: Connection reset by peer]