jhass changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.5.3, 2.4.5, 2.3.8, 2.6.0-preview2: 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!
nexraf1 has quit [Ping timeout: 264 seconds]
za1b1tsu has joined #ruby
roshanavand has joined #ruby
za1b1tsu has quit [Ping timeout: 244 seconds]
bak1an has joined #ruby
orbyt_ has joined #ruby
impermanence has joined #ruby
cd has joined #ruby
SCHAPiE has quit [Quit: ZNC - https://znc.in]
hightower3 has joined #ruby
SCHAPiE has joined #ruby
<hightower3> Hm, when I do 'string'.sub /x/, 'y', this of course works. But when I call this from a method_missing() handler, sub() doesn't seem to work and instead prints: can't convert String to Hash (String#to_hash gives String) (TypeError).
<hightower3> Any ideas?
alicef has quit [Ping timeout: 246 seconds]
<SeepingN_> open ended ranges.. interesting
alicef has joined #ruby
jcarl43 has quit [Quit: WeeChat 2.3]
argoneus has quit [Remote host closed the connection]
Dimik has quit [Ping timeout: 272 seconds]
jdawgaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
argoneus has joined #ruby
agent_white has quit [Ping timeout: 246 seconds]
<hightower3> Here it is: https://pastebin.com/qBwSHnU0
<ruby[bot]> hightower3: we in #ruby do not like pastebin.com, it loads slowly for most, has ads which are distracting and has terrible formatting. Please use https://gist.github.com
kurko_ has quit [Read error: Connection reset by peer]
<hightower3> not sure why gsub inside method_missing doesn't work...
<SeepingN_> what happens if something is nil
darkhanb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kurko_ has joined #ruby
<SeepingN_> not that this is complete
<hightower3> It's not... I just made a quick example that would work if it wasn't executing in method_missing handler
<hightower3> but since it is executing there, it throws an error instead of working
<hightower3> and I don't understand why
Wojnar has joined #ruby
roshanavand has quit [Quit: Gone planting!]
roshanavand has joined #ruby
<SeepingN_> don't you need a name before a and b in your call
mangold has joined #ruby
bambanx has joined #ruby
<hightower3> name gets filled in with the name of method that is missing
ua has quit [Excess Flood]
roshanavand has quit [Ping timeout: 252 seconds]
bambanx has quit [Client Quit]
bambanx has joined #ruby
SeepingN_ has quit [Quit: The system is going down for reboot NOW!]
RougeR has quit [Ping timeout: 268 seconds]
<havenwood> hightower3: A nit, I'd suggest #tr over #gsub for this case.
funnel has quit [Ping timeout: 252 seconds]
kurko_ has quit [Ping timeout: 268 seconds]
Nicmavr has quit [Read error: Connection reset by peer]
sagax has joined #ruby
<sagax> hi all!
<havenwood> sagax: o/
<sagax> in Gemfile i have gem 'pg'
<hightower3> yes but we are beating around the bush... the example fails even if no sub() is used. I can just reference the contents of the hash (the args) and it'll fail
<havenwood> hightower3: What args are you calling that method with when it fails?
<sagax> but when install i got -- `Your PostgreSQL is too old. Either install an older version of this gem or upgrade your database to at least PostgreSQL-9.2`
<sagax> but when i check version pg_ctl --version this show `pg_ctl (PostgreSQL) 9.6.10`
<havenwood> sagax: psql -V
Nicmavr has joined #ruby
<sagax> hm, strange
<hightower3> havenwood, my pastebin link above contains an example of what doesn't work
<sagax> psql -V write `psql (PostgreSQL) 8.4.20`
<havenwood> sagax: That's ^ the prob
sgen has joined #ruby
<sagax> thanks, will be see more about postgresql
<havenwood> hightower3: Are you doing it at top level? That should work in a class.
<havenwood> hightower3: hmm
kurko_ has joined #ruby
<havenwood> >> nil.to_string
<ruby[bot]> havenwood: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
OrangeManBad has quit [Ping timeout: 264 seconds]
<havenwood> #!> NoMethodError: undefined method `to_string' for nil:NilClass
bambanx has quit [Quit: Leaving]
phaul has quit [Ping timeout: 240 seconds]
funnel has joined #ruby
<havenwood> ah, it's String#to_hash you're running into
bambanx has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<hightower3> havenwood, but you got it actually, it works within a class
<hightower3> strange...
<havenwood> hightower3: At top level, you're defining #method_missing on Object.
<havenwood> hightower3: Which breaks object coercion.
sgen has quit [Remote host closed the connection]
im0nde has joined #ruby
<havenwood> For example, at top level: def hightower3; :ok end; 42.hightower3 #=> :ok
bak1an has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<havenwood> hightower3: Your code is good. It just not a good method to define on Object, since that's way too many method missings. :)
<havenwood> hightower3: Some details on top level, and how methods are defined where they are at top level: https://banisterfiend.wordpress.com/2010/11/23/what-is-the-ruby-top-level/
alicef has quit [Ping timeout: 246 seconds]
za1b1tsu has joined #ruby
<havenwood> hightower3: So when there's an implicit coercion, and #to_hash is tried, it instead is calling your method_missing. Does that make sense?
minimal_life has joined #ruby
alicef has joined #ruby
<hightower3> havenwood, I've got another issue... if I do: puts "#{'TEST'.to_s.gsub /(T)/, 'x\1'}" , that of course works, and prints xTESxT. But if I want to print "\" instead of "x" and do puts "#{'TEST'.to_s.gsub /(T)/, '\\\1'}", the \1 somehow gets escaped unintentionally
<hightower3> yeah, thanks
ansraliant has joined #ruby
za1b1tsu has quit [Ping timeout: 268 seconds]
<havenwood> hightower3: Another way you could write that: 'TEST'.to_s.gsub(/T/) { |capture| "\\#{capture}" }
<havenwood> hightower3: #=> "\TES\T"
<havenwood> capture is a bad variable name there though >.>
<hightower3> ah nice one, thanks!
<havenwood> hightower3: np
minimal_life has quit [Quit: I am functioning within established parameters.]
NpcOrangeManBad has joined #ruby
<sagax> i fixed psql and now all `bundle` ok
<sagax> thanks to all
sgen has joined #ruby
NpcOrangeManBad is now known as OrangeManBad
sgen has quit [Remote host closed the connection]
ta_ has joined #ruby
sgen has joined #ruby
gix has joined #ruby
sgen has quit [Remote host closed the connection]
jdawgaz has joined #ruby
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
justicefries has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<havenwood> sagax: woot
Wojnar has quit [Remote host closed the connection]
ivanskie has joined #ruby
<sagax> havenwood: ? o_o
<havenwood> sagax: a celebrator owl woot
<sagax> oh, ok
<sagax> english not native for me
<havenwood> sagax: It was the merriam webster word of the year in 2007: https://www.newsweek.com/word-year-w00t-95217
cow[moo] has joined #ruby
<havenwood> it was a 'cooler way of saying "yay"' in 2007, so it's probably a less cool way to say "yay" now
<havenwood> 'woot'.squeeze
m27frogy has joined #ruby
ivanskie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ta_ has quit [Ping timeout: 268 seconds]
<havenwood> 10.downto(7).map { |n| 13 ** n % n + 110 }.pack('c*')
jdawgaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nfk has quit [Quit: Try memory.free_dirty_pages=true in about:config]
jdawgaz has joined #ruby
ur5us has joined #ruby
bihi has joined #ruby
ur5us has quit [Read error: Connection reset by peer]
Yxhuvud has quit [Ping timeout: 264 seconds]
tdy has joined #ruby
gix has quit [Ping timeout: 252 seconds]
esrse has joined #ruby
cow[moo] has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jdawgaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jdawgaz has joined #ruby
Op3nEyez has joined #ruby
Op3nEyez has quit [Read error: Connection reset by peer]
za1b1tsu has joined #ruby
za1b1tsu has quit [Ping timeout: 268 seconds]
lytol has quit [Remote host closed the connection]
patr0clus has joined #ruby
kurko_ has quit [Ping timeout: 252 seconds]
orbyt_ has joined #ruby
kapil____ has joined #ruby
za1b1tsu has joined #ruby
patr0clus is now known as s3nd1v0g1us
za1b1tsu has quit [Ping timeout: 268 seconds]
darkhanb has joined #ruby
bambanx has quit [Read error: Connection reset by peer]
ta_ has joined #ruby
bihi has quit [Quit: Bye!]
Inside has quit [Disconnected by services]
jdawgaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Sauvin has joined #ruby
arescorpio has joined #ruby
jdawgaz has joined #ruby
braincrash has quit [Quit: bye bye]
braincrash has joined #ruby
mochiyoda is now known as mochiyoda_
mochiyoda_ is now known as mochiyoda
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bambanx has joined #ruby
kurko_ has joined #ruby
c0ncealed4 has quit [Remote host closed the connection]
jdawgaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
c0ncealed4 has joined #ruby
jdawgaz has joined #ruby
jdawgaz has quit [Client Quit]
bambanx has quit [Read error: Connection reset by peer]
jdawgaz has joined #ruby
eckhardt has joined #ruby
<baweaver> About to start streaming on destructuring in Ruby: https://www.twitch.tv/baweaver
<baweaver> Definitely a bit advanced, but should be a fun time.
bambanx has joined #ruby
za1b1tsu has joined #ruby
dellavg_ has joined #ruby
kurko_ has quit [Ping timeout: 268 seconds]
za1b1tsu has quit [Ping timeout: 240 seconds]
RougeR has joined #ruby
jdawgaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jdawgaz has joined #ruby
jdawgaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
MoritaShinobu has joined #ruby
bambanx has quit [Quit: Leaving]
RougeR has quit [Ping timeout: 250 seconds]
arescorpio has quit [Remote host closed the connection]
bambanx has joined #ruby
ellcs has joined #ruby
conta has joined #ruby
mangold has quit [Quit: This computer has gone to sleep]
ellcs has quit [Ping timeout: 264 seconds]
lone_ranger has joined #ruby
dellavg_ has quit [Ping timeout: 244 seconds]
za1b1tsu has joined #ruby
vondruch has quit [Ping timeout: 244 seconds]
voolik has joined #ruby
lone_ranger has quit [Quit: lone_ranger]
s3nd1v0g1us has quit [Quit: WeeChat 2.1]
Inline has quit [Quit: Leaving]
za1b1tsu has quit [Ping timeout: 252 seconds]
za1b1tsu has joined #ruby
voolik has quit [Quit: Taking a nap...]
kurko_ has joined #ruby
Cthulu201 has quit [Read error: Connection reset by peer]
kurko_ has quit [Ping timeout: 245 seconds]
Cthulu201 has joined #ruby
doubledup has joined #ruby
reber has joined #ruby
ta_ has quit [Remote host closed the connection]
aupadhye has joined #ruby
conta has quit [Ping timeout: 268 seconds]
bambanx has quit [Quit: Leaving]
Dbugger has joined #ruby
mangold has joined #ruby
voolik has joined #ruby
mangold has quit [Client Quit]
voolik has quit [Ping timeout: 272 seconds]
mangold has joined #ruby
ua has joined #ruby
impermanence has quit [Remote host closed the connection]
conta has joined #ruby
whysthatso has joined #ruby
gix has joined #ruby
mniip has quit [Ping timeout: 600 seconds]
warrshrike has joined #ruby
<warrshrike> hey
<warrshrike> is there chaining in ruby hashes
<warrshrike> i want to detect duplicates in a ruby array by putting them in a hash
<elomatreb> Chaining? Hashes are ordered, if that's what you mean
<warrshrike> i.e. in O(N)
<warrshrike> so if the value is duplicate, it will hash to same key and i will know
whysthatso has quit [Quit: whysthatso]
<warrshrike> does that make sense?
<warrshrike> whats an appropriate data structure for that
<elomatreb> You can use #uniq to get O(n) deduplication, FWIW
<warrshrike> elomatreb: doesnt that do the same thing?
<elomatreb> Yes, but you don't have to implement it yourself
<warrshrike> i also want to implement it for learning purposes lol
<elomatreb> Ruby hashes are not as straightforward as the classical hash table you might find in a textbook (i.e. they also contain a linked list to satisfy the order property), but for the most part they work like you'd expect
Freshnuts has joined #ruby
Freshnuts has quit [Max SendQ exceeded]
Freshnuts has joined #ruby
<warrshrike> elomatreb: got it to work with str.hash and a ruby hash
postmodern has quit [Quit: Leaving]
clemens3 has joined #ruby
mangold has quit [Quit: This computer has gone to sleep]
Burgestrand has joined #ruby
za1b1tsu has quit [Ping timeout: 250 seconds]
kapil____ has quit [Quit: Connection closed for inactivity]
kapil____ has joined #ruby
bzf- has left #ruby ["Linkinus - http://linkinus.com"]
za1b1tsu has joined #ruby
marz_d`ghostman has joined #ruby
<marz_d`ghostman> I'm stubbing exit on my code by allow(object).to receive(:exit).and_throw :exit, then I have expect(object.run).to_throw :exit, but I'm getting uncaught throw :exit. Doesn't the expect automatically catch it though?
vondruch has joined #ruby
mangold has joined #ruby
dmitch has quit [Quit: Textual IRC Client: www.textualapp.com]
jamied has quit [Quit: Textual IRC Client: www.textualapp.com]
phaul has joined #ruby
aufi has joined #ruby
hightower3 has quit [Ping timeout: 250 seconds]
ansraliant has quit [Quit: My planet needs me]
mikecmpbll has joined #ruby
cabotto has joined #ruby
<marz_d`ghostman> my rescue code has a log function and exit, how do I expect two function calls? it seems calling expect (object.run).to receive(:log) and expect(object.run)to raise_error(SystemExit) differently will not stub the exit on first call
<phaul> if you pass object.run to expect Ruby there and then evaluates object.run, rspec doesn't have a chance to do anything about that. if you pass a block then rspec has control. That's why on raise_error always expect a block.
Burgestrand has quit [Quit: Closing time!]
bastilian has quit [Read error: Connection reset by peer]
Turnikov[m] has quit [Remote host closed the connection]
jonjitsu has quit [Read error: Connection reset by peer]
Demos[m] has quit [Remote host closed the connection]
turt2live has quit [Write error: Broken pipe]
<phaul> otherwise please paste the example on pastebin, and I can take a look.
<phaul> or gist or whatever
thinkpad has quit [Ping timeout: 252 seconds]
thinkpad has joined #ruby
GDPR has quit [Remote host closed the connection]
Azure has quit [Ping timeout: 244 seconds]
GDPR has joined #ruby
fluxAeon has quit [Read error: Connection reset by peer]
fluxAeon has joined #ruby
<phaul> marz_d`ghostman: ?
Demos[m] has joined #ruby
<marz_d`ghostman> phaul: sorry for the delay
<phaul> no probs. Can you please also paste the rspec examples you are writing?
<phaul> im blind
<phaul> sorry Its right there :)
<marz_d`ghostman> I'm trying to expect that invokes the log_error and then exit. But having two expects doesn't work as the first one would exit the rspec when getting to the line in the code where it really exits
roshanavand has joined #ruby
<phaul> I can't run this but how does this behave atm? To my understanding in this form this doesn't really checks the example, but kills the test ?
<phaul> even with just one expect
<phaul> so first thing to fix would be expect { @sync.run }.to raise_error(SystemExit)
venmx has joined #ruby
<phaul> notice I changed the argument of expect to be a block
<marz_d`ghostman> phaul: that succeeds, expect { @sync.run }.to raise_error(SystemExit). What I'm trying to do is also expect :log_error to get invoked before SystemExit
roshanavand has quit [Ping timeout: 252 seconds]
Freshnuts has quit [Quit: Leaving]
<phaul> right but that's not what you had on the gist
doubledup has quit [Quit: Leaving]
<phaul> you had expect(@sync.run).to raise_error(SystemExit). that is different
SuperL4g_ has joined #ruby
Azure has joined #ruby
wildermind has joined #ruby
Sup3rLurk has joined #ruby
SuperLag has quit [Ping timeout: 244 seconds]
SuperL4g has quit [Ping timeout: 268 seconds]
<phaul> I would make two examples anyways. You can share the setup in a context with before hooks. One would expect the raise_error, the other would have to stub out the raise error, and expect the call. I can do the rewrite, but I would do it "blind" as I can't run it
rkoller has joined #ruby
<phaul> also there is a problem of leaving files behind, during the test. that makes the test dependent on order and state
rkoller has quit [Client Quit]
<phaul> lemme try too give you a rewrite, but I can't guarantee I get it right first time :)
roshanavand has joined #ruby
kurko_ has joined #ruby
nowhere_man has quit [Remote host closed the connection]
bastilian has joined #ruby
turt2live has joined #ruby
jonjitsu has joined #ruby
nowhere_man has joined #ruby
Miron has quit [Ping timeout: 245 seconds]
livcd has quit [Ping timeout: 244 seconds]
Miron has joined #ruby
warrshrike has quit [Ping timeout: 256 seconds]
kurko_ has quit [Ping timeout: 268 seconds]
gregf_ has joined #ruby
<phaul> marz_d`ghostman: @sync is the object that establish_lock / acquire_lock are methods of?
<marz_d`ghostman> phaul: Yes, that is correct.
<phaul> marz_d`ghostman: my first attempt, this might not work yet.. https://gist.github.com/phaul/0fc77b0adc9fa45652c08d31e4253f1b
akaiiro has quit [Remote host closed the connection]
aufi has quit [Ping timeout: 245 seconds]
<marz_d`ghostman> phaul: If you stub :exit to do nothing, the code will run though the rest of it which it shouldn't cause it should exit
<marz_d`ghostman> Is there something like allow to receive(:exit) continue with the next test? something like that
<phaul> ok I will fix that.
<phaul> updated
kurko_ has joined #ruby
al2o3-cr has quit [Quit: WeeChat 2.3]
esrse has quit [Ping timeout: 244 seconds]
al2o3-cr has joined #ruby
kurko_ has quit [Ping timeout: 252 seconds]
<marz_d`ghostman> phaul: Awesome! I've been searching and working on this one for a couple days. Just what I need. You're a lifesaver. Thanks man
<phaul> no probs. you are welcome
Burgestrand has joined #ruby
<marz_d`ghostman> phaul: By the way, isn't the best convention for rspec structure goes something like this? https://gist.github.com/marzdgzmn/1e8308e417bbeed15bef8440415046dd
<marz_d`ghostman> phaul: Cause rubocop seems to be giving me warning about my Rspec.describe Class having too many lines currently [52/25]
venmx has quit [Ping timeout: 264 seconds]
AJA4350 has joined #ruby
<phaul> yeah, you can tune rubocop to be more acceptive for RSpec. I myself tend to care less about nesting levels for specs, as long as the error report reads nicely. ie contexts, describes, it { pasted in sentences make sense
<phaul> or number of statements for rspec blocks
reber has quit [Remote host closed the connection]
livcd has joined #ruby
pskosinski has quit [Ping timeout: 252 seconds]
<marz_d`ghostman> Ah, okay. Thought I'm doing something wrong cause I'm not yet done with the tests and I'm currently way beyond the 25 line rubocop is complaining about, hehe :)
<phaul> I do have a Matrics/BlockLength exclude for spec/**/* in my .ruboconf
<marz_d`ghostman> I'll do just that. By the way, you keen on blockchains?
<marz_d`ghostman> If so, you think ruby has a place on that field?
<phaul> hm. I don't really know much about blockchains, sorry
<jhass> who does, they all pretend :P
<marz_d`ghostman> haha, you have a point though
<jhass> a blockchain, technically not the buzzword, is just a data structure
<jhass> would you ask "has ruby a place on the field of binary trees"?
<marz_d`ghostman> just curious cause all I see being used are java and c++
<jhass> well, look harder :P
<marz_d`ghostman> guess I'll do that :)
<marz_d`ghostman> I'm not really that familiar with binary trees and the likes since I don't have a good computer science background. Just jumped into programming head first. Any books or resources you can recommend to reinforce a layman's computer science fundamentals? :D
mikecmpbll has quit [Ping timeout: 245 seconds]
clemens3 has quit [Ping timeout: 240 seconds]
im0nde has quit [Ping timeout: 250 seconds]
cabotto has quit [Remote host closed the connection]
Burgestrand has quit [Quit: Closing time!]
im0nde has joined #ruby
kapil____ has quit [Quit: Connection closed for inactivity]
conta has quit [Ping timeout: 252 seconds]
venmx has joined #ruby
Burgestrand has joined #ruby
kurko_ has joined #ruby
GodFather has joined #ruby
aufi has joined #ruby
kurko_ has quit [Ping timeout: 252 seconds]
kurko_ has joined #ruby
cabotto has joined #ruby
kurko_ has quit [Ping timeout: 240 seconds]
xfbs has joined #ruby
Nicmavr has quit [Read error: Connection reset by peer]
cabotto has quit [Remote host closed the connection]
Nicmavr has joined #ruby
asphyxia has quit [Read error: Connection reset by peer]
cabotto has joined #ruby
Tuor has joined #ruby
kurko_ has joined #ruby
cabotto has quit [Remote host closed the connection]
xfbs has quit [Quit: afk]
xfbs has joined #ruby
justicefries has joined #ruby
cow[moo] has joined #ruby
nexraf1 has joined #ruby
cabotto has joined #ruby
nexraf1 has quit [Quit: WeeChat 2.2]
roshanavand has quit [Remote host closed the connection]
roshanavand has joined #ruby
conta has joined #ruby
venmx has quit [Ping timeout: 268 seconds]
venmx has joined #ruby
cabotto has quit [Remote host closed the connection]
ua has quit [Ping timeout: 250 seconds]
cabotto has joined #ruby
ua has joined #ruby
cabotto has quit [Remote host closed the connection]
Tuor has quit [Quit: Konversation terminated!]
roshanavand has quit [Quit: Gone planting!]
Fusl has quit [Excess Flood]
Fusl has joined #ruby
ua has quit [Ping timeout: 268 seconds]
Burgestrand has quit [Quit: Good bye and have a nice day!]
ua has joined #ruby
cabotto has joined #ruby
cabotto has quit [Client Quit]
bak1an has joined #ruby
clemens3 has joined #ruby
mniip has joined #ruby
discopatrick has joined #ruby
Fusl has quit [Remote host closed the connection]
dmitch has joined #ruby
blandflakes has joined #ruby
noark9 has joined #ruby
ellcs has joined #ruby
aufi has quit [Ping timeout: 240 seconds]
justicefries has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
justicefries has joined #ruby
mangold has quit [Quit: This computer has gone to sleep]
wildermind has quit [Quit: Connection closed for inactivity]
Iambchop has joined #ruby
Rapture has joined #ruby
xfbs has quit [Quit: afk]
mangold has joined #ruby
vondruch_ has joined #ruby
kaleido has quit [Quit: true story]
vondruch has quit [Ping timeout: 268 seconds]
vondruch_ is now known as vondruch
mangold has quit [Quit: This computer has gone to sleep]
xfbs has joined #ruby
orbyt_ has joined #ruby
cxl has quit [Ping timeout: 264 seconds]
cxl has joined #ruby
whysthatso has joined #ruby
kaleido has joined #ruby
whysthatso has quit [Client Quit]
AJA4350 has quit [Remote host closed the connection]
AJA4350 has joined #ruby
ellcs has quit [Ping timeout: 264 seconds]
aupadhye has quit [Remote host closed the connection]
aupadhye has joined #ruby
voolik has joined #ruby
SeepingN has joined #ruby
noark9 has quit [Quit: noark9]
aufi has joined #ruby
fluxAeon has quit [Ping timeout: 240 seconds]
justicefries has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
noark9 has joined #ruby
mangold has joined #ruby
GodFather has quit [Ping timeout: 245 seconds]
gix has quit [Disconnected by services]
justicefries has joined #ruby
noark9 has quit [Client Quit]
noark9 has joined #ruby
vondruch has quit [Quit: vondruch]
aupadhye has quit [Remote host closed the connection]
vondruch has joined #ruby
Inline has joined #ruby
GodFather has joined #ruby
conta has quit [Ping timeout: 252 seconds]
jackrandom has quit [Quit: ZNC - https://znc.in]
jackrandom has joined #ruby
jsc has joined #ruby
jsc is now known as status402
Wojnar has joined #ruby
GodFather has quit [Ping timeout: 260 seconds]
darkhanb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jcarl43 has joined #ruby
conta has joined #ruby
Fusl has joined #ruby
rippa has joined #ruby
ams__ has joined #ruby
GodFather has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
conta has quit [Quit: conta]
status402 has quit [Quit: status402]
voolik has quit [Ping timeout: 244 seconds]
nadir has joined #ruby
MoritaShinobu has quit [Quit: Leaving]
kurko_ has quit [Ping timeout: 246 seconds]
mangold has quit [Quit: Leaving]
darkhanb has joined #ruby
impermanence has joined #ruby
Dbugger has quit [Remote host closed the connection]
apeiros_ has joined #ruby
noark9 has quit [Quit: noark9]
doubledup has joined #ruby
doubledup has quit [Remote host closed the connection]
orbyt_ has joined #ruby
kurko_ has joined #ruby
cow[moo] has quit [Quit: Textual IRC Client: www.textualapp.com]
mangold has joined #ruby
GodFather has quit [Ping timeout: 260 seconds]
roshanavand has joined #ruby
cow[moo] has joined #ruby
ivanskie has joined #ruby
oft_gegong has joined #ruby
<oft_gegong> I'm getting started in ruby, but I'm really impatient. I know that the worst enemy in programming is impatience.
impermanence has quit [Remote host closed the connection]
Rapture has quit [Ping timeout: 252 seconds]
mwlang has joined #ruby
reber has joined #ruby
akaiiro has joined #ruby
<ivanskie> its okay, once you learn programming you can just write an AI to learn other things for you.
Sauvin has quit [Remote host closed the connection]
<ivanskie> I have a question uhm.
braderhart has joined #ruby
<ivanskie> I'm using net-ssh with net-ssh-gateway.
<baweaver> ...just write an AI? That's.... not common
<crankharder> ...yet
<ivanskie> I was able to send in request_pry, and launch my command and see the output.
<ivanskie> and i can type things.
<ivanskie> except, when I press Enter it just sends new-line.
dinfuehr has quit [Ping timeout: 245 seconds]
<ivanskie> There's this old example: https://net-ssh.github.io/ssh/v1/chapter-5.html#s5
<baweaver> oft_gegong: The worst enemy in programming are people who insist things are easier than they actually are
dinfuehr has joined #ruby
<ivanskie> b is right.
za1b1tsu has quit [Ping timeout: 272 seconds]
<ivanskie> oft_gegong: if you are impatient, then just start writing a program. and figure out how to do it as you go.
<ivanskie> kind of a backwards approach
<baweaver> I still make things up as I go :D
SuperL4g_ is now known as SuperLag
<ivanskie> so the old example doesn't work anymore, its outdated documentation. :(
<ivanskie> But dkowis on github essentially re-wrote it.. and it still doesn't work https://github.com/net-ssh/net-ssh/issues/622
<baweaver> Net::SSH hasn't gotten love in quite a while.
<ivanskie> very sad day
Fusl has quit [Remote host closed the connection]
eckhardt has joined #ruby
<ivanskie> I don't understand what intercepts the characters and ignores CR. rather it actually replaces CR with NL
<ivanskie> there are these: http://net-ssh.github.io/net-ssh/Net/SSH/Connection/Term.html. I don't even know how to describe it. But I haven't been able to figure out where to put it, and enable/disable some of these flags.
<baweaver> Yeah, it's too deep down the flags rabbit hole for me to really have any guesses.
<ivanskie> i might have to use what I have to just establish a port forwarding, then call a system ssh command to launch into the remote shell that way. so sad :(
apeiros_ has quit [Read error: Connection reset by peer]
dachi has joined #ruby
<ivanskie> I'm basically replicating parts of Heroku toolbelt cli
<ivanskie> for our aws setup. eb ssh will not work, because everything is behind a firewall basically.
apeiros_ has joined #ruby
<ivanskie> its frustrating to get to launching into rails console through a jump box, etc etc.. just to get to the irb>. and be able to type and erase.. but when you press Enter it's like you are in text editor lol.
* ivanskie goes weeping
DTZUZU has joined #ruby
justicefries has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
justicefries has joined #ruby
conta has joined #ruby
<eam> ivanskie: the thing intercepting and changing characters is your terminal
<eam> you can configure its behavior with `stty`
conta has quit [Ping timeout: 260 seconds]
<ivanskie> i was thinking that the ICRNL setting was doing it.
<ivanskie> eam: so once I make the connection, i'd just execute an stty command to change the behavior?
za1b1tsu has joined #ruby
<eam> possibly, yeah, or run the related tty ioctl from ruby
<eam> the specifics ... I really haven't had enough coffee to debug terminal problems this early in the morning :)
<ivanskie> haha
<ivanskie> its a good lead tho
aufi has quit [Ping timeout: 252 seconds]
za1b1tsu has quit [Ping timeout: 268 seconds]
<ivanskie> hmm interesting
<ivanskie> ch.exec('stty icrnl') before requesting pty, says 'stty: standard input: Inappropriate ioctl for device' but exec that after request pty.. and it closes the channel.
eddof13 has joined #ruby
<baweaver> Started streaming me some Ruby last night - https://www.twitch.tv/videos/329652556
<ivanskie> ooh
<baweaver> Destructuring in this case for kicks. Will probably be streaming through some other fun stuff as I have time
<baweaver> though RubyConf will definitely be distracting.
<ivanskie> awesome
<baweaver> I'll likely do a full run of the RubyConf talk on there some time later.
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<ivanskie> eam have you had more coffee yet?
<ivanskie> you're like my only hope
<ivanskie> lol
eckhardt has joined #ruby
eddof13 has quit [Quit: eddof13]
eddof13 has joined #ruby
djellemah has joined #ruby
<ivanskie> This is the output for `stty -a` once pty connection is established. https://dpaste.de/EfPJ
akaiiro has quit [Ping timeout: 272 seconds]
<ivanskie> yeah here's the culprit: "-igncr icrnl"
<ivanskie> ignore carriage return turn cr into newline
eddof13 has quit [Quit: eddof13]
<nofxx> Coffee's color is actually RUBY... fun facts
clemens3 has quit [Ping timeout: 252 seconds]
<ivanskie> under what kind of light?
<apeiros_> under an LSD bulb
apeiros_ is now known as apeiros
<ivanskie> quite probable
eddof13 has joined #ruby
thebetrayer has joined #ruby
thebetrayer has quit [Client Quit]
thebetrayer has joined #ruby
bak1an has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
roshanavand has quit [Quit: Gone planting!]
t0th_- has joined #ruby
<eam> ivanskie: sorry, working on the fires they pay me to put out -- looks like you got it though!
<t0th_-> hi, i have a GemFile with: gem 'mqtt', :git => 'https://github.com/njh/ruby-mqtt.git'
<t0th_-> i run bundle install but when try use require i have this error: `require': cannot load such file -- mqtt . Why?
mangold has quit [Quit: This computer has gone to sleep]
<z64> t0th_-: wild guess, but maybe you aren't using bundler to run your project? you either have to `require "bundler/setup"`, or `$ bundle exec ruby main.rb` (or whatever your main file is named)
apeiros has quit [Read error: Connection reset by peer]
apeiros has joined #ruby
mistergibson has joined #ruby
roshanavand has joined #ruby
thebetrayer has quit [Ping timeout: 260 seconds]
<t0th_-> bundler: command not found: start.rb
Fusl has joined #ruby
za1b1tsu has joined #ruby
apeiros has quit [Read error: Connection reset by peer]
venmx has quit [Ping timeout: 252 seconds]
apeiros has joined #ruby
za1b1tsu has quit [Ping timeout: 268 seconds]
kapil____ has joined #ruby
eddof13 has quit [Quit: eddof13]
lytol has joined #ruby
oft_gegong has quit [Quit: Page closed]
nfk has joined #ruby
apeiros has quit [Read error: Connection reset by peer]
apeiros has joined #ruby
t0th_- has quit [Quit: Leaving]
za1b1tsu has joined #ruby
apeiros has quit [Read error: Connection reset by peer]
apeiros__ has joined #ruby
roshanavand has quit [Quit: Gone planting!]
troulouliou_div2 has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
za1b1tsu has quit [Ping timeout: 272 seconds]
zapata_ has joined #ruby
akaiiro has joined #ruby
zapata has quit [Ping timeout: 252 seconds]
Sina has quit [Quit: Connection closed for inactivity]
nexraf1 has joined #ruby
nexraf1 has quit [Client Quit]
roshanavand has joined #ruby
nexraf1 has joined #ruby
eddof13 has joined #ruby
bak1an has joined #ruby
eddof13 has quit [Client Quit]
kurko_ has quit [Ping timeout: 246 seconds]
impermanence has joined #ruby
kurko_ has joined #ruby
dachi_ has joined #ruby
dachi has quit [Quit: Page closed]
dachi_ is now known as dachi
apeiros__ has quit [Read error: Connection reset by peer]
apeiros has joined #ruby
GodFather has joined #ruby
blandflakes has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
blandflakes has joined #ruby
blandflakes has quit [Client Quit]
eddof13 has joined #ruby
cow[moo] has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cow[moo] has joined #ruby
SeepingN has quit [Quit: The system is going down for reboot NOW!]
orbyt_ has joined #ruby
dachi has quit [Quit: ZNC 1.7.1 - https://znc.in]
dachi has joined #ruby
braderhart has quit [Quit: Connection closed for inactivity]
dachi has left #ruby [#ruby]
orbyt_ has quit [Read error: Connection reset by peer]
orbyt_ has joined #ruby
eddof13 has quit [Quit: eddof13]
eddof13 has joined #ruby
mwlang has quit [Quit: mwlang]
venmx has joined #ruby
dachi has joined #ruby
desperek has joined #ruby
eddof13 has quit [Quit: eddof13]
dachi has quit [Quit: ZNC 1.7.1 - https://znc.in]
dachi has joined #ruby
akaiiro has quit [Ping timeout: 268 seconds]
dachi has left #ruby [#ruby]
eddof13 has joined #ruby
lunarkitty7 is now known as spectralkitty
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
za1b1tsu has joined #ruby
xfbs has quit [Quit: afk]
wildermind has joined #ruby
cow[moo] has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
za1b1tsu has quit [Ping timeout: 240 seconds]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
kaleido has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kaleido has joined #ruby
zenspider has quit [Quit: bye]
roshanavand has quit [Remote host closed the connection]
roshanavand has joined #ruby
whysthatso has joined #ruby
zenspider has joined #ruby
Inside has joined #ruby
orbyt_ has joined #ruby
roshanavand has quit [Remote host closed the connection]
spiette has quit [Quit: ZNC 1.7.1 - https://znc.in]
TheBloke has quit [Read error: Connection reset by peer]
<zenspider> rawr
dachi has joined #ruby
fluxAeon has joined #ruby
<ivanskie> any IO/console experts here?
<havenwood> ivanskie: have an io-console question?
<ivanskie> i think so?
<ivanskie> background: writing a pseudo copy of heroku cli. specifically command to launch into rails console on remote machine.
<ivanskie> eam has pointed me in the right direction with changing stty or something similar modes.. im not having amazing luck there. anything i try changing results in it complaining about incompatible mode for ssh.
<havenwood> ivanskie: show the error?
<ivanskie> and now i've sumbled upon io/console and now when im in irb> on remote machine (using net::ssh) i press enter, and it acts as if I open a "
<ivanskie> irb(main):001:0>
<ivanskie> irb(main):002:0*
ams__ has quit [Quit: Connection closed for inactivity]
<ivanskie> my super ugly code (cause i've been at it for like 10+ hours now) https://dpaste.de/jP77
RougeR_ has joined #ruby
<ivanskie> lines of interest here i think are 69-76
<ivanskie> supposedly.. I wait for stdin activity and then send raw characters through. This snippet of code now causes two problems. 1. this is a heavy loop, not really letting much else happen on screen. 2. i have no idea what im doing so i'm not exactly getting the result i want.
bak1an has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<eam> ivanskie: I'm also interested in the exact error re: "incompatible mode for ssh"
whysthatso has quit [Quit: whysthatso]
whysthatso has joined #ruby
dachi has quit [Ping timeout: 260 seconds]
<ivanskie> i can't remember how to reproduce that now
eddof13 has quit [Quit: eddof13]
reber__ has joined #ruby
<ivanskie> i know im so helpful right now. i think i need a break from this lol. i've spent a bunch of time to get to this point. its just annoying
TheBloke has joined #ruby
reber has quit [Ping timeout: 268 seconds]
fluxAeon has quit [Ping timeout: 240 seconds]
eddof13 has joined #ruby
eddof13 has quit [Client Quit]
fluxAeon has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ua_ has joined #ruby
eddof13 has joined #ruby
reber has joined #ruby
ua has quit [Ping timeout: 244 seconds]
reber__ has quit [Ping timeout: 268 seconds]
spiette has joined #ruby
roshanavand has joined #ruby
orbyt_ has joined #ruby
nexraf1 has quit [Quit: WeeChat 2.2]
roshanavand has quit [Remote host closed the connection]
<ivanskie> ok im onto something
fluxAeon has quit [Ping timeout: 272 seconds]
<ivanskie> i think its something with the io buffer
<eam> take breaks, keep at it :)
druonysus has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
orbyt_ has quit [Read error: Connection reset by peer]
dachi has joined #ruby
<ivanskie> oh so close now
justicefries has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
justicefries has joined #ruby
Nicmavr has quit [Read error: Connection reset by peer]
Nicmavr has joined #ruby
desperek has quit [Quit: xoxo]
roshanavand has joined #ruby
ellcs has joined #ruby
eddof13 has quit [Quit: eddof13]
eddof13 has joined #ruby
despai has joined #ruby
vutral1 has quit [Ping timeout: 252 seconds]
bambanx has joined #ruby
siaw23 has joined #ruby
justicefries has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
TheBloke has quit [Quit: Textual IRC Client: www.textualapp.com]
<siaw23> hello fine people. so i have something like this https://gist.github.com/siaw23/9b316a26ec85b858ac91387a9bed5a7b and i understand Ruby’s has a new feature to simplify this (with #yield_self or #then) can anyone help me with this?
za1b1tsu has joined #ruby
<Radar> siaw23: @var = something.do_something.do_another_thing
<Radar> ?next
<ruby[bot]> Next question, please!
despai has quit [Quit: ...]
<siaw23> i know i can do that Radar :D
<siaw23> can i use #then for this?
<Radar> But why?
<siaw23> i just want to learn about its usage
<siaw23> maybe this is not the best use case for it then i’d undersand :)
<Radar> @var = something.yield_self { |thing| thing.do_something }
<siaw23> thanks a lot :)
akaiiro has joined #ruby
za1b1tsu has quit [Ping timeout: 268 seconds]
kurko_ has quit [Ping timeout: 268 seconds]
<ivanskie> okay so now.. this gets me to the shell. and i can type and press enter. but i keep having to press enter twice.. https://dpaste.de/Swda#
<ivanskie> first Enter press sends newline.. and second counts as CR
<ivanskie> what would make it behave like that?
hurricanehrndz has quit [Quit: Goodbye]
<ivanskie> without $stdin.iflush the screen buffer is basically one character behind
phaul has quit [Ping timeout: 244 seconds]
snickers has joined #ruby
za1b1tsu has joined #ruby
ellcs has quit [Ping timeout: 260 seconds]
dviola has joined #ruby
za1b1tsu has quit [Ping timeout: 272 seconds]
bambanx has quit [Quit: Leaving]
reber has quit [Remote host closed the connection]
kapil____ has quit [Quit: Connection closed for inactivity]
K350 has joined #ruby
asphyxia has joined #ruby
K350 has quit [Quit: leaving]
kurko_ has joined #ruby
cliluw has quit [Read error: Connection reset by peer]
cliluw has joined #ruby
asphyxia has quit [Quit: Lost terminal]
<Inside> augh I regret ever touching this piece of code.
<Inside> I should've just left it as is
ivanskie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kurko_ has quit [Ping timeout: 268 seconds]