« Back to channel list

#ruby - 26 July 2018

« Back 1 day Forward 1 day »
[00:01:43] tdy: has joined #ruby
[00:02:38] bmurt: has joined #ruby
[00:20:15] cagomez: has joined #ruby
[00:33:57] Caerus: has joined #ruby
[00:35:53] Some-body_: has joined #ruby
[00:46:26] weaksauce: has joined #ruby
[01:01:01] redlegion: has joined #ruby
[01:02:20] stewp: has joined #ruby
[01:03:33] za1b1tsu: has joined #ruby
[01:09:41] ur5us: has joined #ruby
[01:13:45] spectra: has joined #ruby
[01:21:49] negatifze: has joined #ruby
[01:33:00] redlegion: has joined #ruby
[01:38:17] white_lilies: has joined #ruby
[01:39:25] ur5us: has joined #ruby
[01:42:16] dstrunk: has joined #ruby
[01:42:58] redlegion: has joined #ruby
[01:44:01] ur5us: has joined #ruby
[01:52:57] redlegion: has joined #ruby
[02:02:11] graphene: has joined #ruby
[02:12:57] redlegion: has joined #ruby
[02:13:09] graphene: has joined #ruby
[02:15:36] kapil___: has joined #ruby
[02:26:08] \13k: has joined #ruby
[02:28:02] cpallares: has joined #ruby
[02:32:56] redlegion: has joined #ruby
[02:34:23] Eldritch: has joined #ruby
[02:44:17] za1b1tsu: has joined #ruby
[02:50:06] tdy: has joined #ruby
[02:52:24] s2013: has joined #ruby
[02:53:00] redlegion: has joined #ruby
[02:53:54] \13k: has joined #ruby
[03:00:31] cadillac_: has joined #ruby
[03:02:59] redlegion: has joined #ruby
[03:05:09] shakes: has joined #ruby
[03:11:04] braincrash: has joined #ruby
[03:12:58] redlegion: has joined #ruby
[03:19:06] za1b1tsu: has joined #ruby
[03:22:58] redlegion: has joined #ruby
[03:27:52] akaiiro: has joined #ruby
[03:28:11] s2013: has joined #ruby
[03:30:01] s2013: has joined #ruby
[03:32:56] redlegion: has joined #ruby
[03:32:56] gix: has joined #ruby
[03:34:28] Nicmavr: has joined #ruby
[03:39:02] edwardly: has joined #ruby
[03:39:10] bmurt: has joined #ruby
[03:44:46] duderonomy: has joined #ruby
[03:48:10] graphene: has joined #ruby
[03:48:26] r29v: has joined #ruby
[04:08:38] ogres: has joined #ruby
[04:17:25] darkhanb: has joined #ruby
[04:20:30] akaiiro: has joined #ruby
[04:22:06] white_lilies: has joined #ruby
[04:32:58] redlegion: has joined #ruby
[04:49:28] \void: has joined #ruby
[04:49:48] za1b1tsu: has joined #ruby
[04:53:00] redlegion: has joined #ruby
[05:02:59] redlegion: has joined #ruby
[05:03:38] cadillac_: has joined #ruby
[05:04:13] lain2: has joined #ruby
[05:08:55] dellavg: has joined #ruby
[05:10:38] lainonthewired: has joined #ruby
[05:11:42] jokke1: has joined #ruby
[05:12:22] havenwood: lainonthewired: hi
[05:14:41] lainonthewired: I learn ruby at the moment i think i have mostly make it and want to write a bigger programm now has someone on idea for a programm that is needed or a project i can join ?
[05:17:26] Genya: has joined #ruby
[05:18:31] lainonthewired: And i have a question is it possilbe to get ocra to work with TK ? The command shell programms run but not the tk programms.
[05:19:52] Genya: has joined #ruby
[05:20:43] dviola: has joined #ruby
[05:26:14] Dbugger: has joined #ruby
[05:28:00] Es0teric: has joined #ruby
[05:31:30] sauvin: has joined #ruby
[05:34:31] apeiros: has joined #ruby
[05:36:25] venmx: has joined #ruby
[05:43:01] redlegion: has joined #ruby
[05:43:29] Xiti: has joined #ruby
[05:47:30] Megamos: has joined #ruby
[05:52:59] redlegion: has joined #ruby
[06:02:58] redlegion: has joined #ruby
[06:03:12] donofrio_: has joined #ruby
[06:08:25] biberu: has joined #ruby
[06:12:57] redlegion: has joined #ruby
[06:21:59] Puffball: has joined #ruby
[06:22:59] redlegion: has joined #ruby
[06:25:11] apeiros: has joined #ruby
[06:42:58] redlegion: has joined #ruby
[06:48:38] aufi: has joined #ruby
[06:48:44] conta: has joined #ruby
[06:50:45] tuor: has joined #ruby
[06:51:28] tuor: (my setup: Ubuntu 16.04) Hi, I have installed gem with sudo and now I always need sudo to install gems. How can I remove all gems and start over with all my gems in my $HOME? So I don't require sudo to install gems....
[06:55:04] rfoust: has joined #ruby
[06:58:08] cagomez: has joined #ruby
[07:01:50] Freshnuts: has joined #ruby
[07:03:59] alfiemax: has joined #ruby
[07:06:27] dalpo: Tuor: how did you install ruby on your pc?
[07:06:52] dalpo: with apt?
[07:07:37] tuor: apt install ruby (I think)
[07:07:52] tuor: dalpo: pretty shure yes.
[07:08:29] dalpo: ok so its normal that you need to use sudo for each gem install
[07:08:40] tuor: I want to be able to install gems an use bundle and rake in my home without sudo. What do I have to do?
[07:09:18] TheBrayn: well, you can just do bundle install --path .vendor in your project
[07:09:30] TheBrayn: and then do bundle exec rake
[07:09:50] TheBrayn: but you should usually be able to install gems into your homedir too
[07:09:58] TheBrayn: not sure how ubuntu does things though
[07:10:30] yohji: has joined #ruby
[07:12:24] tuor: I'm the only user of this laptop. Can I install ruby in a way, that gem, bundle, rake, what ever is all handled inside my home by default?
[07:14:44] dalpo: TheBrayn: by default on ubuntu if you want to install a gem with the system ruby you need the root permission
[07:14:48] dalpo: ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /var/lib/gems/2.5.0 directory.
[07:15:10] TheBrayn: I wonder what other distributions do differently to allow this
[07:15:15] dalpo: this is the error I see installing a gem with a normal user
[07:15:37] dalpo: I don't know
[07:16:01] dalpo: generally I always use a ruby version manager
[07:16:28] dalpo: like chruby
[07:17:30] dalpo: Tuor: so my suggestion is to install ruby with a ruby version manager like rbenv
[07:17:53] dalpo: rbenv, rvm, chruby + ruby-install
[07:18:05] TheBrayn: I don't think that's necessary at all
[07:18:11] sysvalve: has joined #ruby
[07:18:14] TheBrayn: you should be able to add an additional gem path
[07:18:55] dalpo: TheBrayn: I agree, it's the only easiest way in my experience :)
[07:20:41] dalpo: i think chruby should only handle the $GEM_HOME, $GEM_PATH...
[07:28:26] Es0teric: has joined #ruby
[07:28:55] alfiemax: has joined #ruby
[07:32:11] Freshnuts: has joined #ruby
[07:33:06] tuor: I'll check it out. thx all of you for your help!
[07:36:55] TomyWork: has joined #ruby
[07:37:42] tuor: has joined #ruby
[07:38:02] tuor: ACTION is back again.
[07:43:43] grr12314: has joined #ruby
[07:45:22] sina: has joined #ruby
[07:46:27] grr12314: hi, is it just me unable to find it, or does ruby really not have a way to format a float with a minimal representation? i.e. 2 instead of 2.0 when whole, etc
[07:48:43] ineb: grr12314: only 2.0 iam afraid.
[07:49:04] ineb: or thinks like Float(2) etc.
[07:49:30] ineb: 2.to_f being another option
[07:50:29] Radar: TheBrayn: strongly recommend using chruby or asdf to make your Ruby life easier.
[07:50:39] Radar: Or was that Tuor?
[07:50:59] grr12314: hm nvm seems like %g does the trick
[07:51:12] Radar: Tuor: https://ryanbigg.com/2014/10/ubuntu-ruby-ruby-install-chruby-and-you
[07:51:30] reber: has joined #ruby
[07:51:32] Radar: Blog post hasn't been updated in a year but the advice within will still work.
[07:53:00] redlegion: has joined #ruby
[08:02:06] mikecmpbll: has joined #ruby
[08:02:19] tuor: Radar: thx :)
[08:02:59] redlegion: has joined #ruby
[08:04:21] hurricanehrndz: has joined #ruby
[08:05:20] quobo: has joined #ruby
[08:12:12] TheBrayn: Radar: I don't really have a use for neither of them
[08:12:58] redlegion: has joined #ruby
[08:22:56] redlegion: has joined #ruby
[08:33:21] redlegion: has joined #ruby
[08:35:24] grr12314: has left #ruby: ()
[08:40:14] kke: has joined #ruby
[09:03:02] redlegion: has joined #ruby
[09:03:14] Vircung: has joined #ruby
[09:05:09] mikecmpb_: has joined #ruby
[09:06:26] venmx: has joined #ruby
[09:12:58] redlegion: has joined #ruby
[09:17:28] jokke1: has joined #ruby
[09:18:33] dhollinger: has joined #ruby
[09:22:58] redlegion: has joined #ruby
[09:33:00] redlegion: has joined #ruby
[09:38:22] sarna: has joined #ruby
[09:42:58] redlegion: has joined #ruby
[09:45:18] tuor: has joined #ruby
[09:48:57] beefjoe: has joined #ruby
[09:52:57] redlegion: has joined #ruby
[10:02:39] weird_error: has joined #ruby
[10:02:59] redlegion: has joined #ruby
[10:12:57] redlegion: has joined #ruby
[10:16:32] mzo: has joined #ruby
[10:20:37] kapil___: has joined #ruby
[10:26:01] AJA4350: has joined #ruby
[10:38:10] venmx: has joined #ruby
[10:43:00] redlegion: has joined #ruby
[10:46:40] nielsk: has joined #ruby
[10:55:28] donofrio: has joined #ruby
[10:56:11] GodFather: has joined #ruby
[11:00:13] _whitelogger: has joined #ruby
[11:03:02] redlegion: has joined #ruby
[11:11:26] venmx: has joined #ruby
[11:13:00] redlegion: has joined #ruby
[11:18:01] dstrunk: has joined #ruby
[11:20:50] psychicist__: has joined #ruby
[11:22:59] redlegion: has joined #ruby
[11:26:31] mojtaba: has joined #ruby
[11:26:51] mojtaba: Hello, can I ask rails related questions here?
[11:27:03] mojtaba: I was following a tutorial to create a migration, but I had a typo. I fixed the typo an ran again the migration command. But it says ruby has aborted the operation. (because part of the migration has been done.) do you know how can I fix this issue?
[11:32:30] d^sh_: has joined #ruby
[11:32:58] redlegion: has joined #ruby
[11:33:44] d^sh-: has joined #ruby
[11:34:54] graphene: has joined #ruby
[11:36:41] apeiros: just in case - mojtaba crossposted in #rubyonrails and got help there. not that somebody wastes time (and that's btw. why crossposting without telling is rude)
[11:37:03] dviola: has joined #ruby
[11:38:18] mojtaba: has left #ruby: ()
[11:43:00] redlegion: has joined #ruby
[11:54:03] graphene: has joined #ruby
[11:58:10] graphene: has joined #ruby
[12:08:00] bmurt: has joined #ruby
[12:12:20] bak1an: has joined #ruby
[12:12:53] Vircung: has joined #ruby
[12:26:33] jottr: has joined #ruby
[12:38:39] tuor: has joined #ruby
[12:53:01] redlegion: has joined #ruby
[13:08:52] rfoust: has joined #ruby
[13:16:25] crankhar1er: has joined #ruby
[13:23:10] Mike11: has joined #ruby
[13:27:57] Puffball: has joined #ruby
[13:33:42] conta1: has joined #ruby
[13:43:23] beefjoe: has joined #ruby
[13:45:10] d10n-work: has joined #ruby
[13:45:33] venmx: has joined #ruby
[13:46:54] krawchyk: has joined #ruby
[13:49:12] saleria: has joined #ruby
[14:03:28] gnufied: has joined #ruby
[14:12:39] mzo: has joined #ruby
[14:13:11] eblip: has joined #ruby
[14:14:38] Nicmavr: has joined #ruby
[14:24:32] crankhar1er: has joined #ruby
[14:25:42] SCHAPiE: has joined #ruby
[14:32:45] konsolebox: has joined #ruby
[14:35:34] chongtxtx: has joined #ruby
[14:35:41] Sembei: has joined #ruby
[14:36:27] KeyJoo: has joined #ruby
[14:36:59] KeyJoo: has joined #ruby
[14:47:46] bmurt: has joined #ruby
[15:08:02] GodFather: has joined #ruby
[15:10:12] _yohji_: has joined #ruby
[15:15:54] Beams: has joined #ruby
[15:18:29] __yohji__: has joined #ruby
[15:24:39] bmurt: has joined #ruby
[15:26:56] tcopeland: has joined #ruby
[15:27:01] dviola: has joined #ruby
[15:27:45] brendan-: has joined #ruby
[15:37:09] quobo: has joined #ruby
[15:38:25] Celmor: has joined #ruby
[15:40:01] Celmor: I was looking for a gem to convert markdown to pdf, I tired https://github.com/monterail/wing (gem install wing) but according to #ruby#gem that's old
[15:40:36] Celmor: and doesn't work
[15:45:18] kapil___: has joined #ruby
[15:50:16] tycoon177: is there a way that i can convert a symbol to a string without the colon being included in the string?
[15:51:11] mikecmpb_: Celmor : i've never done that specifically but might be easier to do markdown -> html -> pdf, as both of those conversions are very common.
[15:51:54] Celmor: yeah, thought so too
[15:52:26] mikecmpbll: e.g. redcarpet for markdown -> html and wkhtmltopdf for html -> pdf.
[15:52:35] Celmor: the proble, is if it's not optimized for print code snippets often clip the right side and don't wrap
[15:52:36] tycoon177: Celmor: you could look into Pandoc bindings. i'm sure that pandoc could handle markdown to pdf
[15:54:12] jcarl43: has joined #ruby
[15:54:36] cagomez: has joined #ruby
[15:55:38] cagomez: has joined #ruby
[15:55:40] Celmor: thanks for the suggestions, gonna try them out
[15:59:04] apeiros_: has joined #ruby
[15:59:09] bmurt: has joined #ruby
[16:00:08] rippa: has joined #ruby
[16:02:27] tycoon177: disregard my question re: symbols. it seems like that's not the standard behavior if i just run irb, so i think this is a rails specific thing (or project specific)
[16:04:19] tycoon177: and now that issue seems to have disappeared. strange
[16:06:18] krawchyk: has joined #ruby
[16:09:42] deathwishdave: has joined #ruby
[16:15:10] cthulchu: has joined #ruby
[16:15:22] qolq: has joined #ruby
[16:19:51] tdy: has joined #ruby
[16:20:13] darkhanb: has joined #ruby
[16:26:31] alfiemax_: has joined #ruby
[16:29:54] alfiemax: has joined #ruby
[16:30:50] AJA4351: has joined #ruby
[16:34:22] lxsameer: has joined #ruby
[16:44:11] SeepingN: has joined #ruby
[16:50:36] biberu: has joined #ruby
[16:52:55] crankhar1er: has joined #ruby
[16:55:12] baweaver: Pro tip if you're getting PM spammed: /mode <your name> +R
[16:55:25] baweaver: It prevents non-registered users from PMing you
[16:55:39] baweaver: i.e. all the bots currently being annoying.
[16:56:55] bmurt: has joined #ruby
[16:58:42] crankhar1er: has joined #ruby
[17:04:55] cadillac_: has joined #ruby
[17:08:03] deathwishdave: has joined #ruby
[17:18:18] crankhar1er: has joined #ruby
[17:22:22] AJA4351: has joined #ruby
[17:23:51] mikecmpbll: has joined #ruby
[17:31:04] havenwood: has joined #ruby
[17:32:03] eckhardt: has joined #ruby
[17:32:07] mzo: has joined #ruby
[17:35:50] havenwood: has joined #ruby
[17:41:46] Eiam: has joined #ruby
[17:42:00] dinfuehr: has joined #ruby
[17:46:23] Cthulu201: has joined #ruby
[17:46:57] dtzuzu: has joined #ruby
[17:50:41] jetpack_joe: has joined #ruby
[17:54:25] lxsameer: has joined #ruby
[17:57:30] sameerynho: has joined #ruby
[18:05:20] jp: has joined #ruby
[18:09:20] Tony-St4rk: has left #ruby: ()
[18:09:29] lxsameer: has joined #ruby
[18:10:21] ruby[bot]: -bbbb chouhoulis!*@*$#ruby-fix-your-connection chouhoul_!*@*$#ruby-fix-your-connection chouhou__!*@*$#ruby-fix-your-connection chouho___!*@*$#ruby-fix-your-connection
[18:10:21] ruby[bot]: -bb chouh____!*@*$#ruby-fix-your-connection *!*@50-207-64-46-static.hfc.comcastbusiness.net$#ruby-fix-your-connection
[18:15:22] wilbert: has joined #ruby
[18:17:52] zapata: has joined #ruby
[18:18:58] AJA4351: has joined #ruby
[18:24:10] weaksauce: has joined #ruby
[18:25:55] AJA4351: has joined #ruby
[18:29:37] lxsameer: has joined #ruby
[18:47:10] DoubleMalt: has joined #ruby
[18:48:56] dumptruckman: has joined #ruby
[18:49:43] lxsameer: has joined #ruby
[18:51:53] dumptruckman: can anyone help me understand what is happening here? https://pastebin.com/TwRqtmtt
[18:51:53] ruby[bot]: dumptruckman: we in #ruby do not like pastebin.com, it loads slowly for most, has ads which are distracting and has terrible formatting. Please use https://gist.github.com
[18:53:34] dumptruckman: https://gist.github.com/anonymous/dc6914d587bed8fa8d5e lines 21 and 40
[18:54:04] dumptruckman: and 39 for that matter
[18:54:59] dumptruckman: specifically, why is this array syntax being used like this: modify[o.to_i]
[18:56:10] dumptruckman: and what is send doing?
[18:56:27] baweaver: That's some hairy code
[18:56:28] elomatreb: Modify seems to be a lambda, [] is a way of calling the lambda with the passed parameter
[18:56:37] baweaver: Yeah, looks like a lambda
[18:56:53] baweaver: and since scan is returning strings, it's calling that function with the int value it found
[18:57:06] baweaver: because scan is looking for positive or negative digits
[18:58:31] baweaver: As to why they don't use block syntax on it
[18:58:49] baweaver: def operand(&mod_fn) would be clearer
[18:59:11] baweaver: then it could be called on 40 using `operand { |o| o.send... }`
[19:02:07] dumptruckman: yeah, it seemed like messy code to me
[19:02:14] dumptruckman: and i barely have a grasp on ruby
[19:03:07] redlegion: has joined #ruby
[19:03:13] dumptruckman: so the square brackets on modify is just a way to pass in parameters?
[19:03:57] dumptruckman: that was what i was guessing it was
[19:04:00] dumptruckman: but what is send doing?
[19:04:07] dumptruckman: i think maybe i understand it on line 40
[19:04:09] dumptruckman: but not on line 39
[19:04:42] Sainfuw: has joined #ruby
[19:06:20] AJA4351: has joined #ruby
[19:06:41] SeepingN: the index at "o"
[19:07:01] SeepingN: after forcing o into an integer
[19:07:45] apeiros: dumptruckman: Proc#[] is an alias to Proc#call, so: `callable = ->(arg) { … }; callable["arg1"]` is the same as `callable = ->(arg) { … }; callable.call("arg1")`
[19:08:21] apeiros: meh, why do I even write. already 3 people helping. lol, don't mind me :D
[19:09:41] lxsameer: has joined #ruby
[19:11:19] shenghi: has joined #ruby
[19:11:59] \void: has joined #ruby
[19:13:43] dumptruckman: ok, what about this part? %w[to_i ord][arg]
[19:15:20] AJA4351: has joined #ruby
[19:17:19] dumptruckman: OH, nm, i understand that line now
[19:17:48] dumptruckman: it sends the results of getc to both to_i and ord and then picks one based on arg
[19:17:55] dumptruckman: picks the one at index arg
[19:18:02] dumptruckman: in the resulting array
[19:19:25] alem0lars: has joined #ruby
[19:19:38] lxsameer: has joined #ruby
[19:23:02] redlegion: has joined #ruby
[19:26:25] duane: has joined #ruby
[19:32:31] mikecmpbll: has joined #ruby
[19:32:39] ivanskie: has joined #ruby
[19:32:58] scrptktty: has joined #ruby
[19:33:01] redlegion: has joined #ruby
[19:37:04] za1b1tsu: has joined #ruby
[19:40:56] rodd: has joined #ruby
[19:43:00] redlegion: has joined #ruby
[19:43:19] AJA4350: has joined #ruby
[19:46:31] cjohnson: baweaver: I summon thee
[19:46:36] cjohnson: For your mighty ruby powers
[19:48:26] duane: has left #ruby: ()
[19:49:44] lxsameer: has joined #ruby
[19:52:57] redlegion: has joined #ruby
[19:57:23] AJA4351: has joined #ruby
[19:59:42] lxsameer: has joined #ruby
[20:03:00] redlegion: has joined #ruby
[20:04:24] laekur: has joined #ruby
[20:07:14] baweaver: WHO DARES SUMMO... ohai cjohnson
[20:08:34] cjohnson: Ok so here's my problem. Ruby 2.2, rails 4.2. I'm dealing with an ActiveRecord jsonb column
[20:09:12] unreal: has joined #ruby
[20:09:24] timeshifter: has joined #ruby
[20:09:25] cjohnson: In my version of rails there is some bad behavior that will only encode the value if it's an array or hash: https://github.com/rails/rails/blob/v4.2.7.1/activerecord/lib/active_record/connection_adapters/postgresql/oid/json.rb#L20-L26
[20:09:52] cjohnson: I want to override this internal AR method, but only in the context of one model, not for the whole app. So I think the answer is to use refinements
[20:10:08] timeshifter: if i have a bunch of config values set via configatron.colors.red='#ff0000', is there a way i can get that value given a string "red"?
[20:11:02] cjohnson: baweaver: Here's my refinement: https://gist.github.com/chrisjohnson/d21636d2ea339e0875170a642b7feb78 and I am `using Rails4JsonFix` in my model
[20:11:23] cjohnson: baweaver: I can see that the top-level binding.pry is being hit when this refinement is included, but neither of my overridden methods is being called
[20:11:39] cjohnson: Any ideas why? I don't believe they are being called via indirection through `send` or similar
[20:11:46] tty: has joined #ruby
[20:12:22] baweaver: timeshifter: config.colors.public_send(name)
[20:12:49] baweaver: ACTION starts reading
[20:13:51] baweaver: Admittedly never worked with refinements
[20:14:24] baweaver: Will give it a shot though, reading.
[20:14:53] baweaver: How are you including it?
[20:15:01] baweaver: include or extend?
[20:15:18] timeshifter: baweaver: doesn't seem to be returning anything
[20:15:31] cjohnson: That gist is in lib/rails4_json_fix.rb and I am `using Rails4JsonFix` @ baweaver
[20:15:39] cjohnson: Which seems to be the way to mix refinements in
[20:16:19] baweaver: Tracepoint may be a good way to catch it - https://ruby-doc.org/core-2.2.2/TracePoint.html
[20:16:59] baweaver: I'd bet that somehow that refinement isn't being included properly
[20:17:11] baweaver: The code gets evaluated but it sees them in a different resolution space
[20:17:18] baweaver: How are you including it? (code wise)
[20:17:30] baweaver: Throw that file up on the gist
[20:17:30] cjohnson: rails magically loads it from lib/rails4_json_fix.rb
[20:17:45] baweaver: huh, wonder how that works
[20:17:56] baweaver: what tutorial were you following?
[20:18:19] baweaver: (also may peel off here in a few, giving a talk in a few hours and need to do some finishing)
[20:18:28] cjohnson: We may have an initializer ethat autoloads all files in lib/*
[20:18:40] cjohnson: It's definitely being loaded since the binding.pry at the top works
[20:18:48] cjohnson: Updated with my model that's using it
[20:18:56] baweaver: It's loaded, sure, but how does it know where to put the JSON fix?
[20:20:32] baweaver: That's a really good post - http://interblah.net/why-is-nobody-using-refinements
[20:20:39] baweaver: Doing some reading to see how these work
[20:21:07] baweaver: If you put pry in at an application level you might check how and where the method is defined
[20:21:19] baweaver: It respects resolution chain so it'll tell you where it thinks it is
[20:22:10] cjohnson: the method I'm overriding? or my refinement method?
[20:22:16] cjohnson: Not quite sure what you mean
[20:22:19] baweaver: technically both
[20:22:31] ivanskie: has joined #ruby
[20:22:59] redlegion: has joined #ruby
[20:23:06] baweaver: Though I wonder how deep refinements would work.
[20:23:40] baweaver: I mean it gets loaded, sure, but whether or not Rails will respect that dependency chain I'm not sure.
[20:24:16] cjohnson: Well let me ask you this then, maybe refinements aren't the way, do you have another idea how to monkeypatch this method but only in certain contexts?
[20:24:34] baweaver: honestly no.
[20:24:43] cjohnson: Damn you rails
[20:24:57] baweaver: I'd be curious if fryguy or matthewd are around
[20:24:58] baweaver: they might know
[20:25:12] ogres: has joined #ruby
[20:25:37] cjohnson: I tried just globally replacing this method but other models in my app depend on the bad behavior haha
[20:25:55] cjohnson: (which has been fixed in rails 5 so we are gonna have a tough time upgrading)
[20:26:13] baweaver: yeah, those are no fun
[20:26:35] baweaver: https://xkcd.com/1172/
[20:26:50] cjohnson: Ok well maybe then my answer is that I need to make a concern that makes getters/setters for these columns which first json-encode any non-hash non-array value
[20:27:08] cjohnson: LOL exactly
[20:27:20] baweaver: Would serializers work?
[20:27:40] baweaver: http://vaidehijoshi.github.io/blog/2015/06/23/to-serialize-or-not-to-serialize-activemodel-serializers/
[20:27:45] cjohnson: I tried that too
[20:27:50] cjohnson: This method still gets called I think
[20:28:28] cjohnson: Although frankly I found out later that the validator gem I included was also overriding my setter method so I wonder if maybe it was that all along
[20:28:33] cjohnson: I'll try digging the serializer back out
[20:28:40] cjohnson: So far I've got about 30 commits of "WTFFFFF"
[20:29:35] alice2296: has joined #ruby
[20:29:49] alfiemax: has joined #ruby
[20:29:51] alice2296: has joined #ruby
[20:31:12] alice2296: has left #ruby: ()
[20:31:26] cjohnson: I had a concern, then a serializer, then a different concern, then I wrote an initializer that just globally overwrote the class with my own hacked version to find that the rest of the app broke
[20:31:44] alice2296: has joined #ruby
[20:31:44] cjohnson: Then I start down the path of a concern that wraps all scalar values in a hash like {s: "the-real-value"]
[20:31:49] cjohnson: And unwraps them on read
[20:32:04] cjohnson: But then the json-schema validator breaks because I'm validating against a hash but the getter gets a string
[20:32:09] cjohnson: Then the refinement
[20:36:01] cjohnson: Gonna try a concern that double-encodes
[20:39:48] lxsameer: has joined #ruby
[20:40:33] ivanskie: has joined #ruby
[20:41:53] Sainfuw: has joined #ruby
[20:42:58] redlegion: has joined #ruby
[20:45:14] alice2296: has left #ruby: ()
[20:45:46] agent_white: has joined #ruby
[20:52:59] redlegion: has joined #ruby
[20:53:09] timeshifter: has left #ruby: ()
[20:56:29] bmurt: has joined #ruby
[20:57:05] eckhardt: has joined #ruby
[21:04:37] dstrunk: has joined #ruby
[21:13:00] redlegion: has joined #ruby
[21:16:31] apeiros: has joined #ruby
[21:20:11] stewp: has joined #ruby
[21:22:59] redlegion: has joined #ruby
[21:27:03] dstrunk: has joined #ruby
[21:33:03] redlegion: has joined #ruby
[21:37:28] Azure: has joined #ruby
[21:40:36] ur5us: has joined #ruby
[21:42:02] crankhar1er: has joined #ruby
[21:43:00] redlegion: has joined #ruby
[21:43:27] siery: has joined #ruby
[21:45:21] siery: Hei! I need a little help with one loop I use to read data from 2D map, I use two characters notation, the first for the tile and second for the item.
[21:46:08] siery: To read the first character from the line I read from file I do something like this:
[21:46:11] siery: line.each_char.lazy.each_slice(2).map(&:first).with_index do |char, x|
[21:46:39] siery: How can I modify this to read each second element counting from the second character?
[21:47:08] snickers: has joined #ruby
[21:47:38] dr3wo: has joined #ruby
[21:48:13] siery: ah.. I guess I change first for second ^_^. Thanks, that was stupid indeed
[21:48:29] bak1an: has joined #ruby
[21:51:38] apeiros: has joined #ruby
[21:52:18] Celmor: has left #ruby: ()
[21:53:21] siery: well, it does not work
[22:06:23] crankhar1er: has joined #ruby
[22:07:13] konsolebox: siery: it's a little hard to understand what you want to do
[22:08:29] konsolebox: "each second element counting from the second character"?
[22:12:21] SeepingN: abcdef b d f
[22:13:00] redlegion: has joined #ruby
[22:13:19] SeepingN: basicallhy line.each_char.lazy.each_slice(2).map(&:second).with_index
[22:14:12] SeepingN: oops you said that. but second is probably not recognized... maybe in Rails, but probably not even there in this context
[22:14:27] SeepingN: if it's only 2 long, just try "last"
[22:20:00] apeiros: has joined #ruby
[22:21:08] \void: has joined #ruby
[22:22:58] redlegion: has joined #ruby
[22:23:07] beowuff: has joined #ruby
[22:23:40] postmodern: has joined #ruby
[22:24:36] r29v: has joined #ruby
[22:35:24] venmx: has joined #ruby
[22:42:58] redlegion: has joined #ruby
[22:43:06] apeiros: has joined #ruby
[22:43:45] beowuff: has joined #ruby
[22:53:45] siery: SeepingN: Exacly thats what I mean. Now It runs with no error. Gonna write some tests and see how it works.
[22:56:00] jasmith: has joined #ruby
[22:59:42] cjohnson: baweaver: I fixed it by writing a serializer that basically supplements the bad behavior in the Json adapter
[23:00:09] cjohnson: baweaver: The Json adapter only serializes hashs and arrays, so my serializer will serialize all other types. it has no impact upon reading since rails can read values from the database just fine
[23:03:02] redlegion: has joined #ruby
[23:11:38] xenops: has joined #ruby
[23:12:10] apeiros: has joined #ruby
[23:13:00] redlegion: has joined #ruby
[23:16:54] NightMonkey: has joined #ruby
[23:27:59] codymj: has joined #ruby
[23:42:11] apeiros: has joined #ruby
[23:43:01] redlegion: has joined #ruby
[23:57:53] venmx: has joined #ruby