beefjoe70: Maybe the safest way to do what you are trying (so without overriding global variables) would be to create a tmp-file and redirect stdout and stderr to it. Then output that and default stdout and stderr again.
So basically craete some tmp-file and use IO#reopen (stderr.reopen(tmpfile); stdout.reopen(tmpfile)) to really capture all of it while not being too intrusive.
beefjoe70: And for the input, lookup the ARGF constant. I think its better suited for your use case than stdin.
Good morning everyone :) Rails screnario: I have a User that can be identified by either an ID or a slug (String). I want to create a post by that user and pass the string into the mass assignment (user_id). Does anyone know of some library that already solved this problem of "polymorphic primary keys"?
Of course I could just "case" over the parameter manually but I think there could be a more general solution. Think https://github.com/norman/friendly_id but for creation.
dminuoso: That sounds like a good idea thank you. The most general way to do this would to make a class like `ident` and turn it into a general CreationOrUpdate command object that just wraps around the active-record
vivsoni: http://secret-garden.hatenablog.com/entry/2015/10/01/000000 seems to be the same error, but I can't speak japanese. If anyone here could get an answer from that thread it would be very helpful :)