« Back to channel list

#ruby - 18 May 2017

« Back 1 day Forward 1 day »
[00:00:27] Hunter1: has joined #ruby
[00:03:48] SeepingN: ugh. false alert, thx tho
[00:04:14] SeepingN: one of our IT "professionals" doens't know how to rsync, started rsyncing /home !!!!!!!!! wtf
[00:04:34] hutch34: has joined #ruby
[00:04:37] SeepingN: and on top of that, it copied old files over new, so he doesn't know where to rsync form or how to use it to update files
[00:04:59] yosafbridge: has joined #ruby
[00:05:11] SeepingN: my old dot files were restored, which pointed to my local gem repository (now empty). Ugh
[00:08:10] JeanCarl1Machado: has joined #ruby
[00:11:04] rakm: has joined #ruby
[00:12:07] Guest29587: has joined #ruby
[00:12:09] SeepingN: unbelievable. I better go home before I shove the ESXi down this windows boob's throat
[00:13:39] mrconfused: has joined #ruby
[00:15:34] DrCode: has joined #ruby
[00:17:16] joast: has joined #ruby
[00:17:38] Hunter1: has joined #ruby
[00:18:49] MrBusiness: has joined #ruby
[00:19:01] raul782: has joined #ruby
[00:21:46] perniciouscaffei: has joined #ruby
[00:27:23] jenrzzz: has joined #ruby
[00:27:23] jenrzzz: has joined #ruby
[00:29:27] DrCode: has joined #ruby
[00:30:37] paradisaeidae: has joined #ruby
[00:30:39] paradisaeidae_: has joined #ruby
[00:31:51] Pete_: has joined #ruby
[00:32:52] skweek: has joined #ruby
[00:34:36] ascarter: has joined #ruby
[00:42:10] Cohedrin: has joined #ruby
[00:43:18] Rodya_: has joined #ruby
[00:45:09] d^sh: has joined #ruby
[00:46:57] jhack: has joined #ruby
[00:48:02] asdx35: has joined #ruby
[00:51:26] asdx35: I'm writing python code at work these days but I miss ruby a lot
[00:51:40] aguynamedben: has joined #ruby
[00:55:39] apparition: has joined #ruby
[00:56:04] duderonomy: has joined #ruby
[00:56:41] mim1k: has joined #ruby
[01:03:54] minimalism: has joined #ruby
[01:04:33] knight33: has joined #ruby
[01:07:34] mrconfused: has joined #ruby
[01:10:09] asdx35: not sure if I should just rewrite the project, what would you guys suggest?
[01:11:01] asdx35: it's something I feel I can do quickly
[01:11:32] Radar: How big of a project is it (LoC)? Do management require the project to be written in Python?
[01:12:11] gizmore|2: has joined #ruby
[01:12:14] oborot: has joined #ruby
[01:12:29] Radar: asdx35: ^
[01:12:48] Radar: Do you work with other people who only know Python?
[01:13:47] alveric4: has joined #ruby
[01:16:05] asdx35: our manager just quit but he used to prefer python and was biased towards it, "python is faster than ruby" he claimed, but I bet the last time he used ruby was in the 1.8 days
[01:16:22] asdx35: Radar: yes, but they could adapt
[01:17:03] bougyman: if doing something computationally expensive, neither python nor ruby (the common implementations) are the right choice, usually.
[01:17:12] bougyman: so that's a lame argument.
[01:19:12] ghoti: has joined #ruby
[01:22:24] uZiel: has joined #ruby
[01:22:31] dviola: has joined #ruby
[01:23:56] asdx35: I argued with this person a lot at work, I think that might have been one of the reasons of why he decided to quit
[01:25:46] olivier__: has joined #ruby
[01:32:55] jenrzzz: has joined #ruby
[01:34:05] olivier__: has joined #ruby
[01:34:17] michael_mbp: Something I'm working on, I'm making calls from Ruby to C++, crunching in C14, and then passing JSON back to the Rails app
[01:34:43] michael_mbp: planning to extend with gRPC at somepoint. Take away here, don't get fixated on a singular language.
[01:35:17] michael_mbp: complex modelling took me a under a couple hours in Ruby, vs. porting said logic to C++.
[01:45:22] Rodya_: has joined #ruby
[01:45:49] jenrzzz: has joined #ruby
[01:45:49] jenrzzz: has joined #ruby
[01:47:52] fmccann: has joined #ruby
[01:48:54] Nicmavr: has joined #ruby
[01:49:17] Nicmavr: has joined #ruby
[01:49:24] jusa: has joined #ruby
[01:50:33] mrconfused: has joined #ruby
[01:50:34] fern: has joined #ruby
[01:53:07] hugo_dc: has joined #ruby
[01:54:16] d^sh_: has joined #ruby
[01:56:35] olivier__: has joined #ruby
[01:57:24] jrafanie: has joined #ruby
[01:58:31] balazs: has joined #ruby
[01:58:37] iliketur_: has joined #ruby
[02:00:26] BSAlb: has joined #ruby
[02:02:47] cschneid_: has joined #ruby
[02:03:50] cschneid_: has joined #ruby
[02:07:32] PorcoRex: has joined #ruby
[02:07:42] PorcoRex: Good evening Ruby.
[02:09:27] olivier__: has joined #ruby
[02:13:36] Jameser: has joined #ruby
[02:15:14] oborot: has joined #ruby
[02:17:51] itarato: has joined #ruby
[02:19:37] pen: has joined #ruby
[02:20:25] genpaku: has joined #ruby
[02:23:05] gnufied: has joined #ruby
[02:23:32] mwlang: has joined #ruby
[02:24:31] ledestin: has joined #ruby
[02:31:14] uxp: has joined #ruby
[02:31:41] vahe: has joined #ruby
[02:32:34] bougyman: has joined #ruby
[02:34:24] KeyJoo: has joined #ruby
[02:39:10] bruno-: has joined #ruby
[02:41:39] mrconfused: has joined #ruby
[02:45:20] gnufied: has joined #ruby
[02:46:06] Rodya_: has joined #ruby
[02:50:25] cyphase: has joined #ruby
[02:52:16] Talltree: has joined #ruby
[02:55:40] Cohedrin: has joined #ruby
[02:57:09] mim1k: has joined #ruby
[02:58:56] ResidentBiscuit: has joined #ruby
[03:00:50] d^sh: has joined #ruby
[03:03:33] olivier__: has joined #ruby
[03:08:25] nobitanobi: has joined #ruby
[03:09:24] bkxd: has joined #ruby
[03:11:30] ascarter: has joined #ruby
[03:12:15] jphase: has joined #ruby
[03:14:48] bkxd: has joined #ruby
[03:15:33] nanoz: has joined #ruby
[03:18:16] bambanx: has joined #ruby
[03:23:36] ur5us: has joined #ruby
[03:26:24] Talltree: has joined #ruby
[03:28:40] jeffreylevesque: has joined #ruby
[03:29:43] tessi_zz: has joined #ruby
[03:30:41] cyphase: has joined #ruby
[03:33:15] cgfbee: has joined #ruby
[03:46:53] Rodya_: has joined #ruby
[03:47:37] nullobject: has joined #ruby
[03:48:18] eightlimbed: has joined #ruby
[03:48:41] havenwood: eightlimbed: hey
[03:50:33] minimalism: has joined #ruby
[03:50:51] jgt1: has joined #ruby
[03:51:15] eightlimbs: has joined #ruby
[03:52:00] guest3456: has joined #ruby
[03:52:29] guest3456: has left #ruby: ()
[03:53:51] PorcoRex: eightlimbs, hello.
[03:54:47] pwnd_nsfw`: has joined #ruby
[04:08:16] charliesome: has joined #ruby
[04:11:03] cahoots: has joined #ruby
[04:11:36] cahoots: hi, is there a library that will sample the code every so often and just show me what it's doing? like, every second it prints out what the script is doing at that moment
[04:11:53] cahoots: i just need to very broadly understand what the bottlenecks
[04:12:06] raspado: has joined #ruby
[04:12:39] baweaver: cahoots: depends
[04:12:51] baweaver: mostly it's literally just throwing puts statements in it to log out
[04:13:41] cahoots: baweaver, it would just be more convenient to attach something. it can also be a decently large file where many bottlenecks may arise
[04:13:53] PorcoRex: baweaver, I think he wants to profile the app.
[04:14:17] baweaver: ruby-prof in that case
[04:14:50] baweaver: but for what it's doing at specific points, literally it's just logging
[04:15:02] Dimik: has joined #ruby
[04:16:37] cahoots: yeah it looks like ruby-prof will work, thanks :)
[04:17:17] dhollinger: has joined #ruby
[04:19:26] dhollinger: has joined #ruby
[04:20:05] yeticry: has joined #ruby
[04:25:28] ski7777: has joined #ruby
[04:31:12] iliketurtles: has joined #ruby
[04:33:31] renchan: has joined #ruby
[04:39:12] nofxx: has joined #ruby
[04:41:04] uZiel: has joined #ruby
[04:42:07] jeffreylevesque_: has joined #ruby
[04:46:01] fern: has joined #ruby
[04:47:35] Rodya_: has joined #ruby
[04:51:15] fern: has joined #ruby
[04:51:51] nofxxx: has joined #ruby
[04:54:23] xall: has joined #ruby
[04:55:08] ascarter: has joined #ruby
[04:57:43] mim1k: has joined #ruby
[05:05:58] romeoh: has joined #ruby
[05:06:13] paradisaeidae_: has left #ruby: ()
[05:07:32] paradisaeidae: has left #ruby: ()
[05:08:09] P1ro: has joined #ruby
[05:10:32] Cohedrin: has joined #ruby
[05:12:23] gusrub: has joined #ruby
[05:12:34] nofxxxx: has joined #ruby
[05:14:50] marr: has joined #ruby
[05:15:51] ben_alman: has joined #ruby
[05:18:58] aufi: has joined #ruby
[05:22:02] juggler: has joined #ruby
[05:22:58] ascarter: has joined #ruby
[05:32:45] ascarter: has joined #ruby
[05:34:05] rdw200169__: has joined #ruby
[05:42:58] brent__: has joined #ruby
[05:43:04] anisha: has joined #ruby
[05:45:20] ascarter: has joined #ruby
[05:48:24] Rodya_: has joined #ruby
[05:51:45] jgt1: has joined #ruby
[05:53:41] patarr: has joined #ruby
[05:54:48] pankaj_: has joined #ruby
[06:01:16] muelleme: has joined #ruby
[06:06:12] _whitelogger: has joined #ruby
[06:08:55] romeoh: has joined #ruby
[06:11:23] nofxxx: has joined #ruby
[06:15:24] perniciouscaffei: has joined #ruby
[06:19:07] jgt1: has joined #ruby
[06:21:58] enterprisey: has joined #ruby
[06:32:18] Bock: has joined #ruby
[06:33:07] pankaj_: has joined #ruby
[06:34:37] conta: has joined #ruby
[06:37:55] alazred: has joined #ruby
[06:37:55] alazred: has joined #ruby
[06:46:30] ur5us: has joined #ruby
[06:49:04] Rodya_: has joined #ruby
[06:49:07] perniciouscaffei: has joined #ruby
[06:51:25] charliesome: has joined #ruby
[07:00:50] andikr: has joined #ruby
[07:01:17] nofxx: has joined #ruby
[07:04:05] bkxd: has joined #ruby
[07:04:19] TomyWork: has joined #ruby
[07:08:13] biberu: has joined #ruby
[07:08:34] ThirstySurfer: has joined #ruby
[07:09:41] romeoh: has joined #ruby
[07:09:59] nobitanobi: has joined #ruby
[07:18:24] nobitanobi: has joined #ruby
[07:18:39] aufi: has joined #ruby
[07:22:33] mark_66: has joined #ruby
[07:23:39] ur5us: has joined #ruby
[07:24:35] nofxxxx: has joined #ruby
[07:29:18] herbmillerjr: has joined #ruby
[07:29:28] alazred: has joined #ruby
[07:29:28] alazred: has joined #ruby
[07:34:32] silentoxygen: has joined #ruby
[07:36:50] pandaant: has joined #ruby
[07:49:10] mim1k: has joined #ruby
[07:49:49] Rodya_: has joined #ruby
[07:53:22] zacts: has joined #ruby
[07:54:29] ThirstySurfer: has joined #ruby
[07:54:32] patarr: has joined #ruby
[07:58:00] nofxxx: has joined #ruby
[07:58:29] brent__: has joined #ruby
[07:58:36] mikecmpbll: has joined #ruby
[08:01:31] dionysus69: has joined #ruby
[08:04:03] tvw: has joined #ruby
[08:05:39] workmad3: has joined #ruby
[08:06:36] DaniG2k: has joined #ruby
[08:06:48] Silthias1: has joined #ruby
[08:07:16] jenrzzz: has joined #ruby
[08:07:16] jenrzzz: has joined #ruby
[08:10:36] romeoh: has joined #ruby
[08:10:51] nofxxxx: has joined #ruby
[08:13:58] TheBrayn: should I escape “/” in regexpes if I use %r{} instead of //?
[08:15:06] dminuoso: TheBrayn: !tias
[08:15:09] dminuoso: TheBrayn: ?tias
[08:15:12] dminuoso: ?tias TheBrayn
[08:15:12] ruby[bot]: TheBrayn: Why don't you try it and see for yourself?
[08:15:35] TheBrayn: it both works that's why I'm asking for best practices
[08:15:52] dminuoso: TheBrayn: If it's required its not a best practice but a requirement.
[08:16:03] dminuoso: If it's not required, then you can't "escape it"
[08:16:20] dminuoso: So this is not a question of best practices, but whether you have to esacpe or not.
[08:17:12] dminuoso: Or well I guess its optional in that case.
[08:17:32] dminuoso: TheBrayn: One of the reasons %r{} exists is that you dont have to escape those slashes.
[08:17:58] dminuoso: well I guess it never even occured to me to even try and escape something that needs no escaping
[08:19:56] mim1k: has joined #ruby
[08:20:17] charliesome: has joined #ruby
[08:21:26] lxsameer: has joined #ruby
[08:24:51] flying: has joined #ruby
[08:35:38] nofxxx: has joined #ruby
[08:38:37] dionysus69: has joined #ruby
[08:40:55] antgel: has joined #ruby
[08:41:04] tomphp: has joined #ruby
[08:42:33] cyclonis: has joined #ruby
[08:45:11] oborot: has joined #ruby
[08:45:34] aupadhye: has joined #ruby
[08:47:19] TreyG: has joined #ruby
[08:50:31] Kug3lis: has joined #ruby
[08:51:53] Rodya_: has joined #ruby
[08:52:22] aupadhye: has joined #ruby
[08:53:26] yogg-saron: has joined #ruby
[08:56:21] nofxx: has joined #ruby
[08:59:01] mim1k: has joined #ruby
[09:00:47] pragmaticus: has joined #ruby
[09:01:03] armando: has joined #ruby
[09:02:01] deepinuser: has joined #ruby
[09:02:19] selim: I'll try to disable the online fetching with -l but it does just ignore that if I do a gem install -l <gemname> it's still checking on api.rubygem.org but I do not have Internet access on those systems so I get a timeout of more than 30 minutes for every package
[09:02:29] selim: can someone tell me how to disable that for good?
[09:02:42] selim: is that a bug, I have that issue mostly on SLES systems
[09:07:57] fern: has joined #ruby
[09:11:14] romeoh: has joined #ruby
[09:12:06] ur5us: has joined #ruby
[09:16:45] robotmay: has joined #ruby
[09:17:17] herbmillerjr: has joined #ruby
[09:19:16] gusrub: has joined #ruby
[09:22:19] bkxd: has joined #ruby
[09:23:55] mlkkk: has joined #ruby
[09:24:32] vikas027: has joined #ruby
[09:25:50] nofxxx: has joined #ruby
[09:28:18] cyclonis: has joined #ruby
[09:28:21] vikas027: Hey All, How can I have 'optparse' to show help. This is my code. https://dpaste.de/CsTN Options are working fine, but not help
[09:28:27] lacuna: has joined #ruby
[09:28:33] pankaj_: has joined #ruby
[09:31:26] vikas027: don't worry, It is done :) Sometimes, you just need a cofee
[09:33:01] xall: has joined #ruby
[09:38:59] tomphp: has joined #ruby
[09:43:31] ThirstySurfer: has joined #ruby
[09:45:59] dionysus69: has joined #ruby
[09:47:24] ferr: has joined #ruby
[09:50:35] jgt1: has joined #ruby
[09:50:59] tAn: has joined #ruby
[09:51:17] fern: has joined #ruby
[09:53:03] Rodya_: has joined #ruby
[09:53:42] nofxxxx: has joined #ruby
[09:54:41] bkxd_: has joined #ruby
[09:55:29] patarr: has joined #ruby
[09:56:38] mlkkk: has joined #ruby
[09:59:12] harfangk: has joined #ruby
[10:04:43] romank: has joined #ruby
[10:05:41] toretore: has joined #ruby
[10:06:38] tvw: has joined #ruby
[10:08:32] mim1k: has joined #ruby
[10:12:01] romeoh: has joined #ruby
[10:12:41] vall: has joined #ruby
[10:17:02] itarato: has joined #ruby
[10:17:31] olivier__: has joined #ruby
[10:18:04] adaedra: has joined #ruby
[10:18:24] nullobject: has joined #ruby
[10:18:34] jaruga: has joined #ruby
[10:19:40] duderonomy: has joined #ruby
[10:19:49] `derpy: has joined #ruby
[10:21:56] jenrzzz: has joined #ruby
[10:21:56] jenrzzz: has joined #ruby
[10:23:34] cyphase: has joined #ruby
[10:24:47] djbkd: has joined #ruby
[10:25:15] Beams: has joined #ruby
[10:27:23] mahlon: has joined #ruby
[10:28:17] ged: has joined #ruby
[10:28:25] Beams: has joined #ruby
[10:30:57] DaniG2k: has joined #ruby
[10:31:26] Beams: has joined #ruby
[10:36:03] bkxd: has joined #ruby
[10:38:21] nobitanobi: has joined #ruby
[10:39:27] faces: has joined #ruby
[10:40:56] alazred: has joined #ruby
[10:40:57] alazred: has joined #ruby
[10:41:02] mim1k: has joined #ruby
[10:42:47] cfec0b8d: has joined #ruby
[10:43:53] BSaboia: has joined #ruby
[10:44:52] KeyJoo: has joined #ruby
[10:45:23] oborot: has joined #ruby
[10:45:43] Hunter1: has joined #ruby
[10:46:31] jaruga: has joined #ruby
[10:47:21] nobitanobi: has joined #ruby
[10:51:39] anisha_: has joined #ruby
[10:55:01] rgr: has joined #ruby
[10:57:18] jenrzzz: has joined #ruby
[10:57:32] Beams: has joined #ruby
[10:58:50] b0mbnet: has joined #ruby
[11:08:51] Hunter1: has joined #ruby
[11:12:49] romeoh: has joined #ruby
[11:14:05] sepp2k: has joined #ruby
[11:16:20] bkxd_: has joined #ruby
[11:16:31] jrafanie: has joined #ruby
[11:17:24] Beams: has joined #ruby
[11:18:42] xa0s_: has joined #ruby
[11:19:31] nowhere_man: has joined #ruby
[11:22:59] nofxxx: has joined #ruby
[11:24:06] patarr: has joined #ruby
[11:26:04] itarato: has joined #ruby
[11:27:21] pankaj: has joined #ruby
[11:31:41] VladGh: has joined #ruby
[11:35:44] jgt2: has joined #ruby
[11:36:24] romeoh_: has joined #ruby
[11:37:57] nullobject: has joined #ruby
[11:40:37] dionysus69: has joined #ruby
[11:44:11] burgestrand: has joined #ruby
[11:44:11] JeanCarl1Machado: has joined #ruby
[11:44:12] JeanCarloMachado: has joined #ruby
[11:44:24] quobo: has joined #ruby
[11:46:19] fern: has joined #ruby
[11:54:43] robotmay: has joined #ruby
[11:59:41] bkxd: has joined #ruby
[12:00:24] knight33: has joined #ruby
[12:05:02] synthroid: has joined #ruby
[12:09:34] nobitanobi: has joined #ruby
[12:10:24] mochiyoda_: has joined #ruby
[12:11:45] patr0clus: has joined #ruby
[12:13:50] olivier__: has joined #ruby
[12:16:18] DeeJayh: has joined #ruby
[12:16:30] mrconfused: has joined #ruby
[12:16:55] alazred: has joined #ruby
[12:16:55] alazred: has joined #ruby
[12:19:16] olivier__: has joined #ruby
[12:21:30] jgt3: has joined #ruby
[12:24:20] olivier__: has joined #ruby
[12:24:28] nadir: has joined #ruby
[12:26:54] anvor: has joined #ruby
[12:27:47] pupsicle: adaedra: hello
[12:28:14] dviola: has joined #ruby
[12:28:19] dminuoso: adaedra: elo.
[12:29:28] itarato: has joined #ruby
[12:29:49] marahin: has joined #ruby
[12:30:13] marahin: Hello! Can someone please explain behaviour of this code to me: "a = Hash.new([]); a['1280x720'].push({'key' => 'value'})"?
[12:30:34] marahin: `a` returns `{}`, but `a['1280x720']` returns `{'key' => 'value'}` Hash.
[12:30:44] marahin: How is that? Why `a` returns empty hash, even though it _contains_ a value?
[12:31:13] olivier__: has joined #ruby
[12:32:02] canton7: you haven't actually added anything to the hash
[12:32:43] marahin: canton7 how come then?
[12:32:55] marahin: how come I can reference to '1280x720' key in variable a?
[12:33:01] canton7: Note that 'Hash.new([])' returns the *same* array instance whenever an unknown key is requested
[12:33:14] canton7: it doesn't generate a new array instance - it keeps using the same one
[12:33:28] jzigmund: has joined #ruby
[12:33:35] canton7: you want the form 'Hash.new{ |h,k| h[k] = [] }', which generates a new array instance each time you request an unknown key
[12:33:50] marahin: canton7 so this is somehow related to reference?
[12:34:00] bastrud: has joined #ruby
[12:34:25] canton7: yeah, that's part of it
[12:34:43] marahin: canton7 thank you for showing me the solution :)
[12:35:13] canton7: with your first attempt, you'll now notice that `a['foo']` returns `[{'key' => 'value'}]`
[12:35:50] canton7: when you accessed `a['1280x720']` you were given that array instance you passed to Hash.new, but it didn't add a new key to the hash. You modified that array instance (changing the default value)
[12:36:33] vikas027: How do I return two values in a method and please rubocop as well https://dpaste.de/kMJH
[12:36:57] vikas027: Try 2 works fine, but rubocop complains that return is redundant
[12:37:27] canton7: `[hash['publicValue], hash['secretValue']]`
[12:38:15] vikas027: wow , that was super quick canton7. Thanks much
[12:38:15] dminuoso: vikas027: Or you know, stop blindly following rubocop.
[12:38:24] dminuoso: vikas027: Configure it to tell you what you care about.
[12:38:32] dminuoso: I like explicit returns.
[12:39:11] vikas027: dminuoso, I like it too... but my team doesn't. They try to please rubocop as much as they can..
[12:39:12] bkxd_: has joined #ruby
[12:39:47] lacuna: has joined #ruby
[12:40:15] dionysus69: has joined #ruby
[12:41:11] apparition: has joined #ruby
[12:41:19] DeeJayh: has joined #ruby
[12:41:27] dminuoso: vikas027: There's nothing wrong with that then. Consistency matters more than personal preference.
[12:41:37] alazred: has joined #ruby
[12:41:43] Fysicus: has joined #ruby
[12:41:45] dminuoso: I just see it far too often that people "please rubocop" instead of stating "following convention"
[12:42:27] vikas027: dminuoso: True. And I am still a beginner in Ruby, have to abide all rules :)
[12:42:39] eightlimbed: has joined #ruby
[12:42:50] gnufied: has joined #ruby
[12:43:43] canton7: yeah, I do think it's important that when you're starting a language, you drop all of your preconceptions about style and try to use the idioms of the language. Later on, you can decide which bits of style you do and don't like
[12:44:22] vikas027: cantom7: Rightly said
[12:44:44] mrconfused: has joined #ruby
[12:45:36] oborot: has joined #ruby
[12:46:01] dminuoso: Though for what its worth, the default rubocop configuration is quite decent already.
[12:48:13] nullobject: has joined #ruby
[12:50:38] xenops: has joined #ruby
[12:50:42] fusta: has joined #ruby
[12:52:24] jeffreylevesque: has joined #ruby
[12:55:28] ldnunes: has joined #ruby
[12:59:52] pandaant: has joined #ruby
[13:00:10] tomphp: has joined #ruby
[13:00:59] ramortegui: has joined #ruby
[13:07:04] DeeJayh: has joined #ruby
[13:11:05] vall: has joined #ruby
[13:16:07] toretore: has joined #ruby
[13:18:20] cdg: has joined #ruby
[13:23:34] shinnya: has joined #ruby
[13:26:04] DLSteve: has joined #ruby
[13:27:02] Jakaria: has joined #ruby
[13:27:15] bruno-: has joined #ruby
[13:27:28] Jakaria: can anyone tell me what's the role of "do" keyword in this code- https://gist.github.com/JakariaBlaine/6425dbf910484009a4d417b8ef9102e5
[13:28:02] Jakaria: I am learning Ruby.... I saw this code in Rails....
[13:29:12] cam27: has joined #ruby
[13:30:16] elomatreb: Jakaria: do ... end is one form to write a "block", which is a fairly unique to ruby concept
[13:31:23] Beams: has joined #ruby
[13:33:04] bkxd: has joined #ruby
[13:33:36] yogg-saron: has joined #ruby
[13:34:06] synthroid: has joined #ruby
[13:35:00] mim1k: has joined #ruby
[13:36:47] tobiasvl: Jakaria: as elomatreb says, the stuff between "do" and "end" is what's called a block. it's passed to the "concern" method
[13:37:13] Jakaria: can you show me a script of using do...end??? it might be helpful for me to understand about it....
[13:37:27] DeeJayh: has joined #ruby
[13:37:30] elomatreb: You probably won't find much Ruby code that doesn't use them
[13:37:44] tobiasvl: Jakaria: maybe https://mixandgo.com/blog/mastering-ruby-blocks-in-less-than-5-minutes (haven't read it myself)
[13:37:53] tobiasvl: or just read any ruby book
[13:37:59] tobiasvl: how are you learning ruby?
[13:39:13] Jakaria: I've watched some series of basic ruby tutorials in YouTube...
[13:39:27] Jakaria: now, I am learning Rails from RailsForZombie
[13:39:53] tomphp: has joined #ruby
[13:41:07] Jakaria: thanks tobiasvl, that link you gave has some useful information about do...end
[13:44:34] Jakaria: so, do..end block works almost like Proc?
[13:44:39] oleo: has joined #ruby
[13:44:40] harfangk: has joined #ruby
[13:45:16] tvw: has joined #ruby
[13:45:19] tobiasvl: yes, almost. they're both closures
[13:45:27] tobiasvl: http://awaxman11.github.io/blog/2013/08/05/what-is-the-difference-between-a-block/
[13:47:30] jgt3: has joined #ruby
[13:48:02] jamesaxl: has joined #ruby
[13:48:10] Jakaria: thanks, man..... that was very helpful....
[13:48:38] Bish: ACTION things of blocks as proc literals
[13:48:43] Bish: ACTION might be wrong though.
[13:51:59] elomatreb: Procs are objects, blocks are not unless you make them into one using the &block syntax
[13:52:22] olivier__: has joined #ruby
[13:54:12] SaschaVoid: has joined #ruby
[13:56:04] Rodya_: has joined #ruby
[13:56:41] griffindy: has joined #ruby
[13:57:51] __Yiota: has joined #ruby
[13:58:18] yogg-saron: has joined #ruby
[13:58:38] jrafanie: has joined #ruby
[13:58:48] Bish: elomatreb: that description is misleading, blocks cannot become an object
[13:59:11] Bish: you can provide a proc that acts as a block, but blocks wont become objects during that
[13:59:37] olivier__: has joined #ruby
[13:59:56] elomatreb: Yes, I meant "make them into a proc object", *effectively* turning them into one just like the proc method turns a block into a Proc
[14:02:39] Bish: > blocks are not unless you make them into one using the &block syntax, <thats not the only way block can become procs, it's even the most complicated
[14:02:59] Bish: that's what i found misleading
[14:03:31] elomatreb: What would be the other ways?
[14:03:46] Bish: >> Proc.new { puts "hi" }.call
[14:03:47] ruby[bot]: Bish: # => hi ...check link for more (https://eval.in/800208)
[14:04:39] Bish: >> ->(){}
[14:04:40] yogg-saron: has joined #ruby
[14:04:40] ruby[bot]: Bish: # => #<Proc:0x41989be4@/tmp/execpad-9297ea5d937a/source-9297ea5d937a:2 (lambda)> (https://eval.in/800209)
[14:05:41] elomatreb: OK, stabby lambda I'd agree with, but the others are just methods that *could* do the same with &block internally (I have no idea how similar the C level stuff that does that is though)
[14:06:21] bheesham: has joined #ruby
[14:06:23] LightStalker: has joined #ruby
[14:06:27] Bish: even though it wouldn't be the only way, which your description stated
[14:07:13] Bish: and no they couldn't do it with &block.. because &block turns them into proc, which would proc need to call proc
[14:08:21] dasher00: has joined #ruby
[14:12:54] toretore: has joined #ruby
[14:14:00] bmgoog: has left #ruby: ()
[14:14:22] hutch34: has joined #ruby
[14:14:35] dminuoso: 15:58:49 Bish | elomatreb: that description is misleading, blocks cannot become an object │ armyriad
[14:14:46] ruby[bot]: dminuoso: # => undefined method `Proc' for main:Object (NoMethodError) ...check link for more (https://eval.in/800212)
[14:14:51] ruby[bot]: dminuoso: # => #<Proc:0x41789b64@/tmp/execpad-c886ed900973/source-c886ed900973:2> (https://eval.in/800213)
[14:14:59] dminuoso: Voila! block just became an objcet ;o
[14:15:17] elomatreb: Did it actually, or did we get an object the holds/represents a block?
[14:15:43] dminuoso: elomatreb: a block is a special control structure. All a proc is is a block with an object header
[14:15:44] elomatreb: Or did we construct a Proc object *from* a block?
[14:15:58] Bish: dminuoso knows the c internals very well.
[14:15:59] dminuoso: elomatreb: A proc is basically just an RObject with a pointer to a block.
[14:16:15] elomatreb: See, that's the answer I wanted. I should read that Ruby internals book some time
[14:16:31] hxegon: There's a ruby internals book? *googles*
[14:16:38] dminuoso: hxegon: Yes. Ruby under a microscope
[14:16:56] dminuoso: It's a bit dated, the source code examples dont match well anymore but conceptually it's largely still correct.
[14:17:46] User458764: has joined #ruby
[14:19:38] __Yiota: has joined #ruby
[14:19:48] mim1k: has joined #ruby
[14:21:14] mustmodify: has joined #ruby
[14:21:30] ascarter: has joined #ruby
[14:21:45] Bish: dminuoso: how good will ruby3 multithreading be?
[14:22:42] dminuoso: Bish: I barely know anything about Ruby 3.
[14:22:42] yogg-saron: has joined #ruby
[14:23:28] mustmodify: I went to a [jewelery conference](https://goo.gl/uJjJef) one time because it was important to her. I told her it was time for her to come to a code conference with me. :) She said she would go if it wasn't *entirely* about coding... some inspirational speakers or less in-the-woods discussions. Are you aware of anything like that?
[14:24:11] olivier__: has joined #ruby
[14:24:35] lacuna: has joined #ruby
[14:24:50] havenwood: mustmodify: Rails Camp is just camp for adults. It's very in-the-woods though. ;-)
[14:25:04] yogg-saron: has joined #ruby
[14:25:14] jgt3: has joined #ruby
[14:25:16] havenwood: http://west.railscamp.us/
[14:26:03] havenwood: mustmodify: RubyConf is in New Orleans this year. There are often non-technical tracks these days.
[14:26:16] ski7777: has joined #ruby
[14:26:19] havenwood: Talks haven't been selected yet.
[14:26:36] havenwood: mustmodify: http://rubyconf.org/
[14:28:01] dminuoso: mustmodify: Is she looking for after-conf partying like the greek?
[14:29:20] memph1s: has joined #ruby
[14:29:39] bilal: has joined #ruby
[14:29:51] tvw: has joined #ruby
[14:31:28] jerematic: has joined #ruby
[14:32:44] fusta: has joined #ruby
[14:33:52] uZiel: has joined #ruby
[14:34:17] User458764: has joined #ruby
[14:35:08] hashrocket: has joined #ruby
[14:37:05] yogg-saron: has joined #ruby
[14:38:07] nullobject: has joined #ruby
[14:39:16] tgragnato: has joined #ruby
[14:40:13] tvw: has joined #ruby
[14:40:41] jaruga: has joined #ruby
[14:45:44] vahe: has joined #ruby
[14:45:46] alazred: has joined #ruby
[14:46:52] oborot: has joined #ruby
[14:48:24] perniciouscaffei: has joined #ruby
[14:48:30] xall: has joined #ruby
[14:50:10] jphase: has joined #ruby
[14:54:30] jrafanie: has joined #ruby
[14:54:48] chouhoulis: has joined #ruby
[14:56:07] mustmodify: havenwood: thanks! Good ideas!
[14:56:47] Rodya_: has joined #ruby
[14:57:58] elsevero: has joined #ruby
[14:58:47] jgt3: has joined #ruby
[15:00:50] nobitano_: has joined #ruby
[15:01:41] jrafanie_: has joined #ruby
[15:04:30] trwyth: has left #ruby: ()
[15:07:03] ascarter: has joined #ruby
[15:08:03] bkxd: has joined #ruby
[15:09:02] Rodya_: has joined #ruby
[15:10:38] lacuna: has joined #ruby
[15:13:21] raspado: has joined #ruby
[15:14:24] Pumukel: has joined #ruby
[15:16:16] ThirstySurfer: has joined #ruby
[15:17:17] bilal_: has joined #ruby
[15:20:25] bilal80: has joined #ruby
[15:21:08] kegster: has joined #ruby
[15:22:35] sleetdrop: has joined #ruby
[15:23:14] lacuna: has joined #ruby
[15:25:00] jgt3: has joined #ruby
[15:25:25] rippa: has joined #ruby
[15:25:32] cschneid_: has joined #ruby
[15:26:04] ltem: has joined #ruby
[15:29:45] jaruga: has joined #ruby
[15:29:49] jgt3: has joined #ruby
[15:29:58] eightlimbed: has joined #ruby
[15:30:36] majuk: has joined #ruby
[15:33:03] itarato: has joined #ruby
[15:35:43] iliketurtles: has joined #ruby
[15:35:59] skweek: has joined #ruby
[15:37:03] gmoney: has joined #ruby
[15:37:36] etehtsea: has joined #ruby
[15:39:08] itarato: has joined #ruby
[15:39:34] hobodave: has joined #ruby
[15:39:45] rgr_: has joined #ruby
[15:45:12] eightlimbs: has joined #ruby
[15:45:27] pankaj: has joined #ruby
[15:46:03] flyingX: has joined #ruby
[15:46:48] eightlimbs: has left #ruby: ()
[15:46:54] eightlimbs: has joined #ruby
[15:47:28] flyingX: has joined #ruby
[15:47:42] hobodave_: has joined #ruby
[15:48:19] eightlimbs: has left #ruby: ()
[15:48:54] eightlimbed: has joined #ruby
[15:49:07] synthroid: has joined #ruby
[15:49:29] bilal: has joined #ruby
[15:50:05] tomphp: has joined #ruby
[15:51:08] uZiel: has joined #ruby
[15:54:59] t-recx: has joined #ruby
[15:55:53] Saganesque: has joined #ruby
[15:56:04] postmodern: has joined #ruby
[15:57:21] bilal: has joined #ruby
[15:57:44] gnufied: has joined #ruby
[15:59:26] ascarter: has joined #ruby
[15:59:48] brent__: has joined #ruby
[16:00:08] bheesham: has joined #ruby
[16:00:26] brent__: has joined #ruby
[16:01:05] nitric: has joined #ruby
[16:01:07] renchan: has joined #ruby
[16:01:13] ascarter: has joined #ruby
[16:01:48] patarr: has joined #ruby
[16:02:45] bilal: has joined #ruby
[16:02:56] gusrub: has joined #ruby
[16:03:38] nullobject: has joined #ruby
[16:04:03] uZiel: has joined #ruby
[16:05:22] amclain: has joined #ruby
[16:06:33] hutch34: has joined #ruby
[16:07:15] t-recx: has joined #ruby
[16:09:44] rkazak: has joined #ruby
[16:12:18] bruno-: has joined #ruby
[16:12:51] gusrub: has joined #ruby
[16:15:03] ruurd: has joined #ruby
[16:15:26] mim1k: has joined #ruby
[16:16:52] tgragnato: has joined #ruby
[16:17:31] hogetaro: has joined #ruby
[16:20:50] dionysus69: has joined #ruby
[16:23:00] mrconfused: has joined #ruby
[16:24:56] sleetdrop: has joined #ruby
[16:25:00] ascarter: has joined #ruby
[16:25:47] qba73: has joined #ruby
[16:26:13] perniciouscaffei: has joined #ruby
[16:26:36] __Yiota: has joined #ruby
[16:29:01] Guest20275: has joined #ruby
[16:29:45] mrconfused: has joined #ruby
[16:29:55] pupsicle: has joined #ruby
[16:30:06] olivier__: has joined #ruby
[16:30:31] jgt3: has joined #ruby
[16:30:32] md5sumo: has joined #ruby
[16:32:08] bilal: has joined #ruby
[16:33:08] devyn_: has joined #ruby
[16:34:15] bruno-: has joined #ruby
[16:35:27] pankaj: has joined #ruby
[16:36:38] DeeJayh: has joined #ruby
[16:36:55] rakm: has joined #ruby
[16:37:32] rkazak: has joined #ruby
[16:37:34] marr: has joined #ruby
[16:38:26] cahoots: has joined #ruby
[16:39:27] fern: has joined #ruby
[16:40:14] olivier__: has joined #ruby
[16:40:39] alazred: has joined #ruby
[16:40:57] alazred: has joined #ruby
[16:41:40] mikecmpbll: has joined #ruby
[16:42:47] olivier__: has joined #ruby
[16:44:06] jackjackdripper: has joined #ruby
[16:44:49] itarato: has joined #ruby
[16:45:49] Dimik: has joined #ruby
[16:46:10] jgt3: has joined #ruby
[16:47:05] ascarter: has joined #ruby
[16:47:41] huddy: has joined #ruby
[16:50:52] Kug3lis: has joined #ruby
[16:51:31] mrconfused: has joined #ruby
[16:52:50] h0777777: has joined #ruby
[16:54:55] armyriad: has joined #ruby
[16:55:21] blackwind_123: has joined #ruby
[16:56:32] cahoots: has joined #ruby
[16:57:03] TomyLobo: has joined #ruby
[16:57:31] rgr: has joined #ruby
[16:58:07] cahoots: hi, i'm working with a compile command that includes a file path i want to extract, and that file path may have escaped spaces. if it didn't have spaces, i could just do ([^\s]+) to get it, but since it does how can i easily get it out?
[16:58:23] Uranio: has joined #ruby
[16:59:09] olivier__: has joined #ruby
[16:59:56] olivier__: has joined #ruby
[17:01:22] sleetdrop: has joined #ruby
[17:01:55] ascarter: has joined #ruby
[17:02:01] jrafanie: has joined #ruby
[17:03:03] mustmodify: has left #ruby: ()
[17:03:19] Uranio: has left #ruby: ("while you read this, a kitty dies")
[17:07:31] pankaj: has joined #ruby
[17:07:51] al2o3-cr: cahoots: show us what you're working with and what your desired output is
[17:08:22] nanoz: has joined #ruby
[17:08:29] DeeJayh: has joined #ruby
[17:10:36] lacuna: has joined #ruby
[17:11:01] jackjackdripper: has joined #ruby
[17:11:59] ascarter: has joined #ruby
[17:18:43] quobo: has joined #ruby
[17:20:01] nowhere_man: has joined #ruby
[17:20:14] nullobject: has joined #ruby
[17:20:48] SeepingN: has joined #ruby
[17:22:18] theunraveler: has joined #ruby
[17:22:35] cahoots: al2o3-cr, so i have a string like "gcc -o file path/to/with\ spaces/file.c -more -flags"
[17:22:49] cahoots: and i want to extract that whole path
[17:23:25] hobodave: has joined #ruby
[17:23:26] cahoots: in fact, i want to split up the entire string by non-escaped spaces into tokens
[17:24:36] mrconfused: has joined #ruby
[17:26:14] baweaver: http://stackoverflow.com/questions/41700342/split-string-by-whitespaces-ignoring-escaped-whitespaces
[17:27:43] jusa: has joined #ruby
[17:28:08] bheesham: has joined #ruby
[17:28:28] tildes: has joined #ruby
[17:29:49] cahoots: shellsplit, nice. thanks!
[17:30:01] nowhere_man: has joined #ruby
[17:30:23] gusrub: has joined #ruby
[17:30:35] baweaver: note that it's a gem
[17:33:49] jackjackdripper: has joined #ruby
[17:35:59] enterprisey: has joined #ruby
[17:42:35] pandaant: has joined #ruby
[17:42:39] jaruga: has joined #ruby
[17:43:22] polishdub: has joined #ruby
[17:46:26] muelleme: has joined #ruby
[17:49:57] aarwine_: has joined #ruby
[17:50:26] Rodya_: has joined #ruby
[17:51:53] aarwine_: I'm trying to simplify some api access by writing a gem. Currently the gem has an initialize that sets up class variables, but i'm wondering if I should be using attr_accessor instead
[17:52:08] aarwine_: This is for the credentials to auth against the api with
[17:55:38] elsevero: has joined #ruby
[17:55:38] gusrub: has joined #ruby
[17:55:47] baweaver: y'mean instance variable?
[17:56:03] baweaver: attr_* methods just create instance variables and method accessors
[17:57:02] havenwood: aarwine_: You might consider using a Singleton Class.
[17:57:04] havenwood: aarwine_: Use @ instance variables unless you really have a reason to use @@ class instance variables (it's not common).
[17:57:24] havenwood: aarwine_: https://ruby-doc.org/stdlib/libdoc/singleton/rdoc/Singleton.html
[17:58:18] __Yiota: has joined #ruby
[17:58:43] s2013: has joined #ruby
[17:59:12] polishdub: has joined #ruby
[17:59:32] uZiel: has joined #ruby
[18:03:46] SaschaVoid: has joined #ruby
[18:04:21] zooman_68: has joined #ruby
[18:04:31] PatrikasZvaigzde: has joined #ruby
[18:05:11] duderonomy: has joined #ruby
[18:07:27] armyriad: has joined #ruby
[18:10:19] uZiel: has joined #ruby
[18:13:19] eightlimbed: has joined #ruby
[18:16:06] User458764: has joined #ruby
[18:16:16] pankaj: has joined #ruby
[18:17:20] mikecmpbll: has joined #ruby
[18:17:21] bastrud: has joined #ruby
[18:18:11] brent__: has joined #ruby
[18:18:36] brent__: has joined #ruby
[18:20:33] jackjackdripper: has joined #ruby
[18:21:10] ledestin: has joined #ruby
[18:21:53] tgragnato: has joined #ruby
[18:22:47] gusrub_: has joined #ruby
[18:26:15] lxsameer: has joined #ruby
[18:26:43] minimalism: has joined #ruby
[18:28:12] kirun: has joined #ruby
[18:28:30] cam27: has joined #ruby
[18:29:23] rkazak: has joined #ruby
[18:29:26] jamesaxl: has joined #ruby
[18:30:33] jackjackdripper: has joined #ruby
[18:30:51] benlieb: has joined #ruby
[18:36:22] nullobject: has joined #ruby
[18:38:04] itarato: has joined #ruby
[18:39:08] tildes: has joined #ruby
[18:39:30] xall: has joined #ruby
[18:41:04] jrafanie_: has joined #ruby
[18:45:29] Dimik: has joined #ruby
[18:49:21] newrubycoder: has joined #ruby
[18:50:00] jgt3: has joined #ruby
[18:50:53] skweek: has joined #ruby
[18:53:58] raatiniemi: has joined #ruby
[18:55:04] gil_: has joined #ruby
[18:55:04] gil_: has joined #ruby
[18:55:05] gusrub: has joined #ruby
[18:57:06] rkazak: has joined #ruby
[18:59:56] jaruga: has joined #ruby
[19:03:13] jrm: When I run rake secret, for a ruby application (mastodon), it complains about not finding a library, libcld3.so, which is in /usr/local/lib/ruby/gems/2.3/gems/cld3-3.1.2/lib/libcld3.so. Here are the details: http://ftfl.ca/paste/mastodon_rake_secret.html
[19:04:05] User458764: has joined #ruby
[19:04:14] jrm: The Rakefile contains: http://ftfl.ca/paste/mastodon_rakefile.html
[19:04:30] jrm: Any suggestions on how to fix this?
[19:06:40] jackrandom: has joined #ruby
[19:07:27] aswen: has joined #ruby
[19:08:12] Pierreb|home: has joined #ruby
[19:09:28] patarr: has joined #ruby
[19:13:26] romeoh: has joined #ruby
[19:15:53] xall: has joined #ruby
[19:16:53] psychicist__: has joined #ruby
[19:17:11] diego4: has joined #ruby
[19:17:56] DeeJayh: has joined #ruby
[19:19:28] tildes: has joined #ruby
[19:20:16] newrubycoder: guys how do i open my basic server to the internet? it works with localhost as hostname but not with ipv4 ip
[19:20:19] diego4: has joined #ruby
[19:21:11] SeepingN: port forwarding on your router
[19:22:05] newrubycoder: i need to set up stuff on my router?
[19:22:28] baweaver: https://en.wikipedia.org/wiki/Network_address_translation
[19:23:12] baweaver: https://www.howtogeek.com/66214/how-to-forward-ports-on-your-router/
[19:23:30] baweaver: Think of it like a house
[19:23:42] baweaver: every house has an address that's publicly accessible
[19:24:18] baweaver: rooms inside the house can only be routed to by giving a certain name (port) and defining which name (port) goes to which room (machine)
[19:24:29] majuk: has joined #ruby
[19:24:43] gnufied: has joined #ruby
[19:27:50] newrubycoder: wow this stuff is complicated, hoped i could do it through just ruby lol
[19:31:12] newrubycoder: is it safe to open a port?
[19:31:22] elomatreb: Depending on what you expose, maybe
[19:32:15] newrubycoder: just a very basic ruby server i will only run for some minutes per day
[19:32:49] elomatreb: If it's not a risk that someone else besides you might access it (i.e. it's properly authenticated, etc)
[19:33:54] baweaver: Anything that talks to the internet is a risk
[19:35:23] zacts: has joined #ruby
[19:37:49] bernd27: has joined #ruby
[19:37:50] Kanbi_: has joined #ruby
[19:39:57] olivier__: has joined #ruby
[19:41:30] SaschaVoid: has joined #ruby
[19:42:55] patarr: has joined #ruby
[19:43:08] DoubleMalt: has joined #ruby
[19:44:49] muelleme: has joined #ruby
[19:45:16] SaschaVoid: has joined #ruby
[19:48:35] DeeJayh: has joined #ruby
[19:49:02] joaumg: has joined #ruby
[19:51:39] SaschaVoid: has joined #ruby
[19:51:52] redaudit: has joined #ruby
[19:55:06] nullobject: has joined #ruby
[20:03:23] nobitanobi: has joined #ruby
[20:07:13] cdg: has joined #ruby
[20:08:33] olivier__: has joined #ruby
[20:10:36] atmosx: Hello, I have a list of domain names, 100-150k domains. I want to scan very quickly (I wanna know if a domain query is part of that list). What would the fastest approach? A Redis or an SQL? there are some in-memory SQL implementation IIRC
[20:11:49] elomatreb: You could implement some sort of binary search yourself, if you sort them beforehand
[20:13:18] jrafanie: has joined #ruby
[20:13:47] atmosx: right, I didn't thought about this.
[20:16:39] nh_cham: has joined #ruby
[20:17:41] nh_cham: Hey guys, the Preeventualist Lost+Found page is down again.
[20:18:25] ozcanesen: has joined #ruby
[20:20:43] oborot: has joined #ruby
[20:21:08] jenrzzz: has joined #ruby
[20:21:08] jenrzzz: has joined #ruby
[20:21:14] baweaver: nh_cham: Is this a Ruby question?
[20:21:28] nh_cham: Sorry, no question.
[20:21:52] tomphp: has joined #ruby
[20:23:00] ascarter: has joined #ruby
[20:24:07] patarr: has joined #ruby
[20:24:58] gusrub: has joined #ruby
[20:27:37] AndroUser2: has joined #ruby
[20:29:53] ascarter: has joined #ruby
[20:31:14] benlieb: has joined #ruby
[20:31:46] zenspider: does someone have a 1.9 around somewhere I can poke at?
[20:35:45] ascarter: has joined #ruby
[20:35:58] Puffball: has joined #ruby
[20:36:09] DeeJayh: has joined #ruby
[20:36:35] atmosx: zenspider: by poke you have get ssh access to?
[20:37:01] zenspider: not necessarily... Just need to know if something is valid in 1.9
[20:37:14] zenspider: ruby19 -we 'p def self.m; x.y do; end; end'
[20:37:23] zenspider: what's that evaluate to?
[20:37:26] atmosx: 1.9.3-p551 :001 >
[20:38:37] zenspider: that's what I thought. Anyone know when def started to return the name? I think it was 2, no?
[20:38:52] zenspider: still a valid construct in 1.9..., but meaningless
[20:39:10] zenspider: I guess that should be valid syntax for 1.8 as well
[20:39:22] zenspider: (trying to figure out where to place this ruby_parser test)
[20:40:30] Puffball: has joined #ruby
[20:44:28] synthroid: has joined #ruby
[20:45:37] nullobject: has joined #ruby
[20:45:56] Lyfe: has joined #ruby
[20:47:46] MrBusiness: has joined #ruby
[20:48:18] mr_rich101: has joined #ruby
[20:50:02] jidar: has joined #ruby
[20:50:24] havenwood: zenspider: yup, same in 1.8 and symbol in 2.0
[20:50:44] havenwood: 20>> def self.m; x.y do; end; end
[20:50:45] ruby[bot]: havenwood: # => nil (https://eval.in/800630)
[20:50:56] Lyfe: has joined #ruby
[20:51:12] __Yiota: has joined #ruby
[20:51:31] havenwood: zenspider: It's 2.1
[20:51:37] zenspider: cool. actual semantics aren't important for me... just curious why anyone would write such crap
[20:51:44] havenwood: 21>> def self.m; x.y do; end; end
[20:51:46] ruby[bot]: havenwood: # => :m (https://eval.in/800631)
[20:51:53] jenrzzz: has joined #ruby
[20:51:56] zenspider: got it patched up in 1.8, 1.9, 2+
[20:53:43] dminuoso: >> 2.0.nil?
[20:53:44] ruby[bot]: dminuoso: # => false (https://eval.in/800638)
[20:53:46] dminuoso: havenwood: lies.
[20:54:12] zenspider: cool. thanks y'all
[20:54:17] dminuoso: Glad to help.
[20:54:21] SteenJobs: has joined #ruby
[20:57:40] raspado: has joined #ruby
[20:58:00] ascarter: has joined #ruby
[20:58:51] Lyfe: has joined #ruby
[20:58:58] bronson: has joined #ruby
[20:59:09] jidar: has joined #ruby
[20:59:36] olivier__: has joined #ruby
[21:00:16] Bish: has joined #ruby
[21:00:17] yqt: has joined #ruby
[21:00:36] olivier__: has joined #ruby
[21:01:08] MrMuff: has joined #ruby
[21:01:14] SeepingN_: has joined #ruby
[21:03:56] quiller: has joined #ruby
[21:04:32] baweaver: dminuoso there's a method to the madness
[21:04:35] zenspider: I need some sort of regexp sanitizer
[21:04:47] dminuoso: baweaver: What is it?
[21:04:50] baweaver: >> def madness; 42 end
[21:04:51] ruby[bot]: baweaver: # => :madness (https://eval.in/800642)
[21:04:59] zenspider: something better than Regexp.new $1 :)
[21:05:05] baweaver: zenspider: echo > /dev/null
[21:05:09] zenspider: but not as useless as Regexp.new Regexp.escape $1
[21:05:20] oborot: has joined #ruby
[21:05:27] baweaver: ultimate sanitizing experience
[21:05:47] patarr: has joined #ruby
[21:06:38] DeeJayh: has joined #ruby
[21:06:55] zenspider: >> /\A(?<paren>\(\g<paren>*\))*\z/ =~ '(())'
[21:06:56] ruby[bot]: zenspider: # => 0 (https://eval.in/800646)
[21:07:50] ascarter: has joined #ruby
[21:08:09] nofxxxx: has joined #ruby
[21:08:19] hutch34: has joined #ruby
[21:08:21] ur5us: has joined #ruby
[21:08:27] al2o3-cr: Regexp.union $1 :P
[21:08:37] havenwood: https://github.com/apeiros/literal_parser/blob/master/lib/literal_parser.rb#L117
[21:11:44] zenspider: havenwood: that allows _anything_ inside the regexp
[21:12:50] zenspider: I don't want to prove it as halting or anything... but limiting what it can do to a sane subset would be really nice
[21:13:18] zenspider: back in the day I wrote a regexp to match regexps in perl... it was 4 lines long. I'd prefer not to do that either. :)
[21:17:14] dminuoso: zenspider, do you come from Perl?
[21:17:40] dminuoso: Because whenever I think of you, I think of this grey bearded regexp expert wearing Perl5 t-shirts..
[21:18:01] zenspider: that's a loaded question. I come from Seattle. I've coded in perl. I've coded in a ton of languages.
[21:18:18] dminuoso: Fair enough
[21:18:40] gusrub: has joined #ruby
[21:18:57] mim1k: has joined #ruby
[21:19:28] zenspider: perl, python, ruby, c, pascal, smalltalk, lisp (mostly scheme), etc etc etc (in no particular order)
[21:21:09] zenspider: huh. I have `ri Regexp.json_create` output... but can't seem to use it?
[21:22:00] God: has joined #ruby
[21:22:19] baweaver: dminuoso: well zenspider _could_ grow a pretty magnificent beard.
[21:22:36] dminuoso: baweaver: You mean a regular beard?
[21:22:49] zenspider: but you'll never see me in a perl t-shirt. or any t-shirt w/ words/logos
[21:23:34] al2o3-cr: zenspider: require 'json/add/core'
[21:25:31] zenspider: how strange. the ri says it is in ruby-core, which implies you don't require anything
[21:26:28] zenspider: raise XXX, "Not allowed: /#{re.inspect}/" if re !~ /\A([\w()|]+)\z/
[21:26:34] zenspider: should I add anything else?
[21:26:42] zenspider: I doubt {} constructs would be needed
[21:26:50] dminuoso: zenspider: Im guessing the comment got core and stdlib mixed up
[21:27:00] eightlimbed: has joined #ruby
[21:28:09] zenspider: it's a start
[21:29:11] DeeJayh: has joined #ruby
[21:31:04] bheesham: has joined #ruby
[21:31:05] cdg: has joined #ruby
[21:33:08] olivier__: has joined #ruby
[21:33:21] daed: has joined #ruby
[21:37:08] burgestrand: has joined #ruby
[21:37:49] tvw: has joined #ruby
[21:39:00] agentsmith: has joined #ruby
[21:39:11] guardian: has joined #ruby
[21:39:29] eckhardt: has joined #ruby
[21:41:09] Emmanuel_Chanel: has joined #ruby
[21:44:34] hobodave: has joined #ruby
[21:45:25] bkxd: has joined #ruby
[21:48:10] blackwind_123: has joined #ruby
[21:48:33] bernd9000: has joined #ruby
[21:49:45] jeffreylevesque: has joined #ruby
[21:51:00] devyn: has joined #ruby
[21:52:16] sepp2k: has joined #ruby
[21:52:31] baweaver: Here's a fun one
[21:52:37] dminuoso: baweaver is no fun.
[21:52:45] sloggerkhan: has joined #ruby
[21:52:45] dminuoso: ACTION has already ruined it
[21:53:05] baweaver: say you had a string: "event.first_alerted > 1.day.ago && event.status == 2"
[21:53:17] dminuoso: I would say ditch rails.
[21:53:18] baweaver: how would you choose to evaluate that from a string?
[21:53:30] elomatreb: Step 1) Don't
[21:53:37] baweaver: Tempting, but dangerous
[21:53:48] baweaver: Trying to get a rules engine going for some alerts
[21:53:52] baweaver: debating on how I want to go about it
[21:54:11] ascarter: has joined #ruby
[21:54:39] dminuoso: baweaver: you could parse it and analyze the AST
[21:54:51] dminuoso: no, wont work
[21:55:18] baweaver: maybe: condition: {event: {first_alerted: '> 1 day', status: 'critical'}}
[21:55:20] dminuoso: baweaver: Next idea invent a trivial language that you can evaluate to some form of algebraic expressions
[21:55:21] zenspider: baweaver: EventInterpreter.new RubyParser.new.parse string
[21:55:25] baweaver: just go with SEXPs.
[21:55:45] zenspider: where EventInterpreter subclasses SexpProcessor
[21:56:19] zenspider: dminuoso: why won't that work?
[21:56:46] dminuoso: zenspider: Oh, I was thinking about once passed it could be piped back to Ruby in its raw form. But that's definitely not possible.
[21:56:49] sloggerkhan: When working with binary in Ruby is there an easy way of making the result of an op like ~0x0040 give 0xFFBF instead of 0xFBF? (Related, why does it give 0xFBF over 0xBF, even for ~0x40?)
[21:56:58] zenspider: dminuoso: it is with ruby2ruby
[21:57:12] dminuoso: zenspider: no wai.
[21:57:23] dminuoso: zenspider: seattlerb is you?
[21:57:25] jusa: has joined #ruby
[21:57:54] zenspider: baweaver: parsed it looks like: s(:and, s(:call, s(:call, s(:call, nil, :event), :first_alerted), :>, s(:call, s(:call, s(:lit, 1), :day), :ago)), s(:call, s(:call, s(:call, nil, :event), :status), :==, s(:lit, 2)))
[21:58:05] zenspider: and is pretty damn easy to interpret
[21:58:34] DeeJayh: has joined #ruby
[21:58:49] zenspider: you could interpret it yourself, or write a "sanitizer" (interpreter w/o actions), pump that through r2r and then eval it
[21:58:51] baweaver: Yeah. May go with the hash nesting route to make it a bit clearer
[21:59:00] havenwood: eval Ripper.lex("event.first_alerted > 1.day.ago && event.status == 2").select { |_, type, _| %i[on_ident on_period on_sp on_op on_int].include? type }.map(&:last).join
[21:59:21] zenspider: but Ripper is horrible
[21:59:22] havenwood: what harm could you possibly do with periods, identifiers?
[21:59:34] havenwood: ACTION grins
[21:59:39] baweaver: I heard those knuckles crack dminuoso and havenwood
[21:59:48] ascarter: has joined #ruby
[22:00:12] dminuoso: baweaver: That's fine. I taught my coworker how to throw a punch properly.
[22:00:23] baweaver: I assume it was a hit
[22:00:31] rikai: has joined #ruby
[22:00:43] baweaver: were they hooked?
[22:00:53] oleandros: has joined #ruby
[22:01:18] baweaver: Just taking a jab at ya
[22:01:36] zenspider: oh hey! they fixed my favorite ripper bug!
[22:01:40] zenspider: >> require "ripper"; Ripper.sexp("I'm a little teapot")
[22:01:41] ruby[bot]: zenspider: # => nil (https://eval.in/800654)
[22:01:48] dminuoso: zenspider: What did that produce before?
[22:01:49] zenspider: that used to parse
[22:02:02] zenspider: 19>> require "ripper"; Ripper.sexp("I'm a little teapot")
[22:02:03] ruby[bot]: zenspider: # => [:program, [[:command, [:@const, "I", [1, 0]], [:args_add_block, [[:string_literal, [:string_content ...check link for more (https://eval.in/800655)
[22:02:07] dminuoso: zenspider: Considering how Ripper is implemented that is really surprising..
[22:02:15] zenspider: 20>> require "ripper"; Ripper.sexp("I'm a little teapot")
[22:02:17] ruby[bot]: zenspider: # => [:program, [[:command, [:@const, "I", [1, 0]], [:args_add_block, [[:string_literal, [:string_content ...check link for more (https://eval.in/800656)
[22:02:20] zenspider: 21>> require "ripper"; Ripper.sexp("I'm a little teapot")
[22:02:22] ruby[bot]: zenspider: # => [:program, [[:command, [:@const, "I", [1, 0]], [:args_add_block, [[:string_literal, [:string_content ...check link for more (https://eval.in/800657)
[22:02:25] zenspider: 22>> require "ripper"; Ripper.sexp("I'm a little teapot")
[22:02:26] ruby[bot]: zenspider: # => nil (https://eval.in/800658)
[22:02:33] zenspider: took them a long while
[22:02:50] zenspider: I still don't trust it one bit
[22:03:09] zenspider: also really dislike the [[]] s
[22:03:24] dminuoso: zenspider: Oh neat. You wrote a recursive descent parser for Ruby? :)
[22:03:50] zenspider: no :( that's nearly impossible. I wrote a racc parser
[22:04:28] dminuoso: Ohh. I was looking at your ruby2ruby and didnt realize what was going on..
[22:04:54] dminuoso: zenspider: I tried to debug a parsing bug before. After 8 hours of debugging bison state tables I simply gave up.
[22:05:11] dminuoso: I mean a ruby parsing bug
[22:05:29] zenspider: it's pretty horrible
[22:05:44] zenspider: I have some tools and methods to figure stuff out, since I'm just trying to match ruby... but still horrible
[22:05:54] fusta: has joined #ruby
[22:06:30] dminuoso: zenspider: Indeed. After that I understood why so many large projects such as GCC and clang have switched to hand writtern (weaker) RDPs..
[22:06:48] dminuoso: You can't even do sensible diagnostics with a LR parser
[22:08:01] zenspider: yup. the fact that GCC and clang have flipped to RDP gives me hope that it may be possible for ruby... but I'm not willing to put the time into doing a LR -> LL flip for free
[22:08:36] patr0clus: has joined #ruby
[22:12:36] SeepingN: has joined #ruby
[22:15:22] olivier__: has joined #ruby
[22:24:54] patarr: has joined #ruby
[22:27:52] oborot: Is it safe to use an ruby pre-built on Ubuntu 14.04 in Ubuntu 16?
[22:29:02] oborot: Trying to install the backup gem on some LAMP servers but seems like overkill to downlod and build a dedicated ruby when I just need it for the occasional backup
[22:33:32] DeeJayh: has joined #ruby
[22:33:32] oborot: It takes a quite a while to build the backup gem too since it seems to require some native extensions to work
[22:34:07] oborot: Tried to get the traveling ruby by Phusion to work for this, but no dice
[22:36:26] ecuanaso: has joined #ruby
[22:36:27] skweek: has joined #ruby
[22:38:13] bruno-_: has joined #ruby
[22:38:59] havenwood: oborot: Brightbox also maintains up-to-date Ruby packages for Ubuntu: https://www.brightbox.com/docs/ruby/ubuntu/
[22:42:16] mrconfused: has joined #ruby
[22:43:58] oborot: havenwood: I'm trying to automate the setup with an ansible script. It would be preferable to just ship one pre-built ruby binary to rule them all during server provisioning
[22:44:42] cagomez: has joined #ruby
[22:45:30] havenwood: oborot: You could use Travis or RVM's precompiled, statically linked binaries. Here're Travis's: http://rubies.travis-ci.org/
[22:45:46] havenwood: oborot: They have 14.04 as do RVM.
[22:46:40] oborot: I'll try them, thanks
[22:47:19] oborot: I probably wouldn't even need a ruby version manager on the remote server either...
[22:47:48] oborot: I could probably just set the GEM_PATH or whatever
[22:47:57] havenwood: oborot: Or you can install Ruby from source with ruby-install to /usr/local easily.
[22:48:13] raspado: has joined #ruby
[22:48:20] havenwood: oborot: ruby-install --system --latest ruby
[22:48:53] havenwood: oborot: https://github.com/postmodern/ruby-install
[22:52:26] VladGh: has joined #ruby
[23:02:11] DeeJayh: has joined #ruby
[23:03:37] jgt3: has joined #ruby
[23:09:03] ascarter: has joined #ruby
[23:19:23] mim1k: has joined #ruby
[23:21:23] joelwallis: has joined #ruby
[23:23:18] gusrub: has joined #ruby
[23:26:59] duderono_: has joined #ruby
[23:29:34] knight33: has joined #ruby
[23:33:11] cschneid_: has joined #ruby
[23:33:35] shinnya: has joined #ruby
[23:33:55] mrconfused: has joined #ruby
[23:34:08] Bhootrk_: has joined #ruby
[23:38:07] DeeJayh: has joined #ruby
[23:38:55] cam27: has joined #ruby
[23:41:03] patarr: has joined #ruby
[23:42:18] Bhootrk_: has joined #ruby
[23:48:33] bernd9000: has joined #ruby
[23:48:38] tAn: has joined #ruby
[23:52:12] ecuanaso: has joined #ruby
[23:53:03] alveric1: has joined #ruby
[23:53:08] Bhootrk_: has joined #ruby
[23:53:19] boombox_: has joined #ruby
[23:57:31] bernd27: has joined #ruby
[23:58:15] jusa: has joined #ruby