« Back to channel list

#ruby - 07 November 2018

« Back 1 day Forward 1 day »
[00:09:12] sabrehagen: has joined #ruby
[00:10:23] sabrehagen: Hi all, I'm from outside ruby-land and was wondering if somebody would be kind enough to do an open source contribution on my part. I was wondering if somebody would take a shot at implementing my 'when' clause detailed here: https://github.com/tmuxinator/tmuxinator/issues/658
[00:11:00] sabrehagen: I've tried the authors suggestion, and found it made my config files unmaintainable for practical purposes
[00:16:59] elphe: has joined #ruby
[00:17:19] mangold: has joined #ruby
[00:18:37] renlo: has joined #ruby
[00:19:48] Inside: that seems like an insane amount of work :D
[00:20:09] renlo: so in IRB, I just did `require_relative 'some_module'` and now I have some 'Foo' thing I have access to. What the heck is 'Foo'?
[00:20:32] Inside: renlo: what's the code in 'some_module'?
[00:20:41] Milos: has joined #ruby
[00:21:28] renlo: SomeBlah::Blahh::SomeThing.some_method.other_method do\nsome_func "Foo" do .......
[00:22:07] Inside: that's really not enough to go on
[00:22:16] renlo: this language is magical
[00:23:33] renlo: oh I am silly lol, at the bottom of said file is a "Foo = ..." lol
[00:25:50] tdy: has joined #ruby
[00:26:48] Radar: renlo: gist the code next time please
[00:26:52] Radar: ?gist renlo
[00:26:52] ruby[bot]: renlo: https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
[00:27:26] renlo: proprietary code
[00:28:04] Radar: ok I'll need proprietary dollars to help out with that
[00:28:14] Inside: shoot I'll just take regular dollars
[00:28:42] Radar: Inside: wow
[00:28:47] renlo: What I wrote is what I saw, which happened to be incomplete. First time using this language and thought magic was happening
[00:29:07] renlo: so, regardless if I had gisted it or pastebinned it, would have been nonsensical
[00:29:17] renlo: and proprietary :)
[00:29:45] biberao: Inside: you forgot about me right?
[00:29:46] Radar: SomeBlah::Blahh::SomeThing
[00:29:51] Radar: renlo: you work for Vague Inc?
[00:30:04] Inside: biberao: I uhh don't have anything useful to tell you :(
[00:30:32] Inside: Radar, on the other hand, is a fantastic ruby author so he may have a good suggestion
[00:30:34] Azure: has joined #ruby
[00:30:35] venmx: has joined #ruby
[00:30:39] Radar: biberao: Well Grounded Rubyist is the one typically recommended here. It's a thick tome.
[00:30:44] renlo: again, first time using this language and thought magic was happening, the important part was the `some_func "Foo" do`, thought it was somehow injecting that into the global scope or something
[00:30:49] Radar: biberao: If you've got other programming experience, POODR might be a better book for you.
[00:32:26] biberao: let me google poodr
[00:33:23] renlo: com-poodr
[00:35:45] ruby[bot]: Practical Object Oriented Design in Ruby http://www.poodr.com/
[00:36:45] Inside: I'm almost to the testing chapter in POODR
[00:36:51] Inside: let's see just how bad I am at writing tests
[00:41:25] wolfshappen: has joined #ruby
[00:44:17] baweaver: Inside: everyone's bad at writing tests when they start
[00:45:01] baweaver: The thing to remember is that you _do_ have to write code that's actually testable, otherwise it becomes substantially more difficult.
[00:45:08] Inside: yeah absolutely
[00:45:13] Inside: but even the whole testing methodology
[00:45:32] Inside: I do mostly rails and there are so many places to plug tests in
[00:45:40] Inside: ie: models, controllers, etc
[00:45:56] baweaver: What's funny are people who insist controllers are unit testable.
[00:46:13] baweaver: If they are, you have too much logic that needs to move out.
[00:46:33] baweaver: request-wise they end up as integration tests.
[00:46:34] Inside: Here's a test I'm writing right now - how do you check that your strong parameters are correct?
[00:46:48] Inside: baweaver: Rails just calls everything an integration test now
[00:47:27] baweaver: That feels a bit carte blanche
[00:47:32] biberao: going to google
[00:47:43] renlo: coming from Python I feel like I'm in bizarro land lol
[00:47:48] renlo: "strong parameters" for instance
[00:47:56] Inside: https://guides.rubyonrails.org/testing.html#a-brief-note-about-test-cases
[00:48:02] renlo: "With strong parameters, Action Controller parameters are forbidden to be used in Active Model mass assignments until they have been permitted"
[00:48:04] Inside: renlo: it's a framework specific feature, has nothing to do with ruby
[00:48:16] baweaver: Pretty much.
[00:48:21] Inside: Those are all ruby on rails terms
[00:48:26] renlo: sure, still is odd, Django didnt have weirdness like that I dont think
[00:49:01] baweaver: Consider that you have a users controller that allows updates. Strong params keeps you from tacking on an is_admin = true flag in a request editor
[00:49:08] Inside: renlo: translation is basically "In rails, you have to specify which parameters a controller is allowed to update in a model using a white list"
[00:49:12] baweaver: All frameworks have their novelties.
[00:49:26] renlo: ah got it, makes sense
[00:51:01] baweaver: ACTION needs to learn to modify parser.y to implement more fun ideas into Ruby.
[00:52:08] biberao: you're a core ruby dev?
[00:58:10] baweaver: Some day, perhaps, but no.
[01:04:10] alicef: has joined #ruby
[01:05:24] Azure: has joined #ruby
[01:05:49] Inside: Bleh. 50 lines of code to test 15 lines of controller code to raise code coverage 0.1%
[01:09:37] Some-body_: has joined #ruby
[01:10:06] blackmesa: has joined #ruby
[01:13:02] patr0clus: has joined #ruby
[01:14:25] chouhoulis: has joined #ruby
[01:14:30] Radar: Inside: can I see the controller test?
[01:14:50] Radar: or is it proprietary?
[01:15:49] Inside: https://gist.github.com/Insood/a24b12eea9999a47e8cc7692734c8636
[01:15:51] Inside: nothing fancy in here
[01:19:33] sameerynho: has joined #ruby
[01:25:08] Radar: I'm having connectivity issues to GitHub at the moment
[01:25:15] Radar: "gist.github.com took too long to respond."
[01:25:19] Flonk: has joined #ruby
[01:25:32] ged: has joined #ruby
[01:26:29] cow[moo]: has joined #ruby
[01:27:18] mahlon: has joined #ruby
[01:28:22] rubydoc: did not understand that, parser error @ char position 0
[01:28:49] Radar: Inside: I wonder if there is a better way of approaching this: https://gist.github.com/Insood/a24b12eea9999a47e8cc7692734c8636#file-section-rb-L26
[01:29:12] Radar: Like, could you make that sample user already have that role somehow?
[01:29:13] Inside: I was wondering about that too
[01:29:29] jetchisel: has joined #ruby
[01:29:29] Inside: The check is actually a call to the active directory
[01:29:44] Inside: Which I think might be a terrible idea
[01:31:55] Inside: https://gist.github.com/Insood/0e7503b2d4726267518b79f1718980ac
[01:32:09] Inside: It's a bit terrifying as to house of cards that this system is built on
[01:35:15] mahlon: has joined #ruby
[01:38:14] orbyt_: has joined #ruby
[01:46:09] alicef: has joined #ruby
[01:51:18] Radar: Yeah, that is where you might run into some trouble. I'd probably have a proxy class that decided which to use: ActiveDirectoryLookup or FakeActiveDirectoryLookup, depending on Rails.env.test?
[01:51:53] Radar: FakeAD would just be some plain Ruby methods that would return true in some cases... maybe backed by a DB? I'm not convinced of my own idea. It would take some playing around.
[01:55:52] arescorpio: has joined #ruby
[01:56:21] sp3ncer: has joined #ruby
[02:10:59] esrse: has joined #ruby
[02:12:02] stooj: has joined #ruby
[02:19:01] elphe: has joined #ruby
[02:19:08] Exuma: has joined #ruby
[02:25:45] bmurt: has joined #ruby
[02:30:35] TheBloke: has joined #ruby
[02:32:45] sp3ncer: has joined #ruby
[02:37:09] sp3ncer_: has joined #ruby
[02:39:49] sp3ncer: has joined #ruby
[02:43:08] mroutis: has joined #ruby
[02:43:50] arescorpio: has joined #ruby
[02:55:54] xfbs: has joined #ruby
[03:05:03] mangold: has joined #ruby
[03:07:32] sanscoeur: has joined #ruby
[03:15:27] c0ncealed4: has joined #ruby
[03:19:33] thejs: has joined #ruby
[03:20:23] sameerynho: has joined #ruby
[03:21:29] za1b1tsu: has joined #ruby
[03:21:31] Paraxial: has joined #ruby
[03:27:27] Paraxial: has joined #ruby
[03:34:56] GodFather: has joined #ruby
[03:50:14] Emmanuel_Chanel: has joined #ruby
[04:09:06] braincrash: has joined #ruby
[04:12:54] lunarkitty7: has joined #ruby
[04:21:03] darkhanb: has joined #ruby
[04:22:24] SeepingN: has joined #ruby
[04:31:13] dellavg_: has joined #ruby
[04:33:05] havenwood: 'halloooo'.tr('a', 'e').squeeze('o')
[04:36:14] havenwood: Are we far enough past 1.8 we can safely embrace ?x character literal?
[04:36:31] havenwood: ACTION leans towards "yes"
[04:36:54] SeepingN: ACTION agrees
[04:37:26] SeepingN: I mean I had the oldest install in existance and even that is up to 2.0 now at least
[04:40:38] conta: has joined #ruby
[04:40:39] havenwood: 'halloooo'.tr(?a, ?e).squeeze(?o)
[04:42:34] ivanskie: has joined #ruby
[04:47:54] Pisuke: has joined #ruby
[04:49:34] sauvin: has joined #ruby
[04:51:40] mroutis: has joined #ruby
[04:52:00] Fusl: has joined #ruby
[05:01:36] johnny56: has joined #ruby
[05:07:22] sameerynho: has joined #ruby
[05:22:31] mangold: has joined #ruby
[05:34:49] kapil____: has joined #ruby
[05:40:44] asphyxia: has joined #ruby
[05:42:13] hamms: has joined #ruby
[05:42:37] aufi: has joined #ruby
[05:43:00] cgfbee: has joined #ruby
[05:57:32] drbrain: has joined #ruby
[05:59:05] GodFather: has joined #ruby
[06:06:03] drbrain: has joined #ruby
[06:10:04] jtdowney: has joined #ruby
[06:10:16] clemens3: has joined #ruby
[06:14:55] conta: has joined #ruby
[06:21:08] drbrain: has joined #ruby
[06:22:14] xuanrui: has joined #ruby
[06:22:31] reber: has joined #ruby
[06:28:38] drbrain: has joined #ruby
[06:34:37] ur5us: has joined #ruby
[06:44:14] Fusl: has joined #ruby
[06:54:29] asphyxia: has joined #ruby
[06:56:52] Exagone313: has joined #ruby
[07:00:58] eckhardt: has joined #ruby
[07:07:11] marmotini_: has joined #ruby
[07:07:52] roshanavand: has joined #ruby
[07:10:53] sanscoeur: has joined #ruby
[07:15:14] _whitelogger: has joined #ruby
[07:18:56] roshanavand1: has joined #ruby
[07:23:16] whysthatso: has joined #ruby
[07:27:22] asphyxia: has joined #ruby
[07:49:19] GodFather: has joined #ruby
[07:59:49] marz_d`ghostman: has joined #ruby
[08:04:14] marz_d`ghostman: Having multiple expect inside an it block doesn't seem to work. Exit doesn't seem to be invoke as I'm getting 'expected :exit to be thrown, got nothing' error: https://gist.github.com/marzdgzmn/0d66c7d34a0175f217bd1c5d52027ba6
[08:15:54] aufi: has joined #ruby
[08:16:15] sauvin: has joined #ruby
[08:19:00] sauvin_: has joined #ruby
[08:20:29] claudiuinberlin: has joined #ruby
[08:21:39] clemens3: has joined #ruby
[08:22:01] burgestrand: has joined #ruby
[08:24:25] stooj: has joined #ruby
[08:31:28] marz_d`ghostman: so the statements inside after(:each) is also counted inside the it blocks, I have expect(File).to receive(:delete).with(arguments) inside my it block and one inside my after(:each), it counts twice.
[08:31:43] mangold: has joined #ruby
[08:33:54] jokke: has joined #ruby
[08:48:27] jmcgnh: has joined #ruby
[08:52:35] clemens3_: has joined #ruby
[09:07:44] JamieD: has joined #ruby
[09:13:17] blackmesa: has joined #ruby
[09:40:45] venmx: has joined #ruby
[09:42:56] xfbs: has joined #ruby
[09:47:10] Guest53511: has joined #ruby
[09:48:17] xfbs: has joined #ruby
[09:52:04] xfbs_: has joined #ruby
[09:55:16] conta1: has joined #ruby
[10:00:52] Xiti: has joined #ruby
[10:09:30] mangold: has joined #ruby
[10:11:46] conta1: has joined #ruby
[10:12:55] voiceftp: has joined #ruby
[10:18:46] za1b1tsu: has joined #ruby
[10:23:09] burgestrand: has joined #ruby
[10:36:17] apparition: has joined #ruby
[10:41:07] tuor: has joined #ruby
[10:46:18] Xeago_: has joined #ruby
[10:47:16] conta1: has joined #ruby
[10:50:45] strk: has joined #ruby
[10:51:12] strk: already initialized constant ... how to avoid that ? I'd actually even prefer to have the constant set ONLY if not set
[10:51:24] strk: as it's in a snippet included from elsewhere so it is nice if caller can override
[10:55:54] sonne: strk: CONSTNAME ||= 123 ?
[10:59:59] strk: thanks sonne
[11:00:57] dionysus69: has joined #ruby
[11:04:12] petemoore: has left #ruby: ()
[11:06:16] conta1: has joined #ruby
[11:19:21] prestorium: has joined #ruby
[11:22:25] themsay: has joined #ruby
[11:23:36] beefjoe: has joined #ruby
[11:37:14] conta1: has joined #ruby
[11:40:18] moei: has joined #ruby
[11:46:02] mangold: has joined #ruby
[11:47:22] gix: has joined #ruby
[11:56:10] k0mpa: has joined #ruby
[11:59:02] burgestrand: has joined #ruby
[12:10:56] AJA4350: has joined #ruby
[12:11:32] whysthatso: has joined #ruby
[12:18:54] Bish: kann mir jemand mit geilem backlog sagen warum ich gehighlighted wurde?
[12:19:08] Bish: oopsy, i have been highlighted, can someone tell me who did it
[12:19:14] Bish: thought this was a german channel, sorry?
[12:19:31] Bish: nevermind i found it
[12:19:36] Bish: havenwood: yes, that's what i did, thank you
[12:21:04] strk: has left #ruby: ()
[12:29:13] devyn: has joined #ruby
[12:39:24] conta1: has joined #ruby
[12:41:14] bmurt: has joined #ruby
[12:45:39] troulouliou_div2: has joined #ruby
[12:46:35] TheBloke: has joined #ruby
[12:49:22] cow[moo]: has joined #ruby
[12:52:25] vondruch: has joined #ruby
[12:52:37] voolik: has joined #ruby
[12:56:02] JamieD: has joined #ruby
[12:59:00] nicolasb: has joined #ruby
[13:05:13] GodFather: has joined #ruby
[13:11:45] theRoUS: has joined #ruby
[13:12:07] hays: has joined #ruby
[13:12:32] theRoUS: hoe does one write a gem that can be used to add step definitions to the standard ones provided by base cucumber?
[13:12:39] theRoUS: s/hoe/how/
[13:17:27] Guest53511: has joined #ruby
[13:26:26] Bish: hows before hoes
[13:31:12] theRoUS: like something i can put in env.rb that will add the `step_definitions` tree from the additional gem
[13:32:05] theRoUS: there appears to be no loadpath like $: for cucumber, as it were
[13:41:07] Guest53511: has joined #ruby
[13:43:19] nima_m: has joined #ruby
[13:52:13] houhoulis: has joined #ruby
[13:59:13] fluxAeon: has joined #ruby
[14:03:08] conta: has joined #ruby
[14:04:36] dmitch: has joined #ruby
[14:13:17] reber: has joined #ruby
[14:15:23] Nicmavr: has joined #ruby
[14:23:22] asphyxia: has joined #ruby
[14:29:03] DTZUZO: has joined #ruby
[14:29:28] moeSizlak: has joined #ruby
[14:34:49] cow[moo]: has joined #ruby
[14:35:12] wildermind: has joined #ruby
[14:38:57] burgestrand: has joined #ruby
[14:39:46] rwb: has joined #ruby
[14:41:08] za1b1tsu: has joined #ruby
[14:51:31] burgestrand: has joined #ruby
[14:56:28] rippa: has joined #ruby
[14:59:56] zming: has joined #ruby
[15:00:57] k0mpa: has joined #ruby
[15:00:58] conta: has joined #ruby
[15:02:20] vondruch_: has joined #ruby
[15:02:44] Rapture: has joined #ruby
[15:05:59] Guest53511: has joined #ruby
[15:12:26] im0nde: has joined #ruby
[15:15:16] c0ncealed4: has joined #ruby
[15:25:34] aufi: has joined #ruby
[15:27:42] mangold: has joined #ruby
[15:44:00] Inline: has joined #ruby
[15:44:55] moeSizlak: has left #ruby: ("Leaving")
[15:52:01] xfbs: has joined #ruby
[15:56:36] venmx: has joined #ruby
[16:00:39] Dbugger: has joined #ruby
[16:03:43] orbyt_: has joined #ruby
[16:04:14] vondruch: has joined #ruby
[16:06:20] eddof13: has joined #ruby
[16:08:23] jetchisel: has joined #ruby
[16:15:59] eddof13: has joined #ruby
[16:17:49] TheBloke: has joined #ruby
[16:20:09] chouhoulis: has joined #ruby
[16:20:59] chouhoulis: has joined #ruby
[16:25:28] Inline: has joined #ruby
[16:29:51] gray_-_wolf: has joined #ruby
[16:39:08] nsxt: has joined #ruby
[16:40:25] nsxt: Totally baffled by a golfed expression I came across today. Looking for some help in comprehending the expression within .map {}:
[16:40:29] nsxt: ->n,l{l.slice_when{|x,y|x<y-1}.map{|x|x[n-1]?x.minmax.uniq*?-:x}*?,}
[16:48:11] mangold: has joined #ruby
[16:49:46] canton7: there's a ternary in there
[16:50:18] canton7: x[n - 1] ? (x.minmax.uniq * '-') : x
[16:52:01] nsxt: What is .uniq*?-:x}*?, doing?
[16:52:06] jetchisel: has joined #ruby
[16:52:15] nsxt: Particularly, the first and last question mark?
[16:52:34] gray_-_wolf: ?- is same as '-'
[16:52:34] ruby[bot]: gray_-_wolf: I don't see no is, whom should I tell about -?
[16:52:45] gray_-_wolf: ?- is same as '-'
[16:53:01] nsxt: Wow... Question mark can be used to quote a character literal?
[16:53:20] gray_-_wolf: one character ones :) and rubocop yells at you for it ;)
[16:53:42] canton7: you pretty much only see it in golf
[16:53:55] nsxt: Crazy. Thanks so much!
[16:58:38] im0nde: has joined #ruby
[16:59:23] blackmesa1: has joined #ruby
[17:02:10] jcarl43: has joined #ruby
[17:02:42] phaul: has joined #ruby
[17:08:03] Xiti: has joined #ruby
[17:09:53] havenwood: nsxt: In Ruby 1.8 and earlier, the character literal returned an integer. Then in 1.9 it changed to return the single-character string.
[17:10:20] havenwood: nsxt: Because of the breaking change, it fell into disfavor. That should probably change now that 1.8 is long gone.
[17:10:43] havenwood: 1.8: ?x #=> 120
[17:10:50] havenwood: 1.9: ?x #=> "x"
[17:11:29] beowuff: has joined #ruby
[17:12:26] canton7: it's also impossible to google for if you don't know what it does, so it's not very discoverable
[17:12:36] canton7: and it's only one char shorter than just using quotes
[17:13:28] Inside: has joined #ruby
[17:15:04] al2o3-cr: has joined #ruby
[17:15:23] orbyt_: has joined #ruby
[17:15:26] darkhanb: has joined #ruby
[17:15:38] havenwood: %i() etc are also hard to google, but not too bad to cover in a quick ref
[17:16:40] havenwood: i was just watching a presentation on how android studio helps new devs discover what things are
[17:18:09] havenwood: i don't know that there's an ide smart enough to reveal what a char literal is in Ruby
[17:18:17] mroutis: has joined #ruby
[17:18:50] havenwood: i guess it's not hard to pull from Ripper or disassembled YARV.
[17:22:57] Eiam: i google 'ruby literals' and just search for it on one of the pages
[17:23:30] Eiam: but you have to know they are called literals to find that too, otherwise 'ruby &:' is ehh
[17:23:53] sanscoeur: has joined #ruby
[17:30:44] havenwood: it's a shame GitHub, Google, etc fail at symbols
[17:31:07] havenwood: SymbolHound does find it
[17:32:49] Eiam: general purpose tools
[17:33:04] Eiam: vs a specialized tool
[17:34:44] chouhoulis: has joined #ruby
[17:38:27] darkhanb: has joined #ruby
[17:40:20] chouhoulis: has joined #ruby
[17:40:22] elphe: has joined #ruby
[17:46:39] chouhoulis: has joined #ruby
[17:47:44] JamieD: has joined #ruby
[17:48:04] SeepingN_: has joined #ruby
[17:52:17] chouhoulis: has joined #ruby
[17:56:55] za1b1tsu: has joined #ruby
[18:00:22] Cthulu201: has joined #ruby
[18:04:32] armatechnicos: has joined #ruby
[18:07:35] renlo: has joined #ruby
[18:09:37] jesfre: has joined #ruby
[18:15:49] xfbs_: has joined #ruby
[18:20:56] prestorium: has joined #ruby
[18:21:24] sanscoeur: has joined #ruby
[18:23:00] xfbs: has joined #ruby
[18:28:19] cow[moo]: has joined #ruby
[18:36:48] eckhardt_: has joined #ruby
[18:44:01] nofxx: has joined #ruby
[18:44:32] lxsameer: has joined #ruby
[18:58:20] mroutis: has joined #ruby
[19:01:07] Lytol: has joined #ruby
[19:05:57] renlo: has joined #ruby
[19:07:44] whysthatso: has joined #ruby
[19:14:18] za1b1tsu: has joined #ruby
[19:19:11] whysthatso: has joined #ruby
[19:23:40] despai: has joined #ruby
[19:23:56] weaksauce: has joined #ruby
[19:27:06] JamieD: has joined #ruby
[19:28:59] elphe: has joined #ruby
[19:49:22] blackmesa: has joined #ruby
[19:55:59] ur5us: has joined #ruby
[19:57:04] SeepingN: has joined #ruby
[19:57:38] renlo: has joined #ruby
[19:58:04] Rapture: has joined #ruby
[20:02:28] za1b1tsu: has joined #ruby
[20:33:47] niceperl: has joined #ruby
[20:34:16] phaul: has joined #ruby
[20:35:33] blackmesa: has joined #ruby
[20:46:09] niceperl: has joined #ruby
[20:47:54] iamdevnul: has joined #ruby
[20:48:03] mattwc: has joined #ruby
[20:48:10] pyrmont: has joined #ruby
[20:48:18] Chew: has joined #ruby
[20:48:28] gmcintire: has joined #ruby
[20:48:45] raggi: has joined #ruby
[20:49:17] darthThorik: has joined #ruby
[20:49:23] hsiktas: has joined #ruby
[20:49:24] pwillard: has joined #ruby
[20:49:31] jhill: has joined #ruby
[20:49:42] ec: has joined #ruby
[20:49:43] madhatter: has joined #ruby
[20:50:05] venmx: has joined #ruby
[20:50:46] timeless: has joined #ruby
[20:56:03] whathappens: has joined #ruby
[21:04:16] jesfre: has joined #ruby
[21:04:49] eckhardt_: has joined #ruby
[21:07:11] za1b1tsu: has joined #ruby
[21:14:08] ebl: has joined #ruby
[21:14:41] leitz: has joined #ruby
[21:15:42] eckhardt_: has joined #ruby
[21:17:06] venmx: has joined #ruby
[21:27:02] mroutis: has joined #ruby
[21:29:21] kapil____: has joined #ruby
[21:38:00] roshanavand: has joined #ruby
[21:38:11] ellcs: has joined #ruby
[21:38:46] SeepingN: has joined #ruby
[21:39:49] mochiyoda: has joined #ruby
[21:41:18] ebl: I'm getting what I believe it's inconsistent behaviour between String#<=> and Array#sort (which docs say uses <=>) with an array of strings. Could this be a ruby bug? https://hastebin.com/fodetojuji.rb
[21:41:44] nexraf1: has joined #ruby
[21:42:17] postmodern: has joined #ruby
[21:43:54] phaul: ebl fwiw I cannot reproduce it on 2.5.3
[21:44:41] phaul: ["Password", "Email"].sort # => ["Email", "Password"]
[21:44:49] rokumatsumoto: has joined #ruby
[21:45:04] ebl: phaul, thanks for testing. i'm reproducing on 2.4.0, 2.4.1 and 2.4.3 (mac and linux builds)
[21:45:52] Eiam: 2.3.7 i see the same as phaul
[21:47:07] ebl: i'll see if there is anything on their bug trackers
[21:49:02] renlo: has joined #ruby
[21:53:37] rokumatsumoto: has joined #ruby
[21:58:35] k0mpa: has joined #ruby
[21:58:53] Radar: I cannot reproduce it on Ruby 2.5.1
[21:59:00] AJA4350: has joined #ruby
[21:59:16] niceperl: has joined #ruby
[21:59:18] Radar: Sorry, I _can_ reproduce it on 2.5.1
[21:59:22] ebl: i've just installed ruby 2.5.3 and i'm still getting the error
[21:59:23] Radar: irb(main):001:0> ["Password", "Email"].sort
[21:59:23] Radar: => ["Password", "Email"]
[21:59:27] ebl: this gets weirder by the minute
[21:59:37] Radar: On 2.3.7 I see:
[21:59:38] Radar: ["Password", "Email"].sort
[21:59:38] Radar: => ["Email", "Password"]
[21:59:47] vondruch_: has joined #ruby
[22:00:37] vondruch: has joined #ruby
[22:02:10] ebl: phaul, are you on linux?
[22:02:19] phaul: ebl: yes.
[22:02:56] phaul: ebl: you can play with carc.in with all the versions... to narrow it down
[22:03:06] phaul: when it was introduced and fixed
[22:03:52] ebl: thanks, i'll try and do that
[22:05:06] lypsis: has joined #ruby
[22:05:59] kaleido: has joined #ruby
[22:07:03] ebl: i think i've found it. it seems like there is a special character on "Email" on the second sort. those who copy pasted probably got the same result.
[22:07:37] ebl: thanks everyone who helped and sorry for wasting your time with a stupid hidden character :(
[22:08:07] lypsis: has joined #ruby
[22:08:31] al2o3-cr: The result is not guaranteed to be stable. When the comparison of two elements returns 0, the order of the elements is unpredictable. (from the docs.)
[22:09:00] ebl: yes, but the comparison does not return 0 in this case
[22:10:05] al2o3-cr: ebl: nvm, disregard that.
[22:14:03] sanscoeur: has joined #ruby
[22:14:53] rwb: has joined #ruby
[22:16:08] mochiyoda: has joined #ruby
[22:17:43] rokumatsumoto: has joined #ruby
[22:18:31] al2o3-cr: ebl: yeah, your example has a BOM.
[22:18:34] Radar: ["Password", "Email"].map(&:chars)
[22:18:34] Radar: => [["P", "a", "s", "s", "w", "o", "r", "d"], ["", "E", "m", "a", "i", "l"]]
[22:18:59] Radar: >> ["Password", "Email"].map(&:codepoints)
[22:19:00] Radar: => [[80, 97, 115, 115, 119, 111, 114, 100], [65279, 69, 109, 97, 105, 108]]
[22:19:05] ruby[bot]: Radar: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[22:19:11] Radar: ruby[bot]: dead to me
[22:21:31] al2o3-cr: ["Password", "Email"].map(&:chars)[1][0].bytes.pack('C3') == "\xEF\xBB\xBF" that's a BOM if ever i saw one.
[22:22:58] ebl: yeah, i saw that too when i `unpack`ed the strings. should have started there, my bad
[22:24:32] OrangeManBad: has joined #ruby
[22:27:37] al2o3-cr: ebl: np dude, things are never what they seem... sometimes =)
[22:30:05] al2o3-cr: Radar: should be fixed soon, phaul has send a pr.
[22:30:18] Radar: al2o3-cr: Depends on when apieros deploys it
[22:30:20] Radar: could be years
[22:30:44] al2o3-cr: Radar: yeah, that too. =)
[22:31:09] phaul: tbh. I could just quickly move the functionality into rubydoc... even if temporarily
[22:32:21] dbugger_: has joined #ruby
[22:33:18] al2o3-cr: phaul: if you could get permission temporarily, i couldn't see a problem.
[22:34:43] phaul: if its behind a different command they wont even step on each others feet
[22:34:43] al2o3-cr: phaul: i'd ask one of the ops to see if it would be acceptable.
[22:36:18] phaul: yeah I don't want to start a mutiny :)
[22:36:32] phaul: also don't want to do it behind apeiros's back
[22:36:56] al2o3-cr: phaul: that why i'd ask one of the ops first.
[22:38:18] jesfre: has joined #ruby
[22:38:37] al2o3-cr: phaul: Radar seems to have all pivileges.
[22:38:48] al2o3-cr: according to the access list.
[22:39:02] Radar: al2o3-cr: I don't think access list == bot access
[22:39:36] Radar: phaul: I'd be okay with it if it meant we had an interpreter that worked in-channel
[22:39:59] phaul: ok, I'll put something together tomorrow
[22:40:02] Radar: thank you
[22:40:13] nicolasb: has joined #ruby
[22:40:28] al2o3-cr: Radar: sorry, yeah that is what i meant.
[22:40:35] phaul: let's keep the rubydoc prefix of &
[22:40:43] rubydoc: did not understand that, parser error @ char position 0
[22:40:55] Radar: sounds good to me
[22:41:04] al2o3-cr: phaul: i'd agree.
[22:41:47] al2o3-cr: at least we would have a working bot in the mean time.
[22:42:46] al2o3-cr: apeiros is probably busy doing other things, idk.
[22:44:02] al2o3-cr: phaul: btw, which http api did you decide to use?
[22:44:22] phaul: the one you showed me
[22:44:41] al2o3-cr: typhoeus, good choice. =)
[22:46:59] jesfre: Is the :: operator the same thing for classes and modules as using dot notation or bracket notation when looking into nested JSON dictionaries?
[22:47:00] Inside: How much can you hide in codepoints?
[22:47:13] Inside: People are copy pasting the code to execute it
[22:47:44] Inside: Could you do a sql-injection-type attack?
[22:48:56] al2o3-cr: Inside: hardly, BOM -> zero width no-break space.
[22:53:37] al2o3-cr: Inside: try this: `eval "cHV0cyAnSGVsbG8sIEluc2lkZS4n".unpack1 'm0'`
[22:53:59] Inside: ACTION squints.
[22:55:09] za1b1tsu: has joined #ruby
[22:55:59] Inside: "aGVsbG8gdG8geW91IHRvbw=="unpack1 'm0' :P
[22:57:36] al2o3-cr: it was going to be intel, but i didn't think you'd get it ;)
[23:03:37] al2o3-cr: intel inside.
[23:06:34] PaulePanter: has joined #ruby
[23:06:52] PaulePanter: Hi. The ZDNS JSON output, just seems to put a JSON object on each line.
[23:06:52] PaulePanter: https://paste.debian.net/1050846/
[23:07:03] PaulePanter: The Ruby JSON parser complains about that.
[23:07:12] PaulePanter: Do you know if that is valid JSON?
[23:09:50] al2o3-cr: PaulePanter: yeah, it's valid json.
[23:10:59] al2o3-cr: PaulePanter: in what way does it complain?
[23:16:26] al2o3-cr: PaulePanter: try using single quotes when passing to JSON.parse if that is what you mean.
[23:18:47] nchambers: PaulePanter: works fine here
[23:19:11] PaulePanter: al2o3-cr: I open the file with these lines, and then pass that to JSON.parse.
[23:22:22] al2o3-cr: PaulePanter: it won't work like that, as there are two objects.
[23:24:15] PaulePanter: So, I have to parse each line as JSON?
[23:24:39] PaulePanter: https://paste.debian.net/1050850/
[23:25:25] PaulePanter: Or is adding a JSON object on separate lines without a delimiter not a valid JSON file?
[23:28:48] za1b1tsu: has joined #ruby
[23:29:14] al2o3-cr: PaulePanter: it two valid json objects, it should be delimited by a comma to be as one.
[23:33:27] PaulePanter: Understood. I’ll open an issue at zdns.
[23:34:18] al2o3-cr: PaulePanter: the only way to make that work is; File.read('json').chomp("\n\n").split.map &JSON.method(:parse)
[23:34:38] al2o3-cr: others might have better suggestions.
[23:35:23] PaulePanter: Looks like I also need to put [] around it in the file to make it an array.
[23:35:39] al2o3-cr: PaulePanter: no.
[23:36:10] PaulePanter: al2o3-cr: If I edited my “JSON” file and put a comma between the two objects, JSON.parse still complained.
[23:36:48] al2o3-cr: PaulePanter: you have to wrap it in single quotes or %()
[23:37:10] al2o3-cr: btw, that example was wrong. one sec.
[23:37:29] al2o3-cr: %() mean to escape the double quotes.
[23:39:48] PaulePanter: al2o3-cr: Sorry, I didn’t mean [] to use in the Ruby code, but just editing the JSON file.
[23:40:08] PaulePanter: json_verify von yail seems to agree.
[23:40:26] PaulePanter: Anyway, it seems to be a zdns issue (or me misreading something about the output format).
[23:40:31] PaulePanter: Thank you very much for your help.
[23:47:38] al2o3-cr: PaulePanter: that is one messed up api if it delivers it that way.
[23:48:47] venmx: has joined #ruby
[23:50:55] al2o3-cr: PaulePanter: to get around it for now you could do; File.read('json').split("\n").each_with_object({}) { |js, h| h.update(JSON.parse(js)) }
[23:51:11] nexraf1: has joined #ruby
[23:58:51] daemonwrangler: has joined #ruby