« Back to channel list

#ruby - 27 April 2017

« Back 1 day Forward 1 day »
[00:00:42] rakm_: has joined #ruby
[00:01:00] Channel6: has joined #ruby
[00:01:02] sfdebug: havenwood, thanks dude... i go home now... \o
[00:01:31] rakm_: has joined #ruby
[00:01:52] tercenya: has joined #ruby
[00:06:07] chouhoulis: has joined #ruby
[00:07:27] charliesome: has joined #ruby
[00:11:20] nertzy: has joined #ruby
[00:13:51] mjuszczak: has joined #ruby
[00:14:30] brent__: has joined #ruby
[00:21:22] milardovich: has joined #ruby
[00:26:02] Rodya_: has joined #ruby
[00:28:51] olivier__: has joined #ruby
[00:37:05] jhack: has joined #ruby
[00:37:14] Verity: does ruby have some big limitation
[00:37:19] Verity: whjats the catch
[00:41:43] harfangk: has joined #ruby
[00:43:21] soloscshaw: has joined #ruby
[00:44:03] Rodya_: has joined #ruby
[00:44:53] cyphase: has joined #ruby
[00:45:10] charliesome: has joined #ruby
[00:46:52] john_doe_jr: has joined #ruby
[00:47:03] john_doe_jr: How do u escape a $ in ruby?
[00:48:30] ruby041: has joined #ruby
[00:49:04] ruby041: hey people, I am looking for help with ruby router, if there is anyone online , pm me please
[00:49:08] elomatreb: john_doe_jr: You don't need to, they're not interpolated
[00:49:44] newrubycoder: has joined #ruby
[00:50:01] Radar: Verity: the catch is that it doesn't perform as well as other languages
[00:51:40] newrubycoder: what is the best practice? "double quotes" for strings or 'single quotes'?
[00:52:33] alex123: has joined #ruby
[00:53:06] alex123: does anyone how to create dymanic pages on runtime in ruby?
[00:53:48] Radar: alex123: what
[00:53:56] Verity: newrubycoder, single
[00:54:01] Radar: Verity: [citation neede]d
[00:54:15] Radar: https://github.com/bbatsov/ruby-style-guide#consistent-string-literals
[00:54:16] Verity: what is with this bot
[00:54:56] Radar: I prefer double quotes because I work in other languages where the difference between single + double quotes matter.
[00:55:09] Verity: I'll use double from now on
[00:55:17] Radar: i.e. Golang and Elixir.
[00:55:30] millerti: has joined #ruby
[00:55:30] alex123: @radar, I have an admin user, who has an option to create / edit routes dynamically on runtime from the website as part of admin options. I am struggling with implementing it
[00:55:46] Radar: alex123: it sounds like you're re-inventing a CMS
[00:57:42] alex123: @radar, could you link something please, I am still a huge noob with ruby, so all the help is very appreciated
[00:58:01] Radar: alex123: http://www.refinerycms.com/, Wordpress, etc.
[00:58:52] rwb: has joined #ruby
[01:00:48] alex123: @radar, I already have a working application, can this stuff be added on as extra functionality ?
[01:01:38] sunrunner20: has joined #ruby
[01:02:03] HoierM: has joined #ruby
[01:03:04] Cohedrin: has joined #ruby
[01:04:08] gizmore|2: has joined #ruby
[01:05:34] Channel6: has joined #ruby
[01:05:44] mjuszczak: has joined #ruby
[01:07:02] Bounga``: has joined #ruby
[01:09:14] enterprisey: has joined #ruby
[01:09:58] charliesome: has joined #ruby
[01:10:53] duckpuppy: has joined #ruby
[01:13:07] minimalism: has joined #ruby
[01:18:52] c_nick: has joined #ruby
[01:22:16] cyphase: has joined #ruby
[01:26:27] stupidsenpai: has joined #ruby
[01:26:36] imightbestupid12: has joined #ruby
[01:26:53] c_nick: I have an excel based test cases in ruby which are distributed via incredibuild onto different threads on the available CPU's. When i run it normally it works fine but when i run it via teamcity i sometimes fail to get the excel object and few tests go missing
[01:27:46] c_nick: teamcity agent is running in non interactive mode.. i also tried the interactive mode.. and that seemed to give me less failures
[01:30:25] jeffaustin81: has joined #ruby
[01:32:00] HoloIRCUser1: has joined #ruby
[01:32:22] milardovich: has joined #ruby
[01:38:22] cyphase: has joined #ruby
[01:38:31] sunrunner20: has joined #ruby
[01:40:15] milardovich: has joined #ruby
[01:43:00] jhack: has joined #ruby
[01:43:00] cschneid_: has joined #ruby
[01:43:00] jhack: has joined #ruby
[01:43:09] __Yiota: has joined #ruby
[01:44:07] soloscshaw: has joined #ruby
[01:46:56] jamesaxl: has joined #ruby
[01:50:21] duderonomy: has joined #ruby
[01:51:58] jusa: has joined #ruby
[01:52:11] cyphase: has joined #ruby
[01:53:06] Mia: has joined #ruby
[01:53:07] Mia: has joined #ruby
[01:53:42] nobitanobi: has joined #ruby
[01:58:59] milardovich: has joined #ruby
[02:00:56] Jameser: has joined #ruby
[02:01:38] cyphase: has joined #ruby
[02:04:46] shinnya: has joined #ruby
[02:05:51] libastral: has joined #ruby
[02:11:57] alex189: has joined #ruby
[02:12:06] raul7821: has joined #ruby
[02:12:34] alex189: hi, help please, you can search ruby route by find(params[:id]), but what if I want to searh it by :title , is that possible ?
[02:12:36] esObe_: has joined #ruby
[02:14:16] Dark_Arc: alex189: `Model.find_by(title: 'some title')`
[02:15:02] Dark_Arc: or `find_by!` if you want to raise if it's not found
[02:15:24] xall: has joined #ruby
[02:17:23] alex189: @Dark_Arc thx <3
[02:20:23] genpaku: has joined #ruby
[02:21:46] Cohedrin_: has joined #ruby
[02:22:05] alex189: @Dark_Arc, could you please help with adding pages to nav dynamically
[02:23:02] alex189: @Dark_Arc , this is what I have in routes.rb get ':title', to: 'pages#show', but I need links in nav that will show if page exists
[02:23:31] Canucktux: has left #ruby: ("http://quassel-irc.org - Chat comfortably. Anywhere.")
[02:24:57] milardovich: has joined #ruby
[02:27:11] jrafanie: has joined #ruby
[02:33:38] sunrunner20: has joined #ruby
[02:35:23] Cohedrin: has joined #ruby
[02:36:55] mrgrieve1: has joined #ruby
[02:37:11] impermanence: has joined #ruby
[02:38:45] impermanence: I've seen now multiple sources that say Rubyists avoid more traditional loop structures like while, until, for, etc. for iterators like "each". Buuuuuut...isn't each just backed by a for loop or something? Seriously, what's the advantage?
[02:40:33] olivier__: has joined #ruby
[02:41:22] skweek: has joined #ruby
[02:42:45] mim1k: has joined #ruby
[02:43:15] Rodya_: has joined #ruby
[02:43:25] adam12: impermanence: each is backed by the Enumerable module, which has tons of goodies
[02:43:33] adam12: like chaining methods
[02:43:35] agent_white: has joined #ruby
[02:44:14] impermanence: adam12: neat...I'm just saying that it's loops all the way down...
[02:44:29] adam12: impermanence: It is, kinda, but not the same type of loops
[02:44:36] adam12: .. I guess
[02:45:05] adam12: while / until, etc can replace each, but not select, reject, any, etc.
[02:45:08] elomatreb: each isn't backed by a for loop, in fact the for loop construct is just syntax sugar for calling each
[02:45:08] soloscshaw: has joined #ruby
[02:45:20] SpikeMaster: has joined #ruby
[02:47:07] Cohedrin: has joined #ruby
[02:47:14] alex189: guys , help please!, in my nav I have <% @pages.each do |p| %> <li><%= link_to p.title %></li> <% end %>, but when I select it, I get SELECT "pages".* FROM "pages", how can I access the title ?
[02:47:23] impermanence: elomatreb: you mean at like the "c level" or whatever...?
[02:48:12] elomatreb: No, in Ruby. The C source for Ruby of course uses C-like for/while loops
[02:49:24] SpikeMaster: has left #ruby: ("ERC (IRC client for Emacs 26.0.50)")
[02:51:11] impermanence: elomatreb: well...that all may be...but what I'm asking is: in whatever language "each" is actually implemented in behind Ruby...each is some type of classical loop...or no?
[02:51:24] ruby[bot]: -b *!*@2607:fb90:9147:60ca:71b5:9f74:429f:47e1$#ruby-banned
[02:52:48] gr33n7007h: impermanence: a for loop
[02:53:50] gr33n7007h: oh, it was already said
[02:56:41] impermanence: gr33n7007h: k, so then basically the benefit of each is that it has some cool functions/methods tied to it?
[02:58:03] gr33n7007h: it just a for loop underneath
[02:58:41] armando: has joined #ruby
[02:59:38] elomatreb: You can redefine each for different contexts. Think e.g. of lazy enumeration
[02:59:43] __Yiota: has joined #ruby
[03:03:13] Guest96: has joined #ruby
[03:03:16] Don_John: has joined #ruby
[03:05:20] chagel: has joined #ruby
[03:12:41] sunrunner20: has joined #ruby
[03:14:41] gix: has joined #ruby
[03:18:21] cam27: has joined #ruby
[03:23:28] gusrub: has joined #ruby
[03:31:50] xall: has joined #ruby
[03:37:37] bronson: has joined #ruby
[03:39:33] sunrunner20: has joined #ruby
[03:40:16] raul782: has joined #ruby
[03:43:08] rkellermeyer: has joined #ruby
[03:45:41] soloscshaw: has joined #ruby
[03:53:43] howdoi: has joined #ruby
[03:57:10] _whitelogger: has joined #ruby
[03:59:37] milardovich: has joined #ruby
[04:00:10] hndk: has joined #ruby
[04:01:10] Cohedrin: has joined #ruby
[04:01:37] olivier__: has joined #ruby
[04:04:25] Cohedrin: has joined #ruby
[04:11:03] Bock: has joined #ruby
[04:13:17] jusa: has joined #ruby
[04:13:52] Bock: has joined #ruby
[04:16:12] moei: has left #ruby: ("Leaving...")
[04:17:39] Cohedrin: has joined #ruby
[04:22:41] sunrunner20: has joined #ruby
[04:23:52] rgr_: has joined #ruby
[04:26:03] mattp__: has joined #ruby
[04:30:16] astrobunny: has joined #ruby
[04:35:44] renchan: has joined #ruby
[04:39:11] _whitelogger: has joined #ruby
[04:43:17] mim1k: has joined #ruby
[04:45:13] SleepySensei: has joined #ruby
[04:46:23] soloscshaw: has joined #ruby
[04:48:19] sunrunner20: has joined #ruby
[04:48:22] Cohedrin: has joined #ruby
[04:48:54] nobitanobi: has joined #ruby
[04:59:53] chagel: has joined #ruby
[05:07:20] Bounga``: has joined #ruby
[05:11:43] ferr: has joined #ruby
[05:12:22] anisha: has joined #ruby
[05:13:24] patarr: has joined #ruby
[05:16:01] akkad_: has joined #ruby
[05:16:13] JoshS: has joined #ruby
[05:21:26] Bounga``: has joined #ruby
[05:25:22] chagel: has joined #ruby
[05:26:51] madhatter: has joined #ruby
[05:27:10] yogg-saron: has joined #ruby
[05:28:11] tvw: has joined #ruby
[05:28:50] libastral: has joined #ruby
[05:29:56] sunrunner20: has joined #ruby
[05:35:00] toretore: has joined #ruby
[05:35:13] xall_: has joined #ruby
[05:46:08] infy: has joined #ruby
[05:46:54] JoshS: has joined #ruby
[05:47:05] soloscshaw: has joined #ruby
[05:48:40] esObe_: has joined #ruby
[05:49:41] raul782: has joined #ruby
[05:56:09] Jameser`: has joined #ruby
[05:56:53] jeffaustin81: has joined #ruby
[05:57:10] Cohedrin: has joined #ruby
[06:03:13] cschneid_: has joined #ruby
[06:04:09] soloscshaw: has joined #ruby
[06:04:43] sunrunner20: has joined #ruby
[06:09:12] yogg-saron: has joined #ruby
[06:12:22] cgfbee: has joined #ruby
[06:26:17] Silthias: has joined #ruby
[06:27:50] kke_: gem build should have some sort of option to give the output filename (and gem build --install) . doing something like "gem build foo.gemspec && gem install foo-*.gem" will install whatever versions you have in that dir
[06:28:39] AlexRussia: has joined #ruby
[06:30:32] last_staff: has joined #ruby
[06:33:58] sunrunner20: has joined #ruby
[06:34:49] kke_: i guess i have to do something like "gem build foo.gem && gem install `ls -t foo-*.gem|head -1`" in dockerfile
[06:39:13] oleo: has joined #ruby
[06:41:32] conta: has joined #ruby
[06:43:50] mim1k: has joined #ruby
[06:43:54] Hanmac: has joined #ruby
[06:48:27] kke_: i wonder what happens if i push a gem with conditional dependencies to rubygems?
[06:53:48] aedorn: has joined #ruby
[06:56:35] nobitanobi: has joined #ruby
[07:11:09] charliesome: has joined #ruby
[07:11:24] sunrunner20: has joined #ruby
[07:14:18] patarr: has joined #ruby
[07:18:08] aufi: has joined #ruby
[07:23:42] mark_66: has joined #ruby
[07:25:15] tomphp: has joined #ruby
[07:27:27] brent__: has joined #ruby
[07:28:14] AlexRussia: has joined #ruby
[07:30:36] antgel: has joined #ruby
[07:30:58] cgfbee: has joined #ruby
[07:33:33] maattdd: has joined #ruby
[07:36:03] minimalism: has joined #ruby
[07:42:22] cgfbee: has joined #ruby
[07:42:45] DoubleMalt: has joined #ruby
[07:44:27] burgestrand: has joined #ruby
[07:46:45] mim1k: has joined #ruby
[07:53:32] mdw: has joined #ruby
[07:55:00] xenops: has joined #ruby
[07:56:28] mjora7: has joined #ruby
[07:57:22] blackmesa: has joined #ruby
[07:58:55] lhambley: has joined #ruby
[07:59:21] sunrunner20: has joined #ruby
[08:01:44] Jameser: has joined #ruby
[08:08:14] jaruga: has joined #ruby
[08:11:12] biberu: has joined #ruby
[08:12:43] Bounga``: has joined #ruby
[08:16:45] mburns: has joined #ruby
[08:17:04] jaredrhine: has joined #ruby
[08:19:10] jsrn_: has joined #ruby
[08:21:26] mikecmpbll: has joined #ruby
[08:24:00] TomyLobo3: has joined #ruby
[08:26:48] andikr: has joined #ruby
[08:31:05] mim1k: has joined #ruby
[08:31:42] esObe_: has joined #ruby
[08:31:43] aupadhye: has joined #ruby
[08:32:41] sunrunner20: has joined #ruby
[08:36:59] marr: has joined #ruby
[08:37:23] dionysus69: has joined #ruby
[08:38:10] outreachdan: has joined #ruby
[08:41:03] nobitanobi: has joined #ruby
[08:41:09] vondruch: has joined #ruby
[08:41:59] Qchmqs: has joined #ruby
[08:46:04] guardianx: has joined #ruby
[08:46:08] dangerousdave: has joined #ruby
[08:48:55] yogg-saron: has joined #ruby
[08:48:55] xall: has joined #ruby
[08:51:29] pandaant: has joined #ruby
[08:53:36] AlexRussia: has joined #ruby
[08:53:41] impermanence: has joined #ruby
[08:53:43] mdw: has joined #ruby
[08:54:37] djbkd: has joined #ruby
[08:55:05] dhollinger: has joined #ruby
[08:56:00] lxsameer: has joined #ruby
[08:56:01] lxsameer: has joined #ruby
[08:56:56] Cohedrin: has joined #ruby
[08:58:33] mjora7: has joined #ruby
[08:58:48] DrCode: has joined #ruby
[09:00:08] binaryplease: has joined #ruby
[09:01:21] mjora7: has joined #ruby
[09:04:03] sunrunner20: has joined #ruby
[09:11:03] Beams: has joined #ruby
[09:14:49] patarr: has joined #ruby
[09:14:59] zachary12: has joined #ruby
[09:15:40] esObe__: has joined #ruby
[09:18:33] cfec0b8d: has joined #ruby
[09:20:53] olivier__: has joined #ruby
[09:24:04] User458764: has joined #ruby
[09:27:37] jamesaxl: has joined #ruby
[09:27:43] beauby: has joined #ruby
[09:28:25] workmad3: has joined #ruby
[09:28:47] naftilos76: has joined #ruby
[09:31:54] vondruch: has joined #ruby
[09:33:27] naftilos76: has joined #ruby
[09:34:18] cpaterson: has joined #ruby
[09:39:42] adgtl: has left #ruby: ("Textual IRC Client: www.textualapp.com")
[09:41:03] sunrunner20: has joined #ruby
[09:43:02] brent__: has joined #ruby
[09:48:20] chagel: has joined #ruby
[09:52:18] aspiers: has joined #ruby
[09:58:51] Hanmac: has joined #ruby
[10:06:03] govg: has joined #ruby
[10:12:07] mdw: has joined #ruby
[10:12:59] nobodyzxc: has joined #ruby
[10:17:18] sunrunner20: has joined #ruby
[10:17:41] mdw: has joined #ruby
[10:22:22] mjora7: has joined #ruby
[10:23:00] flying: has joined #ruby
[10:26:44] outreachdan: has joined #ruby
[10:32:14] darix: kke_: there are a few like that already
[10:36:56] duckpuppy: has joined #ruby
[10:39:20] rkazak: has joined #ruby
[10:43:35] kke_: how do they look on the web?
[10:43:44] xall: has joined #ruby
[10:47:06] aupadhye: has joined #ruby
[10:48:29] HoierM: has joined #ruby
[10:51:41] binaryplease1: has joined #ruby
[10:53:10] sunrunner20: has joined #ruby
[10:55:55] TreyG: has joined #ruby
[10:56:20] KCmetro: has joined #ruby
[11:01:27] cschneid_: has joined #ruby
[11:02:47] vondruch: has joined #ruby
[11:04:42] patarr: has joined #ruby
[11:06:37] bsartek: has joined #ruby
[11:09:15] latemus: has joined #ruby
[11:15:19] jaruga: has joined #ruby
[11:15:49] qsx: how could i make line 8 here a little less ugly? http://dpaste.com/383W4TA
[11:17:11] Guest96: has joined #ruby
[11:19:36] gr33n7007h: qsx: you could put all the filter.begins in an array
[11:20:05] gr33n7007h: then do filer.present & [filter.begins].inject :|
[11:21:31] kke_: qsx: i guess you could "include Net::LDAP::Filter" and then drop the Net::LDAP::Filter from the line
[11:21:42] olivier__: has joined #ruby
[11:22:04] burgestrand: has joined #ruby
[11:22:53] Ishido: has joined #ruby
[11:24:14] antgel: has joined #ruby
[11:26:02] Verity: Could someone please help me install pcaprub on windows
[11:26:04] Verity: I'm failing hard
[11:26:09] Verity: (for days)
[11:26:55] Verity: https://github.com/pcaprub/pcaprub gem install pcaprub --no-ri --no-rdoc -- --with-pcap-dir="c:/dev/src/WpdPack" A bunch of undefined reference errors and then: c:/rubydev/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w64-mingw32/bin/ld.exe: pcaprub.o: bad reloc address 0x0 in section `.pdata'
[11:28:04] sunrunner20: has joined #ruby
[11:28:28] Guest96_: has joined #ruby
[11:30:25] qsx: gr33n7007h: how would i do that?
[11:30:42] gr33n7007h: qsx: https://gist.github.com/gr33n7007h/34a3200731a29708fb199f17d6e22533
[11:30:51] sepp2k: has joined #ruby
[11:30:54] hightower3: has joined #ruby
[11:31:24] hightower3: Hey, I am in the IRB shell and I am trying to find the variable containing the IRB shell history. Any pointers as to where is it?
[11:31:38] zachary12: has joined #ruby
[11:31:50] adgtl: has joined #ruby
[11:33:16] duckpuppy: has joined #ruby
[11:33:17] latemus: has joined #ruby
[11:33:21] hightower3: I see "HISTORY", but it contains the filename in which history will be saved, and not the actual content/lines
[11:33:30] jusa: has joined #ruby
[11:34:01] qsx: gr33n7007h: hmh. what i meant was all the repetition of Net::LDAP::Filter, which you also solved with include
[11:34:51] vali: has joined #ruby
[11:35:09] kke_: Verity: it would probably work fine in the windows subsystem for linux that is in win10 (aka "bash for windows") if you can use that.
[11:35:32] rhyselsmore: has joined #ruby
[11:36:48] latemus: has joined #ruby
[11:37:58] Verity: I fixed it myself.
[11:38:06] Verity: I downgraded to ruby 1.9 and matching dev kit
[11:38:42] Verity: that only fixed pcaprub... hmm
[11:38:50] Verity: but now my issue is this ruby is too old for packetfu
[11:38:57] kke_: hightower3: Readline::HISTORY.to_a maybe
[11:39:01] Verity: maybe this one wont be cross platform
[11:39:21] gr33n7007h: hightower3: irb disables history by default
[11:39:38] hightower3: gr33n7007h, yes, yes, I enabled it
[11:39:49] hightower3: kke_, awesome, that's it, thanks. I kept looking within the IRB namespace
[11:40:00] Verity: fixed agaiun, used -v to install an older gem
[11:40:12] kke_: hightower3: it may not be the same on every environment though
[11:40:35] nadir: has joined #ruby
[11:40:38] kke_: if you need it for creating something other people will use.
[11:41:22] ldnunes: has joined #ruby
[11:42:53] hightower3: kke_, it's fine, I just wanted to check the size of all strings in it
[11:43:13] faces: has joined #ruby
[11:45:15] Verity: Ruby 1.9.3 and Packetfu 1.1.11 are the combo for windows 7, if anyone else has this issue
[11:47:09] sunrunner20: has joined #ruby
[11:49:38] TvL: has joined #ruby
[11:51:35] Verity: how can I return a list of interfaces cross platform
[11:51:43] lhambley: has joined #ruby
[11:52:53] duckpuppy: has joined #ruby
[11:54:31] Verity: on ruby 1.9.3
[11:54:37] cyphase: has joined #ruby
[11:55:59] Silthias1: has joined #ruby
[11:56:12] Verity: Socket.getifaddrs (available since Ruby 2.1).
[11:56:48] Verity: http://www.rubydoc.info/gems/network_interface/0.0.1
[11:56:58] Verity: how do you learn to use a gem with no docs
[11:57:09] gr33n7007h: Verity: no one should be using 1.9 anymore. just saying.
[11:57:43] Verity: gr33n7007h, its an assignment, nothing production
[11:57:47] Verity: just want to get it done now
[11:57:49] hndk: has joined #ruby
[11:58:04] olivier__: has joined #ruby
[11:58:49] cam27: has joined #ruby
[12:05:23] gr33n7007h: Verity: are you going to use network_interfaces?
[12:09:31] Verity: going to try
[12:09:41] Verity: I dont know where to begin with no docs
[12:09:56] Verity: so I was guesssing at how to use it, but with no object to call .methods? on I'm not sure how to beguin
[12:10:59] blackmesa: has joined #ruby
[12:11:23] gr33n7007h: NetworkInterface.interfaces ?
[12:13:37] lee_j: has joined #ruby
[12:14:46] synthroid: has joined #ruby
[12:14:47] jusa: has joined #ruby
[12:16:06] lhambley: has joined #ruby
[12:16:16] Verity: that sort of worked
[12:16:25] Verity: I have to run for a bit, I'll return later to test more
[12:18:07] Seenox: has joined #ruby
[12:18:42] synthroid: has joined #ruby
[12:18:50] Seenox: Hello. What is the best way to have a "grep" like functionality in a ruby output?
[12:19:21] apeiros: Seenox: pipe through grep
[12:19:51] Seenox: apeiros: ruby file.rb | grep "xx" ?
[12:19:59] apeiros: f.ex., yes
[12:20:13] Seenox: apeiros: Thanks.
[12:24:52] gnufied: has joined #ruby
[12:25:38] olivier__: has joined #ruby
[12:26:46] Seenox: apeiros: Are there any other way to implement something like that in a ruby file itself?
[12:27:13] apeiros: of course. but how much of greps functionality do you want to copy/implement? the tool is rather powerful…
[12:27:14] sunrunner20: has joined #ruby
[12:31:51] sheepman: has joined #ruby
[12:32:42] impermanence: has joined #ruby
[12:34:18] unshadow: has joined #ruby
[12:35:04] mim1k: has joined #ruby
[12:35:28] dangerousdave: has joined #ruby
[12:36:31] charliesome: has joined #ruby
[12:36:33] binaryplease1: has joined #ruby
[12:36:42] tomphp: has joined #ruby
[12:37:32] Guest96: has joined #ruby
[12:39:12] Seenox: apeiros: Sorry for late reply. Yes, I need to figure that out first.
[12:39:33] pupsicle: has joined #ruby
[12:40:05] Seenox: apeiros: The goal is to read manifest.mf files data, sort them, clean them and pass it to another file.
[12:41:31] burgestrand: has joined #ruby
[12:44:06] rkellermeyer: has joined #ruby
[12:50:20] flying: has joined #ruby
[12:52:01] lhambley: has joined #ruby
[12:54:39] kke_: Seenox: well, ruby is a programming language, you can read, manipulate and output data as you please. reading and writing files is usually the second chapter in any programming tutorial right after the hello world part.
[12:57:07] hashrocket: has joined #ruby
[12:59:24] ramortegui: has joined #ruby
[13:00:38] sspreitz: has joined #ruby
[13:02:03] dangerousdave: has joined #ruby
[13:02:11] cschneid_: has joined #ruby
[13:04:05] arne_: has joined #ruby
[13:04:26] arne_: is there an clever way to map and have a sum in there?
[13:05:00] arne_: a.e. [[1,2],[2,2],[3,2]] => [[1,2],[2,4],[3,6]]
[13:05:11] arne_: where the e.last always gets added up?
[13:06:39] enterprisey: has joined #ruby
[13:07:50] mim1k: has joined #ruby
[13:09:31] camilasan: has joined #ruby
[13:10:42] Guest96_: has joined #ruby
[13:10:58] binaryplease: has joined #ruby
[13:11:42] toretore: arne_: reduce
[13:12:07] Guest96: has joined #ruby
[13:12:21] rfoust: has joined #ruby
[13:12:25] hinbody: I have a couple small scripts to accept input and save it to a file. They currently work fine, but I have an infinite loop asking for input and just use Ctrl-C to stop it when I'm done. Is there any reason not to do this?
[13:12:48] hinbody: currently and in the forseeable future, I will be the only one using these.
[13:12:54] ljarvis: hinbody: if you dont need to do any cleanup, then it's fine
[13:13:08] ljarvis: but you can capture Ctrl-C and do cleanup if you need to
[13:13:13] sunrunner20: has joined #ruby
[13:13:17] ljarvis: and then exit gracefully
[13:13:29] hinbody: ljarvis: hmmmmmm, what about closing the files? I haven't seena any negative side affects
[13:13:45] ljarvis: hinbody: do you close them outside of the loop?
[13:14:03] toretore: hinbody: it's much easier to give advice after seeing the actual code
[13:14:13] hinbody: I do ljarvis
[13:14:20] ljarvis: basically, this is fine: loop { do_everything }; this is not: loop { do something; } do something else
[13:14:29] ljarvis: yeah the code would absolutely help
[13:14:30] gr33n7007h: arne_: or map
[13:14:36] millerti: has joined #ruby
[13:14:57] dasher^0_o: has joined #ruby
[13:15:12] bascht1: has joined #ruby
[13:15:17] hinbody: okay, that makes sense ljarvis, thanks
[13:15:30] arne_: toretore: where do i save the sum in the reduce.. i mean it looks very ugly
[13:15:48] gr33n7007h: arne_: a.map { |k, v| [k, k*v] }
[13:16:12] hinbody: I understand sharing the code is better, but some of it I can't, and this was more generalized about using Ctrl-C to end the script.
[13:16:13] arne_: gr33n7007h: oh no no, i dont want to multiply by k
[13:16:25] hinbody: ljarvis toretore thanks for the input. This helps
[13:16:29] arne_: i basicially want arr.map! { |x| [x.first,sum+=x.last]}
[13:16:39] nanoz: has joined #ruby
[13:16:39] nanoz: has joined #ruby
[13:17:17] ljarvis: arne_: that's why you want reduce as toretore suggested
[13:17:32] Seenox: kke_: Yeah, thanks.
[13:17:39] gr33n7007h: ah, sorry misunderstood
[13:18:00] arne_: ljarvis: yeah still. i don't know how that would look pretty. i wrote one, but thats even worse
[13:18:07] arne_: input.reduce([]){|p, c| p.length == 0? p.push(c):p.push([c.first, p.last.last.to_i + c.last])}
[13:18:18] arne_: and doesn't look very performant eas
[13:19:33] mdw: has joined #ruby
[13:20:56] petruff: has joined #ruby
[13:25:49] soloscshaw: has joined #ruby
[13:27:32] ljarvis: arne_: tbh i would probably just write something like
[13:27:34] ljarvis: >> sum = 0; [[1,2],[2,2],[3,2]].map { |(k, v)| [k, sum += v] }
[13:27:35] ruby[bot]: ljarvis: # => [[1, 2], [2, 4], [3, 6]] (https://eval.in/783871)
[13:29:06] apeiros: Seenox: Enumerable#grep is the minimalist answer to your question. the non-minimalist answer depends on your specifics ;-)
[13:30:10] ikopico: arne_ ljarvis I agree with ljarvis in this case it's better to avoid the "one liner" IMO as well
[13:30:42] aupadhye|t: has joined #ruby
[13:31:27] pupsicle: has joined #ruby
[13:33:02] fschuindt: has joined #ruby
[13:34:30] ikopico: arne_: if you insist on one liner, you might be able to do something like
[13:34:33] ikopico: >> [[1,2], [2,2], [3,2]].inject([]) {|tmp, arr| tmp << [arr.first, (tmp.empty? ? arr.last : tmp.last.last)]}
[13:34:34] ruby[bot]: ikopico: # => [[1, 2], [2, 2], [3, 2]] (https://eval.in/783873)
[13:34:49] ikopico: Well, with a few modifications it'll work
[13:35:14] cschneid_: has joined #ruby
[13:36:31] bkxd: has joined #ruby
[13:37:46] ikopico: >> [[1,2], [2,2], [3,2]].inject([]) {|tmp, arr| tmp << [arr.first, (tmp.empty? ? arr.last : arr.last + tmp.last.last)]}
[13:37:51] ruby[bot]: ikopico: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[13:37:59] blackmesa: has joined #ruby
[13:38:31] Doow: has joined #ruby
[13:38:51] canton7: I hate stuff that mutates inside #inject. That kinda defeats the point of inject
[13:39:08] DLSteve: has joined #ruby
[13:39:12] ljarvis: yep, should be each_with_object
[13:40:59] ljarvis: >> [[1,2], [2,2], [3,2]].each_with_object([]) { |(l, r), a| a << [l, (a.last&.last || 0) + r] }
[13:41:01] ruby[bot]: ljarvis: # => [[1, 2], [2, 4], [3, 6]] (https://eval.in/783874)
[13:41:13] johnson[m]: has joined #ruby
[13:43:03] rwb: has joined #ruby
[13:43:15] ikopico: Good point, nice ljarvis. Still better in this case probably to do a not-one-line solution (like you mentioned)
[13:43:37] ljarvis: yeah I'd go for the map solution myself
[13:44:40] valentinul: has joined #ruby
[13:44:47] impermanence: has joined #ruby
[13:45:52] patarr: has joined #ruby
[13:47:40] sunrunner20: has joined #ruby
[13:48:13] aupadhye|t: has joined #ruby
[13:56:53] raul782: has joined #ruby
[13:57:00] Jameser: has joined #ruby
[13:57:17] Guest96_: has joined #ruby
[13:58:55] |RicharD|: has joined #ruby
[13:59:39] cdg: has joined #ruby
[14:00:11] rkellermeyer: has joined #ruby
[14:07:38] rkellermeyer: has joined #ruby
[14:08:11] Guest96: has joined #ruby
[14:09:24] millerti: has joined #ruby
[14:11:37] __Yiota: has joined #ruby
[14:13:46] Gran_Mal: has joined #ruby
[14:14:22] hotpancakes: has joined #ruby
[14:14:47] Doow: Hi, I'm trying to execute an external command. I want to print the output continously. I want to return the output so I can parse it. I want to check the return code of external command.
[14:15:07] Guest96: has joined #ruby
[14:15:09] ResidentBiscuit: has joined #ruby
[14:15:34] ResidentBiscuit: has joined #ruby
[14:17:17] KCmetro: has joined #ruby
[14:17:30] ikopico: Doow: https://docs.ruby-lang.org/en/2.0.0/Open3.html
[14:18:31] Doow: ikopico, I've looked at that, but I can't figure out how to check the return value
[14:18:53] ltem: has joined #ruby
[14:20:47] Silthias: has joined #ruby
[14:20:52] Guest96_: has joined #ruby
[14:22:25] ikopico: Doow: something like this https://pastebin.com/pSCBJMZP
[14:22:26] ruby[bot]: ikopico: we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/a8d1d38e884382094b531026aa081e64
[14:22:28] ruby[bot]: ikopico: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[14:22:56] olivier__: has joined #ruby
[14:26:40] soloscshaw: has joined #ruby
[14:27:02] Doow: ikopico, that worked great, thank you!
[14:28:20] ikopico: Doow: NP. Probably better in some cases to use Open3#popen3, which separate between stdout and stderr.
[14:29:59] t-recx: has joined #ruby
[14:31:12] cdg_: has joined #ruby
[14:36:52] michele: has joined #ruby
[14:37:40] michele: I have a 6 lines with plain gsubs matching regex mostly the same: https://glot.io/snippets/epbyb6558e
[14:37:47] michele: is there a way i can optimize these lines?
[14:38:25] electrostat: has joined #ruby
[14:40:12] armando: has joined #ruby
[14:41:09] shinnya: has joined #ruby
[14:42:42] theunraveler: has joined #ruby
[14:43:50] ljarvis: michele: you have some that are complete duplicates
[14:43:56] ljarvis: is that an accident?
[14:44:38] tercenya: has joined #ruby
[14:46:08] michele: sorry ljarvis , yes I made a mistake: here's the correct one: https://glot.io/snippets/epbyjrququ
[14:46:50] mustmodify: has left #ruby: ()
[14:47:33] ljarvis: michele: firstly, you can use //i to ignore case
[14:47:51] ljarvis: so /BananA/i will match "banana"
[14:48:25] michele: ljarvis yeah but then how to properly substitute the correct version in gsub?
[14:48:36] electrostat: has joined #ruby
[14:48:52] anisha: has joined #ruby
[14:49:55] ljarvis: ah I missed that, basically you cant. FWIW though do you actually need the case statement?
[14:51:57] Seenox: apeiros: Thanks.
[14:52:57] scorphus: has joined #ruby
[14:53:21] synthroid: has joined #ruby
[14:53:49] Guest96: has joined #ruby
[14:54:56] michele: ljarvis yes there are other unrelated conditions in there
[14:55:10] michele: ljarvis i wanted to optimize all those cases though
[14:55:19] Doow: ikopico, is there any way I can get the return value as a number (without resorting to string parsing of "pid 236 exit 3")?
[14:56:06] boombox_: has joined #ruby
[14:57:05] aglorei: has joined #ruby
[14:57:10] dhollinger: has joined #ruby
[14:57:20] Doow: nm, I solved it myself :)
[14:57:56] jphase: has joined #ruby
[14:59:45] ikopico: Doow: wait_thr.value.exitstatus
[14:59:55] nowhereman: has joined #ruby
[15:00:40] duckly: has joined #ruby
[15:01:15] chihhsin: has joined #ruby
[15:01:44] AlexRussia: has joined #ruby
[15:01:50] yeticry_: has joined #ruby
[15:04:53] vali: has joined #ruby
[15:08:06] olivier__: has joined #ruby
[15:14:09] hexcat: has joined #ruby
[15:14:42] dcunit3d: has joined #ruby
[15:17:12] cschneid_: has joined #ruby
[15:17:39] cek: guys wtf happening with #to_s in Array. print calls it, puts doesn't
[15:17:44] conta: has joined #ruby
[15:17:57] rippa: has joined #ruby
[15:18:51] apeiros: michele: it's not possible to say from the given excerpt, but you could probably just `str.gsub(/banana|bananum/, 'peach').gsub(/Banana|Bananum/, 'Peach')`
[15:19:04] millerti: has joined #ruby
[15:19:45] apeiros: cek: that's not because of something happening to Array#to_s. it's how puts behaves when getting an array as arg (and afaik did since 1.8 or even before)
[15:20:36] cek: so you say it splats it?
[15:21:18] apeiros: &ri IO#puts cek
[15:21:18] `derpy: cek: http://ruby-doc.org/core-2.4.1/IO.html#method-i-puts
[15:21:45] apeiros: pro-tip: when stuff doesn't behave the way you expect, then first thing you do is read the docs.
[15:21:49] dc2: has joined #ruby
[15:21:58] blaisebool: hello all, could someone help me with this ? https://pastebin.com/QqPiq0uU
[15:22:00] ruby[bot]: blaisebool: we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/82074ff203b96449a9895968d2d24265
[15:22:02] ruby[bot]: blaisebool: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[15:22:33] olivier__: has joined #ruby
[15:22:33] apeiros: blaisebool: you're trying to parse something which isn't json as json and ruby complains - what's your problem exactly?
[15:23:00] cek: if (rb_exec_recursive(io_puts_ary, argv[i], out)) { -- yeah i see now
[15:23:10] cek: what a nonsense exception
[15:23:32] apeiros: cek: of course, you can also read the source if you're too bored by the docs bluntly stating it…
[15:23:38] blaisebool: apeiros to output each ohai key by looping json object
[15:23:48] polishdub: has joined #ruby
[15:24:19] hotpancakes: has joined #ruby
[15:25:04] apeiros: blaisebool: what? again, the stuff you're parsing is *not* valid json.
[15:25:33] apeiros: (and doesn't have any keys in it either)
[15:25:56] rkellermeyer: has joined #ruby
[15:26:14] hogetaro: has joined #ruby
[15:27:04] soloscshaw: has joined #ruby
[15:27:58] cek: JSON.parse(ohai)
[15:28:21] KCmetro_: has joined #ruby
[15:29:24] KCmetro_: has joined #ruby
[15:29:45] blaisebool: I'm trying to do something like https://gist.github.com/MacFlurry/42f02e9fe8c24f4f7e4127b196ec4e64
[15:30:12] blaisebool: the code's comming from "mastering chef"
[15:30:19] impermanence: has joined #ruby
[15:30:30] olivier__: has joined #ruby
[15:31:06] apeiros: blaisebool: ok, look, 'ohai' is a string containing the text 'ohai'. ohai is a local variable or method named 'ohai'.
[15:31:12] apeiros: the former is not valid json on its own
[15:31:27] apeiros: the latter must come from somewhere, and doesn't exist in your example code
[15:31:50] charliesome: has joined #ruby
[15:31:50] apeiros: so… you're leaving out something.
[15:33:00] havenwood: blaisebool: like apeiros said, undefined local variable or method `ohai'
[15:33:03] cek: JSON.parse(`ohai`)
[15:33:43] blaisebool: cek that's it, my bad
[15:33:50] havenwood: blaisebool: You can replace likes 3-6 with: abort 'that msg' unless ARGV.one?
[15:33:52] KCmetro: has joined #ruby
[15:34:20] havenwood: It'll still exit 1 but the puts will be STDERR.puts instead and it'll respect silencing warnings.
[15:34:45] cek: has left #ruby: ()
[15:35:04] knight33: has joined #ruby
[15:35:30] hexcat: has left #ruby: ("Leaving")
[15:36:19] blaisebool: havenwood perfect.
[15:36:34] blaisebool: thanks to all
[15:38:32] hotpancakes: has joined #ruby
[15:41:17] RobertBirnie: has joined #ruby
[15:41:18] chouhoulis: has joined #ruby
[15:42:34] MasterAsia: has joined #ruby
[15:43:21] nicesignal: has joined #ruby
[15:43:46] millerti: has joined #ruby
[15:48:42] RobertBirnie: has joined #ruby
[15:51:22] brent__: has joined #ruby
[15:52:23] choke: has joined #ruby
[15:52:45] chouhoulis: has joined #ruby
[15:53:01] flying: has joined #ruby
[15:53:43] outreachdan: has joined #ruby
[15:54:10] bsartek: has joined #ruby
[15:56:49] cagomez: has joined #ruby
[15:56:54] amclain: has joined #ruby
[15:57:57] renchan: has joined #ruby
[16:00:14] mostlybadfly: has joined #ruby
[16:02:24] [Butch]: has joined #ruby
[16:02:54] davidmichaelkarr: has joined #ruby
[16:03:18] negatifze: has joined #ruby
[16:04:57] jamesaxl: has joined #ruby
[16:05:08] jackrandom: has joined #ruby
[16:07:29] hotpancakes: has joined #ruby
[16:07:36] govg: has joined #ruby
[16:09:23] jackrandom: has joined #ruby
[16:09:26] nobitanobi: has joined #ruby
[16:09:29] chouhoul_: has joined #ruby
[16:10:19] blaisebool: hello, how to handle exception with Chef::HTTP::Simple.new(url).get('/')
[16:11:16] baweaver: blaisebool what have you tried?
[16:11:40] blaisebool: rescue OpenURI::HTTPError => errormsg
[16:12:21] baweaver: and what does that result in?
[16:13:05] blaisebool: not yet test it. the api is only accessible at work. and I don't know how to mock it
[16:13:22] gusrub: has joined #ruby
[16:13:30] rkellermeyer: has joined #ruby
[16:13:39] raul782: has joined #ruby
[16:14:09] cagomez: has joined #ruby
[16:14:59] baweaver: That may be a good first step then is to try and run it.
[16:15:10] blaisebool: if I can find how to retrieve json data from api and to parse and grab some json object it will help me
[16:19:09] ikopico: blaisebool: https://jsonplaceholder.typicode.com/
[16:19:24] ikopico: i.e. curl https://jsonplaceholder.typicode.com/posts
[16:22:30] blaisebool: ikopico thanks.
[16:22:42] ikopico: np blaisebool
[16:23:43] gusrub: has joined #ruby
[16:23:43] mjuszczak: has joined #ruby
[16:27:02] outreachdan: has joined #ruby
[16:27:52] hotpancakes: has joined #ruby
[16:28:09] soloscshaw: has joined #ruby
[16:29:08] ddffg: has joined #ruby
[16:29:56] JesseH: has joined #ruby
[16:30:30] michele: has left #ruby: ("Textual IRC Client: www.textualapp.com")
[16:32:13] KCmetro: has joined #ruby
[16:33:04] dc4: has joined #ruby
[16:33:25] JesseH: has left #ruby: ()
[16:33:30] KCmetro_: has joined #ruby
[16:33:43] mjuszczak: has joined #ruby
[16:34:21] jusa: has joined #ruby
[16:37:04] rkellermeyer: has joined #ruby
[16:37:21] skweek: has joined #ruby
[16:38:33] outreach_: has joined #ruby
[16:42:00] HoloIRCUser6: has joined #ruby
[16:44:20] skalfyfan: has joined #ruby
[16:48:52] duderonomy: has joined #ruby
[16:50:08] mjuszczak: has joined #ruby
[16:54:07] geekbri: has joined #ruby
[16:57:32] mim1k: has joined #ruby
[16:59:28] sfdebug: has joined #ruby
[17:00:25] duckpuppy: has joined #ruby
[17:01:07] synthroid: has joined #ruby
[17:01:17] theunraveler: has joined #ruby
[17:02:40] hobodave: has joined #ruby
[17:07:51] pupsicle: has joined #ruby
[17:08:30] mim1k: has joined #ruby
[17:09:25] patr0clus: has joined #ruby
[17:10:37] esObe_: has joined #ruby
[17:13:00] AndBobsYourUncle: has joined #ruby
[17:14:06] haylon: has joined #ruby
[17:14:48] Cohedrin: has joined #ruby
[17:15:52] SuperLag: has joined #ruby
[17:17:38] bsartek: has joined #ruby
[17:17:59] patarr: has joined #ruby
[17:20:32] snockerton: has joined #ruby
[17:21:04] Dreamer3: has joined #ruby
[17:22:45] millerti: has joined #ruby
[17:23:09] mjuszczak: has joined #ruby
[17:24:20] gusrub: has joined #ruby
[17:26:00] hotpancakes: has joined #ruby
[17:26:43] AgentVenom: has joined #ruby
[17:28:31] soloscshaw: has joined #ruby
[17:28:49] ResidentBiscuit: has joined #ruby
[17:28:53] olivier__: has joined #ruby
[17:29:17] ResidentBiscuit: has joined #ruby
[17:29:42] ResidentBiscuit: has joined #ruby
[17:30:47] t-recx: has joined #ruby
[17:34:12] patarr: has joined #ruby
[17:34:47] SeepingN: has joined #ruby
[17:35:42] mim1k: has joined #ruby
[17:39:59] gusrub: has joined #ruby
[17:44:51] jphase: has joined #ruby
[17:45:53] __butch__: has joined #ruby
[17:48:07] [Butch]: has joined #ruby
[17:49:32] last_staff: has joined #ruby
[17:49:43] mjuszczak: has joined #ruby
[17:53:43] mwlang: has joined #ruby
[17:54:20] cagomez: has joined #ruby
[17:55:21] duckpuppy: has joined #ruby
[17:56:55] PatriqueEtoile2: has joined #ruby
[17:59:22] hotpancakes: has joined #ruby
[18:00:00] unshadow: has joined #ruby
[18:00:43] duckpuppy: has joined #ruby
[18:00:58] hotpanca_: has joined #ruby
[18:01:21] negatifze: has joined #ruby
[18:01:39] shinnya: has joined #ruby
[18:03:11] brent__: has joined #ruby
[18:08:44] duckpupp1: has joined #ruby
[18:08:46] cagomez: has joined #ruby
[18:09:25] Brent___: has joined #ruby
[18:09:29] jgnagy: has joined #ruby
[18:09:39] brent__: has joined #ruby
[18:11:06] nadir: has joined #ruby
[18:14:26] mikecmpbll: has joined #ruby
[18:19:31] mim1k: has joined #ruby
[18:20:11] gigetoo: has joined #ruby
[18:20:25] dlitvak: has joined #ruby
[18:25:25] duderonomy: has joined #ruby
[18:27:57] mwlang: has joined #ruby
[18:29:16] soloscshaw: has joined #ruby
[18:29:18] hotpancakes: has joined #ruby
[18:29:36] olivier__: has joined #ruby
[18:33:11] ahrs: has joined #ruby
[18:34:27] jackrandom: has joined #ruby
[18:35:35] negatifze: has joined #ruby
[18:36:26] mochiyoda_: has joined #ruby
[18:37:47] pabst: has joined #ruby
[18:37:48] unshadow_: has joined #ruby
[18:38:06] cibs_: has joined #ruby
[18:38:10] chrisarc1nd: has joined #ruby
[18:38:11] ovaltine1: has joined #ruby
[18:38:12] rvaiya_: has joined #ruby
[18:38:22] phansch_: has joined #ruby
[18:38:23] abort_: has joined #ruby
[18:38:32] csk_: has joined #ruby
[18:38:34] reaVer_: has joined #ruby
[18:38:37] ozzloy_: has joined #ruby
[18:38:58] millerti: has joined #ruby
[18:38:59] KillerFox: has joined #ruby
[18:39:03] ule_: has joined #ruby
[18:39:05] forgot: has joined #ruby
[18:39:08] FastJack: has joined #ruby
[18:39:15] synthroid: has joined #ruby
[18:39:30] tris: has joined #ruby
[18:40:04] sonOfRa: has joined #ruby
[18:45:30] brent__: has joined #ruby
[18:50:26] rfoust: has joined #ruby
[18:50:50] rkazak: has joined #ruby
[18:52:35] unshadow: has joined #ruby
[18:55:09] dcunit3d: has joined #ruby
[18:56:14] millerti: has joined #ruby
[18:56:59] __Yiota: has joined #ruby
[18:57:29] mim1k: has joined #ruby
[18:58:14] haylon_: has joined #ruby
[18:58:31] ddffg: has joined #ruby
[18:59:44] olivier__: has joined #ruby
[19:00:32] JeanCarloMachado: has joined #ruby
[19:01:02] patarr: has joined #ruby
[19:01:35] lxsameer: has joined #ruby
[19:03:03] beauby: has joined #ruby
[19:05:00] patr0clus: has joined #ruby
[19:05:02] olivier__: has joined #ruby
[19:05:05] unshadow_: has joined #ruby
[19:06:02] JoshS: has joined #ruby
[19:07:40] ghoti: has joined #ruby
[19:09:14] olivier__: has joined #ruby
[19:10:08] Dreamer3: has joined #ruby
[19:20:36] dionysus69: has joined #ruby
[19:20:38] yqt: has joined #ruby
[19:21:38] alex``: has joined #ruby
[19:22:21] esObe_: has joined #ruby
[19:22:33] alex``: I have an issue with gir ffi and i3
[19:22:52] alex``: https://gist.github.com/alexherbo2/fb793729edf6061382f8358ab7228d1a
[19:22:59] HoloIRCUser4: has joined #ruby
[19:23:11] alex``: https://gist.github.com/alexherbo2/12e947a736af32a3d6b8f96c02f1fcc0
[19:23:33] alex``: https://github.com/acrisci/i3ipc-glib
[19:23:36] alex``: https://github.com/mvz/gir_ffi
[19:24:13] __Yiota: has joined #ruby
[19:26:34] blackmesa: has joined #ruby
[19:27:12] alex``: I don’t understand how to fix
[19:28:08] brent__: has joined #ruby
[19:28:35] blackmesa: has joined #ruby
[19:29:54] Verity: is removing a requirement from the specs a valid solution to meeting it
[19:29:59] soloscshaw: has joined #ruby
[19:30:02] lxsameer: has joined #ruby
[19:31:21] last_staff: has joined #ruby
[19:37:49] dtzuzu: has joined #ruby
[19:39:09] mim1k: has joined #ruby
[19:40:30] millerti: has joined #ruby
[19:41:54] olivier__: has joined #ruby
[19:42:09] ekinmur: has joined #ruby
[19:44:54] nobodyzxc: has joined #ruby
[19:45:01] sunrunner20: has joined #ruby
[19:48:45] synthroid: has joined #ruby
[19:50:21] enterprisey: has joined #ruby
[19:52:56] mjuszczak: has joined #ruby
[19:53:10] JoshS: has joined #ruby
[19:55:27] mjora7: has joined #ruby
[19:55:50] cagomez: has joined #ruby
[19:56:53] Don_John: has joined #ruby
[20:01:34] alazred: has joined #ruby
[20:01:34] alazred: has joined #ruby
[20:02:27] JeanCarloMachado: has joined #ruby
[20:04:05] mostlybadfly: has joined #ruby
[20:05:25] brent__: has joined #ruby
[20:06:03] rkazak: has joined #ruby
[20:10:40] beauby: has joined #ruby
[20:12:50] olivier__: has joined #ruby
[20:13:30] swills: has joined #ruby
[20:14:47] yogg-saron: has joined #ruby
[20:15:14] haylon: has joined #ruby
[20:15:24] brent__: has joined #ruby
[20:15:27] LightStalker: has joined #ruby
[20:17:01] Rutix: has joined #ruby
[20:17:01] Rutix: has joined #ruby
[20:17:25] postmodern: has joined #ruby
[20:18:38] marr: has joined #ruby
[20:21:16] cdg: has joined #ruby
[20:23:26] dhollinger: has joined #ruby
[20:24:33] pupsicle: has joined #ruby
[20:26:03] ResidentBiscuit: has joined #ruby
[20:27:07] mwlang: has joined #ruby
[20:30:17] blindMoe: has joined #ruby
[20:30:46] soloscshaw: has joined #ruby
[20:32:06] brent__: has joined #ruby
[20:32:18] pupsicle: has joined #ruby
[20:32:35] olivier__: has joined #ruby
[20:33:16] ColeHub: has joined #ruby
[20:33:37] cam27: has joined #ruby
[20:34:13] blindMoe: when I try to install rvm I get permission denied errors in /usr/local/rvm. Should that folder be writable by all users on the system or just root:rvm?
[20:35:30] olivier__: has joined #ruby
[20:37:13] ljarvis: ?rvm blindMoe
[20:37:14] ruby[bot]: ljarvis: I don't know anything about rvm
[20:37:21] ljarvis: blindMoe: #rvm
[20:38:38] synthroid: has joined #ruby
[20:39:08] baweaver: ?rvm ljarvis
[20:39:08] ruby[bot]: ljarvis: Please join #rvm for RVM questions.
[20:39:20] baweaver: ACTION shrugs
[20:39:29] griff: has joined #ruby
[20:41:31] mim1k: has joined #ruby
[20:44:31] ljarvis: ?rvm ljarvis
[20:44:31] ruby[bot]: ljarvis: Please join #rvm for RVM questions.
[20:44:41] ljarvis: ?rvm blindMoe
[20:44:42] ruby[bot]: blindMoe: Please join #rvm for RVM questions.
[20:45:01] baweaver: strange eh ljarvis?
[20:45:10] ljarvis: did you add it sekretly?
[20:45:23] blindMoe: has left #ruby: ("Yeap")
[20:46:14] ljarvis: can someone please take SOAP away from me
[20:46:40] baweaver: >> 20.times.map { %w(yes no).sample }.join(' ')
[20:46:45] ruby[bot]: baweaver: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[20:46:54] baweaver: ACTION kicks bot
[20:46:57] baweaver: >> 20.times.map { %w(yes no).sample }.join(' ')
[20:47:02] ruby[bot]: baweaver: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[20:48:17] knight33: has joined #ruby
[20:49:25] cpaterson: has joined #ruby
[20:50:32] rkazak: has joined #ruby
[20:50:34] anisha: has joined #ruby
[20:50:52] mim1k: has joined #ruby
[20:54:08] griff: has joined #ruby
[20:54:36] rkellermeyer: has joined #ruby
[20:54:58] mochiyoda_: has joined #ruby
[20:58:18] gusrub: has joined #ruby
[21:01:01] AndBobsYourUncle: has joined #ruby
[21:03:08] duckpuppy: has joined #ruby
[21:03:16] hays_: has joined #ruby
[21:03:16] hays_: has joined #ruby
[21:03:56] SeepingN: I'm trying to use ruby to run a sed command which updates a value in a dotfile. Run on command line, it works correctly. From ruby, it makes the backup as directed with -i.backup but never modifies the file. Any idea?
[21:06:32] mim1k: has joined #ruby
[21:06:42] SeepingN: ah, backslash. need more of them. :)
[21:08:34] choke: has joined #ruby
[21:09:08] loincloth: has joined #ruby
[21:09:48] mahlon: has joined #ruby
[21:10:43] SeepingN: double blackslash before ( and ) for sed matching? hmm. whatever, IT WORKS!
[21:11:06] SeepingN: oh right, one to escape ruby, one to escape find. ugh
[21:13:20] troulouliou_dev: has joined #ruby
[21:13:41] troulouliou_dev: hi how can i insstall all the gems of a specific group (developement) with bundle ?
[21:13:44] antoniobeyah: has joined #ruby
[21:14:16] baweaver: http://stackoverflow.com/a/10912661/2872906
[21:14:23] futilegames: has joined #ruby
[21:15:22] troulouliou_dev: baweaver, thats without ; i want the opposite :)
[21:15:57] baweaver: http://bundler.io/v1.14/man/bundle-install.1.html
[21:16:07] baweaver: read it backwards
[21:16:37] hotpancakes: has joined #ruby
[21:16:51] troulouliou_dev: baweaver, ok thanks :)
[21:17:35] troulouliou_dev: baweaver, spec.add_runtime_dependency 'group name ' in gemspec works too ?
[21:17:46] baweaver: Not sure offhand
[21:17:50] baweaver: I'd have to look it up
[21:18:30] lxsameer: has joined #ruby
[21:18:32] rwb: has joined #ruby
[21:19:04] troulouliou_dev: id does upon bundle install but i can't see the in gem list
[21:22:58] beauby: has joined #ruby
[21:23:48] esObe_: has joined #ruby
[21:23:52] evenix: has joined #ruby
[21:24:04] rkazak: has joined #ruby
[21:24:14] mim1k: has joined #ruby
[21:25:48] JeanCarloMachado: has joined #ruby
[21:26:15] Cohedrin: has joined #ruby
[21:26:42] patr0clus: has joined #ruby
[21:26:47] mjuszczak: has joined #ruby
[21:26:51] JeanCarloMachado: has joined #ruby
[21:27:22] mjuszczak: has joined #ruby
[21:29:33] esObe_: has joined #ruby
[21:29:51] brent__: has joined #ruby
[21:30:41] evenix: Hey guys I have a very puzzling issue. Me and my coworker are using a docker container with the EXACT same system since its on the docker-container (same ruby version, same script..) when I run the same script he's running I'm getting an error; when he does it works and he gets a 200 response. The puzzling thing is that we have the exact same version of ruby (and system..etc.. and openssl) here a gist with more info https://gist.gith
[21:30:41] evenix: ub.com/richardsondx/4fb4b3503f5ddb28079855c4d6401512 the error seem to be happening when the socket is running readline
[21:31:28] evenix: but the puzzling thing is: why is it working for him with the exact same version of ruby and not for me? (Note: It works for me sometimes when I go into byebug and go through the stacktrace etc.. sometimes the request works and return a succesfull result )
[21:31:29] soloscshaw: has joined #ruby
[21:31:41] enterprisey: has joined #ruby
[21:33:49] mim1k: has joined #ruby
[21:34:05] evenix: Also; the curl request works on my machine but not when I use ruby. I think there's an issue in net/http but its hard to pinpoint where is the issue because although we're running the code from the same image; I'm the only one experiencing the issue.
[21:34:18] evenix: any ideas? :)
[21:35:55] jgnagy: what is the actual error
[21:35:57] zenspider: evenix: repaste the url w/ the huge blob of text around it
[21:36:27] havenwood: https://gist.github.com/richardsondx/4fb4b3503f5ddb28079855c4d6401512
[21:36:29] evenix: zenspider: that same url works on other machine with the exact same code and ruby version (we're all using the same container )
[21:36:33] KCmetro: has joined #ruby
[21:36:33] zenspider: don't assume the error is in a library older than you. :P
[21:37:03] jgnagy: yeah, so "Connection reset by peer (Errno::ECONNRESET)"
[21:37:09] zenspider: this does sound like a networking / ssl issue tho
[21:37:29] jgnagy: do you have access to the logs on the server side?
[21:37:59] evenix: @jgnagy I've been testing it with this script
[21:38:14] zenspider: that probably won't even hit logging if it is ECONNRESET, it might not be hitting the stack yet
[21:38:18] jgnagy: well, that error means you got a TCP RST back from the remote end
[21:38:36] jgnagy: or something along the way
[21:39:02] evenix: @jgnagy mmh.. how do you explain that its working with no problem when someone with the exact same image runs it on their computer?
[21:39:18] jgnagy: are they on a different machine?
[21:39:22] jgnagy: maybe a different network
[21:39:26] evenix: yes but we're using docker containers
[21:39:30] zenspider: I'm not sure how docker does networking ... if it is bridged to the host computer, then you need to check the differences between the hosts. I'll assume that the docker containers are exactly the same down to the byte (you should be able to confirm that simply by the sha, right?)
[21:39:32] evenix: on the same wifi
[21:39:46] jgnagy: docker only solves for differences in your local (machine's) environment
[21:40:16] evenix: oh ok so you think that it could be the network*?
[21:40:21] jgnagy: you should be able to run tcpdump on your host machine
[21:40:45] jgnagy: assuming eth0 is the network interface your machine uses to connect to the world
[21:40:57] zenspider: that seems like overkill... but it should work
[21:41:01] evenix: tcpdump -i eth0
[21:41:39] evenix: ok so you're suggesting to compare our network? with that command?
[21:41:40] jgnagy: you can watch the packets leaving your machine (and where the RST is coming from)
[21:41:49] jgnagy: that is to compare the responses you're getting
[21:41:56] jgnagy: are you running your requests at the same time?
[21:42:17] evenix: No we're running them separately
[21:42:33] jgnagy: and are there times it works for both of you?
[21:42:39] evenix: but we tried to make a loop and my loop always fails and his always works
[21:42:55] evenix: curls always work for both of us
[21:43:14] evenix: The only time it fails is when we run the same exact script (we checked the md5sum )
[21:44:12] minimalism: has joined #ruby
[21:44:33] jgnagy: I don't see anything obviously wrong with your ruby code, nor do I know of any OpenSSL or ruby issues that would cause RSTs, especially in the way you're describing
[21:44:50] jgnagy: I would recommend the tcpdump
[21:45:06] jgnagy: because that way you can compare how the communication itself is happening
[21:45:24] rkellermeyer: has joined #ruby
[21:45:32] jgnagy: (meaning, are you both hitting the same remote IP?, where is the RST coming from?, etc.)
[21:45:57] jgnagy: tcpdump -i eth0 -n -s 65535 tcp port 443
[21:46:04] jgnagy: should help narrow it down a bit
[21:46:10] evenix: ok makes sense. This is actually a great suggestion, I'll try to explore that route. Thanks a lot
[21:46:13] jgnagy: and will give you IPs instead of names
[21:46:24] unshadow: has joined #ruby
[21:46:34] jgnagy: no problem
[21:46:42] Parsify: has joined #ruby
[21:46:49] brent__: has joined #ruby
[21:47:06] jgnagy: even when you use the same docker container, your docker daemon can be configured differently
[21:47:13] jgnagy: such as the DNS servers it uses
[21:47:23] jgnagy: which could impact why your containers do different things
[21:48:00] JeanCarl1Machado: has joined #ruby
[21:49:13] JeanCarloMachado: has joined #ruby
[21:49:36] evenix: Ok. If its not the network.. could it be something else that we didn't think about?
[21:49:45] zenspider: iirc, curl bundles its own ssl keychain
[21:50:36] baweaver: ohai zenspider
[21:51:12] JeanCarloMachado: has joined #ruby
[21:51:16] evenix: how would that impact the request since we have the same code the way the request works should in principle be the same no? (except the network part that we still have to explore )
[21:52:45] rkazak: has joined #ruby
[21:53:37] jusa: has joined #ruby
[21:54:39] evenix: I think jgnagy is probably right I'll have an answer tomorrow when we'll test. Thanks AGain! I'll share the output if I figure this out.
[21:55:19] olivier__: has joined #ruby
[21:56:25] evenix: @zenspider and the library is not older than me :p haha but good one
[21:58:52] JeanCarloMachado: has joined #ruby
[21:59:23] gusrub: has joined #ruby
[22:01:57] duckpuppy: has joined #ruby
[22:02:41] skweek: has joined #ruby
[22:03:03] olivier__: has joined #ruby
[22:03:31] jamesaxl: has joined #ruby
[22:04:02] binaryplease: has joined #ruby
[22:05:13] blackmesa: has joined #ruby
[22:07:03] mjuszczak: has joined #ruby
[22:08:36] negatifze: has joined #ruby
[22:09:12] hays_: has joined #ruby
[22:09:12] hays_: has joined #ruby
[22:10:12] enterprisey: has joined #ruby
[22:10:19] MrBismuth: has joined #ruby
[22:10:29] duper: has joined #ruby
[22:11:11] LBRapid: has joined #ruby
[22:13:45] csaunders_: has joined #ruby
[22:14:41] gimmic_: has joined #ruby
[22:14:43] Rush_: has joined #ruby
[22:14:43] govg: has joined #ruby
[22:14:51] tabakhase__: has joined #ruby
[22:14:55] lagweezl1_away: has joined #ruby
[22:15:07] ByronJoh1son: has joined #ruby
[22:15:26] Meeh: has joined #ruby
[22:15:43] yokel: has joined #ruby
[22:15:50] RushPL: has joined #ruby
[22:15:54] knight33: has joined #ruby
[22:16:36] tabakhase__: has joined #ruby
[22:16:41] bmn: has joined #ruby
[22:16:45] kenichi: has joined #ruby
[22:16:50] AndrewIsHere: has joined #ruby
[22:17:05] pwillard: has joined #ruby
[22:17:08] [spoiler]: has joined #ruby
[22:17:18] artmann_: has joined #ruby
[22:17:20] Junaos: has joined #ruby
[22:17:22] c-c: has joined #ruby
[22:17:26] dcunit3d: has joined #ruby
[22:17:27] _2easy: has joined #ruby
[22:17:28] _2easy: has joined #ruby
[22:17:30] lucas: has joined #ruby
[22:17:33] ammar: has joined #ruby
[22:17:52] nrk: has joined #ruby
[22:17:55] mclee: has joined #ruby
[22:18:34] cgfbee: has joined #ruby
[22:18:54] ohcibi: has joined #ruby
[22:18:54] rcs: has joined #ruby
[22:19:14] canton7: has joined #ruby
[22:19:16] wsmoak: has joined #ruby
[22:19:29] Nightmare: has joined #ruby
[22:20:04] Drakevr: has joined #ruby
[22:20:18] russt: has joined #ruby
[22:20:18] jrmhurst92: has joined #ruby
[22:20:22] xybr_: has joined #ruby
[22:20:57] arthurnn: has joined #ruby
[22:21:20] miah: has joined #ruby
[22:21:36] yo61: has joined #ruby
[22:21:43] Lloyd: has joined #ruby
[22:22:05] tercenya: has joined #ruby
[22:22:35] Takumo: has joined #ruby
[22:22:35] Takumo: has joined #ruby
[22:22:45] ablackack: has joined #ruby
[22:23:11] synstack: has joined #ruby
[22:25:07] Majost: has joined #ruby
[22:25:13] rhyselsmore: has joined #ruby
[22:25:20] LyndsySimon: has joined #ruby
[22:25:42] MrBloo: has joined #ruby
[22:26:07] digitalfiz: has joined #ruby
[22:26:42] mroth: has joined #ruby
[22:26:51] kapowaz: has joined #ruby
[22:27:42] rflot: has joined #ruby
[22:29:32] heyimwill: has joined #ruby
[22:32:17] soloscshaw: has joined #ruby
[22:32:49] hotpancakes: has joined #ruby
[22:33:49] varesa: has joined #ruby
[22:34:29] raul782: has joined #ruby
[22:34:39] hotpanca_: has joined #ruby
[22:34:42] brent__: has joined #ruby
[22:35:48] mjuszczak: has joined #ruby
[22:35:48] negatifze: has joined #ruby
[22:36:37] brent__: has joined #ruby
[22:37:19] cpaterson: has joined #ruby
[22:37:47] hotpancakes: has joined #ruby
[22:38:39] infernix: has joined #ruby
[22:39:25] blackwind_123: has joined #ruby
[22:42:21] hotpancakes: has joined #ruby
[22:42:25] raul7821: has joined #ruby
[22:45:21] Ropeney: has joined #ruby
[22:47:02] griff: has left #ruby: ("Textual IRC Client: www.textualapp.com")
[22:48:49] latemus: has joined #ruby
[22:49:29] duderono_: has joined #ruby
[22:49:53] zenspider: ACTION sighs
[22:49:56] zenspider: whatever dude...
[22:50:49] jgnagy: not looking for help, just curious
[22:50:55] jgnagy: anybody use Lita?
[22:51:01] jgnagy: https://www.lita.io/
[22:51:07] baweaver: Heard of, never used.
[22:51:14] latemus: has joined #ruby
[22:51:22] baweaver: How is the life of zenspider?
[22:51:26] zenspider: nope. used github's bot a bit.. forget the name
[22:51:39] baweaver: ninja'd again
[22:52:05] esObe_: has joined #ruby
[22:52:07] zenspider: "Build a culture--Having fun with your robot forms bonds and develops a sense of community." ... *sigh* that's a bit much
[22:52:42] baweaver: A juicer is heralded as the saviour of humanity here
[22:52:42] jgnagy: I like Hubot, but I really like lita
[22:53:00] jgnagy: mostly because lita, and all the plugins, are in ruby
[22:53:01] baweaver: we're not good at this thing zenspider
[22:53:31] zenspider: I'm too old and grumpy
[22:58:07] baweaver: http://i1.kym-cdn.com/photos/images/original/001/044/247/297.png
[22:58:58] blackmes1: has joined #ruby
[22:59:00] Ropeney: has joined #ruby
[23:00:38] jgnagy: yeah, I didn't write the bot or the website
[23:00:52] jgnagy: but as a tool, it is pretty handy
[23:04:18] jenrzzz: has joined #ruby
[23:04:18] jenrzzz: has joined #ruby
[23:04:19] millerti: has joined #ruby
[23:10:18] hotpancakes: has joined #ruby
[23:10:45] griff: has joined #ruby
[23:11:13] gs: has joined #ruby
[23:12:31] HoloIRCUser2: has joined #ruby
[23:13:13] balazs: has joined #ruby
[23:13:16] mjora7: has joined #ruby
[23:14:39] balazs: Does anyone have examples of updating ElasticSearch from ruby ? Looks like my updates are getting lost...
[23:14:52] jgnagy: updating how?
[23:15:11] jgnagy: I suppose to answer your question directly, yes, I do :)
[23:15:57] jgnagy: are you using https://github.com/elastic/elasticsearch-ruby
[23:15:57] patr0clus: has joined #ruby
[23:17:02] troulouliou_dev: hi wht is the regex to get a word then exactly 10 chars
[23:17:19] FastJack: has joined #ruby
[23:17:27] troulouliou_dev: like /myword(.){30}/ ?
[23:17:52] balazs: Yup; that's what I'm using.
[23:18:39] balazs: Hold on; let me try to get a minimal example...
[23:18:42] zenspider: that's not just a word that is 10 chars... that's ANYTHING that is 36 chars
[23:18:46] GodFather: has joined #ruby
[23:18:52] zenspider: define "word"
[23:19:16] zenspider: hopefully.... \w{10} should suffice
[23:19:27] troulouliou_dev: zenspider, a fixed string => banana
[23:19:53] rexb0t: has joined #ruby
[23:20:23] troulouliou_dev: zenspider, it is a an ascii string (force_encoding(Encoding::BINARY) and i would like to extract a specific word and the 10 next char
[23:20:28] balazs: jgnagy: This is what I'm passing to .update: https://pastebin.com/S1Y31QVr
[23:20:30] ruby[bot]: balazs: we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/5dce639c5e964c8d23cfa1207cbf852d
[23:20:31] ruby[bot]: balazs: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[23:20:56] zenspider: good to know that rubybot is still being forceful for our "sake"
[23:21:12] jgnagy: "banana1234567890".match /^banana(.{10})/
[23:21:41] zenspider: troulouliou_dev: by using binary you're throwing "char" out the window... if "byte" is sufficient or you want to pretend that it's ASCII underneath, then . or \w will suffice
[23:21:42] jgnagy: the first match data index 1 for that is "1234567890"
[23:22:25] zenspider: people still use .match... some things never chang. :P
[23:22:32] zenspider: like my typos
[23:22:39] troulouliou_dev: zenspider, if i have \x00 instead of any char in 123456789 it will still work ?
[23:23:03] zenspider: troulouliou_dev: you know you can try this out in irb instead of asking me, right?
[23:23:10] zenspider: irb is amazing. try it
[23:23:12] troulouliou_dev: zenspider, yeah it doesn work :)
[23:23:20] zenspider: then why did you ask that question?
[23:23:46] jgnagy: balazs I see the JSON data in your paste
[23:23:46] Puffball: has joined #ruby
[23:23:47] troulouliou_dev: maybe some kind of encoding issue at my side or something to add at then end of the regexp /blah/n ..
[23:23:57] hotpancakes: has joined #ruby
[23:24:07] jgnagy: but do you have the ruby code you're using to submit it?
[23:24:14] jgnagy: or something similar
[23:24:22] gusrub: has joined #ruby
[23:24:33] zenspider: troulouliou_dev: either ask the question you mean to ask, or go experiment and figure it out. do not expect anyone here to be psychic
[23:24:47] troulouliou_dev: zenspider, ok :)
[23:24:52] beauby: has joined #ruby
[23:24:53] aedorn: Is there a better way to keep the main Ruby thread idle while other threads are running? Outside of sleep or SomeForeverRunningThread.join?
[23:25:08] mjuszczak: has joined #ruby
[23:26:04] balazs: jgnagy: It's a 1000-line file with initialization and crap, but that is the hash I'm passing to "client.update"
[23:26:21] hotpancakes: has joined #ruby
[23:26:55] jgnagy: aedorn: run a loop that loops until some event happens so the main thread can clean up on shutdown
[23:27:13] JeanCarloMachado: has joined #ruby
[23:27:14] balazs: Something like a client.create works fine, but I couldn't find docs on exactly how those fields are supposed to be set up in the hash. So I'm just going by other examples
[23:28:09] zenspider: >> "banana\x00123456789".b[/banana.{10}/] # works for me
[23:28:10] ruby[bot]: zenspider: # => "banana\x00123456789" (https://eval.in/784082)
[23:28:24] aedorn: jgnagy: Then it constantly jumps back to that loop.. it's effectively doing the same as the others, which causes what I'm doing to slow down.
[23:29:22] patr0clus: has joined #ruby
[23:29:39] zenspider: aedorn: why outside of a sleep or join?
[23:29:48] zenspider: you want to run until the other threads are done, so why not join on them?
[23:30:00] cschneid_: has joined #ruby
[23:30:46] aedorn: zenspider: Because it's still, for whatever reason, causes things to slow down. If I run everything in irb, it's say a 5 minutes process.. but when I start it and include a sleep/join, it's more like 15
[23:31:05] aedorn: If I move to something ridiculous like STDIN.gets, same result as running in irb
[23:31:40] Verity: who tag me
[23:32:58] soloscshaw: has joined #ruby
[23:33:32] Radar: Verity: http://logs.ryanbigg.com/ruby?date=2017-04-27#6207483
[23:33:41] Radar: Verity: It would help if you didn't go awol in the middle of a conversation, perhaps?
[23:34:05] Qommand0r: has joined #ruby
[23:36:11] hotpancakes: has joined #ruby
[23:37:01] balazs: jgnagy: just figured it out. So the "update" an entry in the traditional sense, I need to use "index"
[23:37:16] lxsameer: has joined #ruby
[23:37:43] jgnagy: sorry, got distracted by work
[23:37:52] jgnagy: those guys... expecting me to do things just because they pay me
[23:38:09] Verity: I need to get paid for ruby and quick
[23:38:43] jgnagy: aedorn: your problem depends a lot on your scenario
[23:38:50] jgnagy: which ruby are you using?
[23:39:06] jgnagy: what are your threads doing? more specifically, are they blocking?
[23:39:46] aedorn: 2.4.1, some do, some do not
[23:40:02] SCHAPiE: has joined #ruby
[23:41:51] aedorn: As to what they're doing.. one is a consumer (via Bunny) for RabbitMQ, the rest are kicked off on certain events.. they all go through the same process of creating a network namespace, setting up a MAC-VLAN, creating X amount of interfaces on top of that, creating a bridge, and a virtual pair, plus 2 socat processes
[23:41:55] aedorn: and then they go from there
[23:42:26] zenspider: aedorn: I have a doubt. t.join should be essentially free.
[23:42:36] aedorn: well, it's not I'm afraid
[23:42:42] cagomez: has joined #ruby
[23:42:49] jgnagy: I agree with zenspider
[23:42:57] zenspider: aedorn: again. I have a doubt. you'll need to show some code to prove it.
[23:43:10] jgnagy: joining on all the non-main threads should be the event you use to stop
[23:43:24] zenspider: I puke up 10k threads all the time. it isn't join that slows me down at all.
[23:43:57] jgnagy: that said, if you're using 2.4 and relying purely on threads for concurrency and doing things that block for a while, you're not going to get much performance benefit from threading
[23:44:15] zenspider: depends on how they block... if it is just io, then it is basically free
[23:45:11] jgnagy: his sounds like a bunch of system calls
[23:45:23] jgnagy: well aedorn's
[23:45:32] jgnagy: I shouldn't use gender-specific pronouns
[23:46:28] zenspider: they're male according to search :)
[23:46:44] zenspider: unless that name is the John Smith of ... whereever
[23:47:33] jgnagy: I think Bunny is evented
[23:47:35] aedorn: I'm not even sure where to begin to generalize it enough where I can show anything, which is the only problem. Let's say that isn't the issue (the join), then why is running via irb which is doing the exact same faster than running as a process and using join
[23:47:53] hotpancakes: has joined #ruby
[23:48:50] jgnagy: how are you distributing working into the threads?
[23:49:00] zenspider: can't tell ya that w/o code or performance data
[23:49:04] jgnagy: do you have a Queue they're popping them off of?
[23:49:26] jgnagy: or are you using the main thread and some event from bunny to push work into a new thread?
[23:50:47] aedorn: It gets kicked off via the Bunny consumer.. and running the Consumer via blocking (which uses join) or not will have the issue. The same as sleeping on the main thread, doing a loop, etc..
[23:54:33] jusa: has joined #ruby
[23:56:10] DLSteve: has joined #ruby
[23:56:44] jgnagy: I'm asking because if you have a Threadpool, or an Array of threads or something, and assuming you're using `q.subscribe(block: true) do...` and shuffling work off to that pool or array, their hello world should work fine
[23:56:50] jgnagy: https://github.com/rabbitmq/rabbitmq-tutorials/blob/master/ruby/worker.rb
[23:57:29] jgnagy: something like that for the main thread, but instead of line 19's sleep, you push work as a thread to some threadpool
[23:57:32] cagomez: has joined #ruby
[23:57:56] jgnagy: by using bunny's #subscribe, it creates the loop for you
[23:58:07] hotpancakes: has joined #ruby
[23:58:24] aedorn: Yes, that's essentially what I'm doing. Even in Bunny's code that block attribute runs .join on the consumer thread
[23:59:02] aedorn: Is there a way to track threads? Like what has focus and when inside the Ruby VM? Like we can track GC objects..
[23:59:35] JeanCarloMachado: has joined #ruby
[23:59:54] jgnagy: you can use gdb