« Back to channel list

#ruby - 14 May 2018

« Back 1 day Forward 1 day »
[00:04:10] bmurt: has joined #ruby
[00:11:08] houhoulis: has joined #ruby
[00:11:58] arashb: has joined #ruby
[00:16:36] donofrio: has joined #ruby
[00:17:33] agent_white: has joined #ruby
[00:19:49] orbyt_: has joined #ruby
[00:21:57] bmurt: has joined #ruby
[00:25:54] karapetyan: has joined #ruby
[00:52:05] denkweise: has joined #ruby
[00:53:31] cschneid_: has joined #ruby
[00:57:27] cschneid_: has joined #ruby
[00:59:19] n0m4d1c: has joined #ruby
[00:59:35] govg: has joined #ruby
[00:59:47] banisterfiend: has joined #ruby
[01:00:40] dc2: has joined #ruby
[01:03:03] cschneid_: has joined #ruby
[01:05:55] alfiemax: has joined #ruby
[01:16:05] jottr: has joined #ruby
[01:17:18] cschneid_: has joined #ruby
[01:18:46] chocoelho: has joined #ruby
[01:19:01] cschneid_: has joined #ruby
[01:21:33] arashb: has joined #ruby
[01:26:01] kmurphy4_: has joined #ruby
[01:26:07] cschneid_: has joined #ruby
[01:26:20] cschneid_: has joined #ruby
[01:36:03] arashb: has joined #ruby
[01:45:46] arashb: has joined #ruby
[01:46:36] bmurt: has joined #ruby
[01:49:18] dinfuehr: has joined #ruby
[01:50:18] gizmore|2: has joined #ruby
[01:55:34] arashb: has joined #ruby
[01:55:41] vladdypwnz: has joined #ruby
[01:56:12] yxhuvud: has joined #ruby
[02:08:35] duderonomy: has joined #ruby
[02:09:23] jnollette: has joined #ruby
[02:11:04] redlegion: has joined #ruby
[02:19:50] howdoi: has joined #ruby
[02:25:26] ebl18_: has joined #ruby
[02:25:32] ebl18_: Sorry to bother, I'm a full stack developer of broad experience, I need to earn some pocket money in part-time ASAP. I can do Python Django, Java EE, Node.js, React, Angular, Web scraping etc. Contact me if you need, Email: pippobox@gmail.com, Telegram: @lit2014 ((https://t.me/lit2014) Small projects prefered.
[02:25:49] vladdypwnz: has joined #ruby
[02:26:05] baweaver: Probably won't have much luck with getting jobs for those in a Ruby channel
[02:26:35] havenwood: ebl18_: How about Ruby?
[02:28:10] ebl18_: I have only do a tiny project of modify redmine source code which is in ruby.
[02:28:59] cschneid_: has joined #ruby
[02:29:20] ebl18_: If you don't mind I'll try, as I'm very familiar with JavaEE,Node.js, etc., It will be much quicker for me than novices.
[02:29:24] jnollette: has joined #ruby
[02:30:20] arescorpio: has joined #ruby
[02:32:24] cschneid_: has joined #ruby
[02:35:51] dc2: has joined #ruby
[02:38:32] BTRE: has joined #ruby
[02:45:32] cschneid_: has joined #ruby
[03:00:11] cadillac_: has joined #ruby
[03:04:37] jnollette: has joined #ruby
[03:10:49] gheegh: has joined #ruby
[03:16:58] jottr: has joined #ruby
[03:17:31] w0b: has joined #ruby
[03:24:10] tuskkk___: has joined #ruby
[03:27:24] alfiemax: has joined #ruby
[03:27:37] ciscam: has joined #ruby
[03:31:25] kapil___: has joined #ruby
[04:02:11] karapetyan: has joined #ruby
[04:07:12] ciscam: has joined #ruby
[04:13:55] jrheaton: has joined #ruby
[04:15:08] memo1: has joined #ruby
[04:15:22] reber: has joined #ruby
[04:21:22] govg: has joined #ruby
[04:25:41] orbyt_: has joined #ruby
[04:35:02] govg: has joined #ruby
[04:43:26] jrheaton: has joined #ruby
[04:44:54] j0bk: has joined #ruby
[04:54:46] schleppel: has joined #ruby
[05:12:08] xuyuheng: has joined #ruby
[05:13:36] conta: has joined #ruby
[05:14:14] caleBOT: has joined #ruby
[05:14:15] caleBOT_: has joined #ruby
[05:14:49] cadillac_: has joined #ruby
[05:17:49] jottr: has joined #ruby
[05:24:23] alfiemax: has joined #ruby
[05:25:18] caleBOT_: has joined #ruby
[05:25:18] caleBOT: has joined #ruby
[05:28:02] anisha: has joined #ruby
[05:33:15] Jameser: has joined #ruby
[05:37:24] ramfjord: has joined #ruby
[05:38:00] cadillac_: has joined #ruby
[05:38:29] xuyuheng: has joined #ruby
[05:42:09] ur5us: has joined #ruby
[05:43:10] tvw: has joined #ruby
[05:49:46] alfiemax: has joined #ruby
[05:51:52] Jameser: has joined #ruby
[05:58:35] blackmesa: has joined #ruby
[06:01:33] blackmesa: has joined #ruby
[06:13:13] conta: has joined #ruby
[06:13:24] rkazak: has joined #ruby
[06:30:42] yeticry: has joined #ruby
[06:33:50] eblwork18: has joined #ruby
[06:37:01] apeiros_: has joined #ruby
[06:37:11] caleBOT: has joined #ruby
[06:37:12] caleBOT_: has joined #ruby
[06:37:44] caleBOT__: has joined #ruby
[06:37:46] caleBOT__: has joined #ruby
[06:41:00] caleBOT__: has joined #ruby
[06:41:01] caleBOT__: has joined #ruby
[06:43:51] armyriad: has joined #ruby
[06:47:24] amar: has joined #ruby
[07:02:06] suukim: has joined #ruby
[07:03:47] Jameser: has joined #ruby
[07:04:43] yeticry: has joined #ruby
[07:07:30] mohsen_1: has joined #ruby
[07:10:25] eblwork18: has joined #ruby
[07:11:35] Jameser: has joined #ruby
[07:12:40] rabajaj: has joined #ruby
[07:14:04] roshanavand: has joined #ruby
[07:18:43] jottr: has joined #ruby
[07:24:44] avelldiroll: has joined #ruby
[07:25:50] burgestrand: has joined #ruby
[07:26:35] yohji: has joined #ruby
[07:30:44] ikbenhet: has joined #ruby
[07:33:03] ellcs: has joined #ruby
[07:33:24] dionysus69: has joined #ruby
[07:33:31] za1b1tsu: has joined #ruby
[07:35:33] leslie: has joined #ruby
[07:42:40] n13z: has joined #ruby
[07:44:07] vondruch: has joined #ruby
[07:44:35] DoubleMalt: has joined #ruby
[07:48:58] karapetyan: has joined #ruby
[07:51:41] aupadhye: has joined #ruby
[07:52:13] mikecmpbll: has joined #ruby
[07:58:01] Jameser: has joined #ruby
[07:58:08] tomphp: has joined #ruby
[07:59:28] Yzguy: has joined #ruby
[08:01:28] marr: has joined #ruby
[08:02:47] mikecmpbll: has joined #ruby
[08:12:10] mniip: has joined #ruby
[08:12:30] Jameser: has joined #ruby
[08:14:50] linduxed: has joined #ruby
[08:15:27] guille-moe: has joined #ruby
[08:18:38] amar: has joined #ruby
[08:24:43] ellcs: has joined #ruby
[08:25:50] mniip: has joined #ruby
[08:27:21] amar: has joined #ruby
[08:28:01] amar: has joined #ruby
[08:28:02] Jameser: has joined #ruby
[08:37:03] sysvalve: has joined #ruby
[08:37:23] alfiemax: has joined #ruby
[08:41:07] n13z: has joined #ruby
[08:43:49] venmx: has joined #ruby
[08:45:25] ur5us: has joined #ruby
[08:48:12] ur5us: has joined #ruby
[08:52:47] plexigras: has joined #ruby
[08:57:25] eblwork18: has joined #ruby
[09:00:46] ur5us: has joined #ruby
[09:00:58] roshanavand: has joined #ruby
[09:01:22] Beams: has joined #ruby
[09:01:54] ur5us: has joined #ruby
[09:03:31] jamesaxl: has joined #ruby
[09:03:53] dionysus69: has joined #ruby
[09:05:49] kke: has joined #ruby
[09:07:12] TomyWork: has joined #ruby
[09:09:08] byte512: has joined #ruby
[09:09:54] CBebop: has joined #ruby
[09:10:06] ur5us: has joined #ruby
[09:10:39] yup: has joined #ruby
[09:14:19] alfiemax: has joined #ruby
[09:15:52] yup: Is there any way to analyze my ruby to avoid *ever* getting a NoMethodError? I shipped code to users that has a nasty NoMethodError due to a silly misread. (I ran Logger.warning instead of Logger.warn). It seems like there should be a way to tell "this method doesn't exist anywhere" and pop up a warning. Rubocop doesn't (can't?) do this. I'm using Emacs for reference but any editor integration or command--line
[09:15:54] yup: tool suggestion would be appreciated.
[09:19:31] jottr: has joined #ruby
[09:20:00] apeiros: yup: rubys dynamic nature makes that rather difficult
[09:20:16] dminuoso: yup: Crystal.
[09:20:17] apeiros: afaik there are a couple of tools which try. one's name was iirc "laser".
[09:20:28] cabotto: has joined #ruby
[09:20:32] dminuoso: yup: What you are asking for is called a "typing system". Ruby doesn't have one.
[09:20:38] apeiros: oh, latest commit 2011. I guess that's dead.
[09:22:06] dminuoso: Or if you like Ruby can be considered unityped, where any object has type `any`, and `any` responds to all messages with some `any` object.
[09:22:28] eblwork18: has joined #ruby
[09:22:37] apeiros: is raising considered responding?
[09:22:46] dminuoso: apeiros: Yes.
[09:23:00] dminuoso: apeiros: Typetheory wise it's fine.
[09:23:01] yup: has joined #ruby
[09:23:27] anisha: has joined #ruby
[09:23:28] aufi: has joined #ruby
[09:30:07] vondruch: has joined #ruby
[09:31:50] dhollinger: has joined #ruby
[09:39:42] venmx: has joined #ruby
[09:40:10] ur5us: has joined #ruby
[09:43:29] sidx64: has joined #ruby
[09:46:12] somebody: has joined #ruby
[09:49:16] yup: has joined #ruby
[10:00:22] govg: has joined #ruby
[10:02:44] amar: has joined #ruby
[10:03:10] wangzhong: has joined #ruby
[10:06:55] conta: has joined #ruby
[10:08:31] zenspider: there's the typing library and other stuff coming out of UMD... They used to have a compiler or at least a static analyzer but I think they've given up on that approach... it might still be around toh
[10:09:38] zenspider: that said, it shouldn't be TOO hard to do some basic static analysis and compare it against an emacs TAGS file for example. It'll still have false positives (methads that exist SOMEWHERE but not on that object) and false negatives (methods that aren't in the tags file (like #to_a) but are definitely implemented (via ruby)
[10:10:01] zenspider: ultimately, it's a better use of your time to write good tests.
[10:12:03] dminuoso: zenspider: A typing system is that. It's a test framework.
[10:13:15] dminuoso: Here's the definition from the most authorative book on applied type theory in programming langauges (TaPL): A type system is a tractable syntactic method for proving the absence of certain program behaviors by classifying phrases according to the kinds of values they compute.
[10:13:35] dminuoso: It's utterly silly to backdoor a tags based typing system into a language.
[10:14:22] dminuoso: Writing a test to do what a typing system should do is an annoying waste of my time.
[10:15:13] conta: has joined #ruby
[10:19:42] joro_: has joined #ruby
[10:26:07] vondruch: has joined #ruby
[10:31:31] ciscam: has joined #ruby
[10:32:55] alfiemax: has joined #ruby
[10:37:27] amatas: has joined #ruby
[10:41:35] Beams: has joined #ruby
[10:42:13] schneider: has joined #ruby
[10:51:17] venmx: has joined #ruby
[10:56:43] rabajaj: has joined #ruby
[11:00:05] aufi: has joined #ruby
[11:01:39] sidx64: has joined #ruby
[11:01:51] ur5us: has joined #ruby
[11:02:46] cabotto: has joined #ruby
[11:06:39] ikbenhet: has joined #ruby
[11:07:17] alex``: has joined #ruby
[11:11:22] apeiros_: has joined #ruby
[11:12:06] anisha: has joined #ruby
[11:14:52] ikbenhet: has joined #ruby
[11:18:20] AJA4350: has joined #ruby
[11:19:31] cabotto: has joined #ruby
[11:20:02] andikr: has joined #ruby
[11:20:21] jottr: has joined #ruby
[11:20:35] ikbenhet: has joined #ruby
[11:21:15] Cavallari: has joined #ruby
[11:23:49] roamingdog: has joined #ruby
[11:24:21] gregf_: has joined #ruby
[11:26:47] gavit: has joined #ruby
[11:26:54] gavit: has left #ruby: ()
[11:28:21] RougeR: has joined #ruby
[11:29:22] ramfjord: has joined #ruby
[11:29:24] cschneid_: has joined #ruby
[11:30:50] ldnunes: has joined #ruby
[11:32:54] TinkerT: has joined #ruby
[11:33:11] ikbenhet: has joined #ruby
[11:35:40] adlerdias: has joined #ruby
[11:36:10] yup: dminuoso: So what would you suggest? Rely on autocompletes and never type a method out by hand?
[11:36:47] cabotto: has joined #ruby
[11:42:46] saTchymoto: has joined #ruby
[11:46:22] dminuoso: yup: Dont pick Ruby?
[11:47:12] dminuoso: yup: When you decide on Ruby you willingly give up types (with the entire baggage of guarantees you are hoping for) and speed.
[11:47:23] clemens3: yup: 100% coverage tests would have found this bug
[11:47:33] dminuoso: clemens3: Which is utterly silly.
[11:47:53] dminuoso: clemens3: You can't generate 100% test coverage because you'd have to trace the flow of your program.
[11:48:00] dminuoso: And that's a typing system.
[11:48:01] clemens3: ah, mr dminuoso
[11:48:22] dminuoso: Instead you end up with massive tons of useless tests that try to mimic the flow of the program. You end up writing more on tests than you should
[11:48:34] dminuoso: clemens3: And more to the point: The bugs happen because of the things you dont see/know about.
[11:48:42] dminuoso: You cant generate tests for cases you dont see/know about.
[11:48:51] clemens3: dminuoso: I didnt say use 100%
[11:48:57] Xeago: has joined #ruby
[11:49:16] clemens3: only that there are more directions to think in
[11:49:22] lupine: given metaprogramming, you just can't eliminate NoMethodError entirely in ruby
[11:49:28] clemens3: coverage tests btw might find other bugs too
[11:49:35] dminuoso: lupine: That has nothing to do with metaprogramming.
[11:49:36] lupine: "use something else" is a reasonable response, but "use crystal" is not :p
[11:49:38] lupine: sure it does
[11:49:39] clemens3: bugs that no type checking would ever find
[11:49:39] anisha: has joined #ruby
[11:49:47] lupine: without metaprogramming, 100% coverage would give you that property
[11:49:56] lupine: with it, it does not
[11:49:57] dminuoso: lupine: It has just to do with the kind of brittle mutable things you can do in Ruby
[11:50:33] cabotto: has joined #ruby
[11:51:00] clemens3: lupine: 100% coverage does not find all bugs, of course.. nothgint dos
[11:51:15] dminuoso: clemens3: Also what does 100% coverage mean?
[11:51:20] clemens3: lupine: but did the log.warning happen in a meta programmed area?
[11:51:21] yup: It makes sense that a tool couldn't guess if you had done metaprogramming, but even standard lib classes cannot be analyzed?
[11:51:27] dminuoso: clemens3: It's not about whether you test every line of code, but you have to test it under all conditions.
[11:51:40] dminuoso: `a = getLine; f.send(a)`
[11:51:41] dminuoso: you cant test this
[11:51:48] clemens3: yup, did your bug happen in a meta programmed code area?
[11:51:54] yup: clemens3: Nope
[11:51:56] gheegh: has joined #ruby
[11:52:12] dminuoso: yup: The kind of "provable properties" you are looking for are called "type systems"
[11:52:14] dminuoso: Ruby has none period.
[11:52:21] clemens3: yup: thanks, so in this case coverage would have found it..
[11:52:51] dminuoso: clemens3: That's nonsense. You might have input dependent behavior.
[11:52:51] jamesaxl: has joined #ruby
[11:52:56] dminuoso: Good luck trying to cover every possible behavior
[11:53:59] yup: Given ruby is mandatory in this project, I guess tests is the only answer. Thanks dminuoso for showing me the real reason why somebody would want a type system. Seems very useful now.
[11:54:02] clemens3: dminuoso: if the line "log.warning" gets executed, it would have bombed, exactly what happened at the customers site
[11:54:33] houhoulis: has joined #ruby
[11:56:06] dminuoso: yup: One of the main reasons people avoid type systems is because they are used to non-inferring bolted-on non-expressive naive type systems like Java has. Once you become with expressive type systems and/or type theory the picture radically changes. :)
[11:56:39] guardian: has joined #ruby
[11:56:50] dminuoso: *Once you become familiar
[11:57:23] lupine: right, we could easily have found *this particular bug* in retrospect
[11:57:55] lupine: funny how you mostly find the bugs you haven't prepared against
[11:58:05] dminuoso: yup: With HM style type inference for example you can get away without writing any type signatures at all - but you get the full robust sanity checks.
[11:58:27] yup: dminuoso: HM style?
[11:58:35] dminuoso: yup: Hindley Milner type inference
[11:58:37] lupine: a large test suite with occasional bugs related to things you'd normally catch at compile-time is just part of the price of using ruby
[11:59:06] guardian: has joined #ruby
[11:59:35] yup: dminuoso: what would be some example languages with HM type interference?
[12:00:25] yup: lupine: would you say that most tests would be easily replaced by a type system?
[12:00:49] guardian: has joined #ruby
[12:03:58] dminuoso: yup: Any in the ML-family. The most prominent example would be Haskell probably.
[12:04:13] dminuoso: You can get away without any type annotations mostly.
[12:05:43] dminuoso: yup: In reality you will usually still annotate top level functions/interfaces because type annotations document usage much better than any code example will.
[12:06:00] dminuoso: yup: I'd say you can encode a lot of things and invariants in type systems.
[12:06:15] dminuoso: yup: The main benefit is that any property you can encode in a sound type system is a _provable_ property.
[12:06:41] dminuoso: That doesn't mean types invalidate tests, but types are much stronger than tests.
[12:06:44] clemens3: yup: no silver bullets, only hard work..
[12:10:34] dminuoso: yup: https://gist.github.com/dminuoso/e84d13e4fada65f742a01afc5335e4db this is a type level description of a REST API I have. The request handler is statically and verifiably _forced_ to know the exact names and types of possible parameters - and Im even forced to acknowledge the possibility that a parameter might not be passed even.
[12:12:00] guille-moe: has joined #ruby
[12:14:09] conta: has joined #ruby
[12:16:22] yup: dminuoso: That is quite nice.
[12:18:03] DTZUZO_: has joined #ruby
[12:19:32] sidx64: has joined #ruby
[12:20:16] mondongo: has joined #ruby
[12:20:51] eblwork18: has joined #ruby
[12:21:28] yup: Thank you lupine, clemens3 for your suggestions
[12:22:10] cabotto: has joined #ruby
[12:22:30] Danielss89: has joined #ruby
[12:23:31] lupine: yup: compile-time checks in general make tests overlapping their functionality unnecessary
[12:24:11] lupine: various typing systems do some of that, other compile-time checks that aren't to do with types can also do that
[12:24:34] lupine: you're still left with a bundle of important tests to write, so I wouldn't say "most tests", no
[12:26:58] yup: lupine: ok. I've still got tests to write then. I'm searching around now for some kind of typing bolt-on bandaid for ruby.
[12:27:21] dminuoso: yup: The most mature project currently is https://github.com/plum-umd/rdl
[12:27:40] dminuoso: yup: Just know it's really bolted on and not sound.
[12:27:40] lupine: for ruby, I'd just stick to the tests and accept a higher defect rate that you'd get with something with more rigorous type
[12:30:31] yup: dminuoso: understood. Thanks for the pointer.
[12:30:46] yup: lupine: do you prefer Haskell as well?
[12:31:15] lupine: no, I spend most of my time in ruby
[12:31:38] lupine: I write tests and sometimes avoidable errors like the original one slip through. I'm ok with that
[12:32:43] lupine: every change I make also tends to take multiple computer-hours to be validated. I'm less ok with that, but it's not made me switch to haskell yet :D
[12:34:10] yup: do you have a recommended resource for getting up to speed with tests? I have to use Minitest, not RSpec
[12:35:45] apeiros: for reasonably small teams / projects you can even just go with a good error reporting system
[12:35:58] apeiros: (of course, also depends on how critical bugs would be)
[12:40:32] GodFather: has joined #ruby
[12:43:15] yup: apeiros: Well, it's not purely a web project so although its nice to get errors, its not easy to push the fixes out.
[12:44:43] apeiros: it doesn't need to be a web project to have reasonably simple deployment.
[12:45:02] apeiros: self-updating script isn't too difficult either
[12:47:48] lupine: minitest is fine. for any existing project, the best advice is to follow the existing test framework & guidelines
[12:48:23] lupine: other than that, just do whatever uncle bob says, appropriately retooled to ruby
[12:48:34] yup: apeiros: How would I start to make the script self-updating? That would be really useful.
[12:49:04] yup: lupine: Ok, thanks. Running down uncle bob now.
[12:49:25] lupine: do you have a particular environment you're deploying to? life is so easy if it's just "debian machines"
[12:49:25] eblwork18: has joined #ruby
[12:49:37] adlerdias_: has joined #ruby
[12:50:44] yup: lupine: No, it's running on a kind of ruby interpreter shipped with an application both on windows and mac
[12:51:07] apeiros: yup: depends a bit on how your users install your software
[12:51:09] yup: lupine: but the dev environment is a debian machine
[12:51:23] apeiros: if you can, I'd probably rely on rubygems as much as possible
[12:51:49] lupine: yeah, bit tougher for those cases
[12:51:53] yup: apeiros: At present they have to click through some menus to install / reinstall from a zipped up ruby folder
[12:52:05] yup: it is definitely a strange system
[12:52:16] apeiros: the ruby interpreter is vendored?
[12:52:18] lupine: http://www.poodr.com/ will help you write code that tests more easily, the books I've read on ruby testing specifically are all hot on rspec and cucumber and whatnot
[12:52:57] apeiros: you could e.g. at startup check against a repository and update source files from there and restart if code changed
[12:58:55] jcalla: has joined #ruby
[12:59:34] bmurt: has joined #ruby
[13:04:08] mtkd: has joined #ruby
[13:12:31] cyberg: has joined #ruby
[13:14:20] chocoelho: has joined #ruby
[13:15:17] jcalla: has joined #ruby
[13:21:15] jottr: has joined #ruby
[13:21:43] kapil___: has joined #ruby
[13:24:15] Nussi: has joined #ruby
[13:25:02] venmx: has joined #ruby
[13:28:17] mikecmpb_: has joined #ruby
[13:29:59] ramfjord: has joined #ruby
[13:30:04] chocoelho: has joined #ruby
[13:33:27] roshanavand: has joined #ruby
[13:38:15] duderonomy: has joined #ruby
[13:38:15] daxroc: has joined #ruby
[13:38:18] jamiejackson: has joined #ruby
[13:44:44] dc2: has joined #ruby
[13:46:35] yup: has joined #ruby
[13:46:38] NL3limin4t0r: has joined #ruby
[13:46:50] cadillac_: has joined #ruby
[13:54:16] Rapture: has joined #ruby
[13:55:19] Beams: has joined #ruby
[13:55:39] amatas: has joined #ruby
[13:59:08] oleo: has joined #ruby
[13:59:47] roshanavand: has joined #ruby
[14:00:47] Asher: has joined #ruby
[14:02:38] tomphp: has joined #ruby
[14:07:54] amatas: has joined #ruby
[14:18:09] GodFather: has joined #ruby
[14:19:42] jamiejackson: hi folks. i'm using OpenUri's open(). i don't really care about the result. how would i just background it and forget about it?
[14:20:44] apeiros: Thread.new do open(blargh) end
[14:23:18] apeiros__: has joined #ruby
[14:24:27] roshanavand: has joined #ruby
[14:27:40] riskish: has joined #ruby
[14:30:39] cschneid_: has joined #ruby
[14:35:08] chihhsin: has joined #ruby
[14:35:20] venmx: has joined #ruby
[14:37:22] jrheaton: has joined #ruby
[14:39:03] karapetyan: has joined #ruby
[14:45:33] roshanavand: has joined #ruby
[14:46:50] yup: has joined #ruby
[14:49:53] orbyt_: has joined #ruby
[14:50:01] jottr: has joined #ruby
[14:50:11] cschneid_: has joined #ruby
[14:51:07] oleo: has joined #ruby
[14:51:38] roshanavand: has joined #ruby
[14:51:49] tomphp: has joined #ruby
[14:54:01] jcalla: has joined #ruby
[14:54:04] gizmore: has joined #ruby
[14:57:01] ramfjord: has joined #ruby
[14:57:23] Zaab1t: has joined #ruby
[14:58:48] apeiros: has joined #ruby
[15:01:19] mtkd: has joined #ruby
[15:07:23] oleo: has joined #ruby
[15:14:36] jcalla: has joined #ruby
[15:18:26] mostlybadfly: has joined #ruby
[15:22:46] venmx: has joined #ruby
[15:23:15] Lyubo1: has joined #ruby
[15:23:28] Dbugger: has joined #ruby
[15:26:01] duderonomy: has joined #ruby
[15:26:04] gheegh: has joined #ruby
[15:32:26] vondruch: has joined #ruby
[15:34:35] cthulchu: has joined #ruby
[15:34:59] ramfjord: has joined #ruby
[15:36:07] jcarl43: has joined #ruby
[15:37:50] jottr: has joined #ruby
[15:41:31] karapetyan: has joined #ruby
[15:44:40] wget: has joined #ruby
[15:45:23] banisterfiend: has joined #ruby
[15:47:38] cagomez: has joined #ruby
[15:50:37] marr: has joined #ruby
[15:52:14] wget: Hello everyone. Being a package maintainer and not very familiar with ruby itself, I wanted to know why the package name is suffixed by its version (here thin-1.7.2) and how a package can conflict with itself? The conflict described here is not very meaningful.
[15:52:14] wget: /usr/lib/ruby/2.5.0/rubygems/specification.rb:2325:in `raise_if_conflicts': Unable to activate skinny-0.2.4, because eventmachine-1.2.7 conflicts with eventmachine (~> 1.0.0), thin-1.7.2 conflicts with thin (< 1.7, >= 1.5) (Gem::ConflictError)
[15:53:30] Dbugger: has joined #ruby
[15:54:08] orbyt_: has joined #ruby
[15:55:41] yxhuvud: wget: you can get such a problem if a gem is required twice, with different version requirements. Note that only one version of any gem can be used at any one time.
[15:57:25] wget: Yxhuvud: hum ok. actually the dependencies are defined two times here (in mailcatcher): one in the add_dependency of the gemspec file and another time in the main rb file itself. This seemed weird, but I'm gonna remove the ones hardcoded in the rb file, just to see...
[15:57:43] tuskkk___: need some help with rails, https://bpaste.net/show/f0a24d59c3c0, trying to link to a controller action
[15:58:27] tuskkk___: ```undefined method `add_to_rotation' for #<#<Class:0x007f9ce8576f20>:0x007f9ce42e9ba8> Did you mean? add_method_to_attributes!```
[15:59:46] [Butch]: has joined #ruby
[16:03:18] karapetyan: has joined #ruby
[16:03:26] mzo: has joined #ruby
[16:04:16] jrabe: has joined #ruby
[16:07:12] Lyubo1: has joined #ruby
[16:09:47] dionysus69: has joined #ruby
[16:12:55] cagomez: I have a PDF file that I can output by using `cat my_pdf.pdf`. I need this output in my Ruby file since I will be sending the PDF over the network. Can I hardcode the string into a Ruby class?
[16:14:16] mzo: why don't you write ruby code to open and read the file
[16:14:48] cagomez: mzo: I wanted to avoid storing the PDF on disk
[16:15:31] cagomez: mzo: basically, I wanted to avoid having to call `File.open('my_pdf.pdf', 'rb') { |f| f.read }` and store the output of that block as a String instead, but I'm not sure if that's possible
[16:15:40] mzo: im not sure the ruby parser will like having the binary pdf contents in the source
[16:15:50] mzo: but you could base64 encode it for example
[16:16:00] apeiros: ?rails tuskkk___
[16:16:00] ruby[bot]: tuskkk___: Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
[16:16:04] cagomez: mzo: perfect! how would I do this?
[16:16:24] banisterfiend: has joined #ruby
[16:16:46] mzo: cast my_pdf.pdf | base64
[16:16:49] conta: has joined #ruby
[16:16:54] mzo: copy that into a string literal
[16:17:03] mzo: and then you just need some ruby function to decode it
[16:17:03] apeiros: cagomez: File.read(path) would be shorter anyway ;-p
[16:17:11] tuskkk___: apeiros: already asked there like an hour ago, its pretty quiet
[16:17:19] mzo: not sure if ruby standard library has base64 decoding
[16:17:25] mzo: maybe need a gem
[16:17:58] apeiros: tuskkk___: the question in #rubyonrails seems to not contain everything?
[16:17:59] mzo: or roll your own :d
[16:18:07] cagomez: mzo: I `cat my_pdf.pdf | base64`?
[16:18:09] apeiros: mzo: it has
[16:18:12] apeiros: require 'base64'
[16:18:27] apeiros: btw., anybody seen adaedra?
[16:18:28] tuskkk___: apeiros: it does
[16:18:49] mzo: cagomez: yes and it should output a huge string
[16:22:12] BTRE: has joined #ruby
[16:23:23] qnaal: has joined #ruby
[16:26:04] Siarkowy: has joined #ruby
[16:30:43] nitric: has joined #ruby
[16:32:11] orbyt_: has joined #ruby
[16:33:37] cthulchu: has joined #ruby
[16:34:35] kapil___: how to get last added key of a hash?
[16:34:43] Uptime: has left #ruby: ()
[16:35:17] apeiros: hash.last.first
[16:35:32] apeiros: oh, misses a to_a
[16:36:13] havenwood: or: hash.keys.last
[16:37:08] nitric_: has joined #ruby
[16:37:25] apeiros: oh, that's actually much better
[16:37:36] apeiros: but I wonder now why there's #first but not #last
[16:37:43] apeiros: it's a DLL after all
[16:38:08] havenwood: i was wondering the same
[16:38:25] kapil___: havenwood: thanks
[16:38:32] havenwood: a doubly, circularly linked list should have first/last connection
[16:38:36] havenwood: ¯\_(ツ)_/¯
[16:39:16] adlerdias: has joined #ruby
[16:39:58] kapil___: i was wondering the same
[16:41:01] cagomez: is whitespace significant in a base64 encoded PDF?
[16:41:04] havenwood: https://bugs.ruby-lang.org/issues/12165
[16:41:05] chocoelho: has joined #ruby
[16:42:18] Ryzokuken: has joined #ruby
[16:43:55] chocoelho: has joined #ruby
[16:45:09] havenwood: I'd imagine it's just so seldom requested nobody has implemented it, but unsure.
[16:46:45] havenwood: cagomez: Amongst the Base64 encoded characters?
[16:48:02] havenwood: cagomez: Try it. Base64.decode64 is permissive and Base64.strict_decode64 isn't.
[16:48:11] robertothais: has joined #ruby
[16:48:35] cagomez: yes, havenwood. from the conversation above, I ran: `cat my_pdf.pdf | base64 | pbcopy` and pasted the string into a Ruby class as a HEREDOC. However, `MyClass.new.to_s` shows surrounding whitespace around the base64 string
[16:50:29] Asher: has joined #ruby
[16:50:30] sanscoeur: has joined #ruby
[16:51:51] vladdypwnz: has joined #ruby
[16:52:05] biberu: has joined #ruby
[16:52:28] cagomez: Found a cool solution. `def to_s; <<~EOF.squish base64... EOF; end;` . tilde in heredoc removes tabs, and `squish` removes newlines
[16:52:32] millerti: has joined #ruby
[16:52:38] vladdypwnz: has joined #ruby
[16:53:20] vladdypwnz: has joined #ruby
[16:55:35] vladdypwnz: has joined #ruby
[16:56:28] vladdypwnz: has joined #ruby
[16:57:05] vladdypwnz: has joined #ruby
[16:59:19] gizmore: has joined #ruby
[17:01:05] chocoelho: has joined #ruby
[17:05:45] n0m4d1c: has joined #ruby
[17:06:42] mtkd: has joined #ruby
[17:07:33] guille-moe: has joined #ruby
[17:07:47] arashb: has joined #ruby
[17:08:04] yup: has joined #ruby
[17:09:39] mtkd: has joined #ruby
[17:10:03] n0m4d1c_: has joined #ruby
[17:10:38] _aeris_: has joined #ruby
[17:10:50] jnollette: has joined #ruby
[17:13:06] gheegh: has joined #ruby
[17:14:01] ramfjord: has joined #ruby
[17:14:03] roshanavand: has joined #ruby
[17:17:47] TomyLobo: has joined #ruby
[17:18:58] gheegh: has joined #ruby
[17:19:20] za1b1tsu: has joined #ruby
[17:20:15] n0m4d1c: has joined #ruby
[17:22:17] dc2: has joined #ruby
[17:22:26] Puffball: has joined #ruby
[17:22:53] ruby[bot]: -bbbb chouhoulis!*@*$#ruby-fix-your-connection chouhoul_!*@*$#ruby-fix-your-connection chouhou__!*@*$#ruby-fix-your-connection chouho___!*@*$#ruby-fix-your-connection
[17:22:53] ruby[bot]: -bb chouh____!*@*$#ruby-fix-your-connection *!*@50-207-64-46-static.hfc.comcastbusiness.net$#ruby-fix-your-connection
[17:23:22] n0m4d1c_: has joined #ruby
[17:24:45] \void: has joined #ruby
[17:26:45] pdcawley: has joined #ruby
[17:29:53] amar: has joined #ruby
[17:32:53] amar: has joined #ruby
[17:35:09] pdcawley: has joined #ruby
[17:36:05] nitric: has joined #ruby
[17:38:01] mtkd: has joined #ruby
[17:38:18] arashb: has joined #ruby
[17:41:19] vladdypwnz: has joined #ruby
[17:42:21] vladdypwnz: has joined #ruby
[17:43:03] vladdypwnz: has joined #ruby
[17:43:56] vladdypwnz: has joined #ruby
[17:44:46] vladdypwnz: has joined #ruby
[17:47:15] SeepingN: has joined #ruby
[17:48:44] Deesl: has joined #ruby
[17:51:24] mroutis: has joined #ruby
[17:53:20] weird_error: has joined #ruby
[17:56:58] mr_wooh: has joined #ruby
[17:58:48] tomphp: has joined #ruby
[17:59:45] jrheaton: has joined #ruby
[18:01:18] vladdypwnz: has joined #ruby
[18:02:05] mroutis: has joined #ruby
[18:04:59] sphenxes: has joined #ruby
[18:05:28] arashb: has joined #ruby
[18:05:38] sameerynho: has joined #ruby
[18:06:14] gheegh: has joined #ruby
[18:10:01] cpruitt: has joined #ruby
[18:11:54] rkazak: has joined #ruby
[18:13:38] ramfjord: has joined #ruby
[18:14:19] cthulchu_: has joined #ruby
[18:16:22] lele: has joined #ruby
[18:22:01] ldepandis: has joined #ruby
[18:26:29] amar: has joined #ruby
[18:26:47] dviola: has joined #ruby
[18:26:48] kegan_: has joined #ruby
[18:27:16] postmodern: has joined #ruby
[18:28:11] execat: has joined #ruby
[18:28:30] execat: has joined #ruby
[18:29:17] kegan_: is there a way to get a post request before it's sent via mechanize
[18:29:25] kegan_: dump it into text
[18:30:55] Lytol: has joined #ruby
[18:31:27] tomphp: has joined #ruby
[18:32:40] Mike11: has joined #ruby
[18:32:46] desperek: kegan_, what do you mean, eh?
[18:32:51] thinkpad: has joined #ruby
[18:34:10] kegan_: desperek I'm making a post request via a form submit on a page, it's giving me 400 bad request and I want to look at the request itself to see what might be missing
[18:35:19] desperek: kegan_, dont use production mode?
[18:35:35] kegan_: I don't know what that is, sir
[18:36:48] kegan_: maybe it's in the log, lemme check
[18:36:58] desperek: kegan_, basically when you run an app you can run in different modes kinda
[18:37:57] kegan_: production vs dev?
[18:38:01] desperek: kegan_, yup
[18:38:05] desperek: just run this in the dev
[18:38:06] desperek: ofc locally
[18:38:19] desperek: and you should be presented with nice error page
[18:38:38] desperek: otherwise just dump things in the controller ruby way
[18:38:48] kegan_: I'm not using rails ? I'm confused, sorry
[18:39:13] desperek: oh wait im so sorry :D
[18:39:24] desperek: i thought it was ror chan
[18:39:37] desperek: uh then dunno really, mechanize you say?
[18:39:42] desperek: kegan_, cant you dump this in console?
[18:40:26] kegan_: what is pry? logs aren't detailed enough
[18:40:37] kegan_: ohhh, I'm gonna try that
[18:41:39] arashb: has joined #ruby
[18:41:56] Deesl: has joined #ruby
[18:48:39] hinbody: has joined #ruby
[18:48:50] hinbody: has left #ruby: ()
[18:48:50] tomphp_: has joined #ruby
[18:49:50] lomex: has joined #ruby
[18:51:23] samort7: has joined #ruby
[18:53:49] jamiejackson: has joined #ruby
[18:53:59] vikaton: has joined #ruby
[18:54:51] dc2: has joined #ruby
[18:56:02] lomex: has joined #ruby
[18:56:56] Neon: has joined #ruby
[18:57:43] jamiejackson: apeiros, thanks for the thread tip. do you know why i can't see the third output (in the thread)? https://gist.github.com/jamiejackson/fe23400df2c369828ede4e66516b8fd7s
[18:57:50] jamiejackson: correction: https://gist.github.com/jamiejackson/fe23400df2c369828ede4e66516b8fd7
[18:57:55] Guest38451: Hi, i'm french noob programmer, anyone is here to PM in french ? xD
[19:00:21] arashb: has joined #ruby
[19:00:53] lomex: has left #ruby: ("Textual IRC Client: www.textualapp.com")
[19:01:59] chouhoul_: has joined #ruby
[19:04:58] leslie: has joined #ruby
[19:06:11] tomphp: has joined #ruby
[19:07:43] dionysus69: has joined #ruby
[19:09:06] za1b1tsu: has joined #ruby
[19:11:50] jamiejackson: anybody know why i don't get output from the third write? https://gist.github.com/jamiejackson/fe23400df2c369828ede4e66516b8fd7
[19:11:52] robertothais: has joined #ruby
[19:12:01] tomphp: has joined #ruby
[19:13:07] havenwood: jamiejackson: I can see the final with your example. Enable Thread exception warnings and see if it was silently failing?
[19:13:41] havenwood: jamiejackson: Thread.abort_on_exception = true
[19:13:50] havenwood: jamiejackson: Or: Thread.warn_on_exception = true
[19:13:57] conta: has joined #ruby
[19:14:00] caleBOT__: has left #ruby: ()
[19:14:14] jamiejackson: that can go anywhere before my thread block?
[19:15:12] tomphp: has joined #ruby
[19:16:28] mtkd: has joined #ruby
[19:18:16] mondz: has joined #ruby
[19:18:51] venmx: has joined #ruby
[19:19:50] arashb: has joined #ruby
[19:20:27] tdy: has joined #ruby
[19:20:37] namidark: has joined #ruby
[19:21:26] bmurt: has joined #ruby
[19:21:37] jenrzzz: has joined #ruby
[19:21:37] jenrzzz: has joined #ruby
[19:24:41] duderonomy: has joined #ruby
[19:27:11] alfiemax: has joined #ruby
[19:28:21] tomphp: has joined #ruby
[19:35:18] arashb: has joined #ruby
[19:39:39] jamiejackson: havenwood, i'm doing something wrong in the context of my module. it's there that i can't seem to get the result of the the third output: https://gist.github.com/jamiejackson/227c4a436b6ca32e2c70c440add775c9
[19:39:48] jamiejackson: do you spot the problem?
[19:40:12] jamiejackson: ruby 2.0, fwiw
[19:40:18] minimalism: has joined #ruby
[19:40:58] shaman42: has joined #ruby
[19:42:13] tAn: has joined #ruby
[19:47:18] orbyt_: has joined #ruby
[19:48:49] jrheaton: has joined #ruby
[19:51:41] anjen: has joined #ruby
[19:51:54] marr: has joined #ruby
[19:55:56] pilne: has joined #ruby
[19:56:44] jenrzzz: has joined #ruby
[19:56:44] jenrzzz: has joined #ruby
[19:57:24] peacetre1ty: has joined #ruby
[20:04:48] Beams: has joined #ruby
[20:04:51] quobo: has joined #ruby
[20:06:13] peacetreaty: i wrote a gem that has a dependency('mail') in Gemfile. it loads mail using require. as long as i directly use my gem everything is fine. But now i started a new project. another gem having my previous gem as a dependency in Gemfile. as soon as i require 'mypreviousgem', i'll get the following error: "cannot load such file -- mail". it thought that bundler automatically takes care of all the dependencies
[20:06:19] peacetreaty: and their paths. does anyone know whats wrong with my gem, or how to fix this?
[20:08:17] karapetyan: has joined #ruby
[20:11:02] chouhoulis: has joined #ruby
[20:11:07] claudiuinberlin: has joined #ruby
[20:13:17] Puffball: has joined #ruby
[20:13:42] eckhardt_: has joined #ruby
[20:17:44] Puffball: has joined #ruby
[20:19:38] jottr: has joined #ruby
[20:23:10] arashb: has joined #ruby
[20:27:10] desperek: ay kegan_ does it work now?
[20:27:11] karapetyan: has joined #ruby
[20:28:04] kegan_: desperek nope
[20:28:23] kegan_: I didn't get to use pry but I'm trying to extract the form data from the mechanize request
[20:28:41] jrheaton: has joined #ruby
[20:28:43] kegan_: considering just making the request manually with unirest... I'm stubborn and want to go the way I was going even though redirecting (heh) may be my best bet
[20:29:13] jottr: has joined #ruby
[20:29:31] desperek: kegan_, whatcha trying to do?
[20:29:45] sidx64: has joined #ruby
[20:31:02] desperek: or, kegan_ are you sure the thing you are trying to reach is there?
[20:31:13] desperek: use some client and test it manually
[20:31:16] desperek: or something
[20:31:37] kegan_: I've parsed enough data to ensure I'm actually acting on objects that are there
[20:31:57] kegan_: and yes, I'm doing it manually
[20:32:16] desperek: kegan_, so, doing it manually works. then are you sure you are passing the values to mechanize correctly?
[20:32:49] desperek: or rather, are the values correct?
[20:32:55] desperek: maybe try setting them manually for a moment?
[20:33:16] karapetyan: has joined #ruby
[20:33:57] mroutis: has joined #ruby
[20:37:17] sidx64_: has joined #ruby
[20:44:53] karapetyan: has joined #ruby
[20:56:03] ccrow: has joined #ruby
[21:04:59] arashb: has joined #ruby
[21:11:44] jamiejackson: i'm doing something wrong in the context of my module. it's there that i can't seem to get the result of the the third output: https://gist.github.com/jamiejackson/227c4a436b6ca32e2c70c440add775c9 what am i doing wrong?
[21:13:10] ur5us: has joined #ruby
[21:13:26] ur5us: has joined #ruby
[21:16:06] arashb: has joined #ruby
[21:17:31] kmurphy4_: has joined #ruby
[21:17:57] pilne: has joined #ruby
[21:21:31] mtkd: has joined #ruby
[21:29:19] robertothais: has joined #ruby
[21:29:44] apeiros: jamiejackson: you have to wait for all threads to finish
[21:29:57] apeiros: ruby only cares about the main thread to finish. other threads still running are killed.
[21:33:27] ramfjord: has joined #ruby
[21:34:49] arashb: has joined #ruby
[21:35:49] jamiejackson: oh, hmm. i wanted to be able to background a statement and move on without waiting for it to complete. afaik i can do that with some other languages. is that not possible with ruby?
[21:37:07] burgestrand: has joined #ruby
[21:38:22] GodFather: has joined #ruby
[21:38:23] orbyt_: has joined #ruby
[21:41:11] tomphp: has joined #ruby
[21:42:26] apeiros: in other languages too, if you kill the programm before it's done, it won't be done. that should be somewhat self evident.
[21:42:52] apeiros: all you have to do is ensure at the end of your main code, that all threads have finished.
[21:48:04] apeiros: (Thread.list - [Thread.current]).each(&:join)
[21:48:11] jamiejackson: this thing's already at the end of the code. fyi what i'd like to be able to do is background a command to sleep for n seconds then request a url. something like `nohup bash -c 'sleep 10; curl http://myurl.com' &`. not sure if that's possible or not. i don't care about the results of the url request, i just want it to have tried.
[21:48:15] chouhoul_: has joined #ruby
[21:49:09] jamiejackson: so basically, this would happen, say 10s _after_ the main script has run. maybe it's a crazy idea, but it's worth knowing it's crazy.
[21:49:42] kmurphy4_: has joined #ruby
[21:49:48] amite_: has joined #ruby
[21:49:57] apeiros: if your script does not run, there's nothing to execute your code. no matter the language. if you want to daemonize your code, that's a different story. but I'm now off. cya.
[21:51:48] amite_: hi all quick question: I have a File.read('...').each_line.grep() do |line| ...end where in I do a lookup and set some variable. How do I test if the grep of a string failed and hence take an action at the end of file.read statement?
[21:52:31] jenrzzz: has joined #ruby
[22:00:18] roshanavand: has joined #ruby
[22:05:34] jenrzzz_: has joined #ruby
[22:06:00] n0m4d1c: has joined #ruby
[22:10:54] mroutis: has joined #ruby
[22:12:30] amite_: never mind got it to work!!
[22:12:54] arashb: has joined #ruby
[22:22:32] robertothais: has joined #ruby
[22:23:25] mikecmpbll: has joined #ruby
[22:24:13] kegan_: is there any way to pass parameters to mechanize when using the form class's submit method
[22:24:25] kegan_: there is missing data in the POST request and I'd like to supply it without manually calling post
[22:24:33] kegan_: post_form
[22:30:33] weathermaker: has joined #ruby
[22:30:59] dc2: has joined #ruby
[22:31:42] gigetoo: has joined #ruby
[22:32:26] hays: is there a schedule for 2.6 and 2.5.2?
[22:32:31] hays: or do they just come when them come
[22:33:18] tag: has joined #ruby
[22:36:33] caleBOT: has joined #ruby
[22:36:34] caleBOT_: has joined #ruby
[22:40:04] venmx: has joined #ruby
[22:42:23] hays: just curious how often i should be checking for version bumps
[22:43:58] weathermaker: has joined #ruby
[22:54:20] arashb: has joined #ruby
[22:56:52] cagomez: I have an array of IDs and unpersisted objects. is there an easy way to assign the ID's to the unpersisted objects in memory (I don't need to access the DB at this point)?
[22:57:06] tomphp: has joined #ruby
[22:58:26] \void: has joined #ruby
[22:59:18] lupine: you can just do instance.id = whatever
[22:59:30] duderonomy: has joined #ruby
[22:59:39] lupine: whether that's a good idea or not depends on various things
[22:59:45] chouhoulis: has joined #ruby
[23:00:07] Eiam_: has joined #ruby
[23:00:09] lupine: and I guess it does depend on activerecord (if that's what you're on top of) being able to introspect the database to learn there is an `id` column
[23:01:29] duderonomy: has joined #ruby
[23:01:32] chouhoul_: has joined #ruby
[23:02:42] n0m4d1c_: has joined #ruby
[23:03:27] cagomez: it's to avoid an (N) N+1's :\
[23:15:37] orbyt_: has joined #ruby
[23:20:09] eckhardt_: has joined #ruby
[23:20:36] caleBOT: has joined #ruby
[23:20:37] caleBOT_: has joined #ruby
[23:30:01] gigetoo: has joined #ruby
[23:37:18] ccrow: has joined #ruby
[23:43:48] amar: has joined #ruby
[23:44:31] c0ncealed1: has joined #ruby
[23:55:37] caleBOT: has joined #ruby
[23:55:38] caleBOT_: has joined #ruby
[23:56:05] vladdypwnz: has joined #ruby
[23:57:21] cadillac_: has joined #ruby