« Back to channel list

#ruby - 10 April 2018

« Back 1 day Forward 1 day »
[00:03:20] yxhuvud: has joined #ruby
[00:05:14] lelliott: has joined #ruby
[00:05:30] dviola: has joined #ruby
[00:19:14] caoraivoso: has joined #ruby
[00:20:27] workmad3: has joined #ruby
[00:21:10] cagomez: has joined #ruby
[00:21:51] guacamole: has joined #ruby
[00:21:51] guacamole: has joined #ruby
[00:23:00] rfoust: has joined #ruby
[00:23:11] LumberJackStrap: has joined #ruby
[00:33:30] yxhuvud: has joined #ruby
[00:38:04] orbyt_: has joined #ruby
[00:38:11] quuxman: In an rspec test, can I mock a single method of an object and leave the rest alone?
[00:45:00] lupine: sure. `expect(obj).to receive(....).and_return(...)
[00:45:06] lupine: or `allow`
[00:45:42] quuxman: ah yes you can, it's a Partial Double. Ok, my next question is if you use `allow(Foo::Logger).to receive(:msg)` does that method revert to the original at the end of the test?
[00:47:45] duderonomy: has joined #ruby
[00:47:53] quuxman: I mean if Foo::Logger.msg is already defined, does msg have the original definition after the test
[00:48:34] konsolebox: has joined #ruby
[00:50:11] AJA4350: has joined #ruby
[00:52:46] memo1: has joined #ruby
[00:56:13] Ryzokuken: has joined #ruby
[00:58:04] erlend: has joined #ruby
[00:58:35] arescorpio: has joined #ruby
[01:00:48] vikaton: has joined #ruby
[01:01:21] minimalism: has joined #ruby
[01:01:40] yxhuvud: has joined #ruby
[01:02:11] lelliott: has joined #ruby
[01:03:13] quuxman: apparently yes
[01:08:56] anisha: has joined #ruby
[01:20:40] karapetyan: has joined #ruby
[01:21:58] ledestin: has joined #ruby
[01:22:29] x0F: has joined #ruby
[01:27:25] gizmore: has joined #ruby
[01:29:20] yxhuvud: has joined #ruby
[01:32:45] twshelton: has joined #ruby
[01:34:01] yxhuvud: has joined #ruby
[01:36:53] havenwood: Radar: I spiffed up that nightly Ruby install script, fwiw: https://gist.github.com/havenwood/823382815cbdcfddadd798d4042023a8
[01:40:15] tolerablyjake: has joined #ruby
[01:43:06] n0m4d1c: has joined #ruby
[01:46:41] cschneid_: has joined #ruby
[01:47:16] s2013: has joined #ruby
[01:47:19] mikhael_keehl: has joined #ruby
[01:48:09] mikhael_keehl: What's the best gem of generating email reports?
[01:48:29] ogres: has joined #ruby
[01:49:17] yxhuvud: has joined #ruby
[01:49:31] havenwood: mikhael_keehl: You want more than a regular email-sending library? What're the reports about?
[01:50:33] noobineer: has joined #ruby
[01:50:51] mikhael_keehl: havenwood: I have a ruby script/app that runs rsync for every mirror 3-times a day. I want to get a weekly report of what rsync failed, and its error.
[01:51:44] havenwood: mikhael_keehl: It sounds like the mail or pony gems would do the trick.
[01:51:53] havenwood: mikhael_keehl: https://github.com/benprew/pony
[01:52:00] havenwood: mikhael_keehl: https://github.com/mikel/mail
[01:52:10] Miron: has joined #ruby
[01:52:14] mikhael_keehl: havenwood: I'll look into it, thanks mate
[01:52:25] havenwood: mikhael_keehl: no prob, you're welcome
[01:52:33] havenwood: mikhael_keehl: http://awesome-ruby.com/#-email
[01:52:54] havenwood: mikhael_keehl: https://www.ruby-toolbox.com/categories/e_mail
[01:53:31] mikhael_keehl: ruby-toolbox, hey teach a man how to fish, hehe ;)
[01:58:39] yxhuvud: has joined #ruby
[01:59:25] cschneid_: has joined #ruby
[02:00:17] dinfuehr: has joined #ruby
[02:00:21] alfiemax: has joined #ruby
[02:01:19] herbmillerjr: has joined #ruby
[02:01:29] Xiti: has joined #ruby
[02:04:56] sspreitz: has joined #ruby
[02:05:08] memo1: hi, im running a script wih a ffmpeg (bash), but this command blocks other execution lines. How i run concurrently other lines of codes?, right now im using exec() and system() with no luck
[02:05:15] cschneid_: has joined #ruby
[02:10:24] cschneid_: has joined #ruby
[02:13:53] tacoboy: has joined #ruby
[02:14:15] drale2k: has joined #ruby
[02:14:27] shtirlic: has joined #ruby
[02:16:22] gremax: has joined #ruby
[02:18:02] gix-: has joined #ruby
[02:19:17] n0m4d1c_: has joined #ruby
[02:19:53] workmad3: has joined #ruby
[02:24:01] gix: has joined #ruby
[02:26:21] yxhuvud: has joined #ruby
[02:30:44] tolerablyjake: has joined #ruby
[02:33:07] Azure: has joined #ruby
[02:35:12] blackchalk: has joined #ruby
[02:35:27] blackchalk: has joined #ruby
[02:36:22] Janky: has joined #ruby
[02:38:01] blackchalk: has joined #ruby
[02:38:02] blackchalk: has joined #ruby
[02:48:00] govg: has joined #ruby
[02:48:12] ciscam: has joined #ruby
[02:49:13] Radar: havenwood: spiffy
[02:49:43] karapetyan: has joined #ruby
[02:49:50] eckhardt: has joined #ruby
[02:52:22] darkhanb: has joined #ruby
[02:56:23] lelliott: has joined #ruby
[02:58:41] mroutis: has joined #ruby
[03:00:15] cadillac_: has joined #ruby
[03:02:29] yxhuvud: has joined #ruby
[03:06:51] erlend: has joined #ruby
[03:09:04] KeyJoo: has joined #ruby
[03:19:39] yxhuvud: has joined #ruby
[03:20:07] guacamole: has joined #ruby
[03:20:07] guacamole: has joined #ruby
[03:25:47] gix-: has joined #ruby
[03:29:19] s2013: has joined #ruby
[03:30:47] Mike11: has joined #ruby
[03:31:21] tao_: has joined #ruby
[03:36:38] jcarl43: has joined #ruby
[03:37:04] kapil___: has joined #ruby
[03:43:44] zautomata1: has joined #ruby
[03:47:01] nadir: has joined #ruby
[03:55:05] cschneid_: has joined #ruby
[03:58:36] cschneid_: has joined #ruby
[03:59:00] yxhuvud: has joined #ruby
[04:02:01] s2013: has joined #ruby
[04:06:02] skarlso: has joined #ruby
[04:10:18] govg: has joined #ruby
[04:10:28] matled: has joined #ruby
[04:16:49] arescorpio: has joined #ruby
[04:19:18] workmad3: has joined #ruby
[04:19:35] guacamole: has joined #ruby
[04:19:36] guacamole: has joined #ruby
[04:26:07] mrBen2k2k2k: has joined #ruby
[04:30:21] jenrzzz: has joined #ruby
[04:30:22] jenrzzz: has joined #ruby
[04:30:53] arescorpio: has joined #ruby
[04:36:04] cschneid_: has joined #ruby
[04:37:33] karapetyan: has joined #ruby
[04:38:01] sauvin: has joined #ruby
[04:43:13] eckhardt: has joined #ruby
[04:46:38] harrycs: has joined #ruby
[04:47:37] ruby[bot]: has joined #ruby
[04:47:38] ChanServ: +o ruby[bot]
[04:56:42] baweaver: I made fun! https://github.com/baweaver/qo
[04:57:20] baweaver: people.select(&Qo[name: /weaver/, puns: true])
[04:57:39] baweaver: Will probably make a nice post on Medium for it later
[05:01:14] jamesaxl: has joined #ruby
[05:01:15] reber: has joined #ruby
[05:01:17] alfiemax: has joined #ruby
[05:01:19] lelliott: has joined #ruby
[05:06:29] apeiros: has joined #ruby
[05:13:20] vondruch: has joined #ruby
[05:15:01] erlend: has joined #ruby
[05:16:36] pd2000: has joined #ruby
[05:20:22] havenwood: baweaver: nice!
[05:25:08] hlmjr: has joined #ruby
[05:30:56] aupadhye: has joined #ruby
[05:32:53] anisha: has joined #ruby
[05:34:52] DTZUZO: has joined #ruby
[05:38:22] karapetyan: has joined #ruby
[05:39:34] Ryzokuken: has joined #ruby
[05:39:54] lelliott: has joined #ruby
[05:40:25] cam27: has joined #ruby
[05:41:25] jenrzzz: has joined #ruby
[05:41:25] jenrzzz: has joined #ruby
[05:47:55] Puffball: has joined #ruby
[05:49:54] eckhardt: has joined #ruby
[05:53:12] n008f4g_: has joined #ruby
[05:56:02] dminuoso: baweaver: Now implement that as builtin pattern matching.
[05:56:19] AndBobsYourUncle: has joined #ruby
[05:57:26] dminuoso: But it's a neat little library.
[05:58:08] baweaver: I've thought about it before
[05:58:30] baweaver: so I decided to cheat a bit and see if I can tempt Matz to write / green light it by releasing it as a gem
[06:00:05] jenrzzz: has joined #ruby
[06:00:05] jenrzzz: has joined #ruby
[06:00:24] dminuoso: baweaver: Im not convinced about #=== anymore sadly
[06:02:42] baweaver: I make due with which tools I can
[06:03:19] baweaver: and there's quite enough in Ruby to provide hours of entertainment, so... :D
[06:05:46] anisha: has joined #ruby
[06:05:59] jenrzzz: has joined #ruby
[06:05:59] jenrzzz: has joined #ruby
[06:07:15] pd2000: has joined #ruby
[06:09:35] anisha_: has joined #ruby
[06:11:41] jenrzzz: has joined #ruby
[06:11:41] jenrzzz: has joined #ruby
[06:18:49] workmad3: has joined #ruby
[06:19:35] chrisgopher: has joined #ruby
[06:24:16] jenrzzz: has joined #ruby
[06:24:17] jenrzzz: has joined #ruby
[06:32:01] clemens3: has joined #ruby
[06:32:23] pd2000: has joined #ruby
[06:33:04] thinkpad: has joined #ruby
[06:33:47] jenrzzz: has joined #ruby
[06:33:47] jenrzzz: has joined #ruby
[06:34:06] gr33n7007h: has joined #ruby
[06:38:43] Sylario: has joined #ruby
[06:41:32] tcopeland: has joined #ruby
[06:42:03] tdy: has joined #ruby
[06:43:33] jenrzzz: has joined #ruby
[06:43:33] jenrzzz: has joined #ruby
[06:45:50] indiche: has joined #ruby
[06:46:23] hkais: has joined #ruby
[06:46:43] hkais: hello together
[06:46:52] hkais: I am a very new noob in ruby
[06:47:04] hkais: so struggeling with maybe a basic code
[06:47:04] hkais: .split.collect { |e| Issue.visible.find_by_id(e)}
[06:47:20] hkais: issues = args[0].split.collect { |e| Issue.visible.find_by_id(e)}
[06:47:48] linetrace: has joined #ruby
[06:47:57] hkais: if I understand it correctly the args[0] is getting splitted, but what does the
[06:47:57] hkais: { |e| issue.visible.find.... } mean?
[06:48:16] anisha: has joined #ruby
[06:51:22] pd2000: has joined #ruby
[06:52:38] havenwood: hkais: It looks like Issue is an ApplicationRecord, visible is a scope, and it's finding the first in that scope that has the id e.
[06:56:07] hkais: is there any good book for reading? I have no clue what the scope is nor the ApplicationRecord.
[06:56:23] havenwood: hkais: They're Rails things.
[06:56:51] chrisgopher: The best reference for that kind of stuff would be the official Rails docs
[06:56:57] havenwood: hkais: http://guides.rubyonrails.org/active_record_basics.html
[06:57:37] ruby[bot]: Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
[06:57:56] jenrzzz: has joined #ruby
[06:57:57] jenrzzz: has joined #ruby
[07:06:56] halt: has joined #ruby
[07:09:21] pppktz: has joined #ruby
[07:13:53] KeyJoo: has joined #ruby
[07:13:56] yottanami: has joined #ruby
[07:14:08] yottanami: Is any chance to use raw query in Mongoid?
[07:14:16] yottanami: I need to run a query like this db.users.find({"rounds.score": 20}, {"phone_number": 1, "rounds": { $elemMatch: { score: 20 } }})
[07:17:54] kapil___: has joined #ruby
[07:18:52] jenrzzz: has joined #ruby
[07:18:52] jenrzzz: has joined #ruby
[07:19:04] dionysus69: has joined #ruby
[07:20:16] clemens3: has joined #ruby
[07:22:50] TomyWork: has joined #ruby
[07:23:43] erlend: has joined #ruby
[07:28:10] burgestrand: has joined #ruby
[07:28:48] cschneid_: has joined #ruby
[07:30:16] fyrril: has joined #ruby
[07:35:12] jenrzzz: has joined #ruby
[07:35:12] jenrzzz: has joined #ruby
[07:36:16] reber: has joined #ruby
[07:38:34] venmx: has joined #ruby
[07:41:41] AndBobsYourUncle: has joined #ruby
[07:41:51] eckhardt: has joined #ruby
[07:42:32] marr: has joined #ruby
[07:45:01] jenrzzz: has joined #ruby
[07:45:01] jenrzzz: has joined #ruby
[07:45:08] AndroUser2: has joined #ruby
[07:50:44] jenrzzz: has joined #ruby
[07:50:45] jenrzzz: has joined #ruby
[07:56:31] phaul: has joined #ruby
[08:01:58] drale2k_: has joined #ruby
[08:10:12] c0ncealed1: has joined #ruby
[08:16:13] guille-moe: has joined #ruby
[08:18:11] workmad3: has joined #ruby
[08:19:02] tvw: has joined #ruby
[08:21:02] ur5us: has joined #ruby
[08:22:29] ellcs: has joined #ruby
[08:25:49] cschneid_: has joined #ruby
[08:41:00] venmx: has joined #ruby
[08:44:45] mtkd: has joined #ruby
[08:46:09] ltt: has joined #ruby
[08:47:02] claudiuinberlin: has joined #ruby
[08:47:27] amar: has joined #ruby
[08:50:03] KeyJoo: has joined #ruby
[08:54:39] Ryzokuken: has joined #ruby
[08:56:32] plexigras: has joined #ruby
[08:56:57] Beams: has joined #ruby
[08:57:53] ltt: has joined #ruby
[09:00:17] Beams: has joined #ruby
[09:01:22] armyriad: has joined #ruby
[09:02:03] jenrzzz: has joined #ruby
[09:02:03] jenrzzz: has joined #ruby
[09:02:43] mikecmpbll: has joined #ruby
[09:04:30] rabajaj: has joined #ruby
[09:09:32] Beams: has joined #ruby
[09:27:25] Beams: has joined #ruby
[09:32:25] erlend: has joined #ruby
[09:35:54] mikecmpbll: has joined #ruby
[09:40:06] Beams: has joined #ruby
[09:50:46] qba73: has joined #ruby
[09:51:02] karapetyan: has joined #ruby
[09:56:21] zautomata2: has joined #ruby
[10:02:56] guille-moe: has joined #ruby
[10:03:24] workmad3: has joined #ruby
[10:03:57] vondruch_: has joined #ruby
[10:05:00] zautomata3: has joined #ruby
[10:05:11] qba73: has joined #ruby
[10:06:08] Beams: has joined #ruby
[10:06:17] dr3wo: has joined #ruby
[10:12:12] suukim: has joined #ruby
[10:12:36] ltt: has joined #ruby
[10:14:17] vondruch_: has joined #ruby
[10:15:04] GodFather: has joined #ruby
[10:15:30] AJA4350: has joined #ruby
[10:19:13] Voxxit: has joined #ruby
[10:25:44] drale2k_: has joined #ruby
[10:28:58] drale2k_: has joined #ruby
[10:29:34] DaniG2k: has joined #ruby
[10:31:50] amar_: has joined #ruby
[10:33:14] Beams: has joined #ruby
[10:37:10] quobo: has joined #ruby
[10:37:15] amar: has joined #ruby
[10:40:53] dviola: has joined #ruby
[10:42:03] ElFerna: has joined #ruby
[10:46:33] zautomata4: has joined #ruby
[10:48:40] ltt: has joined #ruby
[10:51:25] Beams: has joined #ruby
[10:53:37] apparition: has joined #ruby
[10:55:14] apeiros: has joined #ruby
[11:00:10] lazyatom: has joined #ruby
[11:00:42] reber: has joined #ruby
[11:01:50] ltt: has joined #ruby
[11:02:20] maxgrok: has joined #ruby
[11:02:37] cadillac_: has joined #ruby
[11:03:45] Azure: has joined #ruby
[11:03:47] dviola: has joined #ruby
[11:03:50] mikecmpbll: has joined #ruby
[11:03:52] drale2k_: has joined #ruby
[11:04:19] dviola: has joined #ruby
[11:04:26] Beams: has joined #ruby
[11:04:55] dviola: has left #ruby: ()
[11:06:50] qba73: has joined #ruby
[11:07:47] despai: has joined #ruby
[11:12:31] Azure: has joined #ruby
[11:16:14] jinie: has joined #ruby
[11:16:40] Nahra: has joined #ruby
[11:18:48] dr3wo: has joined #ruby
[11:21:21] inerthia: has joined #ruby
[11:24:06] Cavallari: has joined #ruby
[11:27:22] houhoulis: has joined #ruby
[11:33:03] Bish: dmarcoux: yesterday you said mutability is cool for the sake of performance, but i can't possible write code with mutation that is faster than immutable one :o (atleast if it's threaded)
[11:33:09] Bish: dminuoso: *
[11:33:24] Bish: i just rewrote a huge ass mutex overloaded code, and it's so much faster!
[11:34:46] apeiros: Bish: aka "I can write shit code in any language"
[11:35:24] Bish: apeiros: true, but i am wondering.. how i would make better performance with mutability
[11:35:25] alfiemax: has joined #ruby
[11:35:29] Bish: if it's multithreaded
[11:35:39] Bish: mutex seem so costly especially in ruby
[11:35:58] apeiros: avoid shared mutable state
[11:36:07] Bish: so avoid mutexes
[11:36:29] apeiros: yes, a consequence of not having shared mutable state is that you need less mutexes.
[11:36:38] Bish: so that's what i said
[11:36:50] apeiros: not if we're pedantic.
[11:36:52] ldnunes: has joined #ruby
[11:37:06] apeiros: (though I'd even argue that it's not really pedantic)
[11:39:09] apeiros: as for "mutability has performance benefits" - copying large datastructures on changes can be expensive. "just" replacing a part of it in place can be much cheaper.
[11:39:57] adlerdias: has joined #ruby
[11:40:44] Bish: are there places where you have to have shared mutable state?
[11:41:10] erlend: has joined #ruby
[11:41:53] apeiros: the world is shared mutable state
[11:42:05] KeyJoo: has joined #ruby
[11:42:30] depesz: has joined #ruby
[11:42:40] Bish: now it's getting philosophical
[11:42:58] apeiros: common place for shared mutable state: IO, the database
[11:43:13] cadillac_: has joined #ruby
[11:43:56] apeiros: you can go from abstract to concrete. think about the interactions of your application with the world and you can see where shared mutable state permeates into your application.
[11:44:06] amar: has joined #ruby
[11:47:55] mtkd: has joined #ruby
[11:50:34] sidx64: has joined #ruby
[11:53:19] karapetyan: has joined #ruby
[11:55:42] cadillac_: has joined #ruby
[11:57:02] alfiemax: has joined #ruby
[11:57:55] hkais: has joined #ruby
[11:58:21] MasterAsia: has joined #ruby
[12:02:02] byte512: has joined #ruby
[12:02:47] depesz: hi. i have a class, that internally defines module. I'd like to make new class that has *some* of the methods from the module replaced by new code.
[12:02:50] depesz: how can I go about it?
[12:04:02] Beams: has joined #ruby
[12:04:31] apeiros: depesz: how did you add the methods of that module to your new class?
[12:04:41] depesz: it's not mine.
[12:04:53] depesz: basically - i have this gem: https://github.com/lfittl/pg_query
[12:05:29] apeiros: "I'd like to make a new class" - that says *your* class, *you* made it. no?
[12:05:39] depesz: internally it has class PgQuery, and in there there is Deparse module. I'd like to make na new class (PgQuery2), which inherits PgQuery, but overwrites some of the methods in Deparse module in it.
[12:06:18] depesz: apeiros: base class/module is not mine. the new one is mine, but Deparse methods seem to be called from parent class (PgQuery), and not my overwrite ...
[12:06:37] apeiros: ok, first things first:
[12:06:43] apeiros: do not inherit from classes you don't own
[12:07:07] depesz: why? copying the whole code doesn't make much sense.
[12:07:24] apeiros: copying the code isn't the only alternative
[12:07:45] depesz: i need to deparse sql query, but in nicer way. adding indentation, and other "things"
[12:07:48] apeiros: the common approach is to compose. i.e. your class contains an instance of that class.
[12:08:06] depesz: deparse code is there, i just need to modify *some* methods of the class.
[12:08:15] apeiros: anyway, re your original question: if you inherit, all you have to do to have some methods replaced with your own is to define them
[12:08:17] depesz: apeiros: well, then I would have to copy the whole deparse module, which is pretty long.
[12:08:36] depesz: apeiros: well, doesn't seem to be the case.
[12:08:47] depesz: moment, let me show some simple example
[12:08:48] apeiros: I'm not quite sure what leap you do to get to that conclusion ("then I have to copy deparse module")
[12:09:00] synthroid: has joined #ruby
[12:09:55] huyderman: has joined #ruby
[12:10:18] depesz: apeiros: https://gist.github.com/depesz/1c5c7cd07b76503acff265fe73c4de75
[12:10:26] kurko_: has joined #ruby
[12:10:45] depesz: apeiros: deparse method (called in line 24) will call internally deparse_select().
[12:10:46] apeiros: ok, it seems you have some misconceptions here
[12:10:58] apeiros: and your explanation of the problem was, um, lets say "incomplete"
[12:11:00] depesz: i did overwrite it (and failed), but it didn't change the way it works.
[12:11:04] depesz: sorry about that
[12:11:27] depesz: is there any way to achieve what I need/want?
[12:11:57] depesz: as in: overwrite *some* of methods that are in a module inside class that I'm inheriting from?
[12:12:24] apeiros: the "inside a class" is irrelevant.
[12:12:40] apeiros: what matters is how PgQuery invokes the methods in Deparse
[12:12:53] apeiros: (which is why I asked you "how did you add the methods of that module to your new class")
[12:13:29] depesz: apeiros: https://github.com/lfittl/pg_query/blob/master/lib/pg_query/deparse.rb
[12:13:39] apeiros: either it includes Deparse, then it's as I said before, you just override it in your subclass (and that really means in the subclass, NOT in a module nested in your subclass)
[12:13:44] depesz: deparse method in PgQuery calls Deparse.from() for each item in tree
[12:14:01] apeiros: then you have bad luck
[12:14:03] depesz: i nested it because that's what i saw in pg_query gem source.
[12:14:53] apeiros: bad enough that there's no silver bullet. you'll have to inspect the codepath and figure out how to selectively replace/reuse parts.
[12:15:26] despai: has joined #ruby
[12:15:31] depesz: apeiros: given the source as it is in here - do you see a way i could have a pgquery2 class that will overwrite just deparse_select ?
[12:15:38] depesz: but keep all other things from normal pgquery ?
[12:15:41] apeiros: and bad enough that it'd take too much time for me, meaning I should go back to what I'm paid for. if you're still at it in ~5h, I can take another look.
[12:15:58] depesz: apeiros: would appreciate. just ping me if/when you'll have time.
[12:22:51] vutral|kali: has joined #ruby
[12:22:52] vutral|kali: has joined #ruby
[12:25:18] Psybur: has joined #ruby
[12:27:01] qba73: has joined #ruby
[12:28:23] RougeR: has joined #ruby
[12:28:24] RougeR: has joined #ruby
[12:30:00] ltt: has joined #ruby
[12:38:03] sidx64_: has joined #ruby
[12:39:14] amelliaa: has joined #ruby
[12:39:18] amar: has joined #ruby
[12:41:33] _aeris_: has joined #ruby
[12:44:55] ltt: has joined #ruby
[12:45:26] k0mpa: has joined #ruby
[12:45:53] bmurt: has joined #ruby
[12:46:44] sidx64: has joined #ruby
[12:48:30] ltt: has joined #ruby
[12:48:42] konsolebox: has joined #ruby
[12:54:32] Mike11: has joined #ruby
[12:56:32] s2013: has joined #ruby
[12:57:04] despai: has joined #ruby
[13:00:20] Asher: has joined #ruby
[13:01:28] drale2k_: has joined #ruby
[13:04:33] Psybur: has joined #ruby
[13:05:26] sidx64: has joined #ruby
[13:05:47] ltt: has joined #ruby
[13:06:25] karapetyan: has joined #ruby
[13:06:30] Voxxit: has joined #ruby
[13:06:49] cadillac_: has joined #ruby
[13:07:33] Beams: has joined #ruby
[13:10:51] MasterAsia: has joined #ruby
[13:12:10] jcalla: has joined #ruby
[13:14:00] RougeR: has joined #ruby
[13:14:01] RougeR: has joined #ruby
[13:14:49] jeffreylevesque: has joined #ruby
[13:14:57] yohji: has joined #ruby
[13:15:37] imode: has joined #ruby
[13:16:02] Dbugger: has joined #ruby
[13:16:42] Dbugger: hello everyone. I have a weird issue when using rbenv, I get an error "recipe for target 'rdoc' failed". Is there a way to install a version without the documentation?
[13:18:00] duderonomy: has joined #ruby
[13:21:30] shinnya: has joined #ruby
[13:22:42] nowhereman_: has joined #ruby
[13:25:19] DLSteve: has joined #ruby
[13:30:02] sidx64: has joined #ruby
[13:35:18] rfoust: has joined #ruby
[13:40:20] Mikasi: has joined #ruby
[13:40:50] alfiemax: has joined #ruby
[13:41:08] cschneid_: has joined #ruby
[13:41:21] guardian: has joined #ruby
[13:42:25] tomphp_: has joined #ruby
[13:42:45] memo1: has joined #ruby
[13:44:46] justinweiss: has joined #ruby
[13:46:14] schaary: has joined #ruby
[13:47:41] pizzaops: has joined #ruby
[13:48:46] lipoqil: has joined #ruby
[13:48:52] amatas_: has joined #ruby
[13:49:54] erlend: has joined #ruby
[13:50:18] bcavileer: has joined #ruby
[13:50:35] tobiasvl: has joined #ruby
[13:52:19] amatas__: has joined #ruby
[13:53:06] BuildTheRobots: has joined #ruby
[13:55:27] Yonk_: has joined #ruby
[14:02:08] mikecmpbll: has joined #ruby
[14:02:16] podman: has joined #ruby
[14:02:48] cadillac_: has joined #ruby
[14:03:09] law: are there recommended systemd setting for giving a rails daemon run as the 'rails' user more/unlimited system resources?
[14:03:30] mtkd: has joined #ruby
[14:03:52] aarongodin: has joined #ruby
[14:03:59] micalexander: has joined #ruby
[14:04:45] kapowaz: has joined #ruby
[14:05:23] HashNuke: has joined #ruby
[14:05:25] DukeDave: has joined #ruby
[14:05:31] ggherdov: has joined #ruby
[14:07:12] mroth: has joined #ruby
[14:07:26] machty: has joined #ruby
[14:07:30] Tony-St4rk: has joined #ruby
[14:08:28] colstrom: has joined #ruby
[14:08:34] ckrailo: has joined #ruby
[14:09:04] kireevco: has joined #ruby
[14:09:06] Mutsuhito: has joined #ruby
[14:09:48] Brak____________: has joined #ruby
[14:10:14] knowtheory: has joined #ruby
[14:10:18] incomprehensibly: has joined #ruby
[14:10:41] foamz: has joined #ruby
[14:11:31] rflot: has joined #ruby
[14:12:14] Chew: has joined #ruby
[14:12:14] memo1: has joined #ruby
[14:12:28] Rapture: has joined #ruby
[14:12:37] drale2k_: has joined #ruby
[14:12:43] jnix: has joined #ruby
[14:12:52] ircmaxell: has joined #ruby
[14:13:47] mattwc: has joined #ruby
[14:14:10] catbusters: has joined #ruby
[14:16:55] caw_______: has joined #ruby
[14:17:21] iamdevnul: has joined #ruby
[14:17:44] andywojo: has joined #ruby
[14:17:48] untitaker: has joined #ruby
[14:18:08] Lloyd: has joined #ruby
[14:18:23] auv: has joined #ruby
[14:18:53] fury: has joined #ruby
[14:20:09] jetpack_joe: has joined #ruby
[14:21:18] tycoon177: has joined #ruby
[14:21:33] andikr: has joined #ruby
[14:22:20] Flabbergazta_: has joined #ruby
[14:24:27] craysiii: has joined #ruby
[14:25:34] seanh: has joined #ruby
[14:25:46] apeiros__: has joined #ruby
[14:26:33] Beams: has joined #ruby
[14:26:51] koenrh: has joined #ruby
[14:27:25] surminus: has joined #ruby
[14:28:30] ltt: has joined #ruby
[14:29:14] netherwolfe: has joined #ruby
[14:29:41] maciuszek: has joined #ruby
[14:31:14] imode: has joined #ruby
[14:31:30] sidx64: has joined #ruby
[14:32:00] qba73: has joined #ruby
[14:32:40] Nuck: has joined #ruby
[14:32:51] afisher: has joined #ruby
[14:34:06] mr-robert: has joined #ruby
[14:35:00] sepp2k: has joined #ruby
[14:38:16] al2o3-cr: has Proc#call always been able to take the reciever as first argument?
[14:41:05] al2o3-cr: >> :send.to_proc.call(:puts, ?*)
[14:41:06] ruby[bot]: al2o3-cr: # => undefined method `*' for :puts:Symbol (NoMethodError) ...check link for more (https://eval.in/987062)
[14:41:14] al2o3-cr: >> :send.to_proc.call(Kernel, :puts, ?*)
[14:41:15] ruby[bot]: al2o3-cr: # => * ...check link for more (https://eval.in/987063)
[14:41:57] Cavallari1: has joined #ruby
[14:42:46] cschneid_: has joined #ruby
[14:44:17] ltt: has joined #ruby
[14:44:23] rwb: has joined #ruby
[14:44:26] al2o3-cr: dminuoso: how can i bind to a C level proc?
[14:45:31] al2o3-cr: >> :send.to_proc.binding
[14:45:32] ruby[bot]: al2o3-cr: # => /tmp/execpad-94ad8e09440f/source-94ad8e09440f:2: [BUG] Segmentation fault at 0x0bd116 ...check link for more (https://eval.in/987064)
[14:46:12] dminuoso: 2.4 has that fixed.
[14:46:38] al2o3-cr: >> RUBY_VERSION
[14:46:39] ruby[bot]: al2o3-cr: # => "2.3.0" (https://eval.in/987065)
[14:47:07] dminuoso: Or maybe its one of the micro/patch versions
[14:47:18] dminuoso: al2o3-cr: at any way, you cant.
[14:47:44] al2o3-cr: dminuoso: hmm, ok. just thought i'd ask :)
[14:49:11] orbyt_: has joined #ruby
[14:51:33] al2o3-cr: dminuoso: how's your haskell coming along?
[14:51:46] dminuoso: Pretty great.
[14:51:57] dminuoso: Just dived into generics to kill so much boiler plate. :)
[14:52:18] cam27: has joined #ruby
[14:53:21] al2o3-cr: so i suppose you use xmonad ;P
[14:54:44] dminuoso: Nah. Not yet anyway.
[14:54:51] dminuoso: I use emacs instead! ;p
[14:55:16] karapetyan: has joined #ruby
[14:55:18] phaul: dminuoso: and what editor do you use?
[14:55:46] al2o3-cr: matz uses emacs
[14:56:33] al2o3-cr: if no simular no oop?
[14:56:46] dminuoso: Well with evil mode it's pretty sleek. :)
[14:57:04] al2o3-cr: one editor i've never used tbh
[14:57:12] KrzaQ-: has joined #ruby
[14:57:23] al2o3-cr: notepad++ ftw
[14:57:39] apeiros: has joined #ruby
[14:58:29] al2o3-cr: you can play snake in emacs can't you
[14:58:31] apeiros: has joined #ruby
[14:59:08] GodFather_: has joined #ruby
[15:00:07] oleo: has joined #ruby
[15:00:15] gr33n7007h: has joined #ruby
[15:01:36] mroutis: has joined #ruby
[15:02:06] al2o3-cr: where does charliesome hang out now?
[15:03:09] al2o3-cr: ruby 2.5 needs adding to eval.in
[15:04:46] cthulchu_: has joined #ruby
[15:05:48] ltt: has joined #ruby
[15:08:25] cschneid_: has joined #ruby
[15:11:36] s2013: has joined #ruby
[15:16:05] aufi: has joined #ruby
[15:16:14] karapetyan: has joined #ruby
[15:16:55] n008f4g_: has joined #ruby
[15:19:23] Map: has joined #ruby
[15:19:50] cthu|: has joined #ruby
[15:22:04] dr3wo: has joined #ruby
[15:22:47] devlaf: has joined #ruby
[15:22:47] nfk: has joined #ruby
[15:25:16] synthroid: has joined #ruby
[15:28:00] tolerablyjake: has joined #ruby
[15:28:01] ltt: has joined #ruby
[15:32:12] al2o3-cr: >> class String def to_proc() -> idx { self[idx] } end end; ([14,6,-1,12]*3).map(&"isoifduoiasdyarghjsoasjb").join(0x20.chr).gsub(/\G/, ?*)
[15:32:13] ruby[bot]: al2o3-cr: # => "*r* *u* *b* *y* *r* *u* *b* *y* *r* *u* *b* *y*" (https://eval.in/987081)
[15:33:39] alfiemax: has joined #ruby
[15:35:16] phaul: >> 0x20.chr
[15:35:17] ruby[bot]: phaul: # => " " (https://eval.in/987087)
[15:35:49] al2o3-cr: ruby is great.
[15:37:01] phaul: what's /\G/ ? "matching first matching position", of what???
[15:39:27] canton7: "\G will match the match boundary, which is either the beginning of the string, or the point where the last character of last match is consumed."
[15:39:43] al2o3-cr: >> " yo ".gsub(/\G/, ?-)
[15:39:44] ruby[bot]: al2o3-cr: # => "- -y-o- -" (https://eval.in/987090)
[15:40:27] al2o3-cr: canton7: good answer
[15:40:46] al2o3-cr: phaul: it's similar to \B
[15:40:53] phaul: ok, I think I get it :) so it matches every gap between chars in this case
[15:40:58] ltt: has joined #ruby
[15:41:11] canton7: (copied from stackoverflow)
[15:41:40] apeiros: you don't need \G for that
[15:41:54] harrycs: has joined #ruby
[15:41:58] apeiros: >> " yo ".gsub(//, ?-) == " yo ".gsub(/\G/, ?-)
[15:42:00] ruby[bot]: apeiros: # => true (https://eval.in/987091)
[15:42:13] al2o3-cr: apeiros: i know
[15:42:23] cagomez: has joined #ruby
[15:42:31] al2o3-cr: i left it in
[15:42:32] canton7: I mean, you don't need (0x20.chr) there, or lots of things... That's not the point :P
[15:43:40] al2o3-cr: base 2 and 16 is all you need 2 know :P
[15:44:54] phaul: reminds me of the C obfuscation contest from long long time ago :)
[15:46:35] phaul: there was one where you use an ascii art of a circle in the code to approximate PI. What a great idea :D
[15:47:42] al2o3-cr: phaul: did you know PI was intended to be 3.2 then all hell broke lose
[15:48:23] phaul: no I wasn't aware
[15:48:29] al2o3-cr: true story.
[15:50:03] al2o3-cr: to what leverage does Math.gamma become inaccurate factorial?
[15:51:08] ltt: has joined #ruby
[15:52:55] al2o3-cr: i'm losing track of ruby.
[15:53:48] despai: has joined #ruby
[15:57:23] [Butch]: has joined #ruby
[15:58:31] erlend: has joined #ruby
[16:00:32] marxarelli: has joined #ruby
[16:00:58] al2o3-cr: i've got a sneaky suspicion vladimir makarov is a genius.
[16:01:10] al2o3-cr: just saying
[16:01:40] mikecmpbll: has joined #ruby
[16:02:03] npgm: has joined #ruby
[16:02:46] ltt: has joined #ruby
[16:03:04] al2o3-cr: just like mike pall.
[16:03:09] jcarl43: has joined #ruby
[16:08:40] troulouliou_dev: has joined #ruby
[16:11:50] darkhanb: has joined #ruby
[16:15:45] dionysus69: has joined #ruby
[16:15:51] WebDawg: has joined #ruby
[16:18:13] alex``: has joined #ruby
[16:21:57] raynold: has joined #ruby
[16:23:41] weird_error: has joined #ruby
[16:25:48] stormpack: has joined #ruby
[16:28:24] lelliott: has joined #ruby
[16:36:36] jamesaxl: has joined #ruby
[16:39:32] snapcase: has joined #ruby
[16:44:32] unreal: has joined #ruby
[16:44:37] dr3wo: has joined #ruby
[16:50:08] jdawgaz: has joined #ruby
[16:51:29] Janky: I have a folder full of about a thousand .txt files. Each of these .txt files has about 30 lines of information in it. Can anyone point me to a tutorial on how to put these files into a single spreadsheet? Thanks.
[16:51:32] sanscoeur: has joined #ruby
[16:52:16] al2o3-cr: Janky: as in csv?
[16:52:25] Janky: that would work
[16:52:29] claudiuinberlin: has joined #ruby
[16:52:49] kapil___: has joined #ruby
[16:52:54] gizmore: Janky: what format are the txt files?
[16:53:12] pilne: has joined #ruby
[16:53:28] Janky: delimited by line
[16:53:59] gizmore: so its basically output excel from multiple line by line data?
[16:54:20] darkhanb_: has joined #ruby
[16:54:26] gizmore: for me the most difficult part would be the excel writing
[16:54:29] gizmore: never did that
[16:54:36] Janky: I'm trying to make it so each .txt file has it's own row, and each line within that .txt file has it's own column
[16:54:46] gizmore: sounds reasonable
[16:54:52] gizmore: how about this
[16:54:59] gizmore: generate a csv from the files
[16:55:03] gizmore: then import to excel
[16:55:28] stormpack_: has joined #ruby
[16:55:30] gizmore: but excel writing would be possible too
[16:55:34] Janky: I could do that
[16:55:38] havenwood: Janky: To load it all into memory: Dir['*.txt'].map { |filename| File.readlines filename, chomp: true }
[16:55:39] gizmore: start with a few for loops
[16:55:39] baweaver: al2o3-cr: I made something fun
[16:55:48] karapetyan: has joined #ruby
[16:55:59] gizmore: Janky: havenwood took all the fun and made rubygolf
[16:56:16] baweaver: Query Objects, think pattern matching in Ruby: https://github.com/baweaver/qo
[16:56:23] havenwood: Janky: The stdlib CSV isn't hard to figure out, or there are various spreadsheet gems (like spreadsheet).
[16:57:04] havenwood: Janky: https://www.ruby-toolbox.com/categories/reporting
[16:57:19] havenwood: Janky: http://awesome-ruby.com/#-spreadsheets-and-documents
[16:57:42] Janky: thank you
[16:57:46] havenwood: you're welcome
[17:04:03] despai: has joined #ruby
[17:04:28] al2o3-cr: awesome this baweaver, really is nifty :)
[17:05:14] ltem: has joined #ruby
[17:05:44] al2o3-cr: another one added to my gem list ;)
[17:06:24] bmurt: has joined #ruby
[17:07:10] FrankD: has joined #ruby
[17:08:40] baweaver: I may improve it a bit later
[17:08:47] baweaver: Thinking of deep hash queries
[17:09:32] al2o3-cr: go for it pal.
[17:10:21] baweaver: muffin_people = people.select(&Qo[address: {street: /Drury Lane/}])
[17:12:06] al2o3-cr: nothing ceases to amaze me in ruby, do you know that.
[17:12:36] baweaver: Just wait until we get started on the next book
[17:12:58] al2o3-cr: i can't wait :)
[17:13:01] baweaver: It's a book of Ruby black magics, The Ruby Grimoire
[17:13:12] al2o3-cr: haha nice name
[17:13:16] baweaver: Current book is mostly just pending legal feedback at $WORK
[17:13:25] darkhanb: has joined #ruby
[17:13:39] baweaver: Then ETA Jan 2019 for the final draft, though I think I'll be done sooner.
[17:13:44] al2o3-cr: ah, thought it was taking a while
[17:14:29] amar: has joined #ruby
[17:14:38] baweaver: Dotted i's and crossed t's and such
[17:15:22] sparr: other than an explicit call to somestring.to_sym or somestring.intern, what could cause "interning empty string" error?
[17:15:28] sparr: in ruby 1.8
[17:15:29] imode: has joined #ruby
[17:16:17] al2o3-cr: sparr: an empty string would do that.
[17:17:27] baweaver: sparr: Just to get it out of the way: 1.8 is super old and long since deprecated, which means it's a massive security risk. You should upgrade.
[17:21:01] al2o3-cr: sparr: %s"" might do it?
[17:21:04] cadillac_: has joined #ruby
[17:22:05] clemens3: has joined #ruby
[17:22:40] ruby[bot]: al2o3-cr: # => /tmp/execpad-57d9285cb600/source-57d9285cb600:2: empty symbol literal (https://eval.in/987114)
[17:22:57] al2o3-cr: hmm, no it doesn't
[17:26:02] al2o3-cr: sparr: i can't overemphasize UPGRADE
[17:29:25] reber: has joined #ruby
[17:29:33] cadillac_: has joined #ruby
[17:29:41] suukim: has joined #ruby
[17:30:05] cagomez: has joined #ruby
[17:32:59] eckhardt: has joined #ruby
[17:39:15] cyberg: has joined #ruby
[17:39:25] sparr: i know :(
[17:39:27] sparr: sadly not my call
[17:45:23] baweaver: sparr: Who's blocking it?
[17:45:25] al2o3-cr: sparr: i mean come on, i must of been 3 or 4 when 1.8 was a thing ;P
[17:45:51] n0m4d1c: has joined #ruby
[17:46:51] TinkerT: has joined #ruby
[17:46:54] baweaver: because by this point it's a glaring security hole, especially if you're on RHEL or CentOS and using it for deployments.
[17:48:28] twshelton: has joined #ruby
[17:49:12] n0m4d1c_: has joined #ruby
[17:57:17] faces: has joined #ruby
[17:58:32] despai: has joined #ruby
[17:58:57] al2o3-cr: sparr: whos cal is it?
[17:59:12] GodFather_: has joined #ruby
[18:01:01] Rapture: has joined #ruby
[18:02:44] cstrahan: has joined #ruby
[18:03:19] al2o3-cr: class Integer; alias whoa +; def +(moar) puts "#{self}+#{moar}"; whoa(moar); end; end; %(#{$$}) # good terminal fun ;)
[18:05:17] sparr: my boss' boss
[18:05:33] sparr: so, new line of questioning...
[18:05:40] al2o3-cr: sparr: sack them.
[18:06:03] al2o3-cr: ok, listening...
[18:06:04] sparr: preface: this is in puppet, so it's Not Real Ruby, but I'm hoping some guidance here will point me in the right direction there.
[18:06:18] al2o3-cr: ?puppet sparr
[18:06:18] ruby[bot]: sparr: Please join #puppet for help with it.
[18:06:50] \void: has joined #ruby
[18:07:05] John_Ivan: has joined #ruby
[18:07:05] John_Ivan: has joined #ruby
[18:07:12] erlend: has joined #ruby
[18:07:14] al2o3-cr: maybe you'll get more guidance there
[18:09:07] al2o3-cr: i honestly can't help as i have no clue.
[18:10:05] al2o3-cr: maybe others can though, idk sorry.
[18:10:13] imode: has joined #ruby
[18:12:13] mroutis: has joined #ruby
[18:15:31] alex``: has joined #ruby
[18:15:49] tdy: has joined #ruby
[18:17:55] al2o3-cr: 1 kudos point if someone can achieve a SyntaxError with the msg "void value expression"
[18:19:01] al2o3-cr: raise SyntaxError, "void ..." is a no no.
[18:19:54] sameerynho: has joined #ruby
[18:21:41] jdawgaz: has joined #ruby
[18:22:26] jdawgaz: has joined #ruby
[18:23:16] jdawgaz: has joined #ruby
[18:24:04] jdawgaz: has joined #ruby
[18:25:03] jdawgaz: has joined #ruby
[18:25:39] jdawgaz: has joined #ruby
[18:26:29] jdawgaz: has joined #ruby
[18:27:14] jdawgaz: has joined #ruby
[18:28:04] jdawgaz: has joined #ruby
[18:28:15] al2o3-cr: ?fixcon jdawgaz
[18:28:15] ruby[bot]: al2o3-cr: I don't know anything about fixcon
[18:28:49] jdawgaz: has joined #ruby
[18:28:52] apeiros: banning of all kinds is a command, hence ! prefixed and restricted to ops
[18:28:56] apeiros: !fixcon jdawgaz
[18:28:56] ruby[bot]: +bbb $a:jdawgaz$#ruby-fix-your-connection jdawgaz!*@*$#ruby-fix-your-connection *!*@ip70-176-27-239.ph.ph.cox.net$#ruby-fix-your-connection
[18:28:56] ruby[bot]: ruby[bot] kicked jdawgaz: join/part detected
[18:29:18] al2o3-cr: ah, thought it was part of the public api
[18:29:20] traxnov: has joined #ruby
[18:30:01] al2o3-cr: it makes sense.
[18:32:22] al2o3-cr: why is {foo: :bar **other} faster than Hash#update what else is going on?
[18:37:25] AndBobsYourUncle: has joined #ruby
[18:37:26] zautomata: has joined #ruby
[18:37:35] zautomata: has joined #ruby
[18:40:23] psychicist__: has joined #ruby
[18:41:57] nicesignal: has joined #ruby
[18:42:16] eckhardt: has joined #ruby
[18:42:26] al2o3-cr: does FileUtil just shell out?
[18:43:14] Strepsils: has joined #ruby
[18:45:09] n0m4d1c: has joined #ruby
[18:45:24] al2o3-cr: would you need a read-only variable bar the in-builts?
[18:47:36] n0m4d1c_: has joined #ruby
[18:53:59] n0m4d1c: has joined #ruby
[19:02:02] mtkd: has joined #ruby
[19:02:51] n008f4g_: has joined #ruby
[19:05:54] chouhoul_: has joined #ruby
[19:05:55] n0m4d1c: has joined #ruby
[19:09:16] alfiemax: has joined #ruby
[19:11:15] cjohnson: Is there a gem that supports gpg decryption with passphrases that doesn't rely on passing hte passphrase in via command line?
[19:12:07] al2o3-cr: cjohnson: why not command line
[19:12:40] cjohnson: Well if you have the passphrase on the command line, anybody can run ps and see it
[19:12:51] al2o3-cr: cjohnson: IO.getpass
[19:13:05] cjohnson: So ideally it would write the passphrase to a file and then pass that file path to the gpg command
[19:14:03] chouhoulis: has joined #ruby
[19:14:07] al2o3-cr: cjohnson: what's wrong with STDIN.getpass("password: ")?
[19:14:17] bauruine: has joined #ruby
[19:16:13] al2o3-cr: or gets(&:getpass)
[19:16:42] al2o3-cr: don't do that one
[19:17:42] al2o3-cr: cjohnson: man getpass(3)
[19:20:13] bmurt: has joined #ruby
[19:20:52] alfiemax: has joined #ruby
[19:21:21] al2o3-cr: actually use STDIN.echo = false
[19:25:36] al2o3-cr: use either actually getpass does this with some tweaks.
[19:26:52] al2o3-cr: cjohnson: sudo uses getpass.
[19:28:32] al2o3-cr: cjohnson: ruby version?
[19:32:35] jenrzzz: has joined #ruby
[19:32:35] jenrzzz: has joined #ruby
[19:32:46] mtkd: has joined #ruby
[19:32:51] ellcs: has joined #ruby
[19:32:54] mroutis: has joined #ruby
[19:34:06] dr3wo: has joined #ruby
[19:35:52] cjohnson: Sorry, I had a call
[19:36:13] cjohnson: 2.4 in the coming months but...2.2 for now
[19:36:33] cjohnson: So, let me clarify. This is for a rails app, the web API needs to call gpg to decrypt the incoming encrypted data
[19:37:11] cjohnson: I'm reviewing the PR to add this endpoint and the author wrote the lib which pipes the encrypted data via stdin, and passes the passphrase on the command line using --passphrase "cleartextpassphrase"
[19:37:16] FrostCandy: has joined #ruby
[19:37:25] cjohnson: I wanted to suggest an improvement that gets it out of the process list
[19:37:45] cjohnson: So I can't prompt interactively for the passphrase
[19:38:08] cjohnson: One approach might be to have ruby write hte passphrase to a file and then pass that file path to the gpg command
[19:38:32] cjohnson: Seems wonky though. What if the ruby process fails to clean up after itself and the passphrase is left behind
[19:39:46] Nahra: has joined #ruby
[19:40:37] ^mtkd: has joined #ruby
[19:42:12] al2o3-cr: cjohnson: not too sure then.
[19:44:32] Nahra: has joined #ruby
[19:48:35] ellcs: has joined #ruby
[19:49:17] Nahra: has joined #ruby
[19:54:16] sidx64: has joined #ruby
[19:57:07] cjohnson: Oh it turns out this is just a stupid client request
[19:57:12] cjohnson: I thought we were plaintext sending encrypted data
[19:57:23] cjohnson: we're using sftp to transfer the file but they want to transfer double-encrypted shit
[19:57:28] cjohnson: So, meh, I don't care
[19:59:46] al2o3-cr: cjohnson: hehe, no worries
[20:00:53] pastorinni: has joined #ruby
[20:01:05] alfiemax: has joined #ruby
[20:08:56] workmad3: has joined #ruby
[20:10:39] m4rCsi: has joined #ruby
[20:14:22] lelliott: has joined #ruby
[20:15:54] erlend: has joined #ruby
[20:16:24] eckhardt: has joined #ruby
[20:18:30] n0m4d1c: has joined #ruby
[20:18:48] claudiuinberlin: has joined #ruby
[20:19:01] m4rCsi: has joined #ruby
[20:20:21] cagomez: has joined #ruby
[20:21:21] venmx: has joined #ruby
[20:24:27] pastorinni: has joined #ruby
[20:24:38] n008f4g_: has joined #ruby
[20:25:45] moei: has joined #ruby
[20:27:31] sidx64_: has joined #ruby
[20:30:30] memo1: has joined #ruby
[20:31:51] sonOfRa: has joined #ruby
[20:33:11] cagomez: has joined #ruby
[20:34:12] harrycs: has joined #ruby
[20:37:03] hkais: has joined #ruby
[20:38:00] SeepingN: has joined #ruby
[20:38:40] mikecmpbll: has joined #ruby
[20:39:03] alfiemax: has joined #ruby
[20:42:47] Dimik---: has joined #ruby
[20:43:03] Dimik---: how can i use some specific version of a gem in a require of .rb file
[20:43:09] Dimik---: without rails environment
[20:43:44] mr-robert: dimik---: gem "name", "= X.X.X" then require "name"
[20:45:24] mroutis: has joined #ruby
[20:45:56] Dimik---: mr-robert thank you sir
[20:46:10] Janky: can anyone help me with a small script I'm working on?
[20:46:39] chouhoul_: has joined #ruby
[20:47:40] phaul: Janky, tell us about it, there will be someone
[20:48:52] memo1: has joined #ruby
[20:51:29] Janky: I've got about a thousand text files, each of them contains about 30 lines. I'm trying to write a program that goes through each files and outputs everything to a CSV. I would like to have it where every file has it's own row and the lines within those .txt. files have their own columns. I've got it setup to where it will read the .txt files and output everything to a .csv, but my only problem
[20:51:29] Janky: is that everything is being output on it's own row under 1 column
[20:55:50] sidx64: has joined #ruby
[20:56:22] ledestin: has joined #ruby
[20:59:23] phaul: if I were you, - this assuming that you have written that script - so if I were you, I would paste the code on a gist, point out where I'm stuck with it, and ask specific questions about it. You are to vague atm. for anybody to help
[21:08:14] phaul: Janky: sounded like you had something running already, that's good. Why not paste it to gist, and tell where it behaves different to what you expect?
[21:10:28] Janky: I don't even know what gist is
[21:10:31] venmx_: has joined #ruby
[21:10:51] rwb: has joined #ruby
[21:10:58] GodFather_: has joined #ruby
[21:11:12] phaul: it's where ppl ususally paste there code to share it with the chat.
[21:13:39] miah: http://gist.github.com/
[21:16:20] alfiemax: has joined #ruby
[21:19:17] Janky: https://gist.github.com/JankyDoodle/d110b41ac5162a263a1db6582dab9ca3
[21:19:50] snc: has joined #ruby
[21:21:01] Janky: so, I have a thousand .txt files in a directory. Each of them has about 30 lines of text. That script goes through each file, and then each line, and outputs all of the information to a single CSV. My only issue is that each line is being written to a row instead of a column
[21:21:09] chouhoulis: has joined #ruby
[21:21:34] snc123: has joined #ruby
[21:22:21] atchoum: has joined #ruby
[21:23:07] SeepingN: build arrays for each column
[21:23:45] nikivi: has joined #ruby
[21:27:56] tobiasvl: Janky: deja vu - did you ask the same thing about python in another channel earlier?
[21:31:09] sluggo: has joined #ruby
[21:31:56] Janky: tobiasvl, I did not
[21:35:03] vikaton: has joined #ruby
[21:35:08] Janky: SeepingN, so I would be putting arrays within arrays?
[21:35:12] sagax: has joined #ruby
[21:37:08] Dimik--: has joined #ruby
[21:37:35] tobiasvl: Janky: I'm a little confused at what you're doing. for each line, you put that line into an array, write that array to the csv, and then clear the array?
[21:37:49] tobiasvl: seems a little redundant
[21:38:01] Janky: I think that's what has been suggested that I do
[21:38:15] jottr: has joined #ruby
[21:38:19] tobiasvl: so the array you're writing to the csv is supposed to just contain one line?
[21:38:34] Janky: right now I just want each file .txt to have it's own row, and each line in that .txt file to have it's own column
[21:39:09] Janky: my script generates 30,000 rows. I'd like a thousand rows with 30 columns
[21:39:35] tobiasvl: ok, then I guess line 13 should be moved to above what's line 11 now?
[21:39:40] Dimik---: has joined #ruby
[21:39:55] tobiasvl: so that for each line in a txt file, you append that to the array, and then when all the lines are in the array, THEN you write the array to the csv
[21:40:24] Janky: I'll give it a shot
[21:40:26] t0rchh: has joined #ruby
[21:41:04] tobiasvl: ok. try to understand why I'm suggesting this though.
[21:41:22] Janky: you're a genius
[21:41:26] Janky: it worked!
[21:41:32] tobiasvl: haha. glad to hear it
[21:42:15] Janky: I've been working on that for a week
[21:46:06] eckhardt: has joined #ruby
[21:48:21] rivalomega: has joined #ruby
[21:48:31] t0rchy: has joined #ruby
[21:50:30] it_tard: has joined #ruby
[21:51:31] mroutis: has left #ruby: ()
[21:54:10] n0m4d1c: has joined #ruby
[21:54:32] mroutis: has joined #ruby
[21:56:05] n0m4d1c_: has joined #ruby
[21:56:05] venmx: has joined #ruby
[21:56:44] jenrzzz: has joined #ruby
[21:56:45] jenrzzz: has joined #ruby
[21:57:01] nfk: has joined #ruby
[21:58:01] jeffreylevesque: has joined #ruby
[21:58:14] mroutis: has joined #ruby
[21:58:39] n0m4d1c__: has joined #ruby
[21:59:05] Sar_Sa: has joined #ruby
[21:59:27] mroutis: hello, Sar_Sa
[22:00:38] ruby[bot]: has joined #ruby
[22:00:39] ChanServ: +o ruby[bot]
[22:01:10] n0m4d1c: has joined #ruby
[22:01:15] rwb: has joined #ruby
[22:02:23] Sar_Sa: what is the better way to pad a string up to certain size. For instance, I have a string with a size less than 10 and I want to padd it with null bytes until the size of 10. So "AA" would be converted to "AA\x00\x00\x00\x00\x00\x00\x00\x00\x00". How can I get that ?
[22:04:14] netherwolfe_: has joined #ruby
[22:05:39] mroutis: Sar_Sa: you should look to ljust and rjust, to pad a string up to a certain size, as phaul said; however, I think it won't help you with bytes
[22:06:02] phaul: how does derpy work again?
[22:07:10] rivalomega: has joined #ruby
[22:08:05] mroutis: at least, you could try a combination of ljust with map, but it's an ugly hack
[22:08:32] phaul: havenwood: thanks
[22:08:37] Sar_Sa: phaul: mroutis thank you let me check
[22:08:46] n0m4d1c_: has joined #ruby
[22:08:55] phaul: &ri ljust
[22:08:55] `derpy: http://ruby-doc.org/core-2.4.1/String.html#method-i-ljust
[22:10:01] mroutis: Sar_Sa: something like the following `'AA'.ljust(10, '~').gsub('~', '\x00')`
[22:10:32] Sar_Sa: mroutis: thank I'm gonna try it
[22:12:30] mroutis: Sar_Sa, why do you want to append "bytes" into a string?
[22:14:08] Sar_Sa: mroutis: works for me. And just another question, How can I convert a integer to a hex string of 4 bytes. For instance 13 would be "\x0D\x00\x00\x00"
[22:14:23] rivalomega: has joined #ruby
[22:16:15] cthulchu_: has joined #ruby
[22:16:22] apeiros: &ri Array#pack Sar_Sa
[22:16:23] `derpy: Sar_Sa: http://ruby-doc.org/core-2.4.1/Array.html#method-i-pack
[22:16:58] apeiros: that one also helps you with the null-padding
[22:17:14] havenwood: oops, I hit 100 lines - I must stop: https://gist.github.com/havenwood/823382815cbdcfddadd798d4042023a8
[22:17:52] cagomez: has joined #ruby
[22:17:53] mroutis: nice, apeiros
[22:18:25] Sar_Sa: thank you!! apeiros
[22:18:31] apeiros: Sar_Sa: a & N patterns are probably relevant
[22:18:43] apeiros: depending on desired endianness, you'll need something else than N
[22:18:46] faces: has joined #ruby
[22:18:49] Sar_Sa: apeiros: it looks like a mess haha
[22:18:51] Sar_Sa: ok thank you
[22:19:17] apeiros: yeah, but since you seem to use a binary packed protocol, that's probably exactly what you need ;-)
[22:19:28] mroutis: has joined #ruby
[22:20:31] havenwood: >> '๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ฆ'.bytes
[22:20:38] ruby[bot]: havenwood: I'm terribly sorry, I could not evaluate your code because of an error: OpenURI::HTTPError:500 Internal Server Error
[22:20:57] ur5us: has joined #ruby
[22:21:10] mroutis: is there a way I could use _derpy outside of IRC?
[22:21:34] havenwood: mroutis: There's ri.
[22:22:42] mroutis: woah, TIL ^, thank you
[22:24:38] erlend: has joined #ruby
[22:24:40] mroutis: has joined #ruby
[22:25:15] rfoust: has joined #ruby
[22:26:13] mroutis: has joined #ruby
[22:28:06] shinnya: has joined #ruby
[22:30:16] Sar_Sa: apeiros this works for me: n = 13 ; [n].pack("V")
[22:31:30] Sar_Sa: I need to use a list with the integer, n.pack does not work
[22:34:14] dr3wo: has joined #ruby
[22:35:07] venmx: has joined #ruby
[22:36:55] mroutis: Sar_Sa, what about [13, 26, 55].map { |x| [x].pack('V') }.join
[22:37:17] s2013: has joined #ruby
[22:37:36] Sar_Sa: mroutis: I just need to convert a integer
[22:37:46] apeiros: >> [13, 26, 55].pack("V3")
[22:37:52] ruby[bot]: apeiros: I'm terribly sorry, I could not evaluate your code because of an error: OpenURI::HTTPError:500 Internal Server Error
[22:37:57] apeiros: eval.in down? :(
[22:38:25] apeiros: wellโ€ฆ # => "\r\x00\x00\x00\x1A\x00\x00\x007\x00\x00\x00"
[22:38:40] apeiros: not sure what you mean by "a list with the integer"
[22:39:32] Sar_Sa: apeiros: I meadn that if I have an integer like n=3. I can not use n.pack
[22:39:38] Sar_Sa: I need to use [n].pack
[22:39:41] rivalomega: has joined #ruby
[22:40:04] apeiros: would be nice if there was a way for single values to pack/unpack
[22:40:23] jenrzzz: has joined #ruby
[22:40:23] jenrzzz: has joined #ruby
[22:40:58] Sar_Sa: apeiros / mroutis thank for the help
[22:45:14] minimalism: has joined #ruby
[22:45:48] conceivably: has joined #ruby
[22:46:44] conceivably: Hi :) Can any one think of a more elegant way of turning an ordinal into an integer than doing /(\d+)/.match("1st").captures.first.to_i ?
[22:47:46] al2o3-cr: Sar_Sa: that was 11 bytes 'esus
[22:48:05] Sar_Sa: al2o3-cr: what ?
[22:48:13] apeiros: "1st".to_i # => 1 @ conceivably
[22:48:47] apeiros: (and no, ruby isn't aware of ordinals, it's just that to_i ignores everything from and after the first non-digit)
[22:49:06] conceivably: :D brilliant! Thank you. I'm glad I asked.
[22:49:22] al2o3-cr: Sar_Sa: it was 10+1 bytes
[22:50:15] rivalomega: has joined #ruby
[22:53:00] al2o3-cr: Sar_Sa: what endian?
[22:53:45] al2o3-cr: vV is VAX nN is network > big endian
[22:54:07] al2o3-cr: yes to what?
[22:54:20] Sar_Sa: bit endian
[22:54:53] al2o3-cr: what size do you need though?
[22:55:17] al2o3-cr: and what's for?
[22:56:30] al2o3-cr: vax is rearly use now
[22:57:12] al2o3-cr: things can change on different archs
[22:57:21] devyn: has joined #ruby
[22:57:37] Sar_Sa: al2o3-cr: but I've already got it with [n].pack("V") :)
[22:59:03] al2o3-cr: [n].pack 'L<' which is well make your own mind up
[22:59:20] marr: has joined #ruby
[22:59:27] Sar_Sa: al2o3-cr: let me check
[22:59:53] Sar_Sa: al2o3-cr: it works too
[23:00:19] Sar_Sa: the same result
[23:02:00] al2o3-cr: well it holds 32 unsigned integer
[23:02:23] al2o3-cr: vax is gone don't use it.
[23:02:53] Sar_Sa: nice! thanks
[23:03:01] al2o3-cr: it's a perlism. legacy.
[23:03:21] Sar_Sa: nice to know that
[23:03:31] al2o3-cr: Sar_Sa: np pal
[23:04:08] al2o3-cr: Nn still hold though.
[23:05:57] Sar_Sa: pack is easy to get
[23:06:15] mroutis: has joined #ruby
[23:06:36] rcs: has joined #ruby
[23:06:46] al2o3-cr: Sar_Sa: how and why?
[23:08:09] Sar_Sa: i mean as a novice, understand the help from http://ruby-doc.org/core-2.4.1/Array.html#method-i-pack is difficult to catch
[23:09:24] al2o3-cr: Sar_Sa: check
[23:09:36] al2o3-cr: >> [0].pack ?C
[23:09:42] ruby[bot]: al2o3-cr: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[23:09:54] al2o3-cr: >> [0].pack ?C
[23:10:00] ruby[bot]: al2o3-cr: I'm terribly sorry, I could not evaluate your code because of an error: OpenURI::HTTPError:500 Internal Server Error
[23:10:40] Sar_Sa: al2o3-cr: now I've already understand its use
[23:11:20] devyn: has joined #ruby
[23:12:57] al2o3-cr: Sar_Sa: ex?
[23:13:09] Sar_Sa: al2o3-cr: ?
[23:14:22] al2o3-cr: example how you've understood?
[23:15:17] Sar_Sa: ah by reading several times https://blog.bigbinary.com/2011/07/20/ruby-pack-unpack.html
[23:15:58] yukai: has joined #ruby
[23:16:15] al2o3-cr: Sar_Sa: so what directive does `@` have?
[23:17:21] al2o3-cr: so say `'\x00\x00\x01\x0f'.unpack('@2C')?
[23:18:16] al2o3-cr: what is the meaning of `@` there?
[23:18:22] devyn: has joined #ruby
[23:18:29] Sar_Sa: not very sure the meaning of "moves to absolute position"
[23:18:55] al2o3-cr: Sar_Sa: what does it mean to you?
[23:19:55] weaksauce: has joined #ruby
[23:21:17] Sar_Sa: al2o3-cr: it indicates the position from the beginnin
[23:21:28] al2o3-cr: Sar_Sa: it doesn't mean anything without double quotes
[23:21:43] al2o3-cr: Sar_Sa: correct.
[23:22:22] al2o3-cr: >> '\x00\x00\x01\x0f'.unpack('@2C')
[23:22:25] rivalome_: has joined #ruby
[23:22:28] ruby[bot]: al2o3-cr: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[23:23:13] al2o3-cr: 48.chr == 0
[23:23:47] Sar_Sa: nice, very powerful pack/unpack
[23:24:11] al2o3-cr: Sar_Sa: it is
[23:24:47] al2o3-cr: i'd say convenient.
[23:25:26] norayr: has joined #ruby
[23:25:49] Sar_Sa: al2o3-cr: thank you for the explanation
[23:29:09] orbyt_: has joined #ruby
[23:29:30] al2o3-cr: Sar_Sa: pack/unpack 8/16/24/32/64 bit the directives are there for a purpose. ruby does all the work underneath for you.
[23:30:54] Sar_Sa: that saves you a lot of time
[23:32:31] al2o3-cr: Sar_Sa: it save you bit shifting <> check does this fit in this space > 0 oh no < greater space ....
[23:33:03] al2o3-cr: intel is always little endian
[23:33:49] venmx: has joined #ruby
[23:34:50] al2o3-cr: Sar_Sa: -1 is that unsigned or signed?
[23:36:03] al2o3-cr: why do you think this?
[23:39:59] al2o3-cr: ACTION listening to zz top.
[23:41:08] Sar_Sa: xDD because the most significant bit is 1
[23:41:40] ciscam: has joined #ruby
[23:41:42] norayr: has left #ruby: ()
[23:42:27] al2o3-cr: is that 1's or 2's complement in ruby?
[23:43:56] atchoum: has joined #ruby
[23:44:51] al2o3-cr: was that a guess?
[23:45:57] al2o3-cr: what does ~7 in your repl
[23:46:57] Sar_Sa: whats repl ?
[23:47:15] Sar_Sa: irb ah ok
[23:47:45] al2o3-cr: Sar_Sa: [[7].pack(?C).unpack('B*'), [~7].pack(?C).unpack('B*')] in irb/pry
[23:48:59] al2o3-cr: Sar_Sa: it flipping fantastic (been eating to many harrybows me)
[23:50:22] Sar_Sa: harrybows ?
[23:50:32] Sar_Sa: my english no so advanced :D
[23:52:01] apparition: has joined #ruby
[23:52:17] al2o3-cr: Sar_Sa: one's complement is when you go the route of the negative scale (it'll always flip the bits)
[23:52:53] al2o3-cr: so 99 is -100
[23:55:07] n0m4d1c: has joined #ruby
[23:55:36] al2o3-cr: Sar_Sa: you from php?
[23:56:06] Sar_Sa: long time ago ...
[23:56:55] al2o3-cr: how long ago>
[23:57:17] weaksauce: has joined #ruby
[23:59:44] duderonomy: has joined #ruby