Activity Graph

Page 1 of 5 | Next »


[05:00:01] Darkwater: *.net *.split
[08:54:04] Darkwater: has joined #ruby


[21:08:25] Darkwater: Ping timeout: 244 seconds
[21:14:30] Darkwater: has joined #ruby
[22:24:17] Darkwater: has joined #ruby
[22:24:17] Darkwater: Changing host


[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
[12:08:01] Darkwater: so eg. ERR: foo went wrong \n OUT: bar is ok
[12:08:34] Darkwater: apeiros: can I do that ^ with spawn?
[12:09:27] Darkwater: does select look harder than it is?
[12:09:37] Darkwater: then I'll try that
[12:24:24] Darkwater: ytti: after select, how do I read everything that's available/
[12:25:32] Darkwater: yeah but how do I read until they're no longer available?
[13:31:49] Darkwater: urgh, I hate programming with terminals
[13:32:05] Darkwater: I can read stdout and stderr now sure but now the problem is with buffering


[10:12:52] Darkwater: has joined #ruby
[11:24:28] Darkwater: what do the cool kids these days use for ruby doc generation?
[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:41:13] Darkwater: if my knowledge of rspec is ok I think you need to pass a string to describe
[11:41:29] Darkwater: describe 'some functionality' do ...
[11:41:45] Darkwater: same with it
[11:42:04] Darkwater: iirc it and describe are equivalent, just some semantic changes
[11:42:32] Darkwater: ooh I see what yuo're trying to do
[11:44:09] Darkwater: I think removing the before :all block might do
[11:44:16] Darkwater: like, set @somevar directly in the describe block
[11:44:35] Darkwater: since you're using it to define the tests, instead of actually using them in the tests
[11:44:42] Darkwater: but then again I don't use rspec
[11:44:55] Darkwater: it would at least work
[11:45:27] Darkwater: then I think you need to look for a different approach
[11:50:20] Darkwater: why do the headers from `ri -T String` contain backspaces? is it so you can't grep them?
[11:59:03] Darkwater: append to cron
[11:59:12] Darkwater: or rather replace the correct one
[11:59:21] Darkwater: as in, the corerct line(s)
[12:26:44] Darkwater: no matter how fitting that was it was 100% an accident i swear
[12:39:10] Darkwater: ENV['HOME'] . '/.rvm'?
[13:30:52] Darkwater: couldn't you use set.all? { |s| s.meth }?
[13:42:26] Darkwater: :unborn/alive/deceased
[13:42:42] Darkwater: life-stage/
[13:50:03] Darkwater: no because someone has to teach the aI
[14:11:15] Darkwater: #alive? -> :not_yet / :yes / :not_anymore


[10:45:37] Darkwater: has left #ruby: ("so much to do, so much to see")


[18:25:35] Darkwater: *.net *.split
[18:30:39] Darkwater: has joined #ruby
[18:30:39] Darkwater: Changing host
[18:30:39] Darkwater: has joined #ruby


[09:40:24] Darkwater: Quit: Changing server
[09:40:30] Darkwater: has joined #ruby
[09:40:31] Darkwater: has joined #ruby
[09:40:31] Darkwater: Changing host


[09:24:23] Darkwater: has joined #ruby
[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
[09:33:28] Darkwater: possibly yes
[09:35:48] Darkwater: probably overkill, I like the idea of having a parent exception class tho


[15:23:46] Darkwater: Quit: We will return shortly after these short commercials.


[13:31:30] Darkwater: the 'possibly' is just redundant



[00:55:34] Darkwater: has joined #ruby


[23:27:11] Darkwater: Ping timeout: 265 seconds


[19:15:35] Darkwater: anyone here got experience with ZeroC ICE?
[19:15:39] Darkwater: trying to use callbacks with murmur
[19:15:52] Darkwater: but I can find like zero documentation on how to do that in ruby
[19:27:45] Darkwater: should be an edit button somewhere near the top



[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:22] Darkwater: might as well put def to_json; to_h.to_json; end then
[19:00:48] Darkwater: was thinking of doing some trickery to call that on objects that don't have to_json
[19:05:22] Darkwater: jhass: think I'm just going to reopen Object for this
[19:05:28] Darkwater: I'd expect this to be default behaviour
[19:09:28] Darkwater: how about a method_missing that checks if to_h exists?
[19:10:18] Darkwater: and to clarify, I'd expect the json module to check for both to_json and to_h
[19:12:23] Darkwater: well, at least in my situation they are
[19:12:34] Darkwater: I'll just slam a to_h in every object for now then
[19:16:53] Darkwater: oh great, the proper to_json -> to_h implementation is longer than I thought
[19:16:59] Darkwater: muh screen space :<
[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:37:26] Darkwater: XF: did you install domainatrix?
[19:43:13] Darkwater: XF: if you can't install it using gem you should find another way of installing it
[19:43:27] Darkwater: maybe fetch it from github or wherever


[00:42:48] Darkwater: slack supports irc kind of
[00:42:52] Darkwater: might make the transition easier
[00:44:25] Darkwater: there's probably limitations
[00:44:31] Darkwater: but at least you can chat
[00:44:40] Darkwater: slack is really just irc with more features anyway
[00:45:00] Darkwater: second, in his case
[00:45:16] Darkwater: but yeah ruby isn't hard to learn
[00:46:18] Darkwater: the web interface is fine
[00:46:55] Darkwater: sinatra is cool as well


[19:17:18] Darkwater: has joined #ruby
[19:17:51] Darkwater: I've got a module that's basically a container for things, should the name be plural or singular?
[19:18:39] Darkwater: Service::IRC, Service::Telegram etc
[19:18:45] Darkwater: for a multi-protocol chat client
[19:19:16] Darkwater: protocol-specific code
[19:19:20] Darkwater: it's about Service
[19:20:16] Darkwater: hm, makes sense
[23:11:28] Darkwater: what are the most mature desktop gui libs for ruby?
[23:11:39] Darkwater: any decent gtk/qt bindings?
[23:15:17] Darkwater: Ox0dea: chat client
[23:15:26] Darkwater: also I keep trying to complete your name from 0x


[02:48:59] Darkwater: Ping timeout: 250 seconds


[09:55:16] Darkwater: has joined #ruby


[18:04:56] Darkwater: Ping timeout: 265 seconds


[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?
[16:56:40] Darkwater: what would be the msot ruby way
[17:01:38] Darkwater: jhass: it's not just an irc bot, it's an entire client
[17:01:45] Darkwater: so I'd like full control over everything
[17:01:58] Darkwater: but I'll take a look at how cinch does things
[17:10:17] Darkwater: been wanting this for a while now
[17:10:43] Darkwater: I want things
[17:10:55] Darkwater: want to make yet another multichat client
[17:11:03] Darkwater: irc, telegram, steam, idk what else
[17:11:35] Darkwater: a client that supports multiple protocols
[17:12:04] Darkwater: already having difficulty in deciding how to make the desktop client
[17:12:29] Darkwater: well I want the chat client to be like a daemon
[17:12:34] Darkwater: and have clients connect to that
[17:12:40] Darkwater: so it'd be like running irssi in a remote screen
[17:12:58] Darkwater: or more like that one irc client I forgot the name of
[17:13:08] Darkwater: quassel does it I think
[17:13:14] Darkwater: server should be fine in ruby
[17:13:25] Darkwater: terminator is written in python and it'
[17:13:29] Darkwater: s popular (though slow)
[17:13:49] Darkwater: but hey, performance isn't a big issue for a chat client
[17:14:38] Darkwater: "ruby-inspired syntax"
[17:14:43] Darkwater: >example is pure valid ruby
[17:15:12] Darkwater: yxhuvud: what do you mean?
[17:15:31] Darkwater: there's one user per server
[17:15:32] Darkwater: read closer
[17:16:55] Darkwater: yeah I consider that a disadvantage of ruby
[17:17:08] Darkwater: but I still like the language
[17:17:22] Darkwater: and I probably wouldn't complete the project if I'd write it in C++
[17:17:43] Darkwater: maybe I'll make a C++ server later
[17:18:32] Darkwater: I have little to no experience with functional programming
[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:38:12] Darkwater: try devdocs.io
[14:39:22] Darkwater: adaedra: just a general tip for everyone though
[14:39:25] Darkwater: has ruby docs as well
[14:39:32] Darkwater: hm, it is true that those help
[14:39:43] Darkwater: anyway dudedudeman learning php is time wasted
[14:40:08] Darkwater: unless you want to become a corporate code typer with job security for a couple of years


[14:03:58] Darkwater: Correction: <[k-_> no


[08:35:11] Darkwater: *.net *.split
[08:37:36] Darkwater: has joined #ruby


[10:00:47] Darkwater: *.net *.split
[12:18:46] Darkwater: has joined #ruby
[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:19:42] Darkwater: like a combined find_all + delete_if? (like a selective pop)
[12:22:21] Darkwater: yeah but I also want to operate on the deleted items
[12:22:24] Darkwater: it's for a queue
[12:22:44] Darkwater: the order is not guaranteed
[12:22:53] Darkwater: actually it's probably not literally a queue
[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
[12:23:55] Darkwater: while removing them from the list
[12:24:58] Darkwater: well, guess I'll just stick with delete_if
[12:25:04] Darkwater: thanks for the suggestions tho
[12:25:29] Darkwater: none, but I already wrote delete_if :>
[12:25:54] Darkwater: it's also more explanatory imo
[12:26:16] Darkwater: yeah but I do need self-modifying
[12:28:29] Darkwater: I'm not going to overengineer this though
[12:50:16] Darkwater: gregf_: I understand how to use partition
[12:50:23] Darkwater: but it's just not what I want in this case


[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:48:03] Darkwater: hm, that's a shame
[11:48:15] Darkwater: anything else?
[11:48:35] Darkwater: actually I guess a function like that would be the only option
[11:49:11] Darkwater: hm, I guess I could use #value? in this case
[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:51:12] Darkwater: so I'm basically looking for an item with an id OR name specified by the user
[11:53:46] Darkwater: I'm happy with the solution I have now
[11:55:13] Darkwater: the id is still used elsewhere


[05:23:27] Darkwater: Ping timeout: 252 seconds


[11:23:23] Darkwater: pretty sure it's possible somehow
[11:23:31] Darkwater: http://datamapper.org/getting-started.html
[11:23:40] Darkwater: pretty sure I'm not
[11:24:27] Darkwater: what I want to do is similar to datamapper though
[11:24:41] Darkwater: I'm basically making models for json objects
[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:04] Darkwater: so I'd want to do something like field :user, User
[11:26:35] Darkwater: which takes obj[:user] in initialize and puts it in @user, and make a reader that returns User.new @user
[11:26:46] Darkwater: something like that
[11:27:53] Darkwater: let me write up a quick example
[11:32:11] Darkwater: http://hastebin.com/yatoguhoka.rb
[11:32:15] Darkwater: that's what I want to do
[11:33:18] Darkwater: how am I going to define the readers and writers though?
[11:34:43] Darkwater: simply def it
[11:34:56] Darkwater: but that would result in lots of repetition
[11:35:06] Darkwater: so I want to write a helper for it
[11:36:06] Darkwater: module Foo; def foo(name); attr_accessor name; end; end is almost what I want
[11:36:18] Darkwater: how do attr_* work?
[11:36:47] Darkwater: can I view the source for them somewhere?
[11:37:44] Darkwater: alright thanks
[11:37:47] Darkwater: I'll mess around a bit
[11:43:34] Darkwater: alright, I got it
[11:43:37] Darkwater: thanks for the help
[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
[12:37:50] Darkwater: that would look pretty ugly imo
[12:38:00] Darkwater: think I can see why datamapper does the extend for you
[12:38:41] Darkwater: I think a subclass would make the most sense tbh
[12:38:46] Darkwater: since it's basically just a type
[12:40:48] Darkwater: eh, doesn't sound like something I'll need for this anyway
[12:40:54] Darkwater: I could almost use a struct for this
[12:41:29] Darkwater: think so too \o/
[12:41:39] Darkwater: wonder why I thought this wouldn't work earlier
[12:41:56] Darkwater: still nice though, learnt a lot about modules and include/extend
[13:13:41] Darkwater: apeiros: aw yeah, sweet success! http://novaember.com/s/8f9453/OaEHnm.png
[13:14:31] Darkwater: I should get an emoji font
[13:14:57] Darkwater: yeah I've found a way to find that out
[13:15:02] Darkwater: graphemica.com/<character>
[13:22:47] Darkwater: tuor: for hashes and arrays you can use json
[13:22:55] Darkwater: there's also yaml but I'm not sure what that's for
[13:23:40] Darkwater: require 'json'
[13:23:42] Darkwater: obj.to_json
[13:24:39] Darkwater: on hashes and arrays (and a few others, string etc) at least