« Back to channel list

#ruby - 29 October 2018

« Back 1 day Forward 1 day »
[12:50:01] helpa: has joined #ruby
[12:50:07] bak1an: has joined #ruby
[12:50:24] helpa: has joined #ruby
[12:51:54] nowhereman_: has joined #ruby
[12:52:53] helpa: has joined #ruby
[13:00:35] gheegh: has joined #ruby
[13:06:13] cabotto: has joined #ruby
[13:06:16] gheegh: hey all.. i need some thoughts. I'm trying to dynamically define a class as a child of OpenStruct, if it's not defined. If defined, I want to just use it. Basically, i'm trying to wrap OpenSturct for responses to an API call. I'm getting a nameerror when trying to use my defined class. thoughts on how to do this?
[13:06:18] gheegh: https://gist.github.com/wflanagan/515b04b3448d9494df5fc386ce3b75c3
[13:07:46] gheegh: sorry, to follow the guide, here's the code snippet defined at dpaste.de https://dpaste.de/OEJz#L
[13:08:58] JustForgotten: has joined #ruby
[13:15:10] noark9: has joined #ruby
[13:16:04] GodFather: has joined #ruby
[13:16:34] jcalla: has joined #ruby
[13:28:20] noark9: has joined #ruby
[13:28:26] bmurt: has joined #ruby
[13:31:39] kaleido: has joined #ruby
[13:34:32] haylon: has joined #ruby
[13:36:10] Cthulu201: has joined #ruby
[13:42:34] cronolio: has joined #ruby
[13:42:41] cronolio: has left #ruby: ()
[13:42:52] gnufied: has joined #ruby
[13:47:46] noark9: has joined #ruby
[13:49:59] apeiros_: has joined #ruby
[13:57:24] vondruch: has joined #ruby
[14:00:13] moei: has joined #ruby
[14:01:11] roshanavand: has joined #ruby
[14:05:29] snowy: has joined #ruby
[14:11:05] Inside: has joined #ruby
[14:11:58] Rapture: has joined #ruby
[14:21:25] dmitch: has joined #ruby
[14:22:51] k0mpa: has joined #ruby
[14:23:02] xfbs: has joined #ruby
[14:29:23] burgestrand: has joined #ruby
[14:39:19] lomex: has joined #ruby
[14:39:56] queip: has joined #ruby
[14:40:23] reber: has joined #ruby
[14:48:24] jokke: hi! i'm using anyenv with rbenv on my system and i have a gem that i want to uninstall. This gem provides an executable that is put into rbenv/shims by rbenv. uninstalling it wont' work though. the gem command just doesn't do anything and the gem is still there (and so is the shim also after rehashing)
[14:48:46] jokke: i also tried this: for version in $(rbenv versions | cut -c3- | awk '{print $1}'); do rbenv shell $version; rbenv exec gem uninstall fogtrack; done
[14:49:08] jokke: didn't help either
[14:52:57] jokke: rbenv whence fogtrack tells me 2.3.1
[14:53:40] jokke: oh now it worked...
[14:54:17] jokke: well, case closed. Thanks! :)
[14:58:33] enslavedtuna: has joined #ruby
[15:00:48] kapil____: has joined #ruby
[15:02:38] enslavedtuna: if i have a nested array like, a = ['b',['c','d']], then a[1][0] => 'c', Now if i want to make x = '[1][0]' how do i call a.x => 'c'?
[15:05:56] orbyt_: has joined #ruby
[15:07:29] tdy3: has joined #ruby
[15:13:24] alicef: has joined #ruby
[15:13:55] apeiros_: enslavedtuna: those are two consecutive method calls.
[15:14:52] apeiros_: enslavedtuna: how to do it dynamically would be either a.send("[]", 1).send("[]", 0) or a.send("dig", 1, 0)
[15:14:55] RougeR: has joined #ruby
[15:15:19] apeiros_: of course that means you'd have to process your string first get those 3-4 values out first (method name and arguments)
[15:15:34] enslavedtuna: i see, so there is no easy way huh
[15:18:00] apeiros: there's also eval, but should be obvious why I won't recommend that. also I don't know enough of your context. f.ex. does it absolutely have to be a String you start out with?
[15:18:09] jsc: has joined #ruby
[15:18:30] phaul: has joined #ruby
[15:21:41] enslavedtuna: it doesnt have to be a string, i get data out of a nested array one depth at a time and want to save the current position
[15:23:08] enslavedtuna: so first its a[y] and then x +='[y]' , then a.x[y] and x+='[y]' repeat
[15:23:31] enslavedtuna: at least that's what i'd hoped to do
[15:23:41] burgestrand: has joined #ruby
[15:23:52] apeiros: enslavedtuna: just store the indexes in an array and use dig.
[15:24:18] apeiros: indices = []; indices << 0; indices << 1; ary.dig(*indices)
[15:24:32] apeiros: much better than string manipulation to build code.
[15:24:52] enslavedtuna: dig looks like exactly what i'm looking for, thanks :)
[15:26:32] PasNox: has joined #ruby
[15:28:05] akaiiro: has joined #ruby
[15:38:04] agent_white: has joined #ruby
[15:38:13] bmurt: has joined #ruby
[15:42:19] phaul: hi apeiros, how's it going
[15:44:50] Deesl: has joined #ruby
[15:50:11] ua: has joined #ruby
[15:51:53] impermanence: has joined #ruby
[15:53:44] apeiros: has joined #ruby
[15:58:11] enslavedtuna: hey apeiros, sorry if this is dumb but i'm having trouble with dig. a=['b',['c','d']], a.dig(1,1) => d, x = [1,1], a.dig(x) => error
[16:01:11] phaul: enslavedtuna: you can splat array arguments like if they were given as separate arguments with '*' : a.dig(*x)
[16:02:59] enslavedtuna: that works, thanks phaul!
[16:03:21] rippa: has joined #ruby
[16:08:17] jackrandom: has joined #ruby
[16:09:17] burgestrand: has joined #ruby
[16:14:27] eckhardt: has joined #ruby
[16:16:36] darkhanb: has joined #ruby
[16:17:05] Guest979: has joined #ruby
[16:27:45] cthulchu: has joined #ruby
[16:34:24] jcarl43: has joined #ruby
[16:37:04] [Butch]: has joined #ruby
[16:37:05] bmurt: has joined #ruby
[16:41:26] orbyt_: has joined #ruby
[16:43:25] [Butch]: has joined #ruby
[16:44:59] JusticeFries: has joined #ruby
[16:46:14] wojnar: has joined #ruby
[16:46:23] nowhereman_: has joined #ruby
[16:48:38] nopolitica: has joined #ruby
[16:52:01] conta: has joined #ruby
[16:53:34] apeiros: hi phaul, quite fine. you're in bulgaria now?
[16:53:40] Nicmavr: has joined #ruby
[16:54:08] phaul: hi apeiros , hungary
[16:54:24] apeiros: well, I'm getting hangry now, so I'll go buy food :D
[16:58:48] whysthatso: has joined #ruby
[17:00:33] mikecmpbll: has joined #ruby
[17:01:23] yxhuvud: has joined #ruby
[17:03:20] Inline: has joined #ruby
[17:05:46] troulouliou_dev: has joined #ruby
[17:12:12] noark9: has joined #ruby
[17:23:41] gregf_: has joined #ruby
[17:23:57] za1b1tsu: has joined #ruby
[17:28:00] reber__: has joined #ruby
[17:31:59] salasrod: has joined #ruby
[17:34:00] snowy: has joined #ruby
[17:35:55] orbyt_: has joined #ruby
[17:41:26] bak1an: has joined #ruby
[17:46:53] maryo: has joined #ruby
[17:47:26] maryo: Is there a way to install 'therubyracer' gem in windows machine?
[17:48:45] noark9: has joined #ruby
[17:49:24] SteenJobs: has joined #ruby
[17:50:34] havenwood: maryo: You're usually better off just installing Node.js.
[17:50:46] havenwood: maryo: ^ Whether it's Windows or not.
[17:52:30] SeepingN: has joined #ruby
[17:53:32] maryo: havenwood, how to install node.js in windows? Does that comes as a gem?
[18:07:27] Lytol: has joined #ruby
[18:09:28] whysthatso: has joined #ruby
[18:10:16] maryo: Installed the msi for nodejs and I also wanted to install another gem named 'dashing' on my windows box. While installing I am getting an error -> https://dpaste.de/Zmsw
[18:10:26] maryo: some pointers on the above error would be helpful
[18:12:48] orbyt_: has joined #ruby
[18:19:14] akaiiro: has joined #ruby
[18:26:40] orbyt_: has joined #ruby
[18:27:53] nopolitica: has joined #ruby
[18:32:06] Inside: You have to install dev tools :D
[18:32:19] Inside: How did you install rails?
[18:33:14] Inside: https://github.com/oneclick/rubyinstaller/wiki/Development-Kit
[18:33:55] Inside: also: I super strongly recommend installing a VM (ie: virtual box) and running your rails dev server from in there. You can setup a shared folder between the guest/host machines and still run your IDE in windows.
[18:34:09] Inside: I tried the whole develop in windows then deploy to linux thing for a while and it's a really major headache
[18:34:45] Inside: (case in point: anything involving building native extensions like this)
[18:36:08] mroutis: has joined #ruby
[18:41:39] mustmodify: has joined #ruby
[18:42:07] mustmodify: How do I figure out which characters are represented by \xE2\x80\x90def ?
[18:42:12] mustmodify: any sequence.
[18:43:38] maryo: Inside, true. In linux platform it is very easy and in windows its a pain.. But for some reason, I am not able to install virtual box due to internal policy. I having finally installed dashing but unable to start them. Here is the error https://dpaste.de/EcXH Any idea?
[18:47:39] mikecmpbll: has joined #ruby
[18:50:41] graphene: has joined #ruby
[18:58:52] kapil____: has joined #ruby
[18:59:23] Inside: I think that's the same error that I got when I just threw my hands up
[18:59:34] Inside: Do what it says - require em/pure_ruby
[19:00:22] Inside: I think inside of boot.rb
[19:00:38] Inside: oh you're not running rails are you
[19:01:48] nofxx: has joined #ruby
[19:02:12] mustmodify: has left #ruby: ()
[19:06:09] chouhoulis: has joined #ruby
[19:12:08] za1b1tsu: has joined #ruby
[19:14:50] graphene: has joined #ruby
[19:28:18] raulp: has joined #ruby
[19:33:33] mochiyoda: has joined #ruby
[19:34:36] conta: has joined #ruby
[19:35:12] orbyt_: has joined #ruby
[19:45:09] tdy: has joined #ruby
[19:45:16] weaksauce: has joined #ruby
[19:45:27] TheBloke: has joined #ruby
[19:50:01] jthomas2: has joined #ruby
[19:53:24] wojnar: has joined #ruby
[19:56:26] desperek: has joined #ruby
[20:10:56] maryo_: has joined #ruby
[20:19:46] Azure: has joined #ruby
[20:24:40] eckhardt: has joined #ruby
[20:25:03] bmurt: has joined #ruby
[20:25:33] akaiiro: has joined #ruby
[20:27:38] za1b1tsu: has joined #ruby
[20:30:51] roshanavand: has joined #ruby
[20:32:28] Eiam: has joined #ruby
[20:36:37] mroutis: has joined #ruby
[20:39:34] comet23: has joined #ruby
[20:40:26] comet23: is this the offical chat for the ruby programming langauge?
[20:40:48] Eiam: comet23: sure
[20:41:07] Eiam: read the topic? https://ruby-community.com/pages/user_rules
[20:41:09] comet23: do i sense uncertainty?
[20:41:31] Eiam: I'm sure some people may take umbrage with the word 'official'
[20:42:18] comet23: that's because they haven't been in the army
[20:42:30] Eiam: okay. did you have a question about ruby?
[20:42:34] comet23: the army teaches you how to handle umbrage in positive ways
[20:45:38] orbyt_: has joined #ruby
[20:46:01] comet23: yes, what is your favorite modular tutorial/explanation?
[20:46:34] nomoney4u: has joined #ruby
[20:46:56] orbyt_: has joined #ruby
[20:47:52] comet23: there is this thing called modular programming
[20:48:01] comet23: i heard that it
[20:48:25] comet23: it's the right way to program because it ends up with clean looking easy to understand code
[20:49:42] Eiam: why do I feel like this is going to end with me asking for adult supervision
[20:50:19] jthomas2: comet23: Are you just asking about Modules in ruby?
[20:50:20] Inside: comet23: I think you're probably thinking of 'composition'
[20:50:20] comet23: i'm not understanding i've never been more confused
[20:50:24] SeepingN: ...Object Oriented === modular?
[20:50:33] Eiam: alright because I've got 10 min till my next meeting, lets do it
[20:50:48] Inside: Check out Practical Object-Oriented Design: An Agile Primer Using Ruby (2nd Edition)
[20:50:48] SeepingN: plenty of time to learn object oriented programmjing
[20:51:08] Eiam: https://en.wikipedia.org/wiki/Modular_programming
[20:51:11] Inside: or don't be a dick and buy the book :D
[20:51:13] comet23: haha that acronym spells poo dr lmao
[20:51:27] SeepingN: ok, DRM controlled ebook
[20:51:37] SeepingN: don't be a dick: buy electronic
[20:51:43] SeepingN: also searchable ;)
[20:51:51] jthomas2: comet23: Ruby is an Object Oriented programming language, so it is "modular" in the sense code is isolated and organized into modular units. Ruby also has the concept of "Modules," which allow you to organized related code.
[20:52:07] Eiam: comet23: Modular programming has its place, I'm not sure Ruby has any specific spin on the concept of modular programming vs another langauge
[20:52:17] comet23: thank you so much :)
[20:52:19] jthomas2: comet23: You should probably just use the standard ruby-docs to get up to speed on what Ruby offers, then come ask a more clear question.
[20:53:38] Eiam: part of what I enjoy about ruby is how little code I often write to accomplish tasks, thus I don't use a lot of modular practices in the type of ruby I write beyond more basic functional composition
[20:53:51] nowhereman_: has joined #ruby
[20:53:54] comet23: have you heard of the metasploit project?
[20:54:01] mochiyoda: has joined #ruby
[20:54:04] comet23: they have the cleanest code i've ever read
[20:54:14] comet23: i'm really impressed and i want to write code like that
[20:54:14] za1b1tsu: has joined #ruby
[20:54:20] Eiam: this is drifting into a meta conversation too
[20:54:28] SeepingN: well if all of your code impressions are from public githubs, that may not be hard to acheive
[20:54:52] Eiam: Confident Ruby is another good book imo for writing clean, clear code in Ruby
[20:55:05] Eiam: it really changed the way I thought about my own code
[20:55:37] Eiam: SeepingN: you don't like confident ruby? =)
[20:55:48] SeepingN: haven't heard of it. looking
[20:55:59] SeepingN: cuz my code is trashy and functional
[20:56:14] SeepingN: mostly a replacement for shell scripting
[20:56:23] Inside: I've been spinning my wheels for the last week trying to rewrite this chunk of code
[20:56:28] Eiam: its good. my team enjoyed it, but maybe they said that cause i sign the checks
[20:56:33] SeepingN: sometimes for Rails reporting and updating
[20:57:05] Eiam: SeepingN: I don't use nil to return meaning anymore, I protect my boundaries and declare clear intent
[20:57:58] Inside: confident ruby/
[20:58:19] zenspider: "modular programming" is a term from the 70s.
[20:58:29] zenspider: ala dikstra and folk
[20:58:42] SeepingN: wow, there's some old refs
[20:59:06] zenspider: ruby Modules have (roughly) nothing to do with "Modular programming"
[20:59:07] im0nde: has joined #ruby
[20:59:59] ur5us: has joined #ruby
[21:00:10] jonjitsu: has joined #ruby
[21:01:21] zenspider: Inside: what is it?
[21:01:37] ua: has joined #ruby
[21:01:54] Inside: I was trying to make a?
[21:02:06] Inside: No paperback version of it?
[21:02:15] Inside: I can get work to buy me books, but not e-books
[21:02:16] zenspider: Inside: I meant what code are you spinning on?
[21:02:33] Inside: zenspider: oh, it's a bit of code which talks to an ERP and then generates a set of work instructions for equipment
[21:02:51] Inside: based on a magic mixture of things that I feel are important to be listed in the work instructions
[21:03:05] Inside: it works (tm), but most of the rules are hard coded
[21:03:21] Inside: so I'm trying to move everything to a sort of a configurable interface so other people can maintain this system
[21:06:48] jordanm: has joined #ruby
[21:18:26] apeiros: 21:41 Eiam: I'm sure some people may take umbrage with the word 'official'
[21:18:56] apeiros: ruby-lang.org officially makes this channel the "official" ruby channel
[21:19:25] apeiros: https://www.ruby-lang.org/en/community/ - "Ruby on IRC (#ruby)"
[21:19:50] apeiros: so yes, this *is* the official irc channel for the ruby programming language :)
[21:20:04] apeiros: /cc comet23 ^
[21:20:43] jcarl43: has joined #ruby
[21:22:42] Inside: ooo lawyered
[21:26:57] SteenJobs: has joined #ruby
[21:29:56] cow[moo]: has joined #ruby
[21:33:25] Radar: Inside: What book doesn't have a paperback version?
[21:35:38] orbyt_: has joined #ruby
[21:35:40] nowhereman_: has joined #ruby
[21:38:46] druonysus: has joined #ruby
[21:39:35] whysthatso_: has joined #ruby
[21:41:17] phaul: has joined #ruby
[21:41:37] Eiam: apeiros: well then! so lawyered =)
[21:42:04] Eiam: apeiros: its like how we have #swift-lang and apple won't put a stupid .txt file on the website to make it official, so we are unofficial =)
[21:42:45] Eiam: Inside: i only have the ebook form of it.
[21:42:54] apeiros: has joined #ruby
[21:47:19] venmx: has joined #ruby
[21:51:15] zenspider: Radar: I took it to be confident ruby... amazon seems to agree
[21:54:34] ua: has joined #ruby
[21:58:03] kaleido: has joined #ruby
[22:00:35] snowy: has joined #ruby
[22:03:11] eckhardt: has joined #ruby
[22:10:06] ua: has joined #ruby
[22:10:27] GodFather: has joined #ruby
[22:10:34] cliluw: has joined #ruby
[22:11:35] cliluw: has joined #ruby
[22:13:03] phaul: has joined #ruby
[22:13:23] s2013: has joined #ruby
[22:16:52] kapil____: has joined #ruby
[22:18:20] za1b1tsu: has joined #ruby
[22:19:08] Inside: has joined #ruby
[22:21:31] baweaver: Radar: or half of your books :P
[22:26:36] Eiam: Inside: its a couple dollars, really need to expense it? =o
[22:27:27] zenspider: YAY! I think I'm actually done with the graphics gem changes for my talk!
[22:31:00] nchambers: has joined #ruby
[22:32:49] samort7: has joined #ruby
[22:32:55] Radar: baweaver: with very good reason ;)
[22:34:39] ua: has joined #ruby
[22:35:08] baweaver: zenspider: reformatting everything for 16:9 myself :P
[22:35:49] Eiam: self publishing probably easier and faster
[22:35:56] Eiam: (and cheaper...)
[22:35:59] Azure: has joined #ruby
[22:37:07] zenspider: baweaver: use that as your default from now on... I haven't seen a 4x3 conf in a very long time. And keynote (probably others) will automatically adjust as best they can.
[22:37:11] Radar: Eiam: All of these things are true. It's also much easier to update PDFs than to update dead-tree books.
[22:37:35] zenspider: Eiam: faster. not easier. and less about cheaper as it is about profit
[22:37:38] Radar: Plus, the "state of the art" in publishers these days is "please write in Microsoft Word"
[22:37:45] orbyt_: has joined #ruby
[22:37:59] baweaver: Yeah, lesson learned there.
[22:38:01] Radar: And "what is Git?" followed by "What do you mean 'Version Control'"?
[22:38:25] baweaver: Not too bad so far, and more space for code samples.
[22:38:38] zenspider: luckily some publishers are more savvy than others... prag for example
[22:39:06] zenspider: totally... going bigger is always easier than trying to go smaller. I did that once and it sucked
[22:39:26] zenspider: tho... maybe that should be a signal that I already had too much on a slide?? I'll have to think about that
[22:39:41] baweaver: ask Radar about his love affair with Manning some time :D
[22:39:50] Radar: fuck 'em.
[22:40:23] Radar: re: slides: GO BIG OR GO HOME (or something like that)
[22:40:26] baweaver: granted, kinda wish NoStarch would move towards markdown.
[22:40:35] Radar: Zach Holman's minimum font size on his slides is 100pt (iirc)
[22:40:44] nexraf1: has joined #ruby
[22:40:54] baweaver: ACTION looks guiltily at his 48pt code
[22:41:05] Radar: baweaver: I think code is different. His text is big.
[22:41:07] zenspider: Radar: I generally agree. I'm a huge fan of Tahakashi method
[22:41:16] Radar: baweaver: most publishers have low tech savvy and with the tech that they have they're pretty... attached. Better the devil you know.
[22:41:34] Eiam: well keynote for sure is optimized to be displayable on giant 100 inch or whatever those thigns are
[22:41:36] Eiam: 100 foot? =)
[22:41:42] baweaver: Speaking of, guess what I'm announcing at RubyConf :D
[22:41:50] zenspider: Pragprog, learn enough (hartl) are both really streamlined
[22:42:19] Radar: zenspider: Yeah! Learn Enough is a great approach. I think Hartl's doing really amazing things there.
[22:42:24] Eiam: baweaver: some weird functional programming shim into ruby ?
[22:42:30] Eiam: baweaver: Raskell?
[22:42:30] Radar: ^ my guess also
[22:42:50] baweaver: Speaking of, guess what two things I'm announcing at RubyConf :D
[22:43:04] Radar: Illustrated Guide to Ruby and Raskell?
[22:44:25] baweaver: First one is most likely going to happen
[22:45:16] baweaver: Though there are some talks on the name potentially changing considering they've also published "Ruby Under a Microscope: An Illustrated Guide to Ruby"
[22:48:41] apeiros: has joined #ruby
[22:50:54] tAn: has joined #ruby
[22:51:21] Radar: baweaver: intentionally riffing off http://patshaughnessy.net/ruby-under-a-microscope ?
[22:51:37] baweaver: unintentionally
[22:51:47] baweaver: Thinking about whether or not the name should change.
[22:52:33] baweaver: me and havenwood were musing around about "Ruby for Lemurs - An Illustrated Apprenticeship"
[23:01:06] fluxAeon: has joined #ruby
[23:02:01] zachk: has joined #ruby
[23:06:52] mikecmpbll: has joined #ruby
[23:08:36] RougeR: has joined #ruby
[23:11:01] asphyxia: has joined #ruby
[23:18:06] JusticeFries: has joined #ruby
[23:21:08] c0ncealed4: has joined #ruby
[23:21:50] noark9: has joined #ruby
[23:23:03] tAn: has joined #ruby
[23:23:24] eckhardt: has joined #ruby
[23:25:51] apeiros: has joined #ruby
[23:31:46] eckhardt: has joined #ruby
[23:36:06] tdy: has joined #ruby
[23:37:31] bak1an: has joined #ruby
[23:38:17] Cork: if i have an OpenSSL::BN object (OpenSSL::PKey::EC#private_key), is there a way to recreate the full OpenSSL::PKey::EC object?
[23:45:19] marmotini_: has joined #ruby
[23:46:50] eckhardt: has joined #ruby
[23:49:43] RedNifre: What happens when you launch ruby files with the interpreter? Does it parse individual files lazily when it encounters a require? I have a version of my script running and it's currently crawling something, but I'd like to continue working on it... I gues the interpreter doesn't mind if I edit the file since it only reads it once on startup, right?
[23:50:50] Inside: as best as I understand it
[23:51:13] RedNifre: oh, never mind, the crawling just finished :o)
[23:51:20] RedNifre: But thanks :)
[23:53:50] Dimik: has joined #ruby
[23:56:10] blackmesa: has joined #ruby