« Back to channel list

#ruby - 24 May 2019

« Back 1 day Forward 1 day »
[00:00:49] AJA4351: has joined #ruby
[00:02:34] Phil0s0rapt0r: has joined #ruby
[00:02:57] jenrzzz: has joined #ruby
[00:05:50] esp32_prog: has joined #ruby
[00:09:16] houhoulis: has joined #ruby
[00:09:30] octos: has joined #ruby
[00:10:35] skryking: has joined #ruby
[00:12:03] xco: has joined #ruby
[00:15:40] ljarvis_: has joined #ruby
[00:16:23] dar123: has joined #ruby
[00:23:19] Swyper: has joined #ruby
[00:24:24] doodlebug: has joined #ruby
[00:26:56] Nicmavr: has joined #ruby
[00:28:21] SirFunk: has joined #ruby
[00:34:11] al2o3-cr: has joined #ruby
[00:34:15] jenrzzz: has joined #ruby
[00:47:48] Talion: has joined #ruby
[00:55:54] dar123: has joined #ruby
[00:56:52] Kestrel-029: has joined #ruby
[01:01:29] kapilp: has joined #ruby
[01:12:36] jenrzzz: has joined #ruby
[01:17:39] orbyt_: has joined #ruby
[01:18:21] haxx0r: has joined #ruby
[01:24:28] fphilipe_: has joined #ruby
[01:26:24] duderonomy: has joined #ruby
[01:28:21] Swyper: has joined #ruby
[01:30:36] Nicmavr: has joined #ruby
[01:31:28] yoshie902a: has joined #ruby
[01:31:30] yoshie902a: has left #ruby: ()
[01:39:06] shakes: has joined #ruby
[01:43:19] salerace: has joined #ruby
[01:54:05] esp32_prog: has joined #ruby
[01:56:04] cliluw: has joined #ruby
[02:02:58] doodleb28: has joined #ruby
[02:04:01] doodleb29: has joined #ruby
[02:05:35] doodleb98: has joined #ruby
[02:06:46] Linuus: has joined #ruby
[02:10:54] doodlebug: has joined #ruby
[02:13:13] Swyper: has joined #ruby
[02:13:48] jenrzzz: has joined #ruby
[02:14:12] Omnilord: has joined #ruby
[02:34:37] doodlebug: has joined #ruby
[02:35:31] xlued: has joined #ruby
[02:36:27] fphilipe_: has joined #ruby
[02:40:39] apg: has joined #ruby
[02:40:39] apg: has joined #ruby
[02:44:49] Swyper: has joined #ruby
[02:46:36] tdy: has joined #ruby
[03:02:48] AJA4350: has joined #ruby
[03:09:29] octos: has joined #ruby
[03:10:29] braincrash: has joined #ruby
[03:23:28] jenrzzz: has joined #ruby
[03:26:56] Nicmavr: has joined #ruby
[03:42:21] esp32_prog: has joined #ruby
[03:46:43] salerace: has joined #ruby
[03:52:14] fphilipe_: has joined #ruby
[03:54:43] ltd: has joined #ruby
[04:17:47] fphilipe: has joined #ruby
[04:26:25] jenrzzz: has joined #ruby
[04:41:00] skryking: has joined #ruby
[04:41:05] matthewd: has joined #ruby
[04:56:52] Kestrel-029: has joined #ruby
[05:00:16] alexeev: has joined #ruby
[05:01:12] xco: has joined #ruby
[05:02:40] jenrzzz: has joined #ruby
[05:02:58] fphilipe: has joined #ruby
[05:04:27] Wolland: has joined #ruby
[05:05:06] fphilipe_: has joined #ruby
[05:14:52] sauvin: has joined #ruby
[05:16:55] reber: has joined #ruby
[05:20:20] alexeev: has joined #ruby
[05:20:54] conta: has joined #ruby
[05:23:58] kyrylo: has joined #ruby
[05:28:54] dellavg_: has joined #ruby
[05:30:34] esp32_prog: has joined #ruby
[05:36:12] alexeev: has joined #ruby
[05:43:56] alexeev: has joined #ruby
[05:45:48] alexeev_: has joined #ruby
[05:50:18] ltd: has joined #ruby
[06:01:25] aupadhye: has joined #ruby
[06:06:23] alexeev: has joined #ruby
[06:09:08] jenrzzz: has joined #ruby
[06:17:30] code_zombie: has joined #ruby
[06:35:57] blackmesa: has joined #ruby
[06:36:31] alexeev: has joined #ruby
[06:36:56] schne1der: has joined #ruby
[06:45:00] andikr: has joined #ruby
[06:48:57] hightower2: has joined #ruby
[06:48:57] lxsameer: has joined #ruby
[06:49:35] hightower2: has joined #ruby
[06:52:51] TomyWork: has joined #ruby
[06:54:43] ubuntu__: has joined #ruby
[06:55:20] fphilipe_: has joined #ruby
[06:56:51] Nicmavr: has joined #ruby
[06:59:46] deimos: has joined #ruby
[07:03:41] jenrzzz: has joined #ruby
[07:11:29] jefffrails35: has joined #ruby
[07:16:13] salerace: has joined #ruby
[07:18:49] esp32_prog: has joined #ruby
[07:26:02] alexeev: has joined #ruby
[07:26:52] Kestrel-029: has joined #ruby
[07:42:08] BuildTheRobots: has joined #ruby
[07:42:44] Sylario: has joined #ruby
[07:43:13] Net: has joined #ruby
[07:43:31] jetpack_joe: has joined #ruby
[07:43:34] hahuang65: has joined #ruby
[07:43:34] solars: has joined #ruby
[07:43:40] Pillus: has joined #ruby
[07:43:41] hsiktas: has joined #ruby
[07:43:57] iamdevnul: has joined #ruby
[07:44:19] BuildTheRobots: has joined #ruby
[07:44:19] deepredsky: has joined #ruby
[07:44:45] hahuang65: has joined #ruby
[07:45:21] esp32_prog: has joined #ruby
[07:45:34] BuildTheRobots: has joined #ruby
[07:45:40] uranoss: has joined #ruby
[07:48:14] justache: has joined #ruby
[07:55:58] r3m: has joined #ruby
[08:03:02] mikecmpbll: has joined #ruby
[08:04:20] buzzbuzzy: has joined #ruby
[08:04:23] timeless: has joined #ruby
[08:04:51] arthurnn: has joined #ruby
[08:05:53] ged: has joined #ruby
[08:06:07] jnix: has joined #ruby
[08:07:14] hsiktas: has joined #ruby
[08:07:27] iamdevnul: has joined #ruby
[08:08:03] chromis: has joined #ruby
[08:08:50] podman: has joined #ruby
[08:08:51] gmcintire: has joined #ruby
[08:08:53] BuildTheRobots: has joined #ruby
[08:09:05] uranoss: has joined #ruby
[08:09:12] hsiktas: has joined #ruby
[08:09:16] Chew: has joined #ruby
[08:09:31] Net: has joined #ruby
[08:09:38] WA9ACE: has joined #ruby
[08:09:46] coffeejunk: has joined #ruby
[08:10:15] discopatrick: has joined #ruby
[08:11:25] sariyar: has joined #ruby
[08:12:05] miah: has joined #ruby
[08:13:15] ShalokShalom: has joined #ruby
[08:18:57] mosh: has joined #ruby
[08:19:11] genpaku: has joined #ruby
[08:19:21] Pillus: has joined #ruby
[08:20:17] meinside: has joined #ruby
[08:20:40] mcspud: has joined #ruby
[08:20:44] Liothen: has joined #ruby
[08:22:51] fphilipe_: has joined #ruby
[08:25:59] ricer2: has joined #ruby
[08:31:36] Avon: has joined #ruby
[08:32:15] deepredsky: has joined #ruby
[08:32:53] Jonopoly_: has joined #ruby
[08:45:08] alexeev: has joined #ruby
[08:47:41] kapilp: has joined #ruby
[08:49:51] lxsameer: has joined #ruby
[09:01:22] dhollin3: has joined #ruby
[09:08:40] cisco: has joined #ruby
[09:10:08] ellcs: has joined #ruby
[09:10:41] conta: has joined #ruby
[09:15:29] alexeev_: has joined #ruby
[09:16:32] clemens3: has joined #ruby
[09:34:26] salerace: has joined #ruby
[09:35:55] r3m: has joined #ruby
[09:37:52] esp32_prog: has joined #ruby
[09:40:54] cisco_: has joined #ruby
[09:48:18] schne1der: has joined #ruby
[09:49:37] cisco_: has joined #ruby
[09:50:10] hightower3: has joined #ruby
[09:54:28] conta: has joined #ruby
[10:07:00] Bish: this channel is getting silent geez
[10:12:14] galeido: has joined #ruby
[10:18:06] cisco: has joined #ruby
[10:22:45] deepredsky: has joined #ruby
[10:22:57] Ai9zO5AP: has joined #ruby
[10:23:31] ytti: squeeee, i made something cute - http://p.ip.fi/XYWk
[10:23:56] ytti: to_human(from_human(1.23, "Gbps")) == "1.23Gbps"
[10:24:56] conta: has joined #ruby
[10:45:37] Nicmavr: has joined #ruby
[10:56:03] salerace: has joined #ruby
[10:57:34] BH23: has joined #ruby
[11:00:20] ytti: i have proprietary device emitting broken JSON, I wonder if there is way way to unbroke it. Essentially I have array of objects, each of these objects contains one spcific name which is non-unique to that object, and the last one takes precedence
[11:00:26] ytti: i'd want the first one to take precedence
[11:00:50] ytti: i guess i'd need to write my own trivial JSON parser to drop the first one
[11:09:43] kyrylo: has joined #ruby
[11:17:12] Swyper: has joined #ruby
[11:19:00] salerace: has joined #ruby
[11:26:10] laaron: has joined #ruby
[11:28:39] salerace: has joined #ruby
[11:36:48] fphilipe_: has joined #ruby
[11:37:52] alexeev: has joined #ruby
[11:41:02] conta: has joined #ruby
[11:42:50] alexeev_: has joined #ruby
[11:43:23] jefffrails35: has joined #ruby
[11:45:22] laaron: has joined #ruby
[11:46:37] eph^: has joined #ruby
[11:47:48] haxx0r: has joined #ruby
[11:48:20] LenPayne: has joined #ruby
[11:49:51] yasumi2136: has joined #ruby
[11:51:37] Rudd0: has joined #ruby
[11:51:49] Fusl: has joined #ruby
[11:53:57] yokel: has joined #ruby
[11:54:11] spectra: has joined #ruby
[12:01:53] Shikichiro: has joined #ruby
[12:05:42] alexeev: has joined #ruby
[12:21:09] laaron: has joined #ruby
[12:22:30] cow[moo]: has joined #ruby
[12:29:19] doodleb75: has joined #ruby
[12:33:51] fphilipe_: has joined #ruby
[12:36:22] AJA4350: has joined #ruby
[12:42:03] cow[moo]: has joined #ruby
[12:44:31] fphilipe_: has joined #ruby
[12:47:19] yasumi2136_: has joined #ruby
[12:50:49] laaron: has joined #ruby
[12:51:25] doodlebug: has joined #ruby
[12:56:57] tweeaks: has joined #ruby
[12:57:21] KeyJoo: has joined #ruby
[12:58:31] jhass: ytti: got an example?
[12:59:24] jhass: maybe it happens to be valid yaml or something
[13:01:33] ytti: jhass, no, no it's JSON converted from XML and definitely invalid - http://p.ip.fi/oh0s
[13:02:27] ytti: jhass, the XML version http://p.ip.fi/rIpq
[13:02:43] ytti: which is actually valid, as same node can appear many times in XML
[13:02:56] ytti: so just bug in their conversion implementatino
[13:04:56] jhass: fun, but I fail to spot where it's syntactically invalid?
[13:05:11] jhass: unless the dots are actually in there
[13:05:44] ytti: jhass, packet-information name appears twice in same object
[13:05:59] ytti: i broke indentation, why it looks ok
[13:06:27] jhass: well, just using the XML is no option?
[13:06:37] conta: has joined #ruby
[13:06:42] ytti: certainly is, and i usually do
[13:06:51] ytti: first time trying the JSON :)
[13:07:32] ytti: ofc reported to vendor too, certainly a mistake i could see myself writing on such converter
[13:08:37] jhass: well converting the XML is just the wrong approach in the first place
[13:08:47] jhass: you want your internal models/data classes to serialize to both
[13:09:01] ytti: the XML is the single source of truth
[13:09:06] ytti: out of which CLI and JSON are generated
[13:09:14] ytti: i don't find fault in the design
[13:09:27] ytti: just a implementation bug
[13:13:59] jhass: ytti: just for fun: https://carc.in/#/r/6yy6
[13:16:18] rippa: has joined #ruby
[13:16:20] ytti: jhass, huh, i was looking at JSON docs but didn't notice object_class
[13:16:30] ytti: jhass, i did try this JSON.load('{"hello": {"goodbye":"moi"}, "hello": {"moi": "jee"}}', Proc.new{|e|p e},create_additions: true)
[13:16:41] ytti: jhass, just to see what the proc observes, but it wouldn't observe the duplicate
[13:16:44] ytti: jhass, thank you
[13:17:20] jhass: not sure I'd actually use it, feels kinda hackish (esp compared to just using the XML), but I guess it works :)
[13:17:48] jhass: yeah no idea what the additions thing is about
[13:18:58] ytti: i'm definitely not going to use this for anything serious, mainly just wanted to see how mature it is, and answer appears to be not much
[13:19:06] ytti: but still that is very neat trick i'm happy to learn
[13:20:40] cow[moo]: has joined #ruby
[13:21:17] jcalla: has joined #ruby
[13:23:53] laaron: has joined #ruby
[13:25:23] DTZUZU2: has joined #ruby
[13:25:59] dar123: has joined #ruby
[13:26:50] jefffrails35: has joined #ruby
[13:27:41] zodd: has joined #ruby
[13:29:51] agent_white: has joined #ruby
[13:32:00] Wolland: has joined #ruby
[13:43:38] laaron: has joined #ruby
[13:45:55] FrankDW: has joined #ruby
[13:52:15] cthulchu: has joined #ruby
[13:56:49] yqt: has joined #ruby
[14:04:13] thiccdaddy: has joined #ruby
[14:04:59] jeremycw: has joined #ruby
[14:25:23] cow[moo]: has joined #ruby
[14:29:37] BH23: has joined #ruby
[14:30:00] _joes_: has joined #ruby
[14:33:24] cd: has joined #ruby
[14:35:40] alexeev: has joined #ruby
[14:39:06] zacts: has joined #ruby
[14:52:56] doodleb28: has joined #ruby
[15:04:20] leitz: has joined #ruby
[15:09:32] polishdub: has joined #ruby
[15:13:00] haxx0r29: has joined #ruby
[15:23:59] thiccdaddy: has left #ruby: ("WeeChat 2.4")
[15:28:13] kapilp: has joined #ruby
[15:38:23] zacts: has joined #ruby
[15:39:59] rf`: has joined #ruby
[15:45:31] deepredsky: has joined #ruby
[15:45:56] ricekrispie: has joined #ruby
[15:46:28] yasumi2136: has joined #ruby
[15:48:48] envex: has joined #ruby
[15:53:17] doodlebug: has joined #ruby
[15:58:49] graft: has joined #ruby
[15:58:49] graft: has joined #ruby
[15:58:59] graft: what happened to Time#iso8601?
[15:59:10] graft: it's gone in 2.6.3
[16:01:13] havenwood: graft: require 'time'
[16:01:23] skryking: has joined #ruby
[16:01:50] graft: strange, I can do Time.now without require 'time'?
[16:02:56] envex: has joined #ruby
[16:03:44] laaron: has joined #ruby
[16:03:45] havenwood: graft: some classes, like Thread, Fiber, Time, etc, load more features when required
[16:04:45] AJA4351: has joined #ruby
[16:04:48] graft: interesting... the docs are singularly unclear here
[16:05:22] tdy: has joined #ruby
[16:05:30] graft: where are docs for require 'time' as opposed to the basic Time?
[16:06:12] havenwood: graft: they just show "require 'time'" in front of all the methods examples where it's required
[16:06:20] dar123: has joined #ruby
[16:06:50] havenwood: graft: Some also say: "You must require 'time' to use this method."
[16:07:05] graft: i'm looking at ruby-doc.org
[16:07:26] graft: there's no documentation for #iso8601 here: https://ruby-doc.org/core-2.6.3/Time.html, although it is referenced in #round as you say
[16:07:52] havenwood: graft: https://docs.ruby-lang.org/en/2.6.0/Time.html#method-c-xmlschema
[16:08:09] havenwood: "You must require 'time' to use this method."
[16:09:35] graft: those docs appear to be incorrect also, ::iso8601 is not #iso8601
[16:10:53] havenwood: graft: ruby-doc.org just puts the documentation here: https://ruby-doc.org/stdlib-2.6.3/libdoc/time/rdoc/Time.html
[16:11:08] graft: no, never mind i figured it out
[16:11:17] havenwood: graft: The links are better for docs.ruby-lang.org, but you can find it on ruby-doc.org as well.
[16:11:39] havenwood: https://ruby-doc.org/stdlib-2.6.3/libdoc/time/rdoc/Time.html#method-i-iso8601
[16:11:56] Nicmavr: has joined #ruby
[16:12:48] laaron: has joined #ruby
[16:13:08] graft: aha there is an 'additional notes' section noting the distinction on ruby-doc.org
[16:13:09] tf2ftw: has joined #ruby
[16:25:19] Tempesta: has joined #ruby
[16:28:20] zacts: has joined #ruby
[16:31:18] johnp: has joined #ruby
[16:34:55] esp32_prog: has joined #ruby
[16:36:55] orbyt_: has joined #ruby
[16:38:05] Rapture: has joined #ruby
[16:41:52] Kestrel-029: has joined #ruby
[16:43:10] laaron: has joined #ruby
[16:45:24] jenrzzz: has joined #ruby
[16:48:05] houhoulis: has joined #ruby
[16:55:38] graft: has joined #ruby
[16:55:38] graft: has joined #ruby
[17:01:53] nowhere_man: has joined #ruby
[17:04:14] xco: has joined #ruby
[17:04:15] octos: has joined #ruby
[17:08:16] zacts: has joined #ruby
[17:09:06] deimos: has joined #ruby
[17:11:08] laaron: has joined #ruby
[17:12:08] dar123: has joined #ruby
[17:14:11] antoniogu: has joined #ruby
[17:16:04] duderonomy: has joined #ruby
[17:22:19] englosh_: has joined #ruby
[17:24:20] antoniogu: has joined #ruby
[17:24:21] zacts: has joined #ruby
[17:26:51] Nicmavr: has joined #ruby
[17:26:57] antoniogu: has joined #ruby
[17:43:24] Azure: has joined #ruby
[17:46:10] dviola: has joined #ruby
[17:48:01] fphilipe_: has joined #ruby
[17:52:34] cjohnson: has joined #ruby
[17:53:19] Wolland: has joined #ruby
[17:55:50] Eiam_: has joined #ruby
[18:00:45] octos: has joined #ruby
[18:05:04] Wolland: has joined #ruby
[18:06:55] ramfjord: has joined #ruby
[18:10:48] laaron: has joined #ruby
[18:15:02] galeido^: has joined #ruby
[18:17:49] ShalokShalom: has joined #ruby
[18:18:32] sameerynho: has joined #ruby
[18:23:18] esp32_prog: has joined #ruby
[18:26:51] Nicmavr: has joined #ruby
[18:34:07] AJA4350: has joined #ruby
[18:38:02] doodleb52: has joined #ruby
[18:43:26] CrazyEddy: has joined #ruby
[18:48:51] reber: has joined #ruby
[18:55:39] octos: has joined #ruby
[18:57:16] budonyc: has joined #ruby
[19:06:07] octos: has joined #ruby
[19:08:03] doodlebug: has joined #ruby
[19:10:07] stryek: has joined #ruby
[19:10:16] schne1der: has joined #ruby
[19:11:44] laaron: has joined #ruby
[19:12:39] ramfjord: has joined #ruby
[19:19:44] SeepingN: has joined #ruby
[19:22:27] ramfjord: has joined #ruby
[19:22:58] gix: has joined #ruby
[19:24:56] graft: has joined #ruby
[19:24:57] graft: has joined #ruby
[19:26:51] Nicmavr: has joined #ruby
[19:42:20] cthulchu_: has joined #ruby
[19:44:32] sparc: has joined #ruby
[19:48:30] fphilipe_: has joined #ruby
[19:50:51] octos: has joined #ruby
[19:54:09] antoniogu: has joined #ruby
[19:57:26] kyrylo: has joined #ruby
[19:58:33] antong: has joined #ruby
[19:59:49] graft: has joined #ruby
[19:59:49] graft: has joined #ruby
[20:00:26] antong: has joined #ruby
[20:02:28] ShalokShalom: has joined #ruby
[20:04:06] digitalnomad: has joined #ruby
[20:07:53] fphilipe_: has joined #ruby
[20:10:25] kyrylo: has joined #ruby
[20:11:33] esp32_prog: has joined #ruby
[20:13:16] octos: has joined #ruby
[20:17:57] codefriar: has joined #ruby
[20:18:22] cadeskywalker: has joined #ruby
[20:18:58] codefriar: Ok, so I'm struggling with something that should be simple. I need to open a file, iterate over the lines, find the appropriate line (it's an alphabetical list) and INSERT a new line (not \n, but a new line of text) and save the file. Any pointers/
[20:21:09] codefriar: started with this: lines.each { |l| p 'yes' if l.include? 'PARSE' } but for whatever reason, it's printing EVERY line,
[20:22:06] moei: has joined #ruby
[20:25:11] jhass: codefriar: how do you define lines?
[20:25:19] jhass: maybe it's not actually lines
[20:25:25] codefriar: file.readlines
[20:26:41] tdy: has joined #ruby
[20:27:23] jhass: https://carc.in/#/r/6yzw
[20:27:25] jhass: seems fine
[20:30:21] jhass: codefriar: could you try to provide a self contained example like this that reproduces your issue?
[20:30:48] codefriar: i'm just an idiot. it had to do with pry being wierd and dumping the lines variable after the each statement...
[20:30:58] codefriar: scrolling up held my answer
[20:31:36] jhass: ah, ok. .each always returns the receiver so that's expected in a repl session
[20:33:45] blueflame: has joined #ruby
[20:34:52] gix-: has joined #ruby
[20:37:26] blueflame: has left #ruby: ()
[20:43:28] aspiers: has joined #ruby
[20:44:19] lupine: has joined #ruby
[20:45:51] jenrzzz: has joined #ruby
[20:56:52] Kestrel-029: has joined #ruby
[21:05:26] i9zO5AP: has joined #ruby
[21:07:22] gix: has joined #ruby
[21:15:36] octos: has joined #ruby
[21:19:56] xco: has joined #ruby
[21:30:12] octos: has joined #ruby
[21:51:40] schne1der: has joined #ruby
[21:56:31] AJA4350: has joined #ruby
[21:59:50] esp32_prog: has joined #ruby
[22:09:06] Swyper: has joined #ruby
[22:10:38] ramfjord: has joined #ruby
[22:11:44] cthulchu: has joined #ruby
[22:14:50] orbyt_: has joined #ruby
[22:15:03] houhoulis: has joined #ruby
[22:22:54] Fernando-Basso: has joined #ruby
[22:25:43] octos: has joined #ruby
[22:26:51] Nicmavr: has joined #ruby
[22:33:15] doodleb70: has joined #ruby
[22:38:21] gix: has joined #ruby
[22:55:16] fphilipe_: has joined #ruby
[22:57:23] Swyper: has joined #ruby
[22:59:22] cd: has joined #ruby
[22:59:44] tdy: has joined #ruby
[23:11:32] orbyt_: has joined #ruby
[23:16:18] duderonomy: has joined #ruby
[23:26:35] xco: is there a way to check all the classes/objects that respond to a certain method?
[23:26:39] xco: for example
[23:26:51] xco: how do i have all the class/objects that respond_to?(:empty?)
[23:27:10] xco: i know String, does, Array does respond to it and hash too i think
[23:27:22] xco: but is there a way to check for a list of this from say irb?
[23:27:32] phaul: you can walk ObjectSpace
[23:27:34] xco: something “meta-programmy” should be able to do that
[23:27:49] phaul: or call &list on the bot :P
[23:27:58] phaul: &list empty?
[23:27:58] rubydoc: Dir.empty?, ENV.empty?, File.empty?, Array#empty?, Hash#empty?, Queue#empty?, SizedQueue#empty?, String#empty?, Symbol#empty?, FileTest#empty?, CSV::FieldsConverter#empty?, DBM#empty?, GDBM#empty?, Matrix#empty?, Pathname#empty?, RDoc::Comment#empty?, RDoc::Markup::Document#empty?, RDoc::Markup::List#empty?, RDoc::Markup::ListItem#empty?, REXML::Elements#empty?, REXML::IOSource#empty?, REXML::Parsers::BaseParser#empty?, REXML::Source#empty?, REXML::Text#empty?, ...
[23:27:58] rubydoc: ... Gem::AvailableSet#empty?, Gem::Package::TarHeader#empty?, Gem::RequestSet::Lockfile::Tokenizer#empty?, Gem::Resolver::RequirementList#empty?, Gem::SourceList#empty?, SDBM#empty?, Set#empty?, StringScanner#empty?, ThreadsWait#empty?
[23:28:30] xco: what?!?! :o
[23:28:57] xco: what kind of sorcery is this? :P
[23:29:14] xco: phaul: thanks but how would i do it in the terminal?
[23:29:28] asat: has joined #ruby
[23:29:41] phaul: walk ObjectSpace
[23:30:23] phaul: &>> ObjectSpace.each_object(Class).take(10)
[23:30:26] rubydoc: # => [Monitor, #<Class:MonitorMixin>, SimpleDelegator, #<Class:URI::File>, URI::File, #<Class:Gem::Version>,... check link for more (https://carc.in/#/r/6z07)
[23:30:53] xco: yeah i saw that i’m reading it’s documentation but have no idea how to use it to check what responds_to empty? for example
[23:31:49] phaul: &>> ObjectSpace.each_object(Class).select { |klass| klass.instance_methods.include? :empty? }
[23:31:49] rubydoc: # => [Thread::SizedQueue, Thread::Queue, #<Class:FileTest>, #<Class:#<Object:0x000055c984233900>>, Hash,... check link for more (https://carc.in/#/r/6z08)
[23:33:17] xco: so this these are ALL the classes that have #empty? as intance methods right?
[23:33:49] phaul: at the point when you run the code. Ruby is dynamic.. so this list can change as the program runs
[23:33:50] xco: what if there’s something up above this “ObjectSpace” that responds to empty??
[23:35:03] phaul: ObjectSpace always includes all objects in the system.
[23:35:21] phaul: classes/ modules and every other objects too.
[23:36:49] shtirlic: has joined #ruby
[23:48:01] esp32_prog: has joined #ruby
[23:59:36] bambanx: has joined #ruby