« Back to channel list

#ruby - 04 March 2019

« Back 1 day Forward 1 day »
[00:11:12] whathappens: has joined #ruby
[00:12:15] crankharder: has joined #ruby
[00:32:14] mangold: has joined #ruby
[00:32:17] crankharder: has joined #ruby
[00:38:09] bmurt: has joined #ruby
[00:45:40] s3nd1v0g1us: has joined #ruby
[00:53:48] AJA4351: has joined #ruby
[00:55:26] lytol_: has joined #ruby
[01:06:31] t0xik: has joined #ruby
[01:26:19] Renich: has joined #ruby
[01:33:10] Swyper: has joined #ruby
[01:47:27] laaron: has joined #ruby
[02:00:21] duderonomy: has joined #ruby
[02:01:20] AJA4351: has joined #ruby
[02:19:38] Onwarion_re: has joined #ruby
[02:20:29] tdy1: has joined #ruby
[02:21:40] iNs: has joined #ruby
[02:42:23] bambanx: has joined #ruby
[03:14:21] crankharder: has joined #ruby
[03:15:44] cschneid: has joined #ruby
[03:28:06] evdubs: has joined #ruby
[03:31:53] evdubs: has joined #ruby
[03:33:02] ogres: has joined #ruby
[03:33:59] ogres: has joined #ruby
[03:35:59] dante: has joined #ruby
[03:46:25] bambanx: has joined #ruby
[03:57:43] dante: has joined #ruby
[04:09:10] braincrash: has joined #ruby
[04:14:11] arekushi: has joined #ruby
[04:16:16] vcavallo: has joined #ruby
[04:20:37] Renich: has joined #ruby
[04:24:52] Nicmavr: has joined #ruby
[04:38:30] zenspider: has joined #ruby
[04:38:46] dellavg__: has joined #ruby
[04:57:44] Renich: has joined #ruby
[05:00:34] zenspider: has joined #ruby
[05:02:25] mr_rich101: has joined #ruby
[05:03:13] Renich: has joined #ruby
[05:13:03] Fusl: has joined #ruby
[05:27:48] Renich: has joined #ruby
[06:07:17] mozzarella: has joined #ruby
[06:13:01] conta: has joined #ruby
[06:22:00] rippa: has joined #ruby
[06:22:16] aufi: has joined #ruby
[06:42:13] LinuxKnight: has joined #ruby
[06:45:07] nwradio: has joined #ruby
[06:58:13] am0123: has joined #ruby
[07:12:49] reber: has joined #ruby
[07:48:55] gs: has joined #ruby
[07:53:07] KramerC: has joined #ruby
[08:03:45] aupadhye: has joined #ruby
[08:04:02] marmotini_: has joined #ruby
[08:12:07] clemens3_: has joined #ruby
[08:34:42] crankharder: has joined #ruby
[08:45:53] Sylario: has joined #ruby
[08:49:45] lxsameer: has joined #ruby
[08:53:47] blackmesa: has joined #ruby
[08:55:51] ur5us: has joined #ruby
[09:00:23] G: has joined #ruby
[09:08:44] hightower3: has joined #ruby
[09:13:14] elphe: has joined #ruby
[09:19:24] ur5us: has joined #ruby
[09:39:05] mangold: has joined #ruby
[09:51:24] ellcs: has joined #ruby
[10:07:42] hiroaki_: has joined #ruby
[10:12:36] amosbird: Hello, what tools can I use to plot a graph like this https://probablydance.files.wordpress.com/2017/02/successful_lookup.png?w=650
[10:17:42] ellcs: https://ramnathv.github.io/rCharts/
[10:17:52] ellcs: sorry, it's for webpages
[10:18:46] mnemon: has joined #ruby
[10:18:51] flips: has joined #ruby
[10:24:12] phaul: https://www.ruby-toolbox.com/categories/graphing
[10:29:08] spectra: has joined #ruby
[11:10:48] ldk: has joined #ruby
[11:15:57] rubydoc: has joined #ruby
[11:17:32] helpa: has joined #ruby
[11:18:35] phaul: al2o3-cr, leftylink ^
[11:20:53] _joes_: has joined #ruby
[11:22:38] elphe: has joined #ruby
[11:24:40] am0123: has joined #ruby
[11:32:47] tdy1: has joined #ruby
[11:37:15] gregf_: has joined #ruby
[11:40:34] Leifr: has joined #ruby
[11:42:31] tdy1: has joined #ruby
[11:43:08] conta: has joined #ruby
[11:43:23] MyMind: has joined #ruby
[11:51:58] ctp: Hi folks. How to reject empty/blank elements in a nested array in a clean way? Something like [ ["", "foo", "bar"], ["", "baz", "qux"] ].reject(&:empty?) but for array of arrays
[11:53:18] aqd: has joined #ruby
[11:54:06] phaul: map over the outer array with reject?
[11:55:59] ctp: yes, was thinking of something like [ ["", "foo", "bar"], ["", "baz", "qux"] ].map(&:reject(&:empty?)) but this somehow doesnt look correct
[11:57:22] mangold: has joined #ruby
[11:57:34] phaul: yes that won't work. but & is just a shorthand for a longer block passing syntax
[11:58:14] phaul: compact doesn't take out empty strings iirc
[11:58:26] phaul: &>> [''].compact
[11:58:27] rubydoc: # => [""] (https://carc.in/#/r/6evn)
[11:58:58] ctp: yepp, compact doe not
[11:59:23] phaul: ctp: .map(&:thing) is just .map { |elem| elem.thing }
[12:00:24] jdawgaz: has joined #ruby
[12:02:15] ctp: yes, i know, just wonder how to map and reject in one step.
[12:02:41] ctp: https://www.irccloud.com/pastebin/QQJ6Y0Dm/
[12:02:41] ruby[bot]: ctp: we in #ruby do not like irccloud.com, it has no syntax highlighting, distracting formatting and loads slowly for most. Please use https://gist.github.com
[12:04:56] phaul: &>> [['a', ''], ['', 'b']].map { |sub_array| sub_array.reject(&:empty?) }
[12:04:57] rubydoc: # => [["a"], ["b"]] (https://carc.in/#/r/6evo)
[12:06:51] ctp: yes, that's it. thanks!
[12:20:12] crankharder: has joined #ruby
[12:27:29] tdy1: has joined #ruby
[12:34:44] AJA4350: has joined #ruby
[12:37:26] crankharder: has joined #ruby
[12:38:50] phaul: &fake Matz.quote
[12:38:50] rubydoc: I didn't work hard to make Ruby perfect for everyone, because you feel differently from me. No language can be perfect for everyone. I tried to make Ruby perfect for me, but maybe it's not perfect for you. The perfect language for Guido van Rossum is probably Python.
[12:39:28] tdy1: has joined #ruby
[13:00:37] lucasb: has joined #ruby
[13:02:06] za1b1tsu: has joined #ruby
[13:02:35] ctp: ok, almost, there. last issue:
[13:03:57] ctp: [["[[foo", "bar]]", "a", "b"], ["[[baz", "qux]]", "c", "d"]]
[13:04:24] ctp: how to replace the "[[" and "]]" (in the strings) by "" (blank)
[13:04:35] ctp: map over map?
[13:09:30] stryek: has joined #ruby
[13:10:47] aufi: has joined #ruby
[13:12:42] phaul: ctp, that would work
[13:19:32] ctp: input.map! { |im| im.map! { |s| s.gsub(/\[\[|\]\]/, "") } }
[13:19:45] ctp: urgh, this looks ugly :)
[13:22:27] phaul: the thing I don't like about it is the way you handle mutation
[13:23:47] phaul: feels like one of the map! could be map. but maybe .each { ... .each { gsub! would be clearer
[13:25:55] phaul: &>> x = [['a']]; x.each { |sub_array| sub_array.each { |string| string.gsub!('a', 'b') } }; x
[13:25:56] rubydoc: # => [["b"]] (https://carc.in/#/r/6ewb)
[13:26:27] phaul: to me this more clearly communicates that we are just iterating, and changing in place inside the iteration
[13:26:42] ctp: ah, right. this makes sense
[13:29:21] lord4163: has joined #ruby
[13:29:44] laaron: has joined #ruby
[13:30:41] nwradio: has joined #ruby
[13:53:51] crankharder: has joined #ruby
[13:59:00] AJA4350: has joined #ruby
[14:28:45] tdy1: has joined #ruby
[14:31:15] crankharder: has joined #ruby
[14:35:49] ua_: has joined #ruby
[14:37:08] tdy1: has joined #ruby
[14:37:27] ua: has joined #ruby
[14:41:01] bmurt: has joined #ruby
[14:55:08] shansen: has joined #ruby
[14:55:28] dinfuehr: has joined #ruby
[14:56:16] Rapture: has joined #ruby
[14:59:17] rippa: has joined #ruby
[15:05:02] Nicmavr: has joined #ruby
[15:05:59] tdy1: has joined #ruby
[15:08:26] gnufied: has joined #ruby
[15:10:30] blackmesa: has joined #ruby
[15:12:25] jcalla: has joined #ruby
[15:17:31] polishdub: has joined #ruby
[15:21:49] szulak_: has joined #ruby
[15:24:59] AJA4350: has joined #ruby
[15:30:31] Dbugger: has joined #ruby
[15:35:25] dviola: has joined #ruby
[15:39:10] marmotini_: has joined #ruby
[15:50:51] blackmesa: has joined #ruby
[15:52:39] elphe: has joined #ruby
[15:59:50] elphe: has joined #ruby
[16:02:57] spiette: has joined #ruby
[16:06:08] Criten: has joined #ruby
[16:07:42] shansen: has joined #ruby
[16:14:07] Renich: has joined #ruby
[16:15:14] v01d4lph4: has joined #ruby
[16:15:23] orbyt_: has joined #ruby
[16:17:53] oncall-pokemon: has joined #ruby
[16:21:20] conta: has joined #ruby
[16:28:01] orbyt_: has joined #ruby
[16:32:42] SuperLag: has joined #ruby
[16:32:56] dontbecold_: has joined #ruby
[16:33:46] dontbecold_: Hi! I'm attempting to update our version of google-protobuf from 3.6.1 to 3.70 on my Mac, but bundler deletes the vendored 3.6.1 linux gem and doesn't populate a 3.7.0 one
[16:33:56] dontbecold_: this means CI (linux) gets upset
[16:34:09] dontbecold_: any advice for trying to solve this?
[16:34:38] dontbecold_: tripping over a lot of terminology here, as i'm also not sure what cross-compiled gems of the same version are called, given that "platform" already means ruby version
[16:45:44] Rapture: has joined #ruby
[16:49:51] szulak_: has joined #ruby
[17:00:02] timmow: has joined #ruby
[17:03:08] JasonO: has joined #ruby
[17:15:29] nowhereman: has joined #ruby
[17:15:36] whathappens: has joined #ruby
[17:19:31] sriehl: has joined #ruby
[17:21:50] moei: has joined #ruby
[17:26:01] [Butch]: has joined #ruby
[17:26:47] sriehl: has joined #ruby
[17:30:43] blackmesa: has joined #ruby
[17:31:11] cthulchu: has joined #ruby
[17:34:27] sriehl: has joined #ruby
[17:38:38] dionysus70: has joined #ruby
[17:38:58] orbyt_: has joined #ruby
[17:40:46] conta1: has joined #ruby
[17:43:55] sriehl: has joined #ruby
[17:45:05] SeepingN: has joined #ruby
[17:46:33] [Butch]: has joined #ruby
[17:49:46] orbyt_: has joined #ruby
[17:50:32] Xiti: has joined #ruby
[17:52:14] havenwood: dontbecold_: share your Gemfile.lock?
[17:52:35] havenwood: dontbecold_: nothing unexpected?: bundle config
[18:03:16] Inline: has joined #ruby
[18:03:27] cr1xu5: has joined #ruby
[18:03:32] Criten: has left #ruby: ("WeeChat 2.4")
[18:09:43] elphe: has joined #ruby
[18:10:35] cagomez: has joined #ruby
[18:11:13] cagomez: has joined #ruby
[18:11:50] cagomez: has joined #ruby
[18:20:05] lukelukeluke: has joined #ruby
[18:21:37] nowhereman: has joined #ruby
[18:21:42] marmotini_: has joined #ruby
[18:33:03] ams__: has joined #ruby
[18:41:34] c-c: What I learned today?
[18:42:20] c-c: Struct.new(:vals) do; # You can declare self.class methods here; end
[18:48:51] lytol_: has joined #ruby
[18:48:58] havenwood: c-c: I've enjoyed the addition of `keyword_init:` to Structs too.
[18:49:43] havenwood: &>> Point = Struct.new(:x, :y, keyword_init: true); Point.new x: 42, y: -42
[18:49:45] rubydoc: # => #<struct Point x=42, y=-42> (https://carc.in/#/r/6exp)
[18:51:35] orbyt_: has joined #ruby
[19:00:03] whathappens: has joined #ruby
[19:00:47] reber: has joined #ruby
[19:02:58] ravenousmoose: has joined #ruby
[19:02:59] cliluw: has joined #ruby
[19:09:01] postmodern: has joined #ruby
[19:19:01] Inline: has joined #ruby
[19:19:42] c-c: havenwood: ok that looks convy
[19:20:11] c-c: ACTION is still reeling in the monads as a tool, f.ex. https://www.youtube.com/watch?v=J1jYlPtkrqQ
[19:21:30] phaul: ah, Tom Stuart vids. I love them.
[19:21:50] c-c: its great but somehow being able to think on that level.. hm or is it modality... is often lost as I struggle to get on with the simple stuff
[19:22:12] c-c: maybe in a year or two
[19:24:02] c-c: Maybe Evenetually, And Then
[19:25:04] phaul: monads is a fairly obscure concept and most struggle with it for a while. I tried to explain it to ppl in the past and failed miserably :)
[19:27:07] c-c: ah, Crockfords 'Curse of Monads' in the wild
[19:28:20] c-c: This was almost as good as Tom's code based monad lecture: https://www.youtube.com/watch?v=ZhuHCtR3xq8
[19:28:26] c-c: (Don't Fear The Monad)
[19:30:13] Eiam: has joined #ruby
[19:33:31] haylon: has joined #ruby
[19:35:23] sameerynho: has joined #ruby
[19:41:40] hightower2: has joined #ruby
[19:47:49] cnsvc_: has joined #ruby
[19:48:59] Inline: has joined #ruby
[19:59:01] agent_white: has joined #ruby
[19:59:14] bjpenn: has joined #ruby
[19:59:33] bjpenn: hey, anyone know why `rubocop` works, but not `bundle exec rubocop `
[20:00:47] mozzarella: define "doesn't work"
[20:01:31] miah: if 'bundle exec rubocop' doesnt work.. is rubocop in your Gemfile?
[20:01:40] miah: (or your gemspec)
[20:02:26] bjpenn: rubocop is in the Gemfile, under group :developent, :test
[20:02:38] miah: rubocop working without bundler means its in your system rubygems installation, when you 'bundle exec' its trying to execute from your bundle stash, and if rubocop wasn't in that list its not going to work
[20:02:39] bjpenn: when i say doesnt work, i get an error... let me paste that error
[20:02:53] bjpenn: miah: ah makes sense
[20:04:26] miah: and similarly if the :development group is `optional: true` you'll end up in a similar scenario
[20:04:55] bjpenn: oh ok, i didnt know about the optional: true flag, or whether or not that's a default behavior. But it doesn't specify `optional: true`
[20:05:04] bjpenn: when i do `gem list` i also see rubocop
[20:05:14] bjpenn: let me try bundle exec gem list
[20:05:34] bjpenn: yeah youre right, bundle exec gem list doesn't show rubocop
[20:05:38] bjpenn: although regular gem list does
[20:06:05] bjpenn: but in Gemfile, it does contain rubocop though
[20:06:23] bjpenn: albeit under a group, but it doesn't contain any parameter similar to "optional: true"
[20:06:46] conta: has joined #ruby
[20:07:29] bjpenn: miah: i've also tried running `bundle install` as well, which runs fine
[20:07:43] miah: do you have a paste of the error?
[20:07:48] bjpenn: yeah let me paste
[20:07:52] miah: preferably gist it
[20:09:38] BTRE: has joined #ruby
[20:09:39] levifig: has joined #ruby
[20:09:51] havenwood: bjpenn: also mind showing us the output of?: bundle config
[20:11:35] miah: good call
[20:11:51] bjpenn: yep, ill produce that
[20:11:57] bjpenn: do you guys want bundle exec gem list?
[20:12:06] bjpenn: and also teh contents of Gemfile
[20:13:08] havenwood: bjpenn: i'm more curious about the error and your bundle config.
[20:14:28] bjpenn: https://dpaste.de/D1WO
[20:14:32] elphe: has joined #ruby
[20:18:05] havenwood: bjpenn: aye, line 11 it shows you have --without set
[20:18:48] ur5us: has joined #ruby
[20:19:51] havenwood: bjpenn: look at the file: /Users/myuser/company/git.repo/.bundle/config
[20:20:00] bjpenn: looking...
[20:20:18] bjpenn: ah yes i see it
[20:20:21] havenwood: bjpenn: Bundler "remembered" to bundle without test and development and stored the setting there.
[20:20:25] bjpenn: BUNDLE_WITHOUT: "test:development"
[20:20:32] TheBloke: has joined #ruby
[20:20:39] bjpenn: any idea why it would have done that?
[20:20:42] havenwood: bjpenn: that's why you're not seeing Rubocop installed
[20:20:44] SeepingN: has joined #ruby
[20:20:50] bjpenn: from what miah was saying, i think it had to have been specified in Gemfile right?
[20:20:55] bjpenn: to not include it right?
[20:21:51] bjpenn: perhaps i ran bundle install at an earlier time (that i dont recall), that specified to not include test,development, and that set the config file?
[20:22:02] bjpenn: (not sure if thats possible)
[20:22:08] bjpenn: if it is, then ill cough it up to that
[20:23:14] havenwood: bjpenn: yes, you likely ran `bundle install` command with --without=test,development, and didn't realize it would be "remembered"
[20:23:36] miah: or somebody else did in the past
[20:24:01] havenwood: bjpenn: you can manually remove the entry, or have bundler remove it for you with: bundle install --with=test,development
[20:24:13] bjpenn: thanks man!
[20:24:59] bjpenn: its awesome to come to irc and actually get some answers for once! :)
[20:25:31] havenwood: bjpenn: happy coding!
[20:25:40] bjpenn: you guys too!
[20:31:42] gnufied: has joined #ruby
[20:35:11] Inline: has joined #ruby
[20:50:51] szulak_: has joined #ruby
[20:52:47] LightStalker: has joined #ruby
[20:54:26] ravenousmoose: has joined #ruby
[21:02:26] tdy1: has joined #ruby
[21:03:03] elphe: has joined #ruby
[21:08:14] szulak_: has joined #ruby
[21:32:13] gix: has joined #ruby
[21:40:54] Calinou: if anyone knows Liquid here, why do I have to set a variable to be able to loop over a nested hash as demonstrated in https://jekyllrb.com/docs/datafiles/? Specifically, the `{% assign org = org_hash[1] %}` part
[21:43:58] szulak_: has joined #ruby
[21:46:20] agent_white: has joined #ruby
[21:48:23] gix: has joined #ruby
[21:51:24] helpa: has joined #ruby
[21:52:38] bvdw8: has joined #ruby
[22:02:34] moei: has joined #ruby
[22:05:21] cliluw: has joined #ruby
[22:07:51] armyriad: has joined #ruby
[22:11:44] bga57: has joined #ruby
[22:12:49] conta: has joined #ruby
[22:21:03] elphe: has joined #ruby
[22:28:58] orbyt_: has joined #ruby
[22:38:41] Xiti: has joined #ruby
[22:47:14] orbyt_: has joined #ruby
[22:48:08] t0x: has joined #ruby
[22:56:53] gix: has joined #ruby
[23:03:02] elphe: has joined #ruby
[23:24:30] elphe: has joined #ruby
[23:26:10] Net: Calinou: org_hash is probably [filename, hash]
[23:33:47] elphe: has joined #ruby
[23:38:02] Calinou: I see, thanks :)
[23:39:33] tdy: has joined #ruby
[23:47:23] gl: has joined #ruby
[23:47:26] gl: has left #ruby: ()
[23:49:35] whathappens: has joined #ruby
[23:51:45] elphe: has joined #ruby