Page 1 of 5 | Next »
[12:01:00] Darkwater: I'm using Open3::popen3, how do I read from stdout and stderr at the same time?
[12:07:50] Darkwater: ytti: I want to read stdout and stderr in order, but I also want to prefix the lines with their origin
[11:39:55] Darkwater: shellie_: in that code, ruby tries to resolve @somevar before it's set by something
[11:40:48] Darkwater: on like 6, you're really calling describe with the result ofsomeresource(@somevar) and a block
[11:44:35] Darkwater: since you're using it to define the tests, instead of actually using them in the tests
[11:50:20] Darkwater: why do the headers from `ri -T String` contain backspaces? is it so you can't grep them?
[09:25:09] Darkwater: is it good practice to create loads of custom *Error classes? (eg for a build script: UnknownConfigError, UnknownBuildTypeError, NoConfigUsedError, etc)
[09:29:03] Darkwater: djellemah: probably, I at least want unique error messages printed to the user for each one
[09:29:32] Darkwater: and since this build script is meant to be extensible I figured it might be best to pull printing messages out of the main logic
[09:30:01] Darkwater: actually I probaly don't have to rescue them separately if I put description messages in the error classes
[09:31:20] Darkwater: that still leaves the question of RuntimeError with message vs custom *Error with static messages
[18:53:03] Darkwater: using the built-in json module, how can I make to_json use to_h if an object doesn't have to_json?
[18:53:33] Darkwater: I could def to_json; to_h.to_json; end on relevant objects but I really don't want to do that on everything
[18:54:28] Darkwater: in the end I want to convert a hash to json, but some elements deep in that hash are custom classes that should only have to_h and not to_json
[19:00:48] Darkwater: was thinking of doing some trickery to call that on objects that don't have to_json
[19:18:09] Darkwater: baweaver: json is temporary anyway since I want to implement my own serializer later, so I'd rather just use the built-in json stuff
[19:43:13] Darkwater: XF: if you can't install it using gem you should find another way of installing it
[19:17:51] Darkwater: I've got a module that's basically a container for things, should the name be plural or singular?
[16:56:36] Darkwater: I'm writing an irc client, how should I handle incoming commands? a case/when block or call methods on self like on_ping, on_privmsg etc?
[17:18:50] Darkwater: and I'm not going to use this project to learn it, nor wait with this project until I've learnt it
[14:40:08] Darkwater: unless you want to become a corporate code typer with job security for a couple of years
[12:19:23] Darkwater: I'm using find_all (followed by each to do something) on an array, and then delete_if to remove the elements that have matched, is there a faster method for this?
[12:23:51] Darkwater: it's an array containing objects, and occasionally I want to take all objects from the array that match a certain criteria (a certain key equalling a certain value) and do something with those
[11:46:32] Darkwater: what would be the most ruby way to compress foo[:bar] == 5 or foo[:baz] == 5 or foo[:ban] == 5?
[11:50:25] Darkwater: well there are a couple of other keys as well, but it doesn't matter if they match
[11:50:46] Darkwater: it would actually excend the functionality because I'm using this in a find block
[11:25:41] Darkwater: so Foo.new gets a hash, some of the children are other objects like these, so call Bar.new with those children
[11:26:35] Darkwater: which takes obj[:user] in initialize and puts it in @user, and make a reader that returns User.new @user
[12:35:48] Darkwater: apeiros: about the type helper thing from earlier, how would you recommend me to handle the input object from the initializer?
[12:35:56] Darkwater: ie. handling the object I'm passing to Message.new here http://hastebin.com/yatoguhoka.rb