#ruby - 18 December 2018
« Back 1 day Forward 1 day »
[00:04:09] dachi_: havenwood: I got to go, thanks for sharing your thoughts, Eiam SeepingN thank you too
[00:24:04] NotSatoshi: I have a program that uses Net::IMAP to download emails for me and I want to store the results into an image or pdf file..... Is there a library that will do this for me?
[01:14:19] NotSatoshi: Is there any example code that downloads all emails from a server and saves them to eml files?
[01:22:53] ModusPwnens: So i'm trying to create a ViewModel for my ruby application. This ViewModel needs to have a field called "method", but I'm finding now that there is already a method called "method" as part of all ruby objects. Is there a way to replace that so I can use my preferred field name?
[01:24:43] NotSatoshi: Eiam: I have been going through that tutorial already, but it mentions nothing about saving..... I am curious if I can save it raw, or if it needs to be formatted to be an EML
[01:26:30] ModusPwnens: @Eiam: Yes, i do. This is a ViewModel and I don't actually care if people try to use that "method" method on them. It's more valuable to me to have the "method" method be a getter.
[01:28:51] ModusPwnens: @Eiam: It just returns the corresponding field in the ViewModel. I literally just have attr_reader :method and i had no idea it was failing until I started to get weird argument errors when I tried to use it.
[01:29:19] ModusPwnens: @Eiam: seems that attr_reader silently fails if there is some sort of name conflict.
[01:31:24] ModusPwnens: Yeah, i just discovered that. The question is, how can I achieve my goal? Is it even possible?
[01:31:56] Eiam: i guess you could try to re-define the ruby version of method slot your code in then pass it onto the original implementation
[01:45:01] Eiam: there are more creative minds than my own and certainly smarter ones. perhaps they will swing around and contribute at some point.
[01:45:40] Eiam: baweaver: re-implement your own 'method' cause f Ruby and their implementation. Thoughts? =)
[01:56:58] hays: if i have a collection of loosely related functions, should I just throw them in a class and make them class functions?
[01:59:44] hays: basically ruby seems to be kinda finicky with modules--always complaining about it not being a method or some problem with the self pointer
[02:21:23] hays: i read about module_function and extend self... they both seem worth avoiding honestly
[03:39:10] Rudolph: can somebody tell me what im doing wrong with this Rakefile? https://clbin.com/AsBTv I would have expected this to print release: https://clbin.com/e437e
[06:17:50] bjpenn: i wouldnt be opposed to that, but navigating large projects with vim seems kind of difficult
[09:54:06] marz_d`ghostman: I've uninstalled a package from my OS and reinstalled it but it appears to have triggered something that causes a lot of warning now like /.bundle/ruby/2.4.0/gems/sqlite3-1.3.13/lib/sqlite3/sqlite3_native.so: warning: already initialized constant SQLite3::Constants::Open::READONLY
[11:52:04] Iambchop: Rudolph: what shell are you using? https://robots.thoughtbot.com/how-to-use-arguments-in-a-rake-task
[12:40:36] ruby[bot]: keanny479: we in #ruby do not like pastebin.com, it loads slowly for most, has ads which are distracting and has terrible formatting. Please use https://gist.github.com
[12:43:51] keanny479: i have the following exercise to achieve, i provided a solution, but Quote.random is not complete, anyone can help me ?
[12:48:51] phaul: is pushing data onto class variable in .new explicitly required by the exercise? It really smells to me..
[13:19:42] TomyWork: are you aware of a ruby lib capable of dealing with asn.1 indefinite-length structures?
[13:20:21] TomyWork: specifically i want to convert all indefinite-length structures to definite-length structures
[20:55:03] baweaver: New illustrated fun - https://medium.com/square-corner-blog/scaling-christmas-an-illustrated-adventure-a2ea739f5451
[21:03:16] Hoffman: heya! I have 4 files at this pastebin, along with a console run: https://pastebin.com/xpEWLat8 . I expected line 57 to read "Fake information returned", as I thought lines 37 to 39 would override getInfo(). Obviously this is not the case, so how might I achieve my goal of stubbing out a function called by initialize?
[21:03:17] ruby[bot]: Hoffman: we in #ruby do not like pastebin.com, it loads slowly for most, has ads which are distracting and has terrible formatting. Please use https://gist.github.com
[21:08:57] Hoffman: its not actually using the object for anything, because I tried to simplify the issue down to barebones
[21:09:22] Zarthus: i see the problem now, can't say I have too much experience with stubs in ruby though
[21:15:06] Zarthus: Hoffman: my first instinct would be to try not printing from the constructor, and checking an assert for equality on animal.getInfo directly
[21:15:27] Zarthus: though i don't know how thi swould play into chef run, at least you can ensure the stub is working correctly
[21:16:00] Hoffman: Zarthus: the print needs to be there because the thing it replaces runs during construction, and I want it to not run
[21:16:28] Hoffman: Zarthus: imagine getInfo calls `search()`, which I do not want run during the test, because it cant
[21:17:01] Zarthus: Hoffman: It's more about working up to the problem, find out which part breaks the stub - not a permanent suggestion
[21:21:00] Zarthus: I haven't bothered setting up your code stack, but from reading the documentation the stub's code is functional
[21:22:03] Hoffman: the current status is as simple as it gets -- the original getInfo() function is getting called, and I want to figure out how to make it *not* get called
[21:23:23] Zarthus: i don't know if it's about as simple as it can get; i don't access the necessary chef knowledge to know what happens in L43
[21:23:55] Zarthus: but i'm nearly confident that something like Creatures::Animal.new.getInfo would eq 'Fake information returned'
[21:37:11] Hoffman: Zarthus: right, cuz that's calling a static method procedurally vs within an object instance