« Back to channel list

#ruby - 28 November 2018

« Back 1 day Forward 1 day »
[00:11:26] elphe: has joined #ruby
[00:14:20] nchambers: has joined #ruby
[00:25:10] GodFather: has joined #ruby
[00:26:08] kspencer: Is there a easy way to basically turn url endpoints into chained attributes?
[00:27:23] phaul: graphql :)
[00:27:24] tjbp: has joined #ruby
[00:27:44] baweaver: What issue are you trying to solve?
[00:30:22] phaul: ACTION living in the world of buzzwords
[00:31:55] elphe: has joined #ruby
[00:33:16] Iambchop: maslen: custom_pg_hba_entries is a Hash, entries is an Array (of Hash), compare yours to the example: https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-config-template/gitlab.rb.template#L833 "postgresql['custom_pg_hba_entries'] = { APP1: [ { type: example, ... }, ... ], APP2: {...}, ... }"
[00:33:42] kspencer: Not so much an issue as it is an inconvenience, I basically want to turn GET api.site.tld/node/endpoint into STATE.get.node.endpoint(args)
[00:35:12] Iambchop: (crap messed up my cut-down example punctuation there, but the real example is still good :-)
[00:35:28] Dreamer3_: has joined #ruby
[00:36:11] Iambchop: (forgot to add the [] when I rushed to add APP2)
[00:38:41] Exuma: has joined #ruby
[00:42:05] elphe: has joined #ruby
[00:52:06] elphe: has joined #ruby
[00:54:44] asphyxia: has joined #ruby
[00:54:50] Nicmavr: has joined #ruby
[01:00:52] nowhere_man: has joined #ruby
[01:02:52] houhoulis: has joined #ruby
[01:11:35] jaddison: has joined #ruby
[01:12:19] elphe: has joined #ruby
[01:17:07] mangold: has joined #ruby
[01:25:46] Renich_: has joined #ruby
[01:26:20] Iambchop: https://usercontent.irccloud-cdn.com/file/QheTnE6A/20181127_202318_HDR-01.jpeg
[01:26:40] Iambchop: (oops wrong channel)
[01:32:30] elphe: has joined #ruby
[01:34:02] SeepingN: delete product forever
[01:45:49] mangold: has joined #ruby
[01:52:41] elphe: has joined #ruby
[02:06:59] nchambers: has joined #ruby
[02:12:50] elphe: has joined #ruby
[02:27:44] woodruffw: has joined #ruby
[02:32:30] Puffball: has joined #ruby
[02:33:01] elphe: has joined #ruby
[02:33:59] troulouliou_div2: has joined #ruby
[02:35:47] esrse: has joined #ruby
[02:47:56] mochiyoda: has left #ruby: ("Konversation terminated!")
[02:53:11] elphe: has joined #ruby
[02:57:25] GodFather: has joined #ruby
[03:01:45] maryo: has joined #ruby
[03:13:21] elphe: has joined #ruby
[03:20:32] DTZUZO: has joined #ruby
[03:21:17] \void: has joined #ruby
[03:25:16] awkwords: has joined #ruby
[03:32:36] Renich: has joined #ruby
[03:33:30] elphe: has joined #ruby
[03:34:37] CrazyEddy: has joined #ruby
[03:39:48] orbyt_: has joined #ruby
[03:43:38] elphe: has joined #ruby
[03:44:57] Exuma: has joined #ruby
[03:53:14] Renich: has joined #ruby
[04:01:01] akaiiro: has joined #ruby
[04:03:41] Exuma: has joined #ruby
[04:03:47] elphe: has joined #ruby
[04:05:33] darkhanb: has joined #ruby
[04:06:28] arescorpio: has joined #ruby
[04:09:44] braincrash: has joined #ruby
[04:26:26] Renich: has joined #ruby
[04:27:28] elphe: has joined #ruby
[04:32:47] Exuma: has joined #ruby
[04:33:08] jasmith: has joined #ruby
[04:37:36] elphe: has joined #ruby
[04:44:21] Puffball: has joined #ruby
[04:44:28] dellavg_: has joined #ruby
[04:51:01] elphe: has joined #ruby
[05:06:11] dbz: has joined #ruby
[05:11:30] elphe: has joined #ruby
[05:19:48] elphe: has joined #ruby
[05:20:27] Exuma: has joined #ruby
[05:42:11] Xiti: has joined #ruby
[05:45:35] raulp: has joined #ruby
[05:45:41] Hobbyboy: has joined #ruby
[05:47:14] elphe: has joined #ruby
[05:57:05] elphe: has joined #ruby
[06:03:00] reber: has joined #ruby
[06:04:49] Xiti: has joined #ruby
[06:21:27] hiroaki: has joined #ruby
[06:22:58] jaddison: has joined #ruby
[06:23:42] conta: has joined #ruby
[06:27:57] conta1: has joined #ruby
[06:33:11] sauvin: has joined #ruby
[06:34:11] armyriad: has joined #ruby
[06:34:19] sepp2k: has joined #ruby
[06:46:47] aupadhye: has joined #ruby
[06:47:18] crankhar1er: has joined #ruby
[07:06:37] mangold: has joined #ruby
[07:09:14] Aqo: has joined #ruby
[07:11:13] roshanavand: has joined #ruby
[07:13:20] eckhardt: has joined #ruby
[07:25:51] apparition: has joined #ruby
[07:36:27] dbz: has joined #ruby
[07:39:58] cnsvc_: has joined #ruby
[07:52:25] alem0lars: has joined #ruby
[08:05:06] Azure: has joined #ruby
[08:29:50] Aqo: hey guys, I would like to look at some real Ruby projects to learn good practices for writing Ruby
[08:30:02] Aqo: can someone recommend some open source repos that have good quality code in them to review
[08:30:24] Aqo: as a newcomer to the language I can't judge what's "good style" or "bad style" in Ruby so it would be nice to get a reference from a regular Ruby user
[08:35:05] clemens3: has joined #ruby
[08:40:08] baweaver: Aqo: what type of projects interest you?
[08:40:46] waheedi: has joined #ruby
[08:40:49] sezuan: zenspider: Thanks.
[08:44:48] burgestrand: has joined #ruby
[08:52:50] roshanavand: has joined #ruby
[08:52:55] Aqo: at the very least I want to try making an http server (rest api / simple frontend thing) and a simple windowing app (maybe a gui for some file format decoder/encoder)
[08:53:14] baweaver: Rack is typical for Ruby.
[09:02:20] dkmueller: has joined #ruby
[09:05:46] burgestrand: has joined #ruby
[09:07:53] mikecmpbll: has joined #ruby
[09:12:29] vondruch: has joined #ruby
[09:16:37] venmx: has joined #ruby
[09:27:11] spectra: has joined #ruby
[09:33:25] Guest21835: has joined #ruby
[09:33:57] mikker: Is there an easy way to execute a process as a specific user (when run as root) with something like Open3, or do I have to rely on sudo?
[09:43:38] keden: has joined #ruby
[09:49:12] asphyxia: has joined #ruby
[10:01:09] dhollinger: has joined #ruby
[10:04:57] LinuxKnight: has joined #ruby
[10:10:28] mangold: has joined #ruby
[10:11:57] tdy: has joined #ruby
[10:14:33] roshanavand: has joined #ruby
[10:20:35] phaul: has joined #ruby
[10:21:23] cnsvc_: has joined #ruby
[10:36:01] Bish: has joined #ruby
[10:36:24] Bish: proc does not have a operator to chain methods right?
[10:37:08] Bish: something like &:to_f&:to_i
[10:37:32] thinkpad: has joined #ruby
[10:39:28] dbz: has joined #ruby
[10:40:48] phaul: https://bugs.ruby-lang.org/issues/6284
[10:43:16] Bish: yeah, that'd be cool
[10:43:40] Bish: but i can't see .map(p1 << p2) being a thing either :D
[10:44:31] Bish: the pipe would be cool
[10:44:57] Bish: .map(p1 | :p2 | p3)
[10:45:04] Bish: yeah i'd like that
[10:45:21] phaul: it seems they are agreed on #* to be the composition. So it's going to be .map(p1 * p2 * 3)
[10:45:54] Bish: yeah let's use symbols we totally use for something different in our brain!
[10:46:10] Bish: while a pipe is like the defacto standard for chaining input and output
[10:46:19] Bish: even it's name says it
[10:46:27] Bish: ACTION sighs
[10:49:12] nicesignal: has joined #ruby
[11:05:19] roshanavand: has joined #ruby
[11:08:13] johnny56: has joined #ruby
[11:10:49] vonfry: has joined #ruby
[11:23:10] akemot: has joined #ruby
[11:25:10] cnsvc_: has joined #ruby
[11:33:27] Bish: calling super in ensure, is that a thing?
[11:34:24] Bish: hm, it won't get the return value
[11:40:11] marz_d`ghostman: What design pattern can I use instead of declaring a global variable for logging?
[11:41:10] bougyman: I use a module instance variable for it.
[11:41:50] Bish: same thing, really
[11:42:26] bougyman: module MyApp; def self.log; @log ||= default_log; end; def self.log=(other); @log = other; end; end
[11:42:27] Bish: marz_d`ghostman: well the thing that logs could have a reference to the logger
[11:42:31] bougyman: but it doesn't complain if you change it
[11:42:58] Bish: kinda like
[11:43:08] Bish: App.loggers << Logger.new($stdout)
[11:43:23] bougyman: yeah, that's the most common pattern I see
[11:44:08] marz_d`ghostman: ah so you can just access it via MyApp::log
[11:44:19] Bish: marz_d`ghostman: rather MyApp.log
[11:44:39] marz_d`ghostman: oh right cause it's a class method
[11:44:47] bougyman: module method
[11:44:53] Bish: same thing, really :p
[11:45:26] Bish: >> Class.is_a? Module
[11:45:26] marz_d`ghostman: Iwhat's the difference of :: and . then?
[11:45:37] bougyman: it's considered good style to use .
[11:45:42] Bish: marz_d`ghostman: you access constants of a module with ::
[11:45:47] bougyman: and weird to use :: for anything other than nesting namespaces.
[11:45:49] Bish: methods aren't constants
[11:45:52] bougyman: or accessing ... yeah
[11:46:09] bougyman: :: _works_, but it's ruby idiom to use . for calling methods, not ::
[11:46:53] Bish: why does that work in the first place, hm
[11:49:03] Bish: what's a pretty way to get month,weeks,days,hours out of a time difference
[11:49:12] Bish: i can only think of some ugly inject
[11:50:57] marz_d`ghostman: By the way, if I have a Configuration module on my module MyApp, can I call the Configuration module directly or do I still have to prepend it with MyApp::Configuration?
[11:51:21] Bish: if you're inside MyApp you can ask Configuration without prefix
[11:51:32] Bish: if you're deeper, or higher, you can't
[11:52:32] phaul: are you sure about deeper? I think being deeper would work...
[11:54:10] phaul: &>> module A; module B; def self.foo; 1; end; end; end; module A; module C; B.foo; end; end
[11:54:23] rubydoc: # => 1 (https://carc.in/#/r/5n7b)
[11:54:34] wildermind: has joined #ruby
[11:55:08] Bish: [30,7,1].each_with_object({a:69}).map { |e,res| result = res[:a]/e;res[:a] = res[:a]%e;result }
[11:55:18] Bish: why does that work.. why shouldn't it.. and how do i do it better?
[11:55:35] Bish: phaul: didn't they change that in more recent versions?
[11:55:56] Bish: well it still works in 2.5
[11:56:07] Bish: &>> RUBY_VERSION
[11:56:19] rubydoc: # => "2.5.3" (https://carc.in/#/r/5n7c)
[11:56:45] phaul: Bish: you can do &25>>, &21>> etc
[11:56:55] phaul: 20 -> 25 supported
[11:57:29] phaul: &20>> RUBY_VERSION
[11:57:41] rubydoc: # => "2.0.0" (https://carc.in/#/r/5n7d)
[11:58:52] phaul: &>> [30,7,1].each_with_object({a:69}).map { |e,res| result = res[:a]/e;res[:a] =res[:a]%e;result }
[11:59:03] rubydoc: # => [2, 1, 2] (https://carc.in/#/r/5n7e)
[11:59:27] Bish: 2 month 1 week 2 days
[11:59:40] Bish: are 69 days, considering 30 day months
[12:00:13] Bish: a more readable approach would be cool, since is basicially "clock math"?
[12:00:40] Bish: and mfw i found it map works with each_with_object
[12:02:25] aufi: has joined #ruby
[12:02:41] phaul: why are you using a Hash for the object?
[12:03:15] Bish: because references for numbers don't work, kinda like primitives i guess?
[12:03:18] burgestrand: has joined #ruby
[12:03:18] Bish: Integers*
[12:03:28] phaul: &>> [30,7,1].each_with_object(69).map { |e,res| result = res/e;res =res%e;result }
[12:03:39] rubydoc: # => [2, 9, 69] (https://carc.in/#/r/5n7l)
[12:03:49] Bish: they get duplicated before hitting the block
[12:03:57] Bish: or they're not mutable or whatever
[12:04:31] Bish: &>> x = 5; [x.object_id,(x+1).object_id]
[12:04:32] rubydoc: # => [11, 13] (https://carc.in/#/r/5n7m)
[12:05:21] Bish: &>> x = 5; [x.object_id,[x].map{ |x| x.object_id }]
[12:05:32] rubydoc: # => [11, [11]] (https://carc.in/#/r/5n7n)
[12:05:40] Bish: guessing they're immutable
[12:06:12] phaul: yeah, that explains it :)
[12:06:59] Bish: but immutability is not the right term
[12:07:02] phaul: altough each_with object could write it into the accum like inject does, but then it couldn't return
[12:07:32] Bish: yeah thing is i need to carry through 2 values
[12:07:43] Bish: so i would carry on an array, which is the same thing
[12:09:59] BTRE: has joined #ruby
[12:10:38] Bish: guess there is no real pretty way to do that
[12:12:15] phaul: in a code that's in a real project I would just spell out 3-4 lines in a method, with local vars for months, weeks, days.. Much easier to understand
[12:20:01] dviola: has joined #ruby
[12:21:29] FastJack: has joined #ruby
[12:22:10] akemot: has joined #ruby
[12:24:45] mangold: has joined #ruby
[12:27:19] cnsvc_: has joined #ruby
[12:29:33] sheepman: has joined #ruby
[12:32:33] roshanavand: has joined #ruby
[12:33:28] thinkpad: has joined #ruby
[12:36:37] roshanavand: has joined #ruby
[12:45:51] Guest21835: has joined #ruby
[12:47:46] bmurt: has joined #ruby
[12:58:11] AJA4350: has joined #ruby
[13:00:35] reber: has joined #ruby
[13:03:50] elomatreb: has joined #ruby
[13:08:49] Guest21835: has joined #ruby
[13:21:03] awkwords: has joined #ruby
[13:24:44] Dreamer3_: has joined #ruby
[13:29:23] awkwords: has joined #ruby
[13:31:48] snowy: has joined #ruby
[13:33:08] dkmueller: has joined #ruby
[13:35:13] blackmesa: has joined #ruby
[13:39:34] aufi: has joined #ruby
[13:41:20] conta: has joined #ruby
[13:46:51] roshanavand: has joined #ruby
[13:54:09] mrbirkov: has joined #ruby
[13:59:47] asphyxia: has joined #ruby
[14:00:45] cnsvc_: has joined #ruby
[14:01:34] elphe: has joined #ruby
[14:02:21] crankhar1er: has joined #ruby
[14:14:19] aupadhye: has joined #ruby
[14:19:52] waheedi: has joined #ruby
[14:33:57] roshanavand: has joined #ruby
[14:40:30] alem0lars: has joined #ruby
[14:51:07] Sylario: has joined #ruby
[15:06:01] aufi: has joined #ruby
[15:06:37] chouhoulis: has joined #ruby
[15:07:48] Renich: has joined #ruby
[15:11:33] beeman: has joined #ruby
[15:13:08] thinkpad: has joined #ruby
[15:15:11] graphene: has joined #ruby
[15:16:09] Puffball: has joined #ruby
[15:20:37] polishdub: has joined #ruby
[15:32:00] conta: has joined #ruby
[15:34:18] cnsvc_: has joined #ruby
[15:36:21] rippa: has joined #ruby
[15:38:32] alem0lars: has joined #ruby
[15:44:46] hutch: has joined #ruby
[15:45:03] conta1: has joined #ruby
[15:45:17] alicef: has joined #ruby
[15:48:53] bmurt: has joined #ruby
[15:49:44] awkwords: has joined #ruby
[15:56:12] Inline: has joined #ruby
[15:56:57] Iambchop: Bish: 69.divmod(30).yield_self{|m,rd| [m]+rd.divmod(7)} #=> [2, 1, 2]
[15:57:39] Iambchop: (would look nicer with "then" in 2.6)
[15:58:13] impermanence: has joined #ruby
[16:02:06] Cthulu201: has joined #ruby
[16:02:49] Inline: has joined #ruby
[16:05:14] Dbugger: has joined #ruby
[16:05:22] waheedi: has joined #ruby
[16:05:26] Inline: has joined #ruby
[16:08:00] Inline: has joined #ruby
[16:10:39] Inline: has joined #ruby
[16:12:28] vondruch: has joined #ruby
[16:17:49] Inline: has joined #ruby
[16:24:59] Inline: has joined #ruby
[16:25:59] Cthulu201: has joined #ruby
[16:26:04] jaddison: has joined #ruby
[16:40:03] roshanavand: has joined #ruby
[16:47:08] segy: has joined #ruby
[16:49:16] DTZUZO: has joined #ruby
[16:49:43] za1b1tsu: has joined #ruby
[16:54:25] Inline: has joined #ruby
[16:54:29] havenwood: https://www.ruby-lang.org/en/news/2018/11/08/snap/
[16:55:16] Rapture: has joined #ruby
[16:55:30] havenwood: https://github.com/ruby/snap.ruby
[17:04:07] Inline: has joined #ruby
[17:04:59] jaddison: has joined #ruby
[17:05:00] cnsvc_: has joined #ruby
[17:05:56] snowy: has joined #ruby
[17:10:01] Inline: has joined #ruby
[17:14:04] darkhanb: has joined #ruby
[17:18:31] Inline: has joined #ruby
[17:21:02] gix: has joined #ruby
[17:21:54] tbuehlmann: havenwood: nice!
[17:32:54] troulouliou_div2: has joined #ruby
[17:40:48] dbz: has joined #ruby
[17:41:41] dbz: has joined #ruby
[17:41:57] leitz: has joined #ruby
[17:45:42] eckhardt_: has joined #ruby
[17:49:12] graphene: has joined #ruby
[17:56:57] za1b1tsu: has joined #ruby
[17:57:04] ghormoon: has joined #ruby
[17:57:55] Guest21835: has joined #ruby
[17:58:58] sanscoeur: has joined #ruby
[17:59:18] akaiiro: has joined #ruby
[18:04:16] sanscoeur: has joined #ruby
[18:06:21] aufi: has joined #ruby
[18:08:05] cschneid_: has joined #ruby
[18:10:34] cnsvc_: has joined #ruby
[18:10:37] sanscoeur: has joined #ruby
[18:16:48] sanscoeur: has joined #ruby
[18:22:20] Renich: has joined #ruby
[18:24:57] sanscoeur: has joined #ruby
[18:31:16] cd: has joined #ruby
[18:37:10] lxsameer: has joined #ruby
[18:47:27] roshanavand: has joined #ruby
[18:48:34] alem0lars: has joined #ruby
[18:48:52] \void: has joined #ruby
[18:51:28] hutch: has joined #ruby
[18:54:03] awkwords: has joined #ruby
[18:54:31] nchambers: has joined #ruby
[18:56:35] graphene: has joined #ruby
[19:00:12] skweek: has joined #ruby
[19:00:36] sanscoeur: has joined #ruby
[19:11:42] reber__: has joined #ruby
[19:12:11] sanscoeur: has joined #ruby
[19:14:47] cnsvc_: has joined #ruby
[19:15:03] tdy: has joined #ruby
[19:17:51] ptx0: has joined #ruby
[19:22:13] dkmuelle1: has joined #ruby
[19:23:05] roshanavand: has joined #ruby
[19:23:05] dkmueller: has joined #ruby
[19:28:56] CrazyEddy: has joined #ruby
[19:33:59] burgestrand: has joined #ruby
[19:37:09] ur5us: has joined #ruby
[19:51:32] aufi: has joined #ruby
[19:55:38] waheedi: has joined #ruby
[20:02:07] Renich_: has joined #ruby
[20:04:42] orbyt_: has joined #ruby
[20:18:01] dviola: has joined #ruby
[20:18:46] Aqo: has joined #ruby
[20:23:27] impermanence: has joined #ruby
[20:26:24] ua: has joined #ruby
[20:42:01] OrangeManBad: has left #ruby: ("Bye")
[20:49:49] beeman: has joined #ruby
[20:52:05] Renich: has joined #ruby
[20:53:37] Sembei: has joined #ruby
[20:59:54] elphe: has joined #ruby
[21:01:31] cnsvc_: has joined #ruby
[21:06:48] jaddison: has joined #ruby
[21:12:58] keden: has joined #ruby
[21:15:44] GodFather: has joined #ruby
[21:16:35] SeepingN: has joined #ruby
[21:26:22] lomex: has joined #ruby
[21:28:17] graphene: has joined #ruby
[21:37:21] Rapture: has joined #ruby
[21:39:29] graphene: has joined #ruby
[21:39:57] troulouliou_dev: has joined #ruby
[21:41:26] RougeR: has joined #ruby
[21:45:35] orbyt_: has joined #ruby
[21:50:26] havenwood: ruby-install --latest jruby # 9.2.4.1
[22:01:29] mikecmpbll: has joined #ruby
[22:03:14] jamesaxl: has left #ruby: ()
[22:05:59] venmx: has joined #ruby
[22:14:56] Nicmavr: has joined #ruby
[22:21:10] robscomputer: has joined #ruby
[22:28:29] tectonic: has joined #ruby
[22:31:46] jaddison: has joined #ruby
[22:32:41] chussenot: has joined #ruby
[22:39:56] mangold: has joined #ruby
[22:40:23] agent_white: has joined #ruby
[22:41:37] jaddison: has joined #ruby
[22:46:34] elphe: has joined #ruby
[22:56:40] elphe: has joined #ruby
[23:00:51] akaiiro: has joined #ruby
[23:06:27] asphyxia: has joined #ruby
[23:10:15] akaiiro: has joined #ruby
[23:17:22] elphe: has joined #ruby
[23:17:34] keden: has joined #ruby
[23:22:02] orbyt_: has joined #ruby
[23:22:05] Renich: has joined #ruby
[23:34:27] elphe: has joined #ruby
[23:35:55] orbyt_: has joined #ruby
[23:40:21] Xiti: has joined #ruby
[23:41:12] akemot: has joined #ruby
[23:56:21] awkwords: has joined #ruby
[23:56:54] brkkyk: has joined #ruby