« Back to channel list

#ruby - 25 October 2018

« Back 1 day Forward 1 day »
[00:02:15] hays: i kinda like the pattern where you download an install script from github using wget
[00:02:28] hays: or curl, whatever
[00:02:56] mangold: has joined #ruby
[00:04:13] juria_roberts: zenspider: Sorry they are environment variables
[00:26:58] cliluw: has joined #ruby
[00:26:59] ur5us: has joined #ruby
[00:29:49] xuanrui: has joined #ruby
[00:33:55] orbyt_: has joined #ruby
[00:36:06] Creatornator: has joined #ruby
[00:45:08] hays: havenwood: you on a mac by chance?
[00:45:27] hays: ruby-install is giving configure: error: cannot run C compiled programs.
[00:45:38] hays: i have xcode instslled and commandline tools installed
[00:45:47] bmurt: has joined #ruby
[00:47:07] hays: this seems weird. conftest.c:10:10: fatal error: 'stdio.h' file not found
[00:49:20] mangold: has joined #ruby
[00:53:29] hays: fixed it
[01:04:27] akemot: has joined #ruby
[01:04:44] tdy: has joined #ruby
[01:08:24] nadir: has joined #ruby
[01:26:26] kurko_: has joined #ruby
[01:45:14] _whitelogger: has joined #ruby
[02:04:55] agent_white: has joined #ruby
[02:10:23] darkhanb: has joined #ruby
[02:14:38] connor_goodwolf: has joined #ruby
[02:21:14] kurko_: has joined #ruby
[02:27:36] arescorpio: has joined #ruby
[02:34:55] jgpawletko: has joined #ruby
[02:35:15] truenito: has joined #ruby
[02:35:19] esrse: has joined #ruby
[02:40:15] arescorpio: has joined #ruby
[02:58:58] im0nde: has joined #ruby
[03:07:05] xall: has joined #ruby
[03:09:16] braincrash: has joined #ruby
[03:12:42] dnewkerk: has joined #ruby
[03:13:21] wojnar: has joined #ruby
[03:15:24] wojnar: has joined #ruby
[03:22:11] kujira: has joined #ruby
[03:35:21] skwurl: has joined #ruby
[03:39:09] Milos: has joined #ruby
[03:49:41] sauvin: has joined #ruby
[04:24:43] dellavg_: has joined #ruby
[04:24:50] eckhardt: has joined #ruby
[04:30:23] reber: has joined #ruby
[04:33:11] Xiti`: has joined #ruby
[04:34:24] skwurl: rails Q:?
[04:37:05] skwurl: i keep getting a " #<Note::ActiveRecord_Relation:0x00007fc275694670> " type thing on my view in this app. ive confirmed that i am savinmg data to the db, but i cant get it to come out onto my view right. amu insight?
[04:37:15] skwurl: i tried .to_s all over
[05:00:07] mattraibert: has joined #ruby
[05:04:14] tbuehlmann: skwurl: can you gist what you're trying to do?
[05:06:03] tbuehlmann: ah, you're already getting help over at #RubyOnRails, nvm
[05:13:58] za1b1tsu: has joined #ruby
[05:15:15] NpcOrangeManBad: has joined #ruby
[05:17:12] MoritaShinobu: has joined #ruby
[05:18:06] donofrio_: has joined #ruby
[05:32:01] d^sh: has joined #ruby
[05:41:02] aupadhye: has joined #ruby
[06:12:48] za1b1tsu: has joined #ruby
[06:14:09] Nicmavr: has joined #ruby
[06:22:19] tdy: has joined #ruby
[06:28:45] Pisuke: has joined #ruby
[06:31:50] Synthead: has joined #ruby
[06:39:22] crankharder: has joined #ruby
[06:40:53] Cork: anyone know if it is possible to create a OpenSSL::PKey::EC from a OpenSSL::BN instance?
[06:43:03] guardian: has joined #ruby
[06:47:55] mangold: has joined #ruby
[07:02:25] SteenJobs: has joined #ruby
[07:09:26] tuor: has joined #ruby
[07:14:28] voolik: has joined #ruby
[07:14:28] clemens3: has joined #ruby
[07:41:36] clemens3_: has joined #ruby
[07:47:16] blackmesa: has joined #ruby
[08:00:11] venmx: has joined #ruby
[08:04:30] ur5us: has joined #ruby
[08:28:04] Caerus: has joined #ruby
[08:34:45] mangold: has joined #ruby
[08:40:42] venmx: has joined #ruby
[08:41:06] lunarkitty7: has joined #ruby
[08:43:18] MoritaShinobu: has joined #ruby
[08:55:32] Guest75806: has joined #ruby
[08:55:52] aupadhye: has joined #ruby
[08:58:10] blackmesa: has joined #ruby
[09:04:11] im0nde: has joined #ruby
[09:04:27] Synthead: has joined #ruby
[09:17:12] aupadhye: has joined #ruby
[09:25:46] voolik: has joined #ruby
[09:29:34] Freshnuts: has joined #ruby
[09:30:35] xfbs: has joined #ruby
[09:31:35] Freshnuts: has joined #ruby
[09:35:05] Freshnuts: has joined #ruby
[09:40:34] tuor: has joined #ruby
[09:43:56] s2013: has joined #ruby
[09:45:04] rkoller: has joined #ruby
[09:48:19] _joes__: has joined #ruby
[09:51:26] akem: has joined #ruby
[09:54:38] xfbs: has joined #ruby
[10:03:33] phaul: has joined #ruby
[10:04:31] roshanavand: has joined #ruby
[10:06:40] rubydoc: has joined #ruby
[10:15:38] despai: has joined #ruby
[10:39:31] whysthatso: has joined #ruby
[10:46:45] vutral1: has joined #ruby
[10:48:23] roshanavand: has joined #ruby
[10:51:05] kurko_: has joined #ruby
[10:54:15] Defenestrate: has joined #ruby
[10:56:05] despai: has joined #ruby
[10:57:06] kapil____: has joined #ruby
[11:00:30] whysthatso: has joined #ruby
[11:00:55] mikecmpbll: has joined #ruby
[11:02:24] InfinityFye: has joined #ruby
[11:14:02] ralinux: has joined #ruby
[11:19:22] despai: has joined #ruby
[11:32:24] wojnar: has joined #ruby
[11:39:42] crankharder: has joined #ruby
[12:01:15] ldnunes: has joined #ruby
[12:03:43] aupadhye: has joined #ruby
[12:10:50] Guest75806: has joined #ruby
[12:14:10] moei: has joined #ruby
[12:16:38] nexraf1_: has joined #ruby
[12:17:01] mostlybadfly: has joined #ruby
[12:17:38] AJA4350: has joined #ruby
[12:22:16] teclator: has joined #ruby
[12:33:18] despai: has joined #ruby
[12:37:17] nexraf1: has joined #ruby
[12:43:21] cow[moo]: has joined #ruby
[12:47:24] rubydoc: has joined #ruby
[12:59:02] blackmesa: has joined #ruby
[13:12:21] bak1an: has joined #ruby
[13:13:59] Guest75806: has joined #ruby
[13:14:46] dmitch: has joined #ruby
[13:19:39] dnewkerk: has joined #ruby
[13:27:20] tdy: has joined #ruby
[13:28:51] nowhere_man: has joined #ruby
[13:30:25] apparition: has joined #ruby
[13:33:31] ph88: has joined #ruby
[13:37:01] kgutteridge: has joined #ruby
[13:47:51] alem0lars: has joined #ruby
[13:52:59] dmitch: has joined #ruby
[13:57:44] Rapture: has joined #ruby
[14:13:13] Inline: has joined #ruby
[14:13:22] Inside: has joined #ruby
[14:13:26] Inside: Guys. Guys.
[14:13:29] Inside: I've been programming ruby for like.. 2 years now
[14:13:40] Inside: And I just learned about keyword arguments to functions
[14:14:55] Inside: This saddens me a lot.
[14:17:23] GodFather: has joined #ruby
[14:18:53] GodFather: has joined #ruby
[14:19:11] jhass: yes, that's very sad indeed
[14:19:15] jhass: btw ruby has no functions
[14:20:15] nowhere_man: has joined #ruby
[14:23:02] wojnar: has joined #ruby
[14:30:10] SteenJobs: has joined #ruby
[14:40:25] dmitch: has joined #ruby
[14:43:38] orbyt_: has joined #ruby
[14:58:27] xfbs: has joined #ruby
[15:06:34] Azure: has joined #ruby
[15:07:03] Inline: has joined #ruby
[15:13:58] apeiros_: has joined #ruby
[15:14:41] Synthead: has joined #ruby
[15:17:42] cd: has joined #ruby
[15:20:27] akemot: has joined #ruby
[15:26:07] dmitch: has joined #ruby
[15:27:02] yxhuvud: has joined #ruby
[15:27:10] Dbugger: has joined #ruby
[15:39:23] beowuff: has joined #ruby
[15:40:48] tdy: has joined #ruby
[15:43:55] eckhardt: has joined #ruby
[16:00:36] dmitch: has joined #ruby
[16:03:50] eddof13: has joined #ruby
[16:03:59] conta: has joined #ruby
[16:04:22] beefjoe: has joined #ruby
[16:06:51] rippa: has joined #ruby
[16:09:36] kapil____: has joined #ruby
[16:11:36] jcarl43: has joined #ruby
[16:13:34] conta: has joined #ruby
[16:15:13] tdy: has joined #ruby
[16:15:18] bmurt: has joined #ruby
[16:15:57] kurko_: has joined #ruby
[16:21:56] ixti: has joined #ruby
[16:27:00] SeepingN: has joined #ruby
[16:27:24] Voxxit: has joined #ruby
[16:34:40] orbyt_: has joined #ruby
[16:36:56] darkhanb: has joined #ruby
[16:38:04] thejs: has joined #ruby
[16:43:19] SeepingN_: has joined #ruby
[16:45:12] mroutis: has joined #ruby
[16:48:27] baweaver: Inside: Want to know something even more fun?
[16:48:34] baweaver: Blocks can use them too.
[16:49:11] baweaver: [{ a: 1 }, { b: 2 }].map { |a: 1, b: 2| a + b } # => [3, 3]
[16:50:42] Eiam: Inside: instead of being sad, be glad that ruby still has neat things to discover and explore after two years =) I love finding out about new stuff in ruby, even if its just 'new to me' and been around since 1.9 or whatever.
[16:51:26] Eiam: true mastery eludes us, the teachers are also the students.
[16:52:31] baweaver: The inmates run the asylum
[16:52:53] troulouliou_div2: has joined #ruby
[16:53:48] baweaver: !!?! # => true
[17:02:49] xfbs_: has joined #ruby
[17:08:06] al2o3-cr: {}.map { |a: 10, b: 5 | a + b } why does this not work?
[17:08:31] al2o3-cr: {c:2}.map { |a: 10, b: 5 | a + b } but this does.
[17:09:30] nowhere_man: has joined #ruby
[17:10:04] phaul: by not working... what do you mean?
[17:10:14] oz: al2o3-cr: it seems to work quite well.
[17:10:46] al2o3-cr: phaul: i'd would of thought the first one would return [15] too.
[17:11:53] phaul: well, {} is empty... so...
[17:12:43] al2o3-cr: yeah, maybe i was thinking the keyword args would still be passed.
[17:14:43] Inside: baweaver: augh what
[17:14:57] Inside: oh I see, default keyword args in the block
[17:15:25] ixti: has joined #ruby
[17:17:55] cow[moo]: has joined #ruby
[17:17:57] phaul: I've just found codepad.org. I go and see if I can patch ruby[bot] to use it..
[17:18:11] phaul: ACTION building 2.3
[17:18:53] al2o3-cr: phaul: it can use carc.in
[17:19:15] al2o3-cr: upto ruby 2.4 on there.
[17:20:02] al2o3-cr: and it's reliable.
[17:20:22] phaul: I patch it for that then
[17:21:24] al2o3-cr: it seems eval.in is totally dead now.
[17:21:39] al2o3-cr: nothing works on there anymore.
[17:22:06] phaul: my 2.3 build failed... grrr
[17:24:25] phaul: https://gist.github.com/060d5f363b3d9a0e15bdff52b3cd1ee2 does anybody know what to do with this? (on arch)
[17:25:47] Cthulu201: has joined #ruby
[17:29:07] marmotini_: has joined #ruby
[17:36:12] cow[moo]: has joined #ruby
[17:38:43] Lytol: has joined #ruby
[17:41:21] rafadc: has joined #ruby
[17:54:58] ivanskie: has joined #ruby
[17:57:51] chouhoulis: has joined #ruby
[18:02:29] Blaguvest: has joined #ruby
[18:15:34] jacobherrington: has joined #ruby
[18:15:43] SCHAPiE: has joined #ruby
[18:18:19] Inside: I've been reading Practical Object-Oriented Design: An Agile Primer Using Ruby lately and it's really throwing me for a loop about how I do stuff
[18:18:52] Inside: I wish we had other people who work here so that I could do a code reiew of some sort :\
[18:19:48] apeiros_: Inside: hm? what stops you from gisting your code here and ask for input?
[18:19:58] baweaver: Ohai apeiros
[18:20:00] baweaver: welcome back
[18:20:22] apeiros: o/ baweaver
[18:23:29] Inside: apeiros: it's mostly high level architecture stuff
[18:23:50] Inside: On a per method or per class level everything sort of works
[18:24:07] Inside: but then when I go to extend it, it turns to mush since I hadn't thought of future uses for that code.
[18:28:34] eckhardt: has joined #ruby
[18:30:22] blackmesa1: has joined #ruby
[18:39:58] beefjoe: has joined #ruby
[18:40:10] wildermind: has joined #ruby
[18:41:37] apeiros: Inside: it is true that the likeliness for an answer increases with the example code being more concrete. but sometimes you'll also get good answers for mostly theoretical questions. of course you can also try to turn your theoretical question into a concrete one.
[18:42:52] orbyt_: I've got a gem that i'm trying to uninstall via gem uninstall gem_name -v 1.5
[18:43:02] orbyt_: However, afterwards running gem list gem_name still shows it as a local gem
[18:43:07] orbyt_: how do I get rid of it?
[18:43:29] apeiros: orbyt_: probably a different version. drop the -v.
[18:43:32] thejs: has joined #ruby
[18:44:40] orbyt_: apeiros I was passing in the version listed in gem list
[18:44:48] OrangeManBad: has joined #ruby
[18:44:52] orbyt_: Strangely without the version option it works
[18:45:17] apeiros: it didn't show you multiple versions in `gem list`?
[18:45:41] NpcOrangeManBad: has joined #ruby
[18:45:57] kurko_: has joined #ruby
[18:48:27] orbyt_: Also, is there something going on with ruby gems? `gem install gem` is just hanging
[18:50:26] apeiros: orbyt_: works fine for me.
[18:50:39] apeiros: just installed oga as a test.
[18:53:45] ivanskie: why does this not work in irb? http://rubular.com/r/RMfgjB1rYB
[18:53:50] ivanskie: i'm only getting the first match
[18:53:51] orbyt_: apeiros I'm seeing a timeout
[18:54:19] apeiros: ivanskie: what code do you use to match?
[18:55:22] orbyt_: has joined #ruby
[18:55:36] orbyt_: Restarting the network service seemed to resolve the issue
[18:57:11] ivanskie: https://repl.it/repls/DisloyalLightgreyLevel
[18:57:48] ivanskie: I'm trying to copy this: https://github.com/johnnyopao/awsp/blob/master/index.js#L9-L26
[18:58:18] apeiros: yeah, the docs of String# and Regexp#match are not explicit on this, but both methods only match once.
[18:58:41] apeiros: i.e. those methods will stop testing the regex against the string after the first successful match
[18:58:48] apeiros: see String#scan for multiple matches
[18:59:43] apeiros: btw., don't do this: `File.open(path).read`, this leaves dangling file descriptors. just use `File.read(path)`
[18:59:49] apeiros: it's less code too
[19:00:00] ivanskie: oh super. thank you for the tip
[19:00:30] apeiros: (if you really really want to explicitly use open, at least do it as `File.open(path, &:read)`, that uses a block which closes the descriptor again)
[19:00:49] ivanskie: i rewrote that guy's awsp, all in bash script.. so it'd work on all our machines no matter their environment.
[19:01:04] ivanskie: but now im writing a gem, sooo trying to build this into it, in ruby.
[19:01:53] ivanskie: speaking of which.. I'm still not even sure if this is going to work. i need to figure out how to run the .sh script which will source file with new envars. to apply to original shell
[19:01:59] ivanskie: argh headache
[19:03:58] orbyt_: has joined #ruby
[19:09:09] tfitts: has joined #ruby
[19:09:22] apeiros: ivanskie: re sourcing env vars: remember you can only ever add env vars for *child* processes.
[19:09:45] tfitts: is there a method that is similar to map but for a single object? I normally want this in the console when I'm looking at objects a few levels deep and want to pull out a few pieces of data from that
[19:10:30] apeiros: tfitts: just call the method on it? o0
[19:11:09] phaul: I am speculating of cource, but I think this is a confusion on objects vs hashes
[19:11:11] ivanskie: right. so the way awsp dev is doing it, and how i replicated it in bash script. is.. I have an alias for 'source .myscript.sh' in .myscript.sh i show the menu, menu writes a temp file with exports. then .myscript.sh sources the temp file, deletes it, and exits.
[19:12:02] ivanskie: awsp dev made his npm script actually be called _awsp in shell.. and the alias for awsp goes to his sh. file which launches the javascript based _awsp script for menu.
[19:12:02] phaul: tfitts: can you show us an example of an object you would like to map on?
[19:12:22] ivanskie: i guess i'll have to do the same but ruby. argh its messy.
[19:13:16] TheNet: tfitts: also speculating: a = object; [a.foo, a.bar]
[19:14:05] tfitts: po has many pois (alias for purchase_order_items), pois belongs to item, po.pois.item.the_method_here{|x| [x.id, x.sku, x.quantity}
[19:14:27] tfitts: I realize I can do po.pois.map{|x| [x.item.id, x.item.sku, x.item.quantity]}
[19:15:25] tfitts: but on occasion there are 2 or 3 levels deeper than pois, sometimes several words long. I'm mainly looking for it as a convenience but I would think it exists
[19:15:52] TheNet: tfitts: why not what I suggested?
[19:16:05] baweaver: Demeter weeps
[19:16:20] tfitts: TheNet: yeah, that's more or less what I currently do
[19:16:51] tfitts: it looks like instance_eval does what I want though
[19:16:52] baweaver: Anyways, crypticisms aside, you probably want to reevaluate your code if you need to dig that deep to get the data you need.
[19:18:42] wojnar: has joined #ruby
[19:19:19] TheNet: tfitts: obj.yield_self { |x| ... } if ruby > 2.5
[19:19:51] tfitts: ugh, still on 2.42. I'll have to see if there's any reason to not upgrade.
[19:19:53] akem: has joined #ruby
[19:24:17] venmx: has joined #ruby
[19:29:45] Rapture: has joined #ruby
[19:32:43] orbyt_: has joined #ruby
[19:34:48] dmitch: has joined #ruby
[19:37:11] OrangeManBad: has joined #ruby
[19:38:07] thejs: has joined #ruby
[19:41:16] beefjoe: has joined #ruby
[19:41:23] dostoyevsky: has joined #ruby
[19:42:43] eddof13: has joined #ruby
[19:44:10] Tempesta: has joined #ruby
[19:47:25] SeepingN: has joined #ruby
[19:49:19] dmitch: has joined #ruby
[19:57:57] samort7: has joined #ruby
[19:59:32] apeiros: has joined #ruby
[20:12:19] knight33: has joined #ruby
[20:18:36] xfbs: has joined #ruby
[20:21:12] despai: has joined #ruby
[20:24:48] phaul: https://gist.github.com/phaul/7d56f4cb63db6793cf82de0ecaf88067 if someone feels like web hacking, please shed some light on this. I've been fighting carc.in for about an hour now. and no luck
[20:26:29] ur5us: has joined #ruby
[20:34:07] jacobherrington: has joined #ruby
[20:34:11] rkoller: has joined #ruby
[20:34:40] ramfjord: has joined #ruby
[20:35:53] al2o3-cr: phaul: using typhoeus, so it does work. https://gist.github.com/gr33n7007h/84f84ad7dbb289cb4ee4cff627abf07a
[20:37:53] al2o3-cr: does it matter if your paramerters are not order?
[20:39:30] phaul: I have no idea, but I also missed the run_request: { ... } wrap in the body.
[20:41:16] phaul: this is the same 504 curl.http_post({ run_request: {language: 'ruby', version: '2.4.1', code: '1' }}.to_json)
[20:42:48] al2o3-cr: phaul: where you setting the headers?
[20:43:15] phaul: give me a second I make a new gist starting from cratch
[20:46:29] despai: has joined #ruby
[20:48:05] akem: has joined #ruby
[20:49:50] akemot: has joined #ruby
[20:51:26] phaul: ah, never mind I should have RTFM first https://www.rubydoc.info/github/taf2/curb/Curl/Easy:http_post . I *was* setting ContentType to application/json, but according to the documentation, http_post posts out form-urlencoded anyway
[20:52:41] phaul: thanks al2o3-cr you pointed me to the right direction
[20:54:29] beefjoe: has joined #ruby
[20:59:20] zapata_: has joined #ruby
[21:01:41] eckhardt: has joined #ruby
[21:17:24] millerti: has joined #ruby
[21:27:29] ramfjord: has joined #ruby
[21:27:56] orbyt_: has joined #ruby
[21:30:50] zachk: has joined #ruby
[21:31:36] mochiyoda: has joined #ruby
[21:35:59] al2o3-cr: has joined #ruby
[22:04:37] SeepingN: has joined #ruby
[22:09:39] kurko_: has joined #ruby
[22:11:26] bougyman: https://www.serverless-ruby.org/
[22:11:29] bougyman: have you signed it yet?
[22:14:49] cow[moo]: has joined #ruby
[22:17:51] eddof13: has joined #ruby
[22:19:34] Dimik: has joined #ruby
[22:20:32] venmx: has joined #ruby
[22:23:53] zapata_: has joined #ruby
[22:24:53] orbyt_: has joined #ruby
[22:30:06] Inside: What are your thoughts on using protected/private methods in ruby for class attributes?
[22:33:01] ellcs: has joined #ruby
[22:33:24] Inside: ie: https://gist.github.com/Insood/513bda0beaaa5c4190a4b829940163e2
[22:45:46] eckhardt: has joined #ruby
[22:49:42] ramfjord: has joined #ruby
[22:55:37] phaul: Inside: it's an instance attribute nevertheless. you are placing self in front of it in instance methods
[22:58:36] phaul: you can create class attributes like class X; class << self ; attr_accessor :x; end; end; X.x = 5;
[23:00:59] Inside: so basically no point?
[23:03:50] knight33: has joined #ruby
[23:04:03] phaul: I can't see how a private accesor is different from accessing the instance variable
[23:05:30] phaul: a custom method wrapping the access can make sense public or private, if you want to add more logic in there
[23:06:17] Inside: Well, this book is recommending using attr_* classes since later on you can create those custom methods if needed without searching for everything that starts with a @
[23:06:56] Inside: so I'm trying to puzzle through it and figure out just what it is that i'm getting out of it
[23:10:17] phaul: to me it's a bit artificial. I would just change the `@'s there and then when needed. But I see your point
[23:13:31] phaul: ^and this actually almost never happens to me
[23:17:18] phaul: an other way of thinking about it, is that if you want 13 * @a everywhere, not @a, why do you store @a instead of 13 * @a
[23:18:53] tdy: has joined #ruby
[23:20:56] knight33: has joined #ruby
[23:22:14] baweaver: I'd argue not much. If your class is big enough that a find and replace is dangerous, you have other issues to contend with.
[23:30:58] fluxAeon: has joined #ruby
[23:36:36] ramfjord: has joined #ruby
[23:51:18] ramfjord: has joined #ruby
[23:53:52] ramfjord: has joined #ruby
[23:55:41] dous: has joined #ruby
[23:57:49] phaul: &list %.-@
[23:57:49] rubydoc: I haven't found any entry that matches class method -@ on %
[23:58:27] phaul: is it possible though..
[23:59:28] phaul: class X; def self.-@; self; end; end; -X