« Back to channel list

#ruby - 19 December 2017

« Back 1 day Forward 1 day »
[00:01:42] eckhardt: has joined #ruby
[00:02:18] jrabe: has joined #ruby
[00:06:34] scorpiosec: has joined #ruby
[00:08:38] orbyt_: has joined #ruby
[00:10:14] mtkd: has joined #ruby
[00:12:33] chaos95: has joined #ruby
[00:16:02] eckhardt: has joined #ruby
[00:16:53] romeoh: has joined #ruby
[00:19:58] ramfjord: has joined #ruby
[00:20:44] pelegreno: has joined #ruby
[00:21:18] pelegreno: has joined #ruby
[00:29:36] cschneid_: has joined #ruby
[00:30:05] NightMonkey: has joined #ruby
[00:33:54] d^sh: has joined #ruby
[00:36:19] cagomez: has joined #ruby
[00:36:35] cagomez: has joined #ruby
[00:36:43] scorpiosec: has joined #ruby
[00:42:43] cdg: has joined #ruby
[00:48:42] Guest12437: has joined #ruby
[00:51:50] orbyt_: has joined #ruby
[00:52:15] jxv: has joined #ruby
[01:01:05] pilne: has joined #ruby
[01:03:51] maum: has joined #ruby
[01:04:40] cdg: has joined #ruby
[01:08:51] scmlinux: has joined #ruby
[01:09:21] cdg: has joined #ruby
[01:11:14] scmlinux: has joined #ruby
[01:11:51] jenrzzz: has joined #ruby
[01:11:51] jenrzzz: has joined #ruby
[01:13:05] alfiemax: has joined #ruby
[01:17:39] romeoh: has joined #ruby
[01:20:23] cagomez: has joined #ruby
[01:24:37] k0mpa: has joined #ruby
[01:28:28] scmlinux`: has joined #ruby
[01:33:34] mtkd: has joined #ruby
[01:36:15] uZiel: has joined #ruby
[01:41:20] knight33: has joined #ruby
[01:48:10] mikhael_k33hl: has joined #ruby
[01:51:36] mikhael_k33hl: I'm having problems setting up rvm with jenkins. https://gist.github.com/marzdgzmn/d3d1e78b2c94249b3c89fc48ffabf880 I'm pretty new to ruby, what seems to be the problem here?
[01:53:31] pilne: has joined #ruby
[01:58:27] scmlinux: has joined #ruby
[01:58:48] uZiel: has joined #ruby
[02:02:12] cagomez: has joined #ruby
[02:08:21] alfiemax: has joined #ruby
[02:15:54] ReinH: @mikhael_k33hl Have you tried googling for your error message?
[02:16:32] havenwood: mikhael_k33hl: The RVM script ~/.rvm/script/rvm isn't getting sourced because you're not using a login shell.
[02:16:57] jenrzzz: has joined #ruby
[02:16:57] jenrzzz: has joined #ruby
[02:17:23] mikhael_k33hl: havenwood: just a newbie question though what does 'rvm use ruby@gemset' do?
[02:17:24] havenwood: mikhael_k33hl: Before you can run `bundle` you need to: gem install bundler
[02:17:39] havenwood: mikhael_k33hl: RVM has a thing that chruby and rbenv don't have called gemsets.
[02:17:57] havenwood: mikhael_k33hl: Gemsets come from a pre-Bundler era, and were used to keep gems separate from system gems.
[02:18:25] romeoh: has joined #ruby
[02:18:27] havenwood: mikhael_k33hl: RVM used to provide the Bundler gem for you, but it doesn't anymore. Bundler will ship with Ruby in 2.5.
[02:19:47] havenwood: mikhael_k33hl: I'd be happy to help you with the login shell stuff in #rvm. It's not very Ruby-related.
[02:20:17] havenwood: It's more RVM related, in shell scripting land.
[02:20:35] mikhael_k33hl: havenwood: oh gee, thanks mate
[02:20:44] kapil___: has joined #ruby
[02:22:10] havenwood: mikhael_k33hl: Note the `i` in `sudo -Hiu jenkins` runs as a login shell: https://rvm.io/integration/jenkins
[02:25:32] d^sh: has joined #ruby
[02:38:51] cdg: has joined #ruby
[02:47:44] cdg: has joined #ruby
[02:49:09] ramfjord: has joined #ruby
[02:50:21] cagomez: has joined #ruby
[02:51:41] meesles: has joined #ruby
[02:55:09] pastorinni: has joined #ruby
[03:00:37] cadillac_: has joined #ruby
[03:03:08] pastorinni: has joined #ruby
[03:09:33] alfiemax: has joined #ruby
[03:10:25] JusticeFries: has joined #ruby
[03:11:33] konsolebox: has joined #ruby
[03:12:07] d^sh: has joined #ruby
[03:17:47] cdg_: has joined #ruby
[03:19:12] romeoh: has joined #ruby
[03:20:02] Dimik: has joined #ruby
[03:21:05] pelegreno: has joined #ruby
[03:26:35] halt: has joined #ruby
[03:28:32] nfk: has joined #ruby
[03:33:07] halt-: has joined #ruby
[03:35:43] orbyt_: has joined #ruby
[03:38:24] mtkd: has joined #ruby
[03:40:46] eckhardt: has joined #ruby
[03:40:52] knight33: has joined #ruby
[03:42:21] DmitryBochkarev: has joined #ruby
[03:44:19] scorpiosec: has joined #ruby
[03:50:21] workmad3: has joined #ruby
[03:56:54] romeoh: has joined #ruby
[03:56:55] riceandbeans: has joined #ruby
[04:08:00] AJA4350: has joined #ruby
[04:12:03] chocoelho: has joined #ruby
[04:18:31] zwliew: has joined #ruby
[04:19:46] nofxx: has joined #ruby
[04:20:02] gix: has joined #ruby
[04:24:15] scorpiosec: has joined #ruby
[04:24:55] slash_nick: has joined #ruby
[04:29:06] nso95-: has joined #ruby
[04:29:20] nso95: has joined #ruby
[04:36:34] Guest29: has joined #ruby
[04:40:27] plexigras: has joined #ruby
[04:40:44] c0ncealed: has joined #ruby
[04:41:02] halt: has joined #ruby
[04:42:48] ramfjord: has joined #ruby
[04:43:23] Dykam: has joined #ruby
[04:52:31] bmurt: has joined #ruby
[04:53:49] slash_nick: has joined #ruby
[05:02:40] anisha: has joined #ruby
[05:06:47] konsolebox: has joined #ruby
[05:07:19] Vashy: I want to create a scaffold for the details of a game. Something like: `rails g scaffold MatchDetails`
[05:07:26] Vashy: Is the pluralness of MatchDetails going to mess things up?
[05:07:38] Vashy: I'm a rails beginner (also posted in #RubyOnRails)
[05:24:16] alfiemax: has joined #ruby
[05:26:19] iamarun: has joined #ruby
[05:26:40] halt: has joined #ruby
[05:31:53] garyserj: has joined #ruby
[05:33:37] jamesaxl: has joined #ruby
[05:34:15] garyserj: Hi, if I have a string representing a command i'd like to run such as mystr="dir c:\\windows\\system32\\calc.exe" How can I get the output of that command?
[05:34:44] LocaMocha: has joined #ruby
[05:34:51] baweaver: what have you tried?
[05:36:19] garyserj: a=`dir c:\\windows\\system32\\calc.exe` That gets the output but doesn't let me puts my string.
[05:36:34] garyserj: i'd like to be able to convery mystr to something with backticks
[05:36:49] garyserj: And i've tried system(mystr) that preserves mystr but it doesn't let me get the output
[05:36:55] Guest29: has joined #ruby
[05:37:18] `derpy: http://ruby-doc.org/core-2.4.1/Dir.html
[05:37:29] baweaver: the builtin works better
[05:37:39] baweaver: also backticks will take interpolation
[05:37:54] garyserj: i'm trying to run commands. not specifically dir
[05:37:57] garyserj: dir was just an example command
[05:38:05] baweaver: also the built in is cross platform
[05:38:14] baweaver: Open3 is the best, though not sure if it works on Windows
[05:38:19] `derpy: http://ruby-doc.org/stdlib-2.4.1/libdoc/open3/rdoc/Open3.html
[05:39:26] aupadhye: has joined #ruby
[05:56:50] rippa: has joined #ruby
[06:00:39] enterprisey: has joined #ruby
[06:02:43] pwnd_nsfw: has joined #ruby
[06:02:53] konsolebox: has joined #ruby
[06:11:25] alfiemax: has joined #ruby
[06:12:16] Terens: has joined #ruby
[06:17:08] reber: has joined #ruby
[06:18:16] rhebz916: has joined #ruby
[06:19:39] rrutkowski: has joined #ruby
[06:20:36] garyserj: how do I get this to work, I want to use gsub with an array
[06:20:38] garyserj: puts "asdf".gsub(a[0],"q")
[06:24:58] Dykam: has joined #ruby
[06:33:10] apeiros: garyserj: that should work. bug replacing a q with a q won't have a visible effect. even less on a string without a q.
[06:35:45] spooky_d: has joined #ruby
[06:35:45] jenrzzz: has joined #ruby
[06:35:45] jenrzzz: has joined #ruby
[06:36:02] spooky_d: I have a program that uses the RUBY C API for something
[06:36:28] spooky_d: and when I have a crash in that program I always see the ruby SIGSEGV handler
[06:36:33] spooky_d: I no longer want to see that thing.
[06:36:42] spooky_d: Do you have any idea how can I disable it?
[06:41:30] _aeris_: has joined #ruby
[06:42:09] ldepandis: has joined #ruby
[06:43:07] ramfjord: has joined #ruby
[06:46:44] pelegreno: has joined #ruby
[06:51:22] dionysus69: has joined #ruby
[06:53:44] mozzarella: has joined #ruby
[06:54:00] garyserj: apeiros: this doesn't work a=[/q/]
[06:54:00] garyserj: puts "asdf".gsub(a[0],"w")
[06:54:23] garyserj: doh I must be mad..
[06:54:24] apeiros: garyserj: what do you expect it to replace?
[06:54:54] garyserj: yeah it works.. "qsdf".gsub(a[0],"w")
[06:57:38] swati_27: has joined #ruby
[06:58:14] b100s: has joined #ruby
[06:58:20] swati_27: Hi. I'm new to ruby on rails and i'm trying to run the server
[06:58:32] swati_27: But it's giving me error. Please help
[06:58:39] pelegreno: has joined #ruby
[06:58:55] swati_27: This is what I did:
[06:59:36] swati_27: https://www.irccloud.com/pastebin/pzt5m4R0/
[06:59:38] ruby[bot]: swati_27: we in #ruby do not like irccloud.com, I reposted your paste to gist for you: https://gist.github.com/96563bb971dc2817551c6d30a67cc2e1
[06:59:38] ruby[bot]: swati_27: irccloud.com has no syntax highlighting, distracting formatting and loads slowly for most.
[06:59:54] konsolebox: has joined #ruby
[06:59:59] pwnd_nsfw`: has joined #ruby
[07:00:49] pelegreno: has joined #ruby
[07:01:10] ur5us: has joined #ruby
[07:02:26] b100s: what is better? https://gist.github.com/b10s/766d95419ddc7820023862e89ffcbdee
[07:03:29] p0p0pr37: has joined #ruby
[07:05:13] apeiros: has joined #ruby
[07:06:31] graft: has joined #ruby
[07:09:23] KeyJoo: has joined #ruby
[07:09:38] Dykam: has joined #ruby
[07:12:15] jenrzzz: has joined #ruby
[07:12:15] jenrzzz: has joined #ruby
[07:16:32] Terens: has joined #ruby
[07:19:42] Pgouv_: has joined #ruby
[07:24:04] b100s: i mean, what is better to have as last stament of function: `return body.is_a?(Hash) ? body['foo'] : nil` or `body['foo'] rescue nil` ?
[07:25:02] pelegreno: has joined #ruby
[07:30:26] pwnd_nsfw: b100s, probably the return nil option
[07:31:54] b100s: @pwnd_nsfw, could you explain why?
[07:32:39] apeiros: has joined #ruby
[07:34:01] apeiros: ?rails swati_27
[07:34:01] ruby[bot]: swati_27: Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
[07:34:52] pwnd_nsfw: b100s, I guess you can kind of narrow down why body['foo'] isn't returning what you want
[07:34:56] apeiros: b100s: clearly the first option
[07:36:25] b100s: @pwnd_nsfw, thanks! @apeiros , why would you choose first?
[07:37:01] matthewd: body && body['foo']
[07:37:05] apeiros: b100s: because your rescue will swallow all kinds of errors
[07:37:09] apeiros: not just the one you expect
[07:37:20] apeiros: but better yet would be if you didn't have to test at all
[07:38:14] apeiros: or if it's only nil & hash, then body&.[]('foo') (yes, looks terribly ugly)
[07:40:16] alex``: has joined #ruby
[07:41:08] hs366: has joined #ruby
[07:42:19] b100s: apeiros, thanks
[07:43:33] mtkd: has joined #ruby
[07:44:18] lupine: has joined #ruby
[07:44:37] tAn: has joined #ruby
[07:46:09] tAn: has joined #ruby
[07:46:53] tAn: has joined #ruby
[07:47:45] tAn: has joined #ruby
[07:50:02] blackmesa: has joined #ruby
[07:50:28] yxhuvud: I wonder why Enuerable#count with break in the block returns the break value instead of the sum so far. :(
[07:52:15] Dykam: has joined #ruby
[07:52:45] apeiros: because break does not return control to count
[07:58:14] mozzarella: has joined #ruby
[08:00:12] andikr: has joined #ruby
[08:01:57] despai: has joined #ruby
[08:08:49] uZiel: has joined #ruby
[08:10:32] apeiros: has joined #ruby
[08:12:15] selim: has joined #ruby
[08:14:06] InfinityFye: has joined #ruby
[08:20:48] TomyWork: has joined #ruby
[08:23:27] tAn: has joined #ruby
[08:23:45] biberu: has joined #ruby
[08:24:51] Jameser: has joined #ruby
[08:24:55] burgestrand: has joined #ruby
[08:25:13] claudiuinberlin: has joined #ruby
[08:26:11] Kristjan: has joined #ruby
[08:27:41] mniip: has joined #ruby
[08:28:09] Kristjan: has left #ruby: ()
[08:28:44] mark_66: has joined #ruby
[08:31:16] pikislabis: has joined #ruby
[08:35:22] Dimik: has joined #ruby
[08:37:26] amatas: has joined #ruby
[08:38:05] ur5us: has joined #ruby
[08:38:37] lunarkitty7: has joined #ruby
[08:41:43] InfinityFye: has left #ruby: ("Leaving")
[08:41:45] kernelPaniq: has joined #ruby
[08:42:13] burgestrand: has joined #ruby
[08:42:33] apeiros: Yxhuvud: back. had to update my mobile. see:
[08:42:34] apeiros: >> def foo; yield; puts "I don't even"; end; foo { break "hi" }
[08:42:36] ruby[bot]: apeiros: # => "hi" (https://eval.in/921790)
[08:42:48] apeiros: the puts isn't executed since control is never given back to foo
[08:43:11] bkxd: has joined #ruby
[08:43:15] ramfjord: has joined #ruby
[08:49:01] Riddell: has joined #ruby
[08:52:19] jenrzzz: has joined #ruby
[08:54:46] mikecmpbll: has joined #ruby
[09:06:34] uZiel: has joined #ruby
[09:10:34] tAn: has joined #ruby
[09:12:04] uZiel: has joined #ruby
[09:12:30] RougeT430: has joined #ruby
[09:14:12] blackmesa1: has joined #ruby
[09:17:43] bkxd: has joined #ruby
[09:27:08] jamesaxl: has joined #ruby
[09:33:23] Serpent7776: has joined #ruby
[09:34:03] blackmesa1: has joined #ruby
[09:34:04] hs367: has joined #ruby
[09:35:00] _hs366: has joined #ruby
[09:35:41] DmitryBochkarev: has joined #ruby
[09:35:50] alex``: has joined #ruby
[09:36:42] A124: has joined #ruby
[09:38:06] cadillac_: has joined #ruby
[09:42:08] A124: has joined #ruby
[09:42:37] _hs366: has joined #ruby
[09:46:08] alex``: has joined #ruby
[09:48:39] mtkd: has joined #ruby
[09:51:02] tvw: has joined #ruby
[09:51:32] Beams: has joined #ruby
[09:55:48] tAn: has joined #ruby
[10:00:12] erlend: has joined #ruby
[10:00:35] Nowaker: has joined #ruby
[10:00:44] amatas: has joined #ruby
[10:02:33] ur5us: has joined #ruby
[10:03:26] uZiel: has joined #ruby
[10:06:50] Cavallari: has joined #ruby
[10:10:15] miskatonic: has joined #ruby
[10:10:21] uZiel: has joined #ruby
[10:11:31] milardovich: has joined #ruby
[10:11:41] anas: has joined #ruby
[10:23:44] pikislabis: has joined #ruby
[10:25:20] Kedare: has joined #ruby
[10:27:48] eb0t: has joined #ruby
[10:33:56] tAn: has joined #ruby
[10:34:11] blackmesa1: has joined #ruby
[10:35:15] nadir: has joined #ruby
[10:35:26] dminuoso: apeiros: It's a freaking mess.
[10:35:51] dminuoso: It's really tough to explain how "break", "return" and "next" differ..
[10:36:10] dminuoso: I thought I got it right, but Burgestrand had to prove me wrong. :(
[10:39:05] marr: has joined #ruby
[10:43:28] ramfjord: has joined #ruby
[10:45:35] milardovich: has joined #ruby
[10:45:53] amatas_: has joined #ruby
[10:50:09] s2013: has joined #ruby
[10:52:17] yosafbridge: has joined #ruby
[10:52:30] jaruga: has joined #ruby
[11:03:35] apeiros: dminuoso: I think next and break are easy
[11:03:41] apeiros: return is somewhat complex
[11:03:56] apeiros: especially with those minute differences depending on whether you use lambda or proc.
[11:04:54] mniip: has joined #ruby
[11:10:37] tAn: has joined #ruby
[11:11:39] cschneid_: has joined #ruby
[11:12:22] nicoulaj: has joined #ruby
[11:16:25] mrBen2k2k2k_: has joined #ruby
[11:21:02] milardovich: has joined #ruby
[11:22:22] ldnunes: has joined #ruby
[11:26:15] leitz: has joined #ruby
[11:27:14] dminuoso: return in isolation is the easiest to explain
[11:28:03] apeiros: go ahead, I'd like to have an easy explanation in my repertoire :)
[11:30:18] cosimo_: has joined #ruby
[11:30:19] dminuoso: apeiros: return returns control to the caller of the currently executed method/lambda.
[11:30:43] apeiros: nice. that actually seems accurate.
[11:31:05] milardovich: has joined #ruby
[11:40:25] jrabe: has left #ruby: ("Rejoining channels")
[11:41:44] milardovich: has joined #ruby
[11:44:20] burgestrand: has joined #ruby
[11:45:41] milardovich: has joined #ruby
[11:54:50] qba73: has joined #ruby
[11:55:22] milardovich: has joined #ruby
[11:55:59] Psybur: has joined #ruby
[11:57:45] tAn: has joined #ruby
[11:57:53] AJA4350: has joined #ruby
[12:03:27] ur5us: has joined #ruby
[12:05:34] scmlinux: has joined #ruby
[12:16:25] mostlybadfly: has joined #ruby
[12:16:30] Juzzika: has joined #ruby
[12:19:00] sameerynho: has joined #ruby
[12:25:00] zwliew: has joined #ruby
[12:26:46] rhebz916: has joined #ruby
[12:34:36] tAn: has joined #ruby
[12:35:43] qba73: has joined #ruby
[12:39:00] mikecmpbll: what do you suppose the rationale behind this is? https://github.com/bbatsov/ruby-style-guide#no-trailing-params-comma
[12:39:09] mikecmpbll: given they take the opposite view on arrays/hashes
[12:39:32] shinnya: has joined #ruby
[12:40:30] mikecmpbll: i know it doesn't really matter, i don't need to care what someone else chooses as a guide, but i'm interested :D
[12:44:28] pikislabis: has joined #ruby
[12:45:15] mikecmpbll: it becomes especially superficial when you have a method that takes a single hash argument, whereby it will tell you to remove the {}, then subsequently tell you to remove the comma
[12:48:54] amatas_: has joined #ruby
[12:49:59] Tempesta: has joined #ruby
[12:50:43] tcopeland: has joined #ruby
[12:54:49] stoffus: has joined #ruby
[13:06:17] synthroid: has joined #ruby
[13:12:53] _aeris_: has joined #ruby
[13:13:40] tAn: has joined #ruby
[13:16:34] Jameser: has joined #ruby
[13:17:57] cadillac_: has joined #ruby
[13:21:51] cagomez: has joined #ruby
[13:26:38] chmurifree: has joined #ruby
[13:29:16] KeyJoo: has joined #ruby
[13:33:11] apeiros: syntax quiz: with `foo(<<-END_OF_STRING) {`, what comes first after the newline? the block body or the string literal? :)
[13:33:38] cdg: has joined #ruby
[13:34:10] ar: apeiros: string
[13:36:18] apeiros: it's impressively ugly :D
[13:40:23] tAn: has joined #ruby
[13:45:51] dminuoso: apeiros: Id guess the string literal.
[13:46:06] apeiros: dminuoso: : 💯
[13:46:42] apeiros: I had to try. I didn't know. in the actual case where it came up I solved it by avoiding the situation as it's so ugly to read.
[13:46:46] dminuoso: apeiros: Did you see my findings in -ot?
[13:46:53] marahin: apeiros could you make a runnable example with the use of that syntax?
[13:46:55] dminuoso: It's so annoying. :(
[13:47:05] dminuoso: From now on Ill just use `break` every time.
[13:47:08] apeiros: marahin: sure. sec.
[13:47:11] marahin: apeiros thx
[13:48:32] qba73: has joined #ruby
[13:48:49] apeiros: marahin: https://eval.in/921958
[13:49:07] apeiros: dminuoso: I'll just use throw/catch everywhere now.
[13:49:45] marahin: apeiros awesome!
[13:49:47] dminuoso: apeiros: Hah. :D
[13:49:48] marahin: and disgusting
[13:49:50] marahin: thank you!
[13:50:00] apeiros: marahin: it gets even funnier if you have multiple here-doc args ;-)
[13:50:06] qba73: has joined #ruby
[13:51:47] mjolnird: has joined #ruby
[13:51:56] cdg: has joined #ruby
[13:52:14] apeiros: https://eval.in/921974
[13:52:48] dminuoso: apeiros: It's come to my attention that heredocs are a code smell of a larger underlying problem.
[13:53:04] dminuoso: It's the refusal to hide interpolation in an abstraction.
[13:53:05] apeiros: strings in code?
[13:53:17] apeiros: IMO strings largely don't belong into code.
[13:53:32] apeiros: but we have no sane mechanics to have them outside of code.
[13:53:46] dminuoso: Well there are valid use cases like SQL.
[13:54:09] apeiros: I'm not sure they wouldn't be better outside of code too.
[13:54:17] apeiros: but I've got bigger beefs with sql anyway.
[13:54:30] apeiros: "lets talk from machine to machine through a language designed to be used by humans"
[13:54:33] apeiros: awesome idea.
[13:54:58] dminuoso: apeiros: SQL is a pretty decent declarative DSL.
[13:55:12] apeiros: yes. it's still one for humans.
[13:55:42] apeiros: bind variables make it slightly less painful. but only slightly.
[13:56:52] Cavallari: has joined #ruby
[13:57:21] apeiros: the approach I take with my framework btw. is to move any non-trivial sql to the database. use views. use table valued functions.
[13:58:02] apeiros: makes a couple of things also less painful. but it's still leaky.
[13:59:19] dminuoso: please dont.
[13:59:22] dminuoso: Ive had enough of views.
[14:00:45] apeiros: I'm sorry. but a view is a ton better than MyModel.joins("funny sql").joins("other funny sql").joins(:some_association).where(guess_the_table_name: {col: …})
[14:01:15] apeiros: even more so if you have funny expressions like rownum over partition, grouped subselects etc.
[14:01:36] apeiros: (yes, some people have more complex queries than `select * from foos`)
[14:02:03] dminuoso: apeiros: I think the arel approach is in the right direction.
[14:02:12] apeiros: no. strong disagree.
[14:02:24] dminuoso: Well it's just executed incorrectly.
[14:02:32] apeiros: there's *literally* no point in learning a pure abstraction layer if it gains you absolutely *nothing*
[14:02:32] dminuoso: But I do wonder whether there's a monadic combinator approach.
[14:03:07] JusticeFries: has joined #ruby
[14:03:09] apeiros: arel is an amazing piece of code. but IMO it's entirely the wrong direction.
[14:03:47] dminuoso: apeiros: Well the great flexibility of ARel comes from being able to merge nodes.
[14:03:48] ur5us: has joined #ruby
[14:04:01] dminuoso: And that's the bit that allows you to think of arel nodes are monoids.
[14:04:55] apeiros: great. you have a good theory which is destroyed by first contact with reality.
[14:05:26] dminuoso: So far its been working great for us, but we dont have complexity in depth.
[14:05:46] dminuoso: We have complexity in width, so in many cases arel does allow for code sharing.
[14:05:49] swati_27: has joined #ruby
[14:05:59] apeiros: look, the very moment you need a piece of sql to hold your arel together, the abstraction breaks and you need to know about complex interactions between two already complex systems
[14:06:13] dminuoso: A lot of our queries are structurally similar, they just target different levels of hierarchies.
[14:06:23] apeiros: and if arel wants to get rid of every piece of sql to use in it, it has to map *all* nuances the different sql implementations use
[14:06:28] apeiros: good fucking luck with that
[14:06:28] dminuoso: apeiros: Well I opt out and go to raw SQL for any non-trivial queries.
[14:06:36] dminuoso: I dont pretend to do any joins.where.left_joins.merge.magic.shit.show
[14:06:44] dminuoso: Because that gets you nowhere, I agree with that.
[14:07:36] dminuoso: I think we're on the same page in a way.
[14:07:45] dminuoso: It's just that our needs are mostly covered by arel.
[14:07:50] dminuoso: Yours probably aren't.
[14:08:12] dminuoso: (Though things quickly break when you start talking about things like ransack)
[14:08:20] apeiros: also I'm quite sure I do not want to even learn the arel equivalent of e.g. `select rank over (partition by col) from foos`
[14:08:27] dminuoso: apeiros: +1
[14:08:29] dminuoso: Im absolutely with you.
[14:08:36] dminuoso: Non-trivial queries, screw AR/arel
[14:08:47] ar: dminuoso: hey!
[14:08:56] apeiros: see, that's where views + table valued functions come into play
[14:09:18] apeiros: you can write the sql as nice as possible and all you see from code is "another table"
[14:09:42] apeiros: that it is aggregated data from "elsewhere" is of no concern to the code anyway. it shouldn't be its concern.
[14:10:03] alex``: has joined #ruby
[14:10:24] apeiros: of course, this boundary also breaks due to e.g. write restrictions. some views you can write, some you can't.
[14:11:07] apeiros: where I'm with you is wrt building complex where clauses
[14:13:26] chocoelho: has joined #ruby
[14:14:52] dminuoso: apeiros: it's interesting, we have had some application that was built around that exact idea. The problem is that you end up baking business logic into views.
[14:15:21] apeiros: that is a problem
[14:15:32] apeiros: albeit IMO limited
[14:15:50] apeiros: given that a view is almost always for read-only, the amount of "logic" in them is necessarily limited
[14:16:27] apeiros: and usually related to how business logic and persistence logic interact. and persistence is the DBs concern, so it's not that far off IMO
[14:16:35] apeiros: but yes, still a problem
[14:17:23] apeiros: there's a list of "business logic" & "persistence logic" interactions I consider problematic and have no clear answer yet.
[14:17:47] apeiros: f.ex. a couple of integrity checks at the db level require application level knowledge
[14:17:49] nso95-: has joined #ruby
[14:17:51] chocoelho: has joined #ruby
[14:18:56] yeticry: has joined #ruby
[14:19:02] dminuoso: apeiros: Well it's a fine line in the end. I have plenty of spots where I willingly bite the bullet and produce N+1 because the code has the right abstraction that way.
[14:19:16] dminuoso: And its mostly fine, because in most of these cases I can take a 50-100ms hit.
[14:19:31] dminuoso: (And I know about them, so if it gets out of hands I can refactor)
[14:19:40] polishdub: has joined #ruby
[14:19:44] cdg: has joined #ruby
[14:21:22] bmurt: has joined #ruby
[14:22:04] dminuoso: apeiros: But at any rate! In my private project Im so glad to be dealing with expression trees. :-)
[14:26:07] bodgix: has joined #ruby
[14:36:07] alfiemax: has joined #ruby
[14:39:18] oleo: has joined #ruby
[14:40:34] krawchyk: has joined #ruby
[14:42:01] JusticeFries: has joined #ruby
[14:45:04] KeyJoo: has joined #ruby
[14:46:39] ramfjord: has joined #ruby
[14:51:03] romeoh: has joined #ruby
[14:51:25] JaccoP: has joined #ruby
[14:52:02] krawchyk: has joined #ruby
[14:53:24] selim: has joined #ruby
[14:55:40] swati_27: has left #ruby: ()
[14:55:59] DmitryBochkarev: has joined #ruby
[14:58:50] sameerynho: has joined #ruby
[14:59:08] konsolebox: has joined #ruby
[15:02:00] qba73: has joined #ruby
[15:03:33] veeti: has joined #ruby
[15:11:31] sotrhraven: has joined #ruby
[15:12:51] safetypin: has joined #ruby
[15:13:45] JaccoP: has joined #ruby
[15:16:39] cdolan: has joined #ruby
[15:17:19] Rapture: has joined #ruby
[15:17:54] mr_foto: has joined #ruby
[15:24:28] qba73: has joined #ruby
[15:26:20] c0ncealed: has joined #ruby
[15:26:50] kanobt61: has joined #ruby
[15:27:08] selim: has joined #ruby
[15:27:35] troys: has joined #ruby
[15:28:19] tAn: has joined #ruby
[15:28:30] krawchyk: has joined #ruby
[15:29:03] tAn: has joined #ruby
[15:30:45] tAn: has joined #ruby
[15:31:24] tAn: has joined #ruby
[15:32:19] mikecmpb_: has joined #ruby
[15:33:10] krawchyk[away]: has joined #ruby
[15:34:02] gnufied: has joined #ruby
[15:36:15] heliumk: has joined #ruby
[15:36:44] selim_: has joined #ruby
[15:40:22] zwliew: has joined #ruby
[15:40:50] nogic: has joined #ruby
[15:42:48] dmiller85: has joined #ruby
[15:43:57] JusticeFries: has left #ruby: ("Textual IRC Client: www.textualapp.com")
[15:46:04] marr: has joined #ruby
[15:46:15] pavelz: has joined #ruby
[15:46:58] pavelz: hello is there a gemrepo generating tool? https://git.themindstudios.com/a.averyanov/esputnik this readme seems templated from somewhere ...
[15:53:17] mikecmpbll: has joined #ruby
[15:55:26] cadillac_: has joined #ruby
[15:55:27] mikecmpbll: pavelz : that'll be generated by bundler i expect.
[15:55:43] mikecmpbll: `bundle gem my_gem`, it generates a gem project scaffold.
[15:58:02] pavelz: mikecmpbll: thanks!
[15:58:57] amelliaa: has joined #ruby
[15:59:34] selim: has joined #ruby
[16:01:37] yeoman: has joined #ruby
[16:01:50] yeoman: there really isn't a good way to make screenshots in ruby (of html-pages) right?
[16:03:25] cschneid_: has joined #ruby
[16:04:23] Papierkorb: Someone has to render it. Selenium may be able to do that
[16:04:26] ur5us: has joined #ruby
[16:04:42] yeoman: but that would require a real browser running, doesn't it?
[16:05:03] Papierkorb: Well of course
[16:05:16] yeoman: hows that 'ofcourse'
[16:05:18] Papierkorb: You can't get around that. You need a HTML rendering engine with CSS capabilities. That's a browser.
[16:05:28] yeoman: well.. nodejs makes it easy.
[16:05:30] yeoman: but i hate js
[16:05:33] tAn: has joined #ruby
[16:05:42] Papierkorb: They still need a HTML rendering engine
[16:05:44] yeoman: phantomjs was great for that task
[16:05:48] yeoman: sure, but it's headless
[16:05:55] qba73: has joined #ruby
[16:05:58] yeoman: up and running in 5 mins
[16:06:01] Papierkorb: No one said it can't be headless
[16:06:05] yeoman: i struggle with this for hours in ruby now
[16:06:37] yeoman: imgkit uses wkhtmltopdf and therefore sucks, right now i try capybara(-webkit)
[16:06:56] yeoman: why isn't there something as easy as mechanize making screenshots
[16:07:09] milardovich: has joined #ruby
[16:07:12] Papierkorb: https://blog.redpanthers.co/screenshots-using-ruby/ was the first google result.
[16:07:14] yeoman: Capybara::Webkit::ConnectionError: /var/lib/gems/2.4.0/gems/capybara-webkit-1.14.0/bin/webkit_server failed to start.
[16:07:46] yeoman: well not really clean :/
[16:07:48] yeoman: but thanks for the link
[16:07:54] yeoman: wasn't the first google result for me
[16:07:59] Papierkorb: the author compares multiple gems it seems.
[16:09:24] yeoman: lawl.. it does install phantomjs as it's calling a method
[16:09:27] yeoman: talking about dirty
[16:09:34] yeoman: usually ruby gems are so tidy
[16:09:42] Papierkorb: Did you bother scrolling on?
[16:09:59] Papierkorb: the later ones take like 3 lines in total. Can't get much shorter than that.
[16:10:02] yeoman: you mean the other gem? yeah trying the first one
[16:10:25] qba73: has joined #ruby
[16:12:35] yeoman: ArgumentError: The detector #<struct Cliver::Detector command_arg=nil, version_pattern=nil> failed to detect theversion of the executable at '/usr/bin/phantomjs'
[16:12:55] yeoman: QXcbConnection: Could not connect to display
[16:12:57] yeoman: god i love this.
[16:13:15] qba73: has joined #ruby
[16:14:04] Papierkorb: Well, does phantomjs require a running X?
[16:14:06] ramfjord: has joined #ruby
[16:14:13] yeoman: it doesn't but on ubuntu it does
[16:14:15] darix: yeoman: you will probably need something like Xfvb
[16:14:18] darix: yeoman: you will probably need something like Xvfb
[16:14:18] yeoman: and i am using docker.
[16:14:30] dmiller85: has joined #ruby
[16:14:33] yeoman: darix: thanks and.. thanks.
[16:14:38] darix: had to fix my typo
[16:14:51] yeoman: didn't even see it, still don't
[16:14:53] yeoman: oh i see.
[16:15:00] darix: launching xvfb and then setting DISPLAY accordingly
[16:15:08] darix: should probably make it work even in docker
[16:15:17] Cavallari: has joined #ruby
[16:15:30] Papierkorb: Oh that may be a world of pain. You'll need to figure out how to run xvfb (or some other small X daemon) in docker
[16:15:41] yeoman: well, no, it's pain because it's ugly
[16:15:50] yeoman: i need to render html, better load kde.
[16:16:00] Papierkorb: What has KDE to do with that?
[16:16:00] yeoman: dafuq thats just bad craftsmanship
[16:16:09] Papierkorb: Like, really nothing to do with one another
[16:16:17] yeoman: yeah okay, then qt with all the X stuff
[16:16:30] yeoman: ugly af, still
[16:17:02] yeoman: i am pretty sure i've run phantom without a running x before.. i am wondering
[16:18:32] darix: yeoman: well you can build your own Qt without the X bindings. then build your phantomjs against that ... and then you can use that stripped down binary
[16:20:23] despai: has joined #ruby
[16:20:53] darix: i bet the phantomjs that someone stuffed into a gem
[16:20:58] darix: or npm package
[16:21:03] darix: might be built like that already
[16:22:54] synthroid: has joined #ruby
[16:25:25] darix: this might be relevant https://about.gitlab.com/2017/12/19/moving-to-headless-chrome/
[16:26:00] mtkd: has joined #ruby
[16:30:27] chocoelho: has joined #ruby
[16:30:36] zapata: has joined #ruby
[16:32:11] pastorinni: has joined #ruby
[16:32:54] darix: yeoman: see that link maybe ;)
[16:32:55] tAn: has joined #ruby
[16:43:08] meesles: has joined #ruby
[16:44:40] cagomez: has joined #ruby
[16:45:52] VeryBewitching: has joined #ruby
[16:46:56] metagod: has joined #ruby
[16:47:19] ruschlem2: has joined #ruby
[16:54:56] jottr: has joined #ruby
[16:56:24] ledestin: has joined #ruby
[16:56:54] FrostCandy: has joined #ruby
[16:57:05] mtkd: has joined #ruby
[16:57:18] krawchyk: has joined #ruby
[16:58:18] tAn: has joined #ruby
[16:58:31] MurphyOne: has joined #ruby
[16:59:04] tAn: has joined #ruby
[16:59:49] tAn: has joined #ruby
[17:01:00] metagod: I wanted to learn more about Classes Modules Inheritance vs Composition any good guide?
[17:01:31] tAn: has joined #ruby
[17:02:35] tAn: has joined #ruby
[17:03:20] mikecmpb_: has joined #ruby
[17:06:34] dminuoso: metagod: About how it works, or how to utilize it?
[17:07:38] metagod: how to utilize it
[17:07:42] metagod: practical part
[17:08:02] mtkd: has joined #ruby
[17:08:15] metagod: also is there a way to delete an instance of class ?
[17:08:39] metagod: def die(victim)
[17:08:39] metagod: puts "Dying .. . . . . .. . "
[17:08:39] metagod: #want to delete the object
[17:08:40] metagod: puts "Dead"
[17:08:57] metagod: I want to kill the victim(object)
[17:09:20] dminuoso: metagod: It's just like when you were a kid.
[17:09:32] dminuoso: You leave it on the ground, mommy will vacuum it away when she has time.
[17:09:58] metagod: i want to explicitly delete it i know ruby uses GC
[17:10:34] metagod: def kill(victim)
[17:10:34] metagod: #if victim exists then kill it
[17:10:34] metagod: if victim.character_name
[17:10:35] metagod: die(victim)
[17:10:35] metagod: puts "Killer Joke"
[17:10:36] metagod: puts "Dead already RIP"
[17:10:47] dminuoso: Please do not paste in this channel.
[17:10:59] dminuoso: You do not want to delete items.
[17:11:05] metagod: do i paste in Pastebin?
[17:12:12] ruby[bot]: https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
[17:13:22] metagod: @dminuoso I am making a prototype game form exercise 45 from learn ruby the hard way i am just beginner so in this game i want to make a player kill other player thus deleting the object
[17:13:44] dminuoso: metagod: So don't focus on deleting objects. That's not the model you need to care about.
[17:13:56] dminuoso: metagod: You could either track his health status, or keep it in a container and just remove it from the container.
[17:14:55] metagod: https://gist.github.com/RAJKUMAR18/67b2a4c2e1d159fa2e66b66c035032c6
[17:15:27] metagod: Please guide how to remove from the container
[17:16:51] skweek: has joined #ruby
[17:17:51] DmitryBochkarev: has joined #ruby
[17:19:39] ramfjord: has joined #ruby
[17:20:21] garyserj: has joined #ruby
[17:32:20] Ishido: has joined #ruby
[17:32:23] [Butch]: has joined #ruby
[17:32:30] kapil___: has joined #ruby
[17:33:16] ruschlem2: has joined #ruby
[17:34:50] tAn: has joined #ruby
[17:40:32] alfiemax: has joined #ruby
[17:41:23] romain_t: has joined #ruby
[17:41:56] dviola: has joined #ruby
[17:46:43] veeti: has joined #ruby
[17:48:02] krawchyk: has joined #ruby
[17:50:48] milardovich: has joined #ruby
[17:50:58] eckhardt: has joined #ruby
[17:53:10] milardovich: has joined #ruby
[17:54:44] bhaak: has joined #ruby
[17:55:13] metagod: has joined #ruby
[17:55:58] metagod: how can i get the object from one of its attribute?
[17:57:32] nofxx: has joined #ruby
[17:58:42] metagod: https://gist.github.com/RAJKUMAR18/31bf510458c3696289af704b5cb7500c
[17:59:00] orbyt_: has joined #ruby
[17:59:10] metagod: any help getting object instance from object attribute
[17:59:10] hahuang65: has joined #ruby
[18:00:59] metagod: has left #ruby: ("Leaving")
[18:01:40] mtkd: has joined #ruby
[18:02:45] ur5us: has joined #ruby
[18:03:37] Psybur_: has joined #ruby
[18:07:35] krawchyk: has joined #ruby
[18:10:25] c0dy: has joined #ruby
[18:11:29] knight33: has joined #ruby
[18:11:30] Exhiled: has joined #ruby
[18:12:08] raynold: has joined #ruby
[18:19:59] tAn: has joined #ruby
[18:25:17] romeoh: has joined #ruby
[18:25:51] TomyLobo: has joined #ruby
[18:25:57] mr_foto: has joined #ruby
[18:26:10] ramfjord: has joined #ruby
[18:27:28] ruschlem2: has joined #ruby
[18:28:17] veeti: has joined #ruby
[18:33:42] zautomata: has joined #ruby
[18:33:49] pastorinni: has joined #ruby
[18:36:19] JaccoP: has joined #ruby
[18:36:33] wald0: has joined #ruby
[18:42:24] mikecmpbll: has joined #ruby
[18:42:50] alfiemax: has joined #ruby
[18:43:09] guille-moe: has joined #ruby
[18:43:51] despai: has joined #ruby
[18:51:32] chocoelho1: has joined #ruby
[18:53:08] cdolan: has joined #ruby
[18:54:19] lytol_: has joined #ruby
[18:56:17] tAn: has joined #ruby
[19:06:29] guille-moe: has joined #ruby
[19:06:57] ur5us: has joined #ruby
[19:07:46] mtkd: has joined #ruby
[19:11:13] Dimik: has joined #ruby
[19:18:35] falaafel: has joined #ruby
[19:21:48] falaafel: Hihi. how can I debug my ruby script if I'm using bundler when I've install my dependant gems into vendor/bundle?
[19:22:11] claudiuinberlin: has joined #ruby
[19:23:03] falaafel: Apologies, if this is a newbie question, but I couldn't find anyone else having similar problems - and 'bundle exec ruby -rdebug ./foo.rb' loses bundler's context
[19:23:19] Psybur__: has joined #ruby
[19:24:10] ltem: has joined #ruby
[19:24:56] veeti: has joined #ruby
[19:26:17] dminuoso: falaafel: What does "loses bundler's context" mean?
[19:26:28] clemens3: has joined #ruby
[19:26:45] apeiros: has joined #ruby
[19:27:42] pastorinni: has joined #ruby
[19:27:48] falaafel: well, I get a LoadError, so I assume it cannot find it in the same manner
[19:28:24] raynold: ahh it's a wonderful day
[19:30:09] tvw: has joined #ruby
[19:33:58] cdg: has joined #ruby
[19:35:24] romeoh: has joined #ruby
[19:38:25] tvw: has joined #ruby
[19:39:09] Azure: has joined #ruby
[19:40:46] falaafel: okay well, if anyone ever has that ever again, you can use pry and require bundle in it's preamble to keep the bundler context of where it stored everything
[19:41:25] tvw: has joined #ruby
[19:42:11] jnollette: has joined #ruby
[19:45:09] milardovich: has joined #ruby
[19:45:23] milardov_: has joined #ruby
[19:48:26] tvw: has joined #ruby
[19:49:33] RougeT430: has joined #ruby
[19:52:56] voker57: has joined #ruby
[19:54:25] tvw: has joined #ruby
[19:56:26] tvw: has joined #ruby
[20:00:06] jottr: has joined #ruby
[20:05:13] veeti: has joined #ruby
[20:06:30] schfkt: has joined #ruby
[20:07:03] riotjones: has joined #ruby
[20:07:16] schfkt: has left #ruby: ()
[20:10:28] orbyt_: has joined #ruby
[20:11:43] alfiemax: has joined #ruby
[20:13:23] alfiemax: has joined #ruby
[20:15:43] the_f0ster: has joined #ruby
[20:28:41] chiggins: has joined #ruby
[20:29:24] chiggins: When deploying a ruby application to production in passenger, is it appropriate to use RVM?
[20:29:32] chocoelho: has joined #ruby
[20:29:45] jottr: has joined #ruby
[20:40:12] alfiemax: has joined #ruby
[20:40:20] my123: has joined #ruby
[20:40:20] my123: has joined #ruby
[20:40:30] Psybur_: has joined #ruby
[20:41:39] cagomez: has joined #ruby
[20:45:20] jottr: has joined #ruby
[20:53:33] havenwood: chiggins: You don't need a Ruby version switcher if you're not switching Rubies.
[20:54:25] havenwood: chiggins: That said, plenty of folk use RVM in prod - despite most Ruby version maintainers arguing you shouldn't.
[20:54:42] havenwood: Ruby version switcher maintainers**
[20:55:10] havenwood: chiggins: Consider using a package manager Ruby or installing to /usr/local in prod.
[20:56:06] havenwood: chiggins: You absolutely can use RVM with Passenger in prod. But it's typically simpler to just have one Ruby.
[20:57:20] cagomez: has joined #ruby
[21:04:36] miskatonic: has joined #ruby
[21:05:02] al2o3-cr: ruby is not a sagittarius :(
[21:05:15] dinfuehr: has joined #ruby
[21:07:35] al2o3-cr: 0.95 was released on 21st December 1995, i'm so happy now :)
[21:11:09] eckhardt: has joined #ruby
[21:11:38] unreal: has joined #ruby
[21:12:32] cagomez: has joined #ruby
[21:14:18] cdg: has joined #ruby
[21:19:37] jenrzzz: has joined #ruby
[21:19:37] jenrzzz: has joined #ruby
[21:20:46] ramfjord: has joined #ruby
[21:23:56] CJKinni: has joined #ruby
[21:26:17] alfiemax_: has joined #ruby
[21:26:33] craysiii: Havenwood what reasoning do people have for dissuading others from ruby in production?
[21:26:47] craysiii: I mean RVM *
[21:28:12] cagomez: has joined #ruby
[21:29:48] zautomata: has left #ruby: ("WeeChat 1.7")
[21:31:59] Radar: Same reason that you wouldn't use a house to crush an ant
[21:32:04] Radar: I mean, you could...
[21:32:17] Zarthus: you can lift a house?
[21:33:21] Radar: Zarthus: do you even lift bro?
[21:33:30] Radar: also depends on the size of the house
[21:33:45] Zarthus: i am confident i could not lift any form of realistic non-toy house
[21:34:03] Zarthus: with a crane i could lift one of those portable houses
[21:42:17] eckhardt_: has joined #ruby
[21:42:29] cagomez: has joined #ruby
[21:43:52] milardovich: has joined #ruby
[21:44:14] cagomez: has joined #ruby
[21:44:28] selim: has joined #ruby
[21:44:59] john__: has joined #ruby
[21:46:28] milardovich: has joined #ruby
[21:50:37] pastorinni: has joined #ruby
[21:50:37] milardovich: has joined #ruby
[21:51:51] orbyt_: has joined #ruby
[21:55:25] cadillac_: has joined #ruby
[21:56:23] pastorinni: has joined #ruby
[21:58:21] selim: has joined #ruby
[22:06:37] jenrzzz: has joined #ruby
[22:06:37] jenrzzz: has joined #ruby
[22:15:20] enterprisey: has joined #ruby
[22:20:35] milardov_: has joined #ruby
[22:24:05] tAn: has joined #ruby
[22:29:26] jnyw: has joined #ruby
[22:32:03] sameerynho: has joined #ruby
[22:33:06] tomphp: has joined #ruby
[22:43:15] alfiemax: has joined #ruby
[22:49:46] davidcsi: has joined #ruby
[22:49:59] neo95: has joined #ruby
[22:50:22] chiggins: havenwood: Didn't notice my IRC session closed on my end. Thank you for the advice.
[22:50:50] chiggins: I'm trying to plan out a deployment of a Sinatra application and figure out the right ways to do it
[22:52:36] Inoperable: has joined #ruby
[22:58:46] neo95_: has joined #ruby
[22:59:43] chiggins: I'm currently getting 'directory index of "/opt/application/public/" is forbidden' while trying to use passenger/nginx
[22:59:50] chiggins: Any ideas how I can get my application running?
[23:01:35] alfiemax: has joined #ruby
[23:03:04] davidcsi: hello guys, i have this .map{ |n| statement..\n statement... } and i need to know when i'm processing the last one, is there a way?
[23:06:34] nadir: has joined #ruby
[23:07:33] s2013: has joined #ruby
[23:07:49] baweaver: davidcsi: what's your actual code?
[23:08:02] baweaver: Also explain what you're wanting to do a bit more clearly
[23:08:34] al2o3-cr: davidcsi: probably use indexing.
[23:09:07] davidcsi: @baweaver https://gist.github.com/davidcsi/4695aa9a18ff4f05857d10b4823763f9
[23:10:02] baweaver: you can use indexing as al2o3-cr mentioned
[23:10:03] davidcsi: i iterate through an xml document, getting all elements and printing them out, but i need to add a comma (,) to each one, but the last (converting to json, there's probably one out there, but i'm embedding this in logstash)
[23:10:38] baweaver: >> [1,2,3,4].join(', ')
[23:10:40] ruby[bot]: baweaver: # => "1, 2, 3, 4" (https://eval.in/922401)
[23:11:00] baweaver: though you could always just map [0..-2] and do the last seperate
[23:11:12] baweaver: also the newline before the |n| is really odd
[23:11:40] davidcsi: oh i did that for (my) clarity
[23:11:51] davidcsi: i'm pretty new at ruby
[23:12:02] baweaver: >> [1,2,3].map.with_index { |n, i| n + i }
[23:12:04] ruby[bot]: baweaver: # => [1, 3, 5] (https://eval.in/922402)
[23:13:50] SeepingN: has joined #ruby
[23:13:52] al2o3-cr: >> foo = [1,2,3]; foo.map.with_index { |e, i| e.to_s if foo.size.pred == i }
[23:13:53] ruby[bot]: al2o3-cr: # => [nil, nil, "3"] (https://eval.in/922403)
[23:14:41] code_zombie: has joined #ruby
[23:16:36] al2o3-cr: maybe i'm not getting it.
[23:18:09] davidcsi: @al2o3, that was perfect, great pointer, working perfectly
[23:18:15] davidcsi: @al2o3-cr, that was perfect, great pointer, working perfectly
[23:20:06] al2o3-cr: davidcsi: yeah, no worries. i thought i'd read it wrong tbh :P
[23:21:29] davidcsi: @al2o3-cr working like this: https://gist.github.com/davidcsi/4ad15f2342845d7a3093806ccbb1d2d4
[23:21:35] davidcsi: many thanks!!
[23:24:09] tomphp: has joined #ruby
[23:24:16] jenrzzz: has joined #ruby
[23:24:16] jenrzzz: has joined #ruby
[23:28:34] cadillac_: has joined #ruby
[23:37:42] scmlinux: has joined #ruby
[23:48:16] Radar: If I wanted a class that is like Struct, but had named args instead of positional args, what is there available for me to use?
[23:48:33] Radar: OpenStruct doesn't fill that obligation because I don't want random attributes to be settable
[23:49:03] Radar: https://rubygems.org/gems/values looks like the right thing, but I was wondering if there's anything in stdlib that I could use
[23:50:03] tcopeland: has joined #ruby
[23:51:17] ruschlem2: has joined #ruby
[23:52:18] tAn: has joined #ruby
[23:53:04] tjbp: has joined #ruby
[23:53:55] tAn: has joined #ruby
[23:54:40] tAn: has joined #ruby
[23:54:44] Radar: Could probably do it with a plain class actually.
[23:55:27] tAn: has joined #ruby
[23:56:07] MrBusiness: has joined #ruby
[23:56:41] tAn: has joined #ruby