« Back to channel list

#ruby - 31 October 2018

« Back 1 day Forward 1 day »
[00:01:19] za1b1tsu: has joined #ruby
[00:06:05] roshanavand: has joined #ruby
[00:10:36] bak1an: has joined #ruby
[00:13:52] orbyt_: has joined #ruby
[00:15:00] impermanence: has joined #ruby
[00:15:37] cd: has joined #ruby
[00:20:24] hightower3: has joined #ruby
[00:20:52] SCHAPiE: has joined #ruby
[00:21:13] 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).
[00:23:00] SeepingN_: open ended ranges.. interesting
[00:23:34] alicef: has joined #ruby
[00:32:35] argoneus: has joined #ruby
[00:35:16] hightower3: Here it is: https://pastebin.com/qBwSHnU0
[00:35:16] 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
[00:35:38] hightower3: not sure why gsub inside method_missing doesn't work...
[00:36:39] SeepingN_: what happens if something is nil
[00:36:42] kurko_: has joined #ruby
[00:36:47] SeepingN_: not that this is complete
[00:37:15] hightower3: It's not... I just made a quick example that would work if it wasn't executing in method_missing handler
[00:37:27] hightower3: but since it is executing there, it throws an error instead of working
[00:37:40] hightower3: and I don't understand why
[00:38:05] wojnar: has joined #ruby
[00:38:22] roshanavand: has joined #ruby
[00:41:57] SeepingN_: don't you need a name before a and b in your call
[00:42:24] mangold: has joined #ruby
[00:42:34] bambanx: has joined #ruby
[00:42:36] hightower3: name gets filled in with the name of method that is missing
[00:44:16] bambanx: has joined #ruby
[00:49:21] havenwood: hightower3: A nit, I'd suggest #tr over #gsub for this case.
[00:52:01] sagax: has joined #ruby
[00:52:26] sagax: in Gemfile i have gem 'pg'
[00:52:27] 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
[00:52:53] havenwood: hightower3: What args are you calling that method with when it fails?
[00:52:55] 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`
[00:53:21] sagax: but when i check version pg_ctl --version this show `pg_ctl (PostgreSQL) 9.6.10`
[00:53:21] havenwood: sagax: psql -V
[00:53:26] Nicmavr: has joined #ruby
[00:53:43] sagax: hm, strange
[00:53:48] hightower3: havenwood, my pastebin link above contains an example of what doesn't work
[00:53:54] sagax: psql -V write `psql (PostgreSQL) 8.4.20`
[00:54:09] havenwood: sagax: That's ^ the prob
[00:54:27] sgen: has joined #ruby
[00:54:30] sagax: thanks, will be see more about postgresql
[00:56:52] havenwood: hightower3: Are you doing it at top level? That should work in a class.
[00:58:11] havenwood: hightower3: hmm
[00:58:14] kurko_: has joined #ruby
[00:59:29] havenwood: hightower3: fwiw: https://gist.github.com/havenwood/50476fab6dc90e60f59da2c53ee5ab1d
[00:59:57] havenwood: >> nil.to_string
[01:00:02] ruby[bot]: havenwood: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[01:00:09] havenwood: #!> NoMethodError: undefined method `to_string' for nil:NilClass
[01:01:00] funnel: has joined #ruby
[01:01:20] havenwood: ah, it's String#to_hash you're running into
[01:01:40] bambanx: has joined #ruby
[01:02:43] hightower3: havenwood, but you got it actually, it works within a class
[01:02:57] havenwood: hightower3: At top level, you're defining #method_missing on Object.
[01:03:20] havenwood: hightower3: Which breaks object coercion.
[01:03:57] im0nde: has joined #ruby
[01:04:18] havenwood: For example, at top level: def hightower3; :ok end; 42.hightower3 #=> :ok
[01:04:47] havenwood: hightower3: Your code is good. It just not a good method to define on Object, since that's way too many method missings. :)
[01:05:30] 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/
[01:06:30] za1b1tsu: has joined #ruby
[01:06:34] 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?
[01:07:24] minimal_life: has joined #ruby
[01:07:41] alicef: has joined #ruby
[01:09:01] 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
[01:09:17] hightower3: yeah, thanks
[01:10:58] ansraliant: has joined #ruby
[01:13:21] havenwood: hightower3: Another way you could write that: 'TEST'.to_s.gsub(/T/) { |capture| "\\#{capture}" }
[01:13:29] havenwood: hightower3: #=> "\TES\T"
[01:13:49] havenwood: capture is a bad variable name there though >.>
[01:13:56] hightower3: ah nice one, thanks!
[01:14:07] havenwood: hightower3: np
[01:16:57] NpcOrangeManBad: has joined #ruby
[01:17:02] sagax: i fixed psql and now all `bundle` ok
[01:17:07] sagax: thanks to all
[01:18:28] sgen: has joined #ruby
[01:21:48] tAn: has joined #ruby
[01:22:22] sgen: has joined #ruby
[01:27:08] gix: has joined #ruby
[01:30:57] jdawgaz: has joined #ruby
[01:36:06] havenwood: sagax: woot
[01:39:28] ivanskie: has joined #ruby
[01:40:06] sagax: havenwood: ? o_o
[01:40:24] havenwood: sagax: a celebrator owl woot
[01:40:37] sagax: english not native for me
[01:42:28] havenwood: sagax: It was the merriam webster word of the year in 2007: https://www.newsweek.com/word-year-w00t-95217
[01:42:48] cow[moo]: has joined #ruby
[01:43:27] havenwood: it was a 'cooler way of saying "yay"' in 2007, so it's probably a less cool way to say "yay" now
[01:43:55] havenwood: 'woot'.squeeze
[01:50:36] m27frogy: has joined #ruby
[01:53:21] havenwood: 10.downto(7).map { |n| 13 ** n % n + 110 }.pack('c*')
[01:57:29] jdawgaz: has joined #ruby
[01:59:41] ur5us: has joined #ruby
[01:59:50] BiHi: has joined #ruby
[02:11:57] tdy: has joined #ruby
[02:16:33] esrse: has joined #ruby
[02:37:27] jdawgaz: has joined #ruby
[02:38:34] Op3nEyez: has joined #ruby
[02:54:40] za1b1tsu: has joined #ruby
[03:22:11] patr0clus: has joined #ruby
[03:24:07] orbyt_: has joined #ruby
[03:25:09] kapil____: has joined #ruby
[03:29:35] za1b1tsu: has joined #ruby
[03:35:59] darkhanb: has joined #ruby
[03:42:43] tAn: has joined #ruby
[03:53:35] sauvin: has joined #ruby
[03:54:09] arescorpio: has joined #ruby
[03:55:47] jdawgaz: has joined #ruby
[04:09:28] braincrash: has joined #ruby
[04:26:04] bambanx: has joined #ruby
[04:33:14] kurko_: has joined #ruby
[04:35:21] c0ncealed4: has joined #ruby
[04:35:22] jdawgaz: has joined #ruby
[04:39:37] jdawgaz: has joined #ruby
[04:41:16] eckhardt: has joined #ruby
[04:41:42] baweaver: About to start streaming on destructuring in Ruby: https://www.twitch.tv/baweaver
[04:41:50] baweaver: Definitely a bit advanced, but should be a fun time.
[04:41:54] bambanx: has joined #ruby
[04:46:15] za1b1tsu: has joined #ruby
[04:47:59] dellavg_: has joined #ruby
[04:51:37] RougeR: has joined #ruby
[04:55:19] jdawgaz: has joined #ruby
[05:11:20] MoritaShinobu: has joined #ruby
[05:18:08] bambanx: has joined #ruby
[05:21:35] ellcs: has joined #ruby
[05:25:25] conta: has joined #ruby
[05:29:43] lone_ranger: has joined #ruby
[05:32:12] za1b1tsu: has joined #ruby
[05:36:12] voolik: has joined #ruby
[06:16:36] za1b1tsu: has joined #ruby
[06:26:58] kurko_: has joined #ruby
[06:32:34] Cthulu201: has joined #ruby
[06:33:58] doubledup: has joined #ruby
[06:40:19] reber: has joined #ruby
[06:42:01] aupadhye: has joined #ruby
[07:01:22] Dbugger: has joined #ruby
[07:02:03] mangold: has joined #ruby
[07:04:04] voolik: has joined #ruby
[07:09:58] mangold: has joined #ruby
[07:10:06] ua: has joined #ruby
[07:17:13] conta: has joined #ruby
[07:30:40] whysthatso: has joined #ruby
[07:37:33] gix: has joined #ruby
[08:00:47] warrshrike: has joined #ruby
[08:01:01] warrshrike: is there chaining in ruby hashes
[08:01:36] warrshrike: i want to detect duplicates in a ruby array by putting them in a hash
[08:01:40] elomatreb: Chaining? Hashes are ordered, if that's what you mean
[08:01:41] warrshrike: i.e. in O(N)
[08:02:03] warrshrike: so if the value is duplicate, it will hash to same key and i will know
[08:02:07] warrshrike: does that make sense?
[08:02:22] warrshrike: whats an appropriate data structure for that
[08:02:44] elomatreb: You can use #uniq to get O(n) deduplication, FWIW
[08:03:21] warrshrike: elomatreb: doesnt that do the same thing?
[08:03:31] elomatreb: Yes, but you don't have to implement it yourself
[08:03:31] warrshrike: i also want to implement it for learning purposes lol
[08:04:28] 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
[08:05:59] Freshnuts: has joined #ruby
[08:07:40] Freshnuts: has joined #ruby
[08:12:18] warrshrike: elomatreb: got it to work with str.hash and a ruby hash
[08:13:50] clemens3: has joined #ruby
[08:21:11] burgestrand: has joined #ruby
[08:26:58] kapil____: has joined #ruby
[08:28:18] bzf-: has left #ruby: ("Linkinus - http://linkinus.com")
[08:32:00] za1b1tsu: has joined #ruby
[08:36:15] marz_d`ghostman: has joined #ruby
[08:37:18] 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?
[08:37:50] vondruch: has joined #ruby
[08:38:02] mangold: has joined #ruby
[08:53:39] phaul: has joined #ruby
[08:58:02] aufi: has joined #ruby
[09:04:30] mikecmpbll: has joined #ruby
[09:08:07] cabotto: has joined #ruby
[09:09:47] 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
[09:12:30] 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.
[09:14:21] phaul: otherwise please paste the example on pastebin, and I can take a look.
[09:14:36] phaul: or gist or whatever
[09:18:15] thinkpad: has joined #ruby
[09:19:31] GDPR: has joined #ruby
[09:21:50] fluxAeon: has joined #ruby
[09:22:25] phaul: marz_d`ghostman: ?
[09:24:25] Demos[m]: has joined #ruby
[09:25:39] marz_d`ghostman: phaul: https://gist.github.com/marzdgzmn/bb3429bbff3d7a2049668fdaed55730d
[09:25:45] marz_d`ghostman: phaul: sorry for the delay
[09:26:50] phaul: no probs. Can you please also paste the rspec examples you are writing?
[09:27:14] phaul: sorry Its right there :)
[09:28:06] 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
[09:28:37] roshanavand: has joined #ruby
[09:30:18] 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 ?
[09:30:31] phaul: even with just one expect
[09:31:27] phaul: so first thing to fix would be expect { @sync.run }.to raise_error(SystemExit)
[09:31:44] venmx: has joined #ruby
[09:32:16] phaul: notice I changed the argument of expect to be a block
[09:33:05] 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
[09:34:02] phaul: right but that's not what you had on the gist
[09:35:52] phaul: you had expect(@sync.run).to raise_error(SystemExit). that is different
[09:36:59] SuperL4g_: has joined #ruby
[09:37:07] Azure: has joined #ruby
[09:37:13] wildermind: has joined #ruby
[09:37:20] Sup3rLurk: has joined #ruby
[09:43:19] 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
[09:43:46] rkoller: has joined #ruby
[09:44:04] phaul: also there is a problem of leaving files behind, during the test. that makes the test dependent on order and state
[09:44:37] phaul: lemme try too give you a rewrite, but I can't guarantee I get it right first time :)
[09:45:41] roshanavand: has joined #ruby
[09:45:50] kurko_: has joined #ruby
[09:47:07] bastilian: has joined #ruby
[09:47:08] turt2live: has joined #ruby
[09:47:08] jonjitsu: has joined #ruby
[09:47:22] nowhere_man: has joined #ruby
[09:48:58] Miron: has joined #ruby
[09:56:22] gregf_: has joined #ruby
[09:56:25] phaul: marz_d`ghostman: @sync is the object that establish_lock / acquire_lock are methods of?
[09:58:45] marz_d`ghostman: phaul: Yes, that is correct.
[09:59:12] phaul: marz_d`ghostman: my first attempt, this might not work yet.. https://gist.github.com/phaul/0fc77b0adc9fa45652c08d31e4253f1b
[10:01:06] phaul: I think https://gist.github.com/phaul/0fc77b0adc9fa45652c08d31e4253f1b#file-rspec-rb-L5 line 5 is not needed.
[10:03:17] 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
[10:03:56] marz_d`ghostman: Is there something like allow to receive(:exit) continue with the next test? something like that
[10:04:36] phaul: ok I will fix that.
[10:10:44] phaul: https://gist.github.com/phaul/0fc77b0adc9fa45652c08d31e4253f1b
[10:11:38] kurko_: has joined #ruby
[10:14:28] al2o3-cr: has joined #ruby
[10:18:15] 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
[10:18:34] phaul: no probs. you are welcome
[10:18:59] burgestrand: has joined #ruby
[10:24:31] 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
[10:24:59] marz_d`ghostman: phaul: Cause rubocop seems to be giving me warning about my Rspec.describe Class having too many lines currently [52/25]
[10:26:07] AJA4350: has joined #ruby
[10:26:26] 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
[10:26:47] phaul: or number of statements for rspec blocks
[10:26:55] livcd: has joined #ruby
[10:27:49] 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 :)
[10:27:50] phaul: I do have a Matrics/BlockLength exclude for spec/**/* in my .ruboconf
[10:29:08] marz_d`ghostman: I'll do just that. By the way, you keen on blockchains?
[10:29:27] marz_d`ghostman: If so, you think ruby has a place on that field?
[10:29:50] phaul: hm. I don't really know much about blockchains, sorry
[10:30:06] jhass: who does, they all pretend :P
[10:31:01] marz_d`ghostman: haha, you have a point though
[10:31:31] jhass: a blockchain, technically not the buzzword, is just a data structure
[10:31:49] jhass: would you ask "has ruby a place on the field of binary trees"?
[10:33:56] marz_d`ghostman: just curious cause all I see being used are java and c++
[10:34:11] jhass: well, look harder :P
[10:34:55] marz_d`ghostman: guess I'll do that :)
[10:36:17] jhass: https://rubygems.org/search?utf8=%E2%9C%93&query=blockchain / https://crates.io/search?q=blockchain / http://crystalshards.xyz/?filter=blockchain / https://metacpan.org/search?q=blockchain and so on
[10:36:20] 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
[10:52:55] im0nde: has joined #ruby
[11:00:02] venmx: has joined #ruby
[11:11:56] burgestrand: has joined #ruby
[11:16:43] kurko_: has joined #ruby
[11:16:51] GodFather: has joined #ruby
[11:20:29] aufi: has joined #ruby
[11:23:41] kurko_: has joined #ruby
[11:27:34] cabotto: has joined #ruby
[11:29:32] xfbs: has joined #ruby
[11:34:03] Nicmavr: has joined #ruby
[11:35:56] cabotto: has joined #ruby
[11:36:00] tuor: has joined #ruby
[11:38:00] kurko_: has joined #ruby
[11:39:52] xfbs: has joined #ruby
[11:42:10] JusticeFries: has joined #ruby
[11:42:35] cow[moo]: has joined #ruby
[11:45:18] nexraf1: has joined #ruby
[11:46:22] cabotto: has joined #ruby
[12:04:30] roshanavand: has joined #ruby
[12:07:27] conta: has joined #ruby
[12:14:21] venmx: has joined #ruby
[12:25:31] cabotto: has joined #ruby
[12:32:11] ua: has joined #ruby
[12:38:41] Fusl: has joined #ruby
[12:48:14] ua: has joined #ruby
[12:49:06] cabotto: has joined #ruby
[12:51:40] bak1an: has joined #ruby
[12:53:11] clemens3: has joined #ruby
[12:54:38] mniip: has joined #ruby
[12:57:22] discopatrick: has joined #ruby
[13:13:56] dmitch: has joined #ruby
[13:23:47] blandflakes: has joined #ruby
[13:24:38] noark9: has joined #ruby
[13:26:56] ellcs: has joined #ruby
[13:37:48] JusticeFries: has joined #ruby
[13:47:29] Iambchop: has joined #ruby
[13:52:51] Rapture: has joined #ruby
[13:55:47] mangold: has joined #ruby
[14:03:20] vondruch_: has joined #ruby
[14:10:13] xfbs: has joined #ruby
[14:12:35] orbyt_: has joined #ruby
[14:18:27] cxl: has joined #ruby
[14:24:52] whysthatso: has joined #ruby
[14:25:48] kaleido: has joined #ruby
[14:27:13] AJA4350: has joined #ruby
[14:31:32] aupadhye: has joined #ruby
[14:33:38] voolik: has joined #ruby
[14:37:13] SeepingN: has joined #ruby
[14:45:42] aufi: has joined #ruby
[14:48:57] noark9: has joined #ruby
[14:50:10] mangold: has joined #ruby
[14:50:52] JusticeFries: has joined #ruby
[14:56:55] noark9: has joined #ruby
[15:02:04] vondruch: has joined #ruby
[15:04:49] Inline: has joined #ruby
[15:06:11] GodFather: has joined #ruby
[15:24:27] jackrandom: has joined #ruby
[15:28:17] jsc: has joined #ruby
[15:34:31] wojnar: has joined #ruby
[15:50:30] jcarl43: has joined #ruby
[15:50:50] conta: has joined #ruby
[15:53:50] Fusl: has joined #ruby
[15:54:29] rippa: has joined #ruby
[15:55:51] ams__: has joined #ruby
[15:57:09] GodFather: has joined #ruby
[16:05:50] nadir: has joined #ruby
[16:13:50] ChanServ: +o havenwood
[16:15:26] darkhanb: has joined #ruby
[16:16:03] ChanServ: -o havenwood
[16:21:19] impermanence: has joined #ruby
[16:29:47] apeiros_: has joined #ruby
[16:31:45] doubledup: has joined #ruby
[16:33:55] orbyt_: has joined #ruby
[16:38:18] kurko_: has joined #ruby
[16:41:06] mangold: has joined #ruby
[16:49:13] roshanavand: has joined #ruby
[16:54:29] cow[moo]: has joined #ruby
[16:57:14] ivanskie: has joined #ruby
[16:57:49] oft_gegong: has joined #ruby
[16:58:25] oft_gegong: I'm getting started in ruby, but I'm really impatient. I know that the worst enemy in programming is impatience.
[17:04:31] mwlang: has joined #ruby
[17:12:05] reber: has joined #ruby
[17:13:17] akaiiro: has joined #ruby
[17:14:14] ivanskie: its okay, once you learn programming you can just write an AI to learn other things for you.
[17:14:45] ivanskie: I have a question uhm.
[17:14:52] braderhart: has joined #ruby
[17:15:00] ivanskie: I'm using net-ssh with net-ssh-gateway.
[17:15:05] baweaver: ...just write an AI? That's.... not common
[17:15:26] ivanskie: I was able to send in request_pry, and launch my command and see the output.
[17:15:36] ivanskie: and i can type things.
[17:15:53] ivanskie: except, when I press Enter it just sends new-line.
[17:17:13] ivanskie: There's this old example: https://net-ssh.github.io/ssh/v1/chapter-5.html#s5
[17:17:16] baweaver: oft_gegong: The worst enemy in programming are people who insist things are easier than they actually are
[17:17:40] dinfuehr: has joined #ruby
[17:17:48] ivanskie: b is right.
[17:18:24] ivanskie: oft_gegong: if you are impatient, then just start writing a program. and figure out how to do it as you go.
[17:18:36] ivanskie: kind of a backwards approach
[17:19:06] baweaver: I still make things up as I go :D
[17:20:40] ivanskie: so the old example doesn't work anymore, its outdated documentation. :(
[17:21:15] ivanskie: But dkowis on github essentially re-wrote it.. and it still doesn't work https://github.com/net-ssh/net-ssh/issues/622
[17:21:17] baweaver: Net::SSH hasn't gotten love in quite a while.
[17:21:28] ivanskie: very sad day
[17:22:29] eckhardt: has joined #ruby
[17:22:45] ivanskie: I don't understand what intercepts the characters and ignores CR. rather it actually replaces CR with NL
[17:24:14] 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.
[17:25:55] 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 :(
[17:25:55] baweaver: Yeah, it's too deep down the flags rabbit hole for me to really have any guesses.
[17:26:25] dachi: has joined #ruby
[17:26:27] ivanskie: I'm basically replicating parts of Heroku toolbelt cli
[17:27:05] ivanskie: for our aws setup. eb ssh will not work, because everything is behind a firewall basically.
[17:27:11] apeiros_: has joined #ruby
[17:28:28] 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.
[17:28:39] ivanskie: ACTION goes weeping
[17:32:01] dtzuzu: has joined #ruby
[17:35:53] JusticeFries: has joined #ruby
[17:40:57] conta: has joined #ruby
[17:44:39] eam: ivanskie: the thing intercepting and changing characters is your terminal
[17:45:00] eam: you can configure its behavior with `stty`
[17:45:26] ivanskie: i was thinking that the ICRNL setting was doing it.
[17:46:22] ivanskie: eam: so once I make the connection, i'd just execute an stty command to change the behavior?
[17:46:46] za1b1tsu: has joined #ruby
[17:47:02] eam: possibly, yeah, or run the related tty ioctl from ruby
[17:47:27] eam: the specifics ... I really haven't had enough coffee to debug terminal problems this early in the morning :)
[17:47:42] ivanskie: its a good lead tho
[17:53:10] ivanskie: hmm interesting
[17:53:49] 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.
[17:54:32] eddof13: has joined #ruby
[18:00:40] baweaver: Started streaming me some Ruby last night - https://www.twitch.tv/videos/329652556
[18:01:04] baweaver: Destructuring in this case for kicks. Will probably be streaming through some other fun stuff as I have time
[18:01:15] baweaver: though RubyConf will definitely be distracting.
[18:02:11] baweaver: I'll likely do a full run of the RubyConf talk on there some time later.
[18:03:44] ivanskie: eam have you had more coffee yet?
[18:03:50] ivanskie: you're like my only hope
[18:04:20] eckhardt: has joined #ruby
[18:06:21] eddof13: has joined #ruby
[18:06:59] djellemah: has joined #ruby
[18:07:58] ivanskie: This is the output for `stty -a` once pty connection is established. https://dpaste.de/EfPJ
[18:08:58] ivanskie: yeah here's the culprit: "-igncr icrnl"
[18:09:43] ivanskie: ignore carriage return turn cr into newline
[18:12:02] nofxx: Coffee's color is actually RUBY... fun facts
[18:13:02] ivanskie: under what kind of light?
[18:14:44] apeiros_: under an LSD bulb
[18:15:03] ivanskie: quite probable
[18:15:48] eddof13: has joined #ruby
[18:16:36] TheBetrayer: has joined #ruby
[18:16:56] TheBetrayer: has joined #ruby
[18:21:07] t0th_-: has joined #ruby
[18:21:37] eam: ivanskie: sorry, working on the fires they pay me to put out -- looks like you got it though!
[18:22:01] t0th_-: hi, i have a GemFile with: gem 'mqtt', :git => 'https://github.com/njh/ruby-mqtt.git'
[18:22:02] t0th_-: i run bundle install but when try use require i have this error: `require': cannot load such file -- mqtt . Why?
[18:25:51] 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)
[18:29:10] apeiros: has joined #ruby
[18:31:59] mistergibson: has joined #ruby
[18:32:27] roshanavand: has joined #ruby
[18:34:44] t0th_-: bundler: command not found: start.rb
[18:35:24] Fusl: has joined #ruby
[18:35:48] za1b1tsu: has joined #ruby
[18:39:17] apeiros: has joined #ruby
[18:41:06] kapil____: has joined #ruby
[18:43:12] Lytol: has joined #ruby
[18:44:25] nfk: has joined #ruby
[18:45:42] apeiros: has joined #ruby
[18:53:28] za1b1tsu: has joined #ruby
[18:53:59] apeiros__: has joined #ruby
[18:58:00] troulouliou_div2: has joined #ruby
[19:04:47] zapata_: has joined #ruby
[19:04:50] akaiiro: has joined #ruby
[19:11:28] nexraf1: has joined #ruby
[19:11:54] roshanavand: has joined #ruby
[19:12:18] nexraf1: has joined #ruby
[19:12:22] eddof13: has joined #ruby
[19:12:59] bak1an: has joined #ruby
[19:24:29] impermanence: has joined #ruby
[19:29:20] kurko_: has joined #ruby
[19:29:29] dachi_: has joined #ruby
[19:30:42] apeiros: has joined #ruby
[19:32:57] GodFather: has joined #ruby
[19:35:10] blandflakes: has joined #ruby
[19:36:21] eddof13: has joined #ruby
[19:41:27] cow[moo]: has joined #ruby
[19:46:43] orbyt_: has joined #ruby
[19:52:44] dachi: has joined #ruby
[19:53:55] dachi: has left #ruby: ()
[19:57:26] orbyt_: has joined #ruby
[20:03:45] eddof13: has joined #ruby
[20:06:34] venmx: has joined #ruby
[20:08:41] dachi: has joined #ruby
[20:19:47] desperek: has joined #ruby
[20:32:02] dachi: has joined #ruby
[20:37:24] dachi: has left #ruby: ()
[20:39:42] eddof13: has joined #ruby
[20:41:59] za1b1tsu: has joined #ruby
[20:43:35] wildermind: has joined #ruby
[20:50:57] kaleido: has joined #ruby
[20:59:50] roshanavand: has joined #ruby
[21:00:42] whysthatso: has joined #ruby
[21:01:03] zenspider: has joined #ruby
[21:02:05] Inside: has joined #ruby
[21:02:10] orbyt_: has joined #ruby
[21:17:04] dachi: has joined #ruby
[21:19:30] fluxAeon: has joined #ruby
[21:21:34] ivanskie: any IO/console experts here?
[21:21:54] havenwood: ivanskie: have an io-console question?
[21:22:02] ivanskie: i think so?
[21:22:34] ivanskie: background: writing a pseudo copy of heroku cli. specifically command to launch into rails console on remote machine.
[21:23:26] 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.
[21:23:53] havenwood: ivanskie: show the error?
[21:24:09] 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 "
[21:24:16] ivanskie: irb(main):001:0>
[21:24:16] ivanskie: irb(main):002:0*
[21:25:25] ivanskie: my super ugly code (cause i've been at it for like 10+ hours now) https://dpaste.de/jP77
[21:25:39] RougeRR: has joined #ruby
[21:25:41] ivanskie: lines of interest here i think are 69-76
[21:26:44] 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.
[21:29:12] eam: ivanskie: I'm also interested in the exact error re: "incompatible mode for ssh"
[21:30:56] whysthatso: has joined #ruby
[21:32:56] ivanskie: i can't remember how to reproduce that now
[21:35:46] reber__: has joined #ruby
[21:36:37] 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
[21:37:03] TheBloke: has joined #ruby
[21:42:00] eddof13: has joined #ruby
[21:43:45] fluxAeon: has joined #ruby
[21:45:15] ua_: has joined #ruby
[21:45:46] eddof13: has joined #ruby
[21:47:15] reber: has joined #ruby
[21:51:10] spiette: has joined #ruby
[21:51:45] roshanavand: has joined #ruby
[21:55:57] orbyt_: has joined #ruby
[21:56:27] ivanskie: ok im onto something
[21:56:59] ivanskie: i think its something with the io buffer
[21:58:32] eam: take breaks, keep at it :)
[21:59:52] ivanskie: https://imgur.com/a/hM3vPbV
[22:00:55] dachi: has joined #ruby
[22:06:28] ivanskie: oh so close now
[22:09:23] JusticeFries: has joined #ruby
[22:13:49] Nicmavr: has joined #ruby
[22:14:54] roshanavand: has joined #ruby
[22:16:05] ellcs: has joined #ruby
[22:19:47] eddof13: has joined #ruby
[22:22:43] despai: has joined #ruby
[22:26:04] bambanx: has joined #ruby
[22:28:20] siaw23: has joined #ruby
[22:29:51] 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?
[22:29:51] za1b1tsu: has joined #ruby
[22:30:15] Radar: siaw23: @var = something.do_something.do_another_thing
[22:30:19] ruby[bot]: Next question, please!
[22:30:41] siaw23: i know i can do that Radar :D
[22:30:51] siaw23: can i use #then for this?
[22:31:12] siaw23: i just want to learn about its usage
[22:31:37] siaw23: maybe this is not the best use case for it then i’d undersand :)
[22:31:41] Radar: @var = something.yield_self { |thing| thing.do_something }
[22:31:52] Radar: As seen in: https://stackoverflow.com/a/47890832/15245
[22:32:27] siaw23: thanks a lot :)
[22:33:22] akaiiro: has joined #ruby
[22:39:16] 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#
[22:39:40] ivanskie: first Enter press sends newline.. and second counts as CR
[22:40:18] ivanskie: https://imgur.com/a/pFpYar5
[22:40:40] ivanskie: what would make it behave like that?
[22:50:40] ivanskie: without $stdin.iflush the screen buffer is basically one character behind
[22:56:29] snickers: has joined #ruby
[23:06:47] za1b1tsu: has joined #ruby
[23:12:02] dviola: has joined #ruby
[23:28:27] K350: has joined #ruby
[23:33:53] asphyxia: has joined #ruby
[23:41:19] kurko_: has joined #ruby
[23:46:58] cliluw: has joined #ruby
[23:50:50] Inside: augh I regret ever touching this piece of code.
[23:51:01] Inside: I should've just left it as is