« Back to channel list

#ruby - 02 November 2015

« Back 1 day Forward 1 day »
[00:00:16] shevy: I more care about the end point than the steps towards it
[00:00:28] shevy: and having to debug stuff always feels like a complete waste of time
[00:00:35] al2o3-cr: shevy: bypass them depends., do you like coding?
[00:00:47] shevy: not really
[00:00:59] al2o3-cr: shevy: Why not?
[00:02:22] al2o3-cr: shevy: No story is perfect, without...
[00:02:22] shevy: al2o3-cr because I feel that the end point is more important than the intermediary step. mankind in the future won't need to program the way we used to do it
[00:03:16] al2o3-cr: shevy: you don't feel the love do you!
[00:03:24] jsrn: has joined #ruby
[00:03:32] VeryBewitching: Code doesn't love.
[00:03:48] VeryBewitching: Well, hopefully it does anyway. ;)
[00:03:55] al2o3-cr: VeryBewitching: very observbant
[00:04:24] shevy: al2o3-cr yeah. I like the process of creating something that works
[00:04:36] al2o3-cr: shevy: Why?
[00:04:37] mistermocha: has joined #ruby
[00:04:49] VeryBewitching: If you look at the trend of how we're defining new languages to write code, we're moving away from an exclusive club of individuals who write all the code to languages that will allow anyone to do it.
[00:05:08] rbennacer: has joined #ruby
[00:05:25] VeryBewitching: In 30 - 40 years people will learn how to do it in elementary school.
[00:05:34] shevy: al2o3-cr because that is the part that is creative
[00:06:11] devoldmx: has joined #ruby
[00:06:12] al2o3-cr: shevy: What does it give you?
[00:06:54] graffix: has joined #ruby
[00:08:17] shevy: al2o3-cr which part
[00:08:48] al2o3-cr: shevy: the creative part
[00:09:12] shevy: al2o3-cr aaah. ideas! ideas build on ideas, you have to watch more Alan Kay lectures
[00:10:07] al2o3-cr: Why, he's only made of what is everything, isn't he?
[00:10:47] shevy: unless you can break the rules of the universe that's valid for everyone
[00:11:16] markfletcher: has joined #ruby
[00:12:27] al2o3-cr: shevy: whatever you tink, Mr.
[00:13:55] al2o3-cr: Ruby gives me satisfaction
[00:13:59] freerobby: has joined #ruby
[00:15:39] al2o3-cr: understand the concepts or behold them
[00:17:05] mistermocha: has joined #ruby
[00:20:49] Brando753: has joined #ruby
[00:24:41] bruno-: has joined #ruby
[00:24:55] jsrn: has joined #ruby
[00:26:06] DenSchub: has joined #ruby
[00:26:55] to_json: has joined #ruby
[00:26:55] to_json: has joined #ruby
[00:27:29] opensource_ninja: has joined #ruby
[00:28:37] mistermocha: has joined #ruby
[00:28:57] terlar: has joined #ruby
[00:29:26] Meeh: has joined #ruby
[00:30:31] Ox0dea: VeryBewitching: Execution can be an act of love.
[00:30:55] Ox0dea: shevy: For what other things is the destination more important than the journey for you?
[00:31:30] VeryBewitching: Ox0dea: That statement can lead to some interesting philosophical discussion, but what the machine does is not emotional; our investment into the code is.
[00:32:02] Ox0dea: VeryBewitching: Only meat can feel, yeah?
[00:32:22] VeryBewitching: Ox0dea: That depends on the meat.
[00:33:00] Ox0dea: VeryBewitching: But your position is that there are at present no non-meat feelers, yes?
[00:33:38] VeryBewitching: Ox0dea: My position is that I have felt for code, I've never experienced code that has felt for me.
[00:33:53] kalusn: has joined #ruby
[00:34:14] VeryBewitching: Ox0dea: I can't comment on other entities that I have not witnessed.
[00:34:57] wnd: has joined #ruby
[00:35:08] Ox0dea: VeryBewitching: Then you confess to having no basis on which to conclude that the transistors don't derive some altruistic satisfaction in performing the work we give them.
[00:35:38] VeryBewitching: Ox0dea: If I were to confess that, you would also have to confess to having no basis to determine that they do.
[00:36:31] VeryBewitching: Ox0dea: We can talk about ideas, the abstract lands we visit in our mind when we're deep in our creations, but neither of us know what the logic gates can or cannot feel.
[00:37:03] VeryBewitching: Ox0dea: Unless you've had meangingful conversations with a 64-bit processor lately :D
[00:37:17] al2o3-cr: VeryBewitching: go suck a dummie or summat
[00:37:33] VeryBewitching: al2o3-cr: I don't even know what you just said.
[00:37:59] cashnguns: has joined #ruby
[00:38:03] markfletcher: has left #ruby: ()
[00:38:36] al2o3-cr: VeryBewitching: it's a compliment
[00:38:45] VeryBewitching: ACTION shrugs.
[00:38:49] VeryBewitching: If you say so :D
[00:39:14] Azure: has joined #ruby
[00:40:05] StevenXL: has joined #ruby
[00:40:07] StevenXL: Hi everyone.
[00:40:13] StevenXL: I need to make a request to an API like so:
[00:40:16] StevenXL: https://gist.github.com/StevenXL/72beab78403cdca34da6
[00:40:33] tlaxkit: has joined #ruby
[00:40:36] StevenXL: In that example, they use curl and the --data-binary option.
[00:40:45] havenwood: al2o3-cr: Be nice.
[00:40:50] StevenXL: How can I do effectively the same thing in Ruby?
[00:44:35] mistermocha: has joined #ruby
[00:47:26] arooni: has joined #ruby
[00:49:44] saddad: has joined #ruby
[00:49:57] Ox0dea: StevenXL: Are you sure you need to emulate `--data-binary`? That just does a POST without URL-encoding anything; that can be done with Net::HTTP#post and a plain-ol' String.
[00:50:02] shevy: Ox0dea life, for instance
[00:50:14] skade: has joined #ruby
[00:51:05] Ox0dea: shevy: Uh... what?
[00:51:08] StevenXL: Ox0dea, I'm not sure. I can try it as you've suggested.
[00:51:13] StevenXL: I'll be back.
[00:51:16] Ox0dea: StevenXL: Godspeed.
[00:51:50] DiCablo: has joined #ruby
[00:51:55] al2o3-cr: StevenXL: set the Content-Type to octet-stream
[00:51:57] taylorrf: has joined #ruby
[00:52:36] Ox0dea: But consider not bothering.
[00:54:34] markfletcher: has joined #ruby
[00:54:41] mistermocha: has joined #ruby
[00:54:42] al2o3-cr: bothered meh
[00:55:30] Dakuan: has joined #ruby
[00:57:55] Rollabunna: has joined #ruby
[00:58:01] sankaber: has joined #ruby
[00:58:16] weemsledeux: has joined #ruby
[00:58:17] al2o3-cr: jesus f c open links lee
[00:58:32] DLSteve: has joined #ruby
[00:58:41] mag42c: has joined #ruby
[00:59:16] but3k4: has joined #ruby
[01:00:16] ledestin: has joined #ruby
[01:00:36] rgtk: has joined #ruby
[01:02:40] rgtk: has joined #ruby
[01:03:42] mistermocha: has joined #ruby
[01:04:04] bubbys: has joined #ruby
[01:04:34] rgtk: has joined #ruby
[01:06:16] rgtk: has joined #ruby
[01:07:18] StevenXL: Ox0dea, Do I have to create a uri object first?
[01:07:38] Ox0dea: StevenXL: Shouldn't be necessary, no.
[01:08:20] rgtk: has joined #ruby
[01:08:23] StevenXL: but I do have to create a new Net:HTTP object. I was wondering if you could clarify on the path argument. Is that the full API endpoint, including auth keys, or the base?
[01:08:28] StevenXL: I can try both.
[01:08:59] Ox0dea: StevenXL: You do need a Net::HTTP instance, yes, and you construct one with a server and an optional port.
[01:10:04] rgtk: has joined #ruby
[01:10:08] s00pcan: has joined #ruby
[01:11:23] Ox0dea: StevenXL: #post can be called several ways, but since you're supplying data (as the second argument) instead of name-value pairs, you'll have to include the query parameters in the path (the first argument).
[01:11:36] StevenXL: that's what was confusing me.
[01:11:50] StevenXL: I was passing them into Net::HTTP.new.
[01:12:02] rgtk: has joined #ruby
[01:12:04] l_tonz: has joined #ruby
[01:14:02] rgtk: has joined #ruby
[01:15:17] StevenXL: I get some kind of socket error. This is what my Net::HTTP instance looks like
[01:15:17] StevenXL: #<Net::HTTP https://extract-beta.api.smartystreets.com:80 open=false>
[01:15:23] StevenXL: I called that variable res
[01:15:55] StevenXL: then I did res.post("auth-id=akcb&auth-token=abcd", data), and I've set the data variable to the string I want to pass in.
[01:16:04] StevenXL: Note that those are not my real auth keys / id
[01:16:08] al2o3-cr: StevenXL: ssl 443
[01:16:10] StevenXL: But I get that socket error.
[01:16:24] StevenXL: al2o3-cr, I need to set it in the Net::HTTP instance?
[01:16:54] Ox0dea: StevenXL: `res.use_ssl = true`
[01:17:37] rgtk_: has joined #ruby
[01:17:39] mistermocha: has joined #ruby
[01:18:32] marahin: hello. What would be the best way to set variable to a value of conditional block, e.g. var = Array.each{ |item| item if item=="name" }?
[01:18:35] marahin: Is there any way to do that?
[01:18:45] blackmesa: has joined #ruby
[01:18:54] Ox0dea: marahin: Are you sure that's what you want to do?
[01:19:15] marahin: Ox0dea, I want to get a one liner of all the items that match, yes.
[01:19:21] Ox0dea: marahin: You want #select.
[01:19:43] rgtk: has joined #ruby
[01:19:49] marahin: Ox0dea, thank you
[01:19:52] Ox0dea: marahin: Sure thing.
[01:20:07] Ox0dea: marahin: If you've got all Strings, you might even consider #grep.
[01:20:19] Ox0dea: >> %w[foo bar baz].grep(/a/)
[01:20:20] ruboto: Ox0dea # => ["bar", "baz"] (https://eval.in/461358)
[01:21:24] rgtk: has joined #ruby
[01:21:47] StevenXL: Ox0dea, al2o3-cr I think I'm getting somewhere.
[01:21:52] StevenXL: I'm getting this resposne now
[01:21:52] d34th4ck3r: has joined #ruby
[01:21:52] StevenXL: #<Net::HTTPBadRequest 400 Bad Request readbody=true>
[01:22:02] al2o3-cr: ?code StevenXL
[01:22:02] ruboto: StevenXL, We can't help you without your code, please post it to https://gist.github.com
[01:22:03] StevenXL: I had to do this: http.verify_mode = OpenSSL::SSL::VERIFY_NONE
[01:22:30] marahin: Ox0dea, nah, I have a complicated hash I need to look upon, what I wrote was just an example of what I though would work and would be the easiest to implement
[01:22:42] marahin: thank you very much for your help, I looked .select up and it works like a charm
[01:22:55] Ox0dea: marahin: Ah, all right, then. Happy to have helped.
[01:23:21] rgtk: has joined #ruby
[01:23:22] StevenXL: ruboto, sorry about that
[01:23:23] StevenXL: https://gist.github.com/StevenXL/1bebd9bc8433a8be74ab
[01:23:37] rickmasta: has joined #ruby
[01:24:09] juanpablo__: has joined #ruby
[01:24:59] yfeldblum: has joined #ruby
[01:25:05] Channel6: has joined #ruby
[01:25:21] rgtk: has joined #ruby
[01:25:56] Ox0dea: StevenXL: Stick a '/' before the '?' on Line 7.
[01:27:07] rgtk: has joined #ruby
[01:27:42] StevenXL: woot woot!!
[01:27:46] StevenXL: thank you both
[01:28:05] StevenXL: Ox0dea, thanks!
[01:28:25] Ox0dea: StevenXL: Sure thing.
[01:28:55] al2o3-cr: StevenXL: Net::HTTP.post_form(URI('https://extract-beta.api.smartystreets.com/'), { "?auth-id" => "id", "auth-token" => "id"}) # shortcut
[01:29:04] rgtk: has joined #ruby
[01:29:35] dorei: is there some ruby testing framework where i could provide it with a set of inputs and a set of expected outputs ?
[01:29:41] Ox0dea: al2o3-cr: StevenXL needs to send data along as well.
[01:30:02] Ox0dea: dorei: Why not just replace with $stdin and $stdout with StringIO instances and do "regular" testing?
[01:30:24] al2o3-cr: ah, should read more carefully
[01:30:44] StevenXL: hehe no worries. I couldn't have gotten this to work w/o both your helps
[01:30:46] StevenXL: very grateful.
[01:30:51] StevenXL: I should probably go home now.
[01:30:56] StevenXL: It's late and getting cold.
[01:30:58] Ox0dea: Pleasure meeting you.
[01:31:01] rgtk: has joined #ruby
[01:31:05] dorei: Ox0dea: both rspec and minitest give me the impression that their philosophy is like one assertion/expectation per case
[01:31:16] StevenXL: Same here Ox0dea. I will surely be back.
[01:31:20] TheNet: has joined #ruby
[01:31:21] Ox0dea: dorei: And your IO is crazy enough as to not fit well within that model?
[01:31:31] Ox0dea: StevenXL: Looking forward to it. :)
[01:31:45] dorei: Ox0dea: it's not IO, i'm refering to input in a more generic way
[01:31:50] al2o3-cr: StevenXL: you'll become a Ruby ninja in no time :)
[01:31:53] Ox0dea: dorei: Parameters, then?
[01:32:34] baroquebobcat: has joined #ruby
[01:32:44] rgtk: has joined #ruby
[01:33:37] dorei: Ox0dea: let's say it's a method that adds two numbers, i think that both rspec/minitest promote something like doing a test that 2 + 3 is 5, i want something like: i give it100 pairs of numbers to added and 100 expected results
[01:33:46] solocshaw: has joined #ruby
[01:34:01] Ox0dea: dorei: Do you want to come up with those 100 numbers yourself?
[01:34:29] Ox0dea: *100 pairs
[01:34:43] dorei: maybe, usually i already have that list
[01:34:44] rgtk: has joined #ruby
[01:34:58] Ox0dea: dorei: Then you need only realize that the test frameworks are "just Ruby".
[01:35:11] mistermocha: has joined #ruby
[01:35:13] dorei: of course
[01:35:35] dorei: i could enumerate my inputs and expect to much the enumerated outputs
[01:35:41] Ox0dea: dorei: pairs.each { |a, b| my_add(a, b).must_equal(a + b) }
[01:36:03] Vile`: has joined #ruby
[01:36:04] Ox0dea: You can just stick assertions/expectations in loops.
[01:36:06] dorei: so, that's the only way to do it?
[01:36:17] Ox0dea: What alternative would you prefer?
[01:36:44] rgtk: has joined #ruby
[01:37:13] Yzguy: has joined #ruby
[01:37:14] dorei: well, maybe something that has two directories, one input and one output and i just throw files into there, i dont know
[01:37:14] rbennacer: has joined #ruby
[01:37:44] al2o3-cr: nokogiri/hpricot ?
[01:38:04] Ox0dea: dorei: That could certainly be orchestrated.
[01:38:15] al2o3-cr: just out of them two?
[01:38:22] Ox0dea: False dichotomy.
[01:38:26] rgtk: has joined #ruby
[01:39:22] al2o3-cr: nokogiri kills any hands down and drawn
[01:39:59] dorei: if u manage to install nokogiri, i think it's really good, at least when it comes to xpath queries
[01:40:22] rgtk: has joined #ruby
[01:40:26] al2o3-cr: dorei: why would you not be able to install it?
[01:40:53] Ox0dea: I've never had that problem, but it's extremely common. :<
[01:40:58] pwnd_nsfw: If you're using windows...
[01:41:02] DiCablo: has joined #ruby
[01:41:03] pwnd_nsfw: It can be a pain
[01:41:08] pwnd_nsfw: but lol devving on windows
[01:41:15] dorei: and in linux too, gem install nokogiri doesnt work for me
[01:41:21] Ox0dea: dorei: Distro?
[01:41:30] al2o3-cr: it comes with libxml2
[01:41:33] mndoci: has joined #ruby
[01:41:39] pwnd_nsfw: I haven't had any problems with Ubuntu 15.04
[01:41:47] pwnd_nsfw: I was so relieved to not run into gem issues
[01:41:56] pwnd_nsfw: Because I was using Windows prior.....
[01:42:18] dorei: i have to use this:
[01:42:19] dorei: gem install nokogiri -- --use-system-libraries --with-xml2-config=/usr/bin/xml2-config --with-xslt-config=/usr/bin/xslt-config
[01:42:21] al2o3-cr: pwnd_nsfw: get rid of wind*z
[01:42:23] rgtk: has joined #ruby
[01:42:31] pwnd_nsfw: al2o3-cr, I would, but, like, games
[01:42:36] pwnd_nsfw: Wine/PlayOnLinux is shit
[01:42:43] nertzy: has joined #ruby
[01:42:47] al2o3-cr: pwnd_nsfw: true
[01:42:55] pwnd_nsfw: So, basically, I have laptop setup for dev work
[01:43:16] pwnd_nsfw: But really, what I do is SSH to Linux machine and still do the actual coding part on Windows lol
[01:43:27] pwnd_nsfw: I do it to pretend I have multiple monitors, tbh
[01:43:45] solocshaw: has joined #ruby
[01:43:53] al2o3-cr: dorei: what OS?
[01:44:06] rgtk: has joined #ruby
[01:44:19] pwnd_nsfw: and would it also matter how he installed Ruby?
[01:44:33] al2o3-cr: pwnd_nsfw: no
[01:44:55] al2o3-cr: dorei: pretty self explanitory really
[01:45:25] m3_del: has joined #ruby
[01:45:35] al2o3-cr: dorei: debian by any chance?
[01:46:05] rgtk: has joined #ruby
[01:46:08] A124: has joined #ruby
[01:46:36] dorei: al2o3-cr: opensuse 11.2
[01:46:39] tkuchiki: has joined #ruby
[01:46:55] Ox0dea: shevy: I realize now that you must've been referring to an afterlife; I do hope you took no offense from my confusion.
[01:47:13] al2o3-cr: dorei: whats `gem -v` say
[01:47:15] dorei: Ox0dea: i think what i'm looking for is data tables feature of cucumber without using cucumber :)
[01:47:39] VladGh: has joined #ruby
[01:47:40] dorei: al2o3-cr: 2.4.8
[01:48:01] rgtk: has joined #ruby
[01:48:41] ScoppoTutteLeFig: has joined #ruby
[01:48:48] Ox0dea: dorei: Damn! I vaguely remember coming across something that fits that description to all 5 Ts.
[01:48:48] ScoppoTutteLeFig: where italian ruby channel?
[01:49:11] Ox0dea: ScoppoTutteLeFig: #ruby-it is dead.
[01:49:25] al2o3-cr: dorei: sudo zypper in libxml2-devel libxslt-devel
[01:49:35] ScoppoTutteLeFig: i remember sex hookup with girl from italian channel
[01:49:39] ScoppoTutteLeFig: i want to find her again
[01:49:48] rgtk: has joined #ruby
[01:50:02] ScoppoTutteLeFig: she was quite very nice
[01:50:09] s00pcan: has joined #ruby
[01:50:14] dorei: Ox0dea: 5 Ts = ?
[01:50:29] Ox0dea: >> 'data tables feature of cucumber without using cucumber'.count ?t # dorei
[01:50:30] ruboto: Ox0dea # => 5 (https://eval.in/461360)
[01:50:36] dorei: al2o3-cr: i already have them
[01:51:01] Rennex: has joined #ruby
[01:51:03] Ox0dea: dorei: It's usually "fits to a T"; I was being cute.
[01:51:42] rgtk: has joined #ruby
[01:52:04] ScoppoTutteLeFig: are you not cute Ox0dea?
[01:52:24] zenguy_pc: has joined #ruby
[01:52:32] al2o3-cr: ScoppoTutteLeFig: 2121 do one
[01:53:21] skade: has joined #ruby
[01:53:40] rgtk: has joined #ruby
[01:53:40] l_tonz: has joined #ruby
[01:55:06] CVTJNII: has joined #ruby
[01:55:17] al2o3-cr: Ox0dea: how'd you get the essid of AP using Fiddle?
[01:55:27] rgtk: has joined #ruby
[01:55:35] Ox0dea: dorei: Gah, I've not found it yet, but I'm almost certain it was something Gary Bernhardt used in an episode of Destroy All Software.
[01:56:05] al2o3-cr: Ox0dea: is it possible?
[01:56:41] Dakuan: has joined #ruby
[01:56:50] Ox0dea: al2o3-cr: Are you asking if libpcap is a thing?
[01:56:54] kaskalu: has joined #ruby
[01:57:17] horsecowdog: has joined #ruby
[01:57:19] al2o3-cr: libpcap is a thing, do you know how?
[01:57:23] rgtk: has joined #ruby
[01:57:33] al2o3-cr: would love to know :)
[01:58:42] Ox0dea: al2o3-cr: There's good reason to suspect more than one function is involved, but Fiddle can wrap pretty much any C function, so why not give it a shot?
[01:59:21] rgtk: has joined #ruby
[01:59:22] Ox0dea: As an aside, you should probably consider whether Ruby is the right tool here.
[02:00:26] haraoka: has joined #ruby
[02:00:39] Dakuan: has joined #ruby
[02:00:51] al2o3-cr: Ox0dea: well you could get it using raw sockets, but wondering how you would do it using fiddle
[02:01:05] rgtk: has joined #ruby
[02:01:37] al2o3-cr: depending if your NIC supported monitor mode
[02:01:58] radgeRayden: has joined #ruby
[02:02:05] mary5030: has joined #ruby
[02:02:20] beast: has joined #ruby
[02:02:27] rakm: has joined #ruby
[02:02:57] rgtk_: has joined #ruby
[02:03:57] mary5030: has joined #ruby
[02:05:03] rgtk: has joined #ruby
[02:05:32] Ox0dea: al2o3-cr: I would just shell out.
[02:05:50] Contigi: has joined #ruby
[02:05:52] Ox0dea: "Ponies for courses", as they say.
[02:06:18] al2o3-cr: Ox0dea: Is it possible?
[02:06:55] rgtk: has joined #ruby
[02:06:57] devoldmx: has joined #ruby
[02:07:12] Ox0dea: al2o3-cr: No, definitely not.
[02:07:42] al2o3-cr: Ox0dea: Is that a cert?
[02:07:55] Ox0dea: Most assuredly.
[02:08:37] rgtk: has joined #ruby
[02:08:54] Ox0dea: Because computers hate us.
[02:10:14] dorei: al2o3-cr: have you checked packetfu ?
[02:10:37] rgtk: has joined #ruby
[02:10:43] al2o3-cr: dorei: yeah, that's not question though :)
[02:10:44] Rennex: has joined #ruby
[02:12:33] rgtk: has joined #ruby
[02:12:47] tvon: has joined #ruby
[02:13:09] mag42c: has joined #ruby
[02:14:17] arooni: has joined #ruby
[02:14:18] rgtk: has joined #ruby
[02:16:16] rgtk: has joined #ruby
[02:16:48] TheNet: has joined #ruby
[02:17:07] mndoci: has joined #ruby
[02:18:12] rgtk: has joined #ruby
[02:19:33] mary5030: has joined #ruby
[02:19:55] cwong_on_irc: has joined #ruby
[02:20:18] rgtk: has joined #ruby
[02:20:40] shevy: hmm how to chop a string up into 3 characters each? so that 'ABCDEFGHI' would become ['ABC','DEF','GHI']?
[02:21:23] havenwood: >> 'ABCDEFGHI'.scan /.../
[02:21:24] ruboto: havenwood # => ["ABC", "DEF", "GHI"] (https://eval.in/461361)
[02:21:35] mistermocha: has joined #ruby
[02:21:49] havenwood: >> 'ABCDEFGHI'.each_char.each_slice(3).map &:join
[02:21:50] ruboto: havenwood # => ["ABC", "DEF", "GHI"] (https://eval.in/461362)
[02:21:52] al2o3-cr: havenwood: i was gonna say that
[02:21:54] rgtk: has joined #ruby
[02:22:10] mistermo_: has joined #ruby
[02:22:11] al2o3-cr: havenwood: i was gonna say that
[02:22:17] shevy: aaaah I was using .split and wondered why it did not work, thanks
[02:22:31] Ox0dea: >> 'abcdefghijk'.scan /..?.?/ # for not ignoring the tail
[02:22:32] ruboto: Ox0dea # => ["abc", "def", "ghi", "jk"] (https://eval.in/461363)
[02:23:02] Ox0dea: We could sure use String.expand and String#expand.
[02:23:04] mary5030_: has joined #ruby
[02:23:11] Ox0dea: #tr's semantics would be fine.
[02:23:15] havenwood: >> 'ABCDEFGHIJ'.each_char.each_slice(3).map &:join
[02:23:16] ruboto: havenwood # => ["ABC", "DEF", "GHI", "J"] (https://eval.in/461364)
[02:23:32] vigintas: has joined #ruby
[02:23:48] Ox0dea: That is, 'a-g' == 'abcdefg' would be nice, and not just for golf either. :P
[02:23:55] rgtk: has joined #ruby
[02:23:59] devbug: has joined #ruby
[02:24:03] Ox0dea: *'a-g'.expand
[02:24:04] krz: has joined #ruby
[02:25:03] mary5030: has joined #ruby
[02:25:35] rgtk: has joined #ruby
[02:27:00] shevy: know what I find the most interesting part here?
[02:27:04] bruce_lee2: has joined #ruby
[02:27:11] shevy: that Ox0dea is using downcased 'abcdef' and havenwood goes all upcased!
[02:27:35] rgtk: has joined #ruby
[02:27:49] ss_much: has joined #ruby
[02:28:04] havenwood: shevy: I'd probably have used downcase too but was mimicking your example.
[02:28:37] Ox0dea: shevy: So you get to tell us why you hate whichever pinky you shift with.
[02:29:28] Ox0dea: al2o3-cr: Are all the integers either even or odd?
[02:29:35] rgtk: has joined #ruby
[02:30:06] havenwood: al2o3-cr: -0.negative? #=> false
[02:30:20] al2o3-cr: Ox0dea: they'll are +/- bar 0
[02:30:28] Ox0dea: al2o3-cr: So 0 isn't an integer?
[02:30:52] Ox0dea: >> 0.integer?
[02:30:54] ruboto: Ox0dea # => true (https://eval.in/461366)
[02:31:19] rgtk: has joined #ruby
[02:31:23] Ox0dea: This is the String#tr implementation: https://eval.in/461365
[02:31:30] al2o3-cr: I asked is 0 even?
[02:31:46] Ox0dea: I have no idea what to extract out such that String#expand could have a nice clean implementation. :<
[02:31:57] havenwood: Ox0dea: hmm
[02:32:21] havenwood: Ox0dea: of course not the same but kinda reminds me of: https://github.com/tom-lord/regexp-examples
[02:32:50] havenwood: /[a-z]/.examples max_group_results: 26
[02:33:01] colegatron: has joined #ruby
[02:33:13] rgtk_: has joined #ruby
[02:33:18] Ox0dea: ACTION fucks al2o3-cr.
[02:33:48] al2o3-cr: how easy do people want it
[02:34:07] ruby-lang070: has joined #ruby
[02:34:21] havenwood: ruby-lang070: hi
[02:34:42] ruby-lang070: I have a question about methods, do you have a sec?
[02:34:58] havenwood: ruby-lang070: Ask away.
[02:35:14] rgtk: has joined #ruby
[02:35:44] rbennacer: has joined #ruby
[02:36:40] Glenny: has joined #ruby
[02:36:49] ruby-lang070: Ok, so I'm trying to understand why when I pass just a variable to a method and then change it inside the method and then call the variable after i've made the method call its value doesnt actually change from when before it was passed to the method, but if i pass a hash and modify it in a method and then call it after the method call then it is actually modified
[02:36:57] al2o3-cr: So 0 isn't an integer? phaha i need to reAD
[02:36:58] ruby-lang070: maybe i should make a gist haha
[02:36:59] rgtk: has joined #ruby
[02:37:04] havenwood: ruby-lang070: Your text probably got cut off there.
[02:37:14] ruby-lang070: ill make a gist
[02:37:19] havenwood: ruby-lang070: :D
[02:37:31] mloy: has joined #ruby
[02:37:31] duckpuppy: has joined #ruby
[02:37:39] al2o3-cr: scope baby, scope
[02:37:53] Ox0dea: ruby-lang070: Array and Hash are essentially "reference types", if that helps you find literature on the matter.
[02:37:54] mloy: has left #ruby: ()
[02:38:25] al2o3-cr: Ox0dea: so are Strings, no?
[02:38:27] DN404: its not scope technically
[02:38:34] Ox0dea: It's got nothing to do with scope.
[02:38:42] havenwood: al2o3-cr: What's zero divided by two?
[02:38:44] al2o3-cr: I jumped the gun
[02:38:51] rgtk: has joined #ruby
[02:38:52] al2o3-cr: havenwood: 5?
[02:39:08] havenwood: al2o3-cr: (It's even.)
[02:39:20] al2o3-cr: havenwood: 16 then
[02:39:39] weemsledeux: has joined #ruby
[02:39:46] havenwood: al2o3-cr: 0.positive? #=> false
[02:39:48] Ox0dea: ruby-lang070: Really, almost every value in Ruby is "mutable", and if you mutate the object passed into your method, the difference will be visible from outside.
[02:40:07] Ox0dea: havenwood: You must have massive stores of troll food.
[02:40:14] havenwood: Ox0dea: haha
[02:40:15] al2o3-cr: havenwood: and your point is?
[02:40:38] havenwood: al2o3-cr: Negative zero is not negative and zero is not positive.
[02:40:49] al2o3-cr: 0 is neither -/+ as i said
[02:40:52] ruby-lang070: https://gist.github.com/anonymous/063ec227986240405b51
[02:40:53] rgtk_: has joined #ruby
[02:40:58] havenwood: al2o3-cr: (Ruby 2.3)
[02:41:12] al2o3-cr: havenwood: and
[02:41:30] havenwood: al2o3-cr: It's divisible by two.
[02:41:33] ruby-lang070: yea but that isn't true for variales
[02:41:59] ruby-lang070: I would have to return the new value from the method and save it into the exsiting variable i want changed
[02:42:01] Ox0dea: ruby-lang070: Hash#[]= mutates the receiver.
[02:42:09] al2o3-cr: havenwood: and
[02:42:34] ruby-lang070: Ok so I need to look into "mutates" correct?
[02:42:37] rgtk: has joined #ruby
[02:42:40] havenwood: al2o3-cr: 0.abs2.zero? #=> true
[02:42:44] Ox0dea: ruby-lang070: There are plenty of methods which mutate Strings as well; replace `name = new_name` with `name.upcase!` and observe the results.
[02:42:55] al2o3-cr: havenwood: and!!!!
[02:42:59] ruby-lang070: yea that would be a permanent change
[02:43:08] Ox0dea: ruby-lang070: Right, because it mutates the receiver.
[02:43:18] Ox0dea: `name = new_name` only reassigns the local variable.
[02:43:29] havenwood: al2o3-cr: require 'mathn'; Math.sqrt(0).zero? #=> true
[02:43:37] ruby-lang070: ahh ok I think I get it now
[02:44:03] Ox0dea: ruby-lang070: If you really do want to completely replace a String in-place, there's String#replace. :P
[02:44:03] al2o3-cr: havenwood: what you try to prove?
[02:44:12] havenwood: al2o3-cr: Zero things.
[02:44:18] ruby-lang070: So If I just set the hash to equal another hash or whatever and didnt actually mutate it then it wouldd do nothing to the local hash correct?
[02:44:27] bruce_lee: has joined #ruby
[02:44:30] rgtk_: has joined #ruby
[02:44:52] havenwood: al2o3-cr: Want more zero things?
[02:45:03] al2o3-cr: havenwood: go ahead
[02:45:09] Ox0dea: ruby-lang070: It would do nothing to the *external* Hash, but you've got the idea.
[02:45:51] havenwood: al2o3-cr: I've got zero.
[02:45:58] ruby-lang070: Yea I've got it now, Thank you Ox0dea and havenwood for your help
[02:46:03] Ox0dea: ruby-lang070: Sure thing.
[02:46:14] m3_del: has joined #ruby
[02:46:28] rgtk: has joined #ruby
[02:46:54] havenwood: al2o3-cr: ZeroQuestionError: questioned 0
[02:47:20] al2o3-cr: >> Math.log(0)
[02:47:21] ruboto: al2o3-cr # => -Infinity (https://eval.in/461367)
[02:47:38] l_tonz: has joined #ruby
[02:48:12] ruboto: al2o3-cr # => 1 (https://eval.in/461368)
[02:48:17] rgtk: has joined #ruby
[02:50:03] mag42c: has joined #ruby
[02:50:11] rgtk: has joined #ruby
[02:50:36] towski_: has joined #ruby
[02:52:02] mary5030: has joined #ruby
[02:52:12] rgtk: has joined #ruby
[02:52:13] shevy: Ox0dea ah nah, the above actually originated because it were nucleotides in DNA, so the strings I'd have had were ATACCGTCTG, hence why I used upcased chars in the question above as well
[02:52:26] havenwood: >> Numeric.new.zero?
[02:52:27] ruboto: havenwood # => false (https://eval.in/461369)
[02:54:06] Ox0dea: havenwood: https://eval.in/461370
[02:54:12] rgtk: has joined #ruby
[02:54:19] Ox0dea: Yes, I benchmarked `reduce(:<<)`.
[02:55:23] Ox0dea: Why doesn't this already exeest?!
[02:55:54] rgtk: has joined #ruby
[02:56:20] al2o3-cr: thats why they introduced refinements isn't?
[02:56:38] skade: has joined #ruby
[02:56:49] Ox0dea: al2o3-cr: I think this should be in core.
[02:57:14] Ox0dea: Then again, that's what we all say.
[02:57:55] rgtk: has joined #ruby
[02:58:28] shevy: we should have a community extension on ruby or something
[02:58:35] Ox0dea: al2o3-cr: I was self-deprecating, you fuckwad.
[02:58:48] Ox0dea: shevy: Kinda like Facets?
[02:58:50] Rollabunna: has joined #ruby
[02:59:04] al2o3-cr: Ox0dea: parden?
[02:59:47] rgtk: has joined #ruby
[02:59:48] al2o3-cr: Ox0dea: I misses 'would' jeez
[03:00:02] shevy: Ox0dea yeah but integrated into ruby-core and with a stronger voting process
[03:00:06] l_tonz: has joined #ruby
[03:00:06] al2o3-cr: Ox0dea: keyboard warrior
[03:01:32] rgtk: has joined #ruby
[03:02:08] blackmesa: has joined #ruby
[03:02:09] Dakuan: has joined #ruby
[03:03:06] Ox0dea: al2o3-cr: I'm not to blame for your inability to proofread what would've been a three-word post.
[03:03:24] sp4rrow: has joined #ruby
[03:03:37] rgtk: has joined #ruby
[03:03:50] al2o3-cr: Ox0dea: yeah my fault
[03:03:53] Ox0dea: al2o3-cr: <3
[03:04:25] al2o3-cr: I can see how it would come across
[03:05:12] A124: has joined #ruby
[03:05:15] arescorpio: has joined #ruby
[03:05:21] Ox0dea: Precision matters.
[03:05:29] favadi: has joined #ruby
[03:05:31] rgtk: has joined #ruby
[03:06:34] TheNet: how do you guys order methods in your classes?
[03:06:47] TheNet: such as alphabetically? or organized by type?
[03:07:01] Ox0dea: TheNet: Real programmers use decent editors.
[03:07:17] rgtk: has joined #ruby
[03:07:45] djbkd: has joined #ruby
[03:08:09] Ox0dea: To clarify, the order doesn't matter if your editor lets you jump to a given method definition with the stroke of a key.
[03:08:28] patdohere: has joined #ruby
[03:08:41] Ox0dea: But keeping related things close to each other makes sense and usually happens naturally.
[03:09:19] rgtk: has joined #ruby
[03:09:58] patdohere: has joined #ruby
[03:10:18] cmoney: has joined #ruby
[03:11:03] rgtk: has joined #ruby
[03:11:42] uber: has joined #ruby
[03:12:34] juanpablo__: has joined #ruby
[03:13:02] rgtk: has joined #ruby
[03:13:11] aufi: has joined #ruby
[03:13:19] Feyn: has joined #ruby
[03:14:25] freerobby: has joined #ruby
[03:15:02] rgtk: has joined #ruby
[03:16:46] rgtk: has joined #ruby
[03:18:47] rgtk: has joined #ruby
[03:20:10] mikeharris22: has joined #ruby
[03:20:33] rgtk_: has joined #ruby
[03:22:33] rgtk: has joined #ruby
[03:24:30] rgtk: has joined #ruby
[03:25:47] mordocai: has joined #ruby
[03:26:17] rgtk: has joined #ruby
[03:28:18] rgtk: has joined #ruby
[03:28:26] bruno-: has joined #ruby
[03:30:03] rgtk: has joined #ruby
[03:31:21] moeabdol: has joined #ruby
[03:32:16] aibot: has joined #ruby
[03:33:11] Vile`: has joined #ruby
[03:33:12] mattwildig: has joined #ruby
[03:33:41] saddad: has joined #ruby
[03:35:01] freerobby: has joined #ruby
[03:37:35] Feyn: has joined #ruby
[03:38:32] Ox0dea: > With which incentive ought I strive to attenuate the number of decibels I'm producing?
[03:39:37] mistermocha: has joined #ruby
[03:42:14] TheNet: has joined #ruby
[03:43:10] mclee_: has joined #ruby
[03:43:49] diegoaguilar: has joined #ruby
[03:44:25] diegoaguilar: has joined #ruby
[03:44:33] markfletcher: has joined #ruby
[03:46:54] mistermocha: has joined #ruby
[03:48:37] rbennacer: has joined #ruby
[03:50:58] Dingus: has joined #ruby
[03:52:51] zenguy_pc: has joined #ruby
[03:53:37] Dingus: Would anyone here be willing to help me figure out how to use map/reduce? I'm trying to merge an array of hashes containing identical keys, with the goal of condensing duplicate keys while keeping their values
[03:54:02] devoldmx: has joined #ruby
[03:56:44] rickmasta: has joined #ruby
[03:56:56] Ox0dea: dingus: You won't need #reduce for this; #merge is a very powerful method.
[03:57:15] Ox0dea: It takes multiple arguments *and* a block for handling merge conflicts.
[03:57:19] iateadonut: has joined #ruby
[03:57:45] Dingus: @0xdea: I'm new to ruby and merge is way over my head. Mind taking a look at a code sample?
[03:57:56] Ox0dea: dingus: I could just show you how to do it?
[03:58:19] Dingus: @0xdea: OK, that sounds good :)
[03:58:45] Ox0dea: dingus: Oh no! #merge *doesn't* take multiple arguments. :<
[03:59:03] Radar: dingus: Show us what you've got and what you expect to have at the end of it.
[03:59:17] Ox0dea: Radar: He's stated the requirements quite plainly?
[03:59:37] Radar: Ox0dea: It'd be helpful to see some example input data and output just so that we know 100% that we have the right answer.
[04:00:07] mistermocha: has joined #ruby
[04:00:17] skade: has joined #ruby
[04:00:28] mary5030: has joined #ruby
[04:00:29] Oatmeal: has joined #ruby
[04:01:01] justinweiss: has joined #ruby
[04:01:06] gener1c: has joined #ruby
[04:01:12] Ox0dea: >> h1, h2 = {a: 1, b: 2}, {a: 3, b: 4}; h1.merge(h2) { |_, ours, theirs| ours + theirs } # dingus
[04:01:13] ruboto: Ox0dea # => {:a=>4, :b=>6} (https://eval.in/461374)
[04:01:46] Ox0dea: dingus: That's how to structure the conflict resolution block, but you are gonna need #reduce to apply it across an array.
[04:02:25] ziprar: has joined #ruby
[04:02:29] mary5030: has joined #ruby
[04:02:53] jwaldrip: has joined #ruby
[04:02:58] Dakuan: has joined #ruby
[04:03:46] blackmesa: has joined #ruby
[04:03:59] Dingus: Ox0dea: Radar: https://paste.ee/p/NO8cv
[04:04:01] hmsimha_: has joined #ruby
[04:04:40] Radar: Ox0dea: see, your answer won't work
[04:04:46] Radar: This is why I always ask for examples.
[04:05:01] jhn: has joined #ruby
[04:05:03] Ox0dea: Radar: What, because it's doing addition? It was a demonstration.
[04:05:15] krz: has joined #ruby
[04:05:30] Ox0dea: dingus: Here's what I hope is a clear demonstration of how #reduce works: https://eval.in/461375
[04:06:00] astrobun_: has joined #ruby
[04:08:58] mistermocha: has joined #ruby
[04:10:39] mistermocha: has joined #ruby
[04:10:50] braincrash: has joined #ruby
[04:11:36] vigintas: has joined #ruby
[04:11:37] Ox0dea: Radar: You were right. I apologize.
[04:12:13] Ox0dea: dingus: Status on your understanding of #reduce? :P
[04:12:20] mistermocha: has joined #ruby
[04:12:41] l_tonz: has joined #ruby
[04:15:12] mistermocha: has joined #ruby
[04:15:19] Dingus: Ox0dea: i tried applying your example to my data but it looks like it's just looping through the array. can't figure out how to get it to do what i want
[04:15:37] Bloomer: has joined #ruby
[04:15:46] Ox0dea: dingus: It does loop through the array, but it builds up a tally as it goes.
[04:16:07] Ox0dea: The "tally" in your case is a Hash, but the principle is the same.
[04:16:20] markfletcher: has left #ruby: ()
[04:16:25] mary5030: has joined #ruby
[04:17:55] kp666: has joined #ruby
[04:17:57] m3_del: has joined #ruby
[04:17:58] Dingus: Ox0dea: How do I combine each score value by player key, though?
[04:18:34] Bloomer: has joined #ruby
[04:18:37] Ox0dea: dingus: What did you replace the 0 with in applying my example to your data?
[04:21:02] Dingus: Ox0dea: I didn't replace it. I guess I don't understand how the code works...
[04:21:51] gix: has joined #ruby
[04:21:53] Ox0dea: dingus: Oh, sorry; I did forget to explain that part. It's the initial value for the tally.
[04:22:04] Ox0dea: >> [1,2,3].reduce(36) { |a, b| a + b }
[04:22:04] ruboto: Ox0dea # => 42 (https://eval.in/461376)
[04:22:36] Ox0dea: So what would be a good starting point for your case?
[04:24:29] Dingus: Ox0dea: don't I need to be selecting keys out of the hash somewhere? When I run your example as is I get "Hash can't be coerced into Fixnum"
[04:25:10] Ox0dea: dingus: Yes, you'll have to do that, but you'll also want to come away from this knowing how to use #reduce, I'd imagine.
[04:26:45] Ox0dea: dingus: Or is that not the case? I have a fish if you want it.
[04:27:17] Dingus: Ox0dea: Please give me the fish so I can dissect it :)
[04:27:24] Ox0dea: dingus: Well said.
[04:29:05] Ox0dea: dingus: https://eval.in/461377
[04:29:29] bruno-: has joined #ruby
[04:30:38] Rinzlit: has joined #ruby
[04:30:50] Ox0dea: That `+=` updates the tally, but it evalues to the result of the addition, and the last expression in the block is what becomes the new tally; that's why I had to stick that ostensibly unnecessary `tally` on that line by itself.
[04:31:43] Ox0dea: There are #each_with_object and #with_object methods that do make it unnecessary, but then we'd've gotten into grouped block parameters and lost the thread.
[04:32:20] Dingus: Ox0dea: so there's an invisible assignment happening on the 'tally' line?
[04:32:56] Ox0dea: dingus: No, not in the sense you're thinking.
[04:34:13] Dingus: Ox0dea: would you mind providing a similar example using with_object or each_with_object so I can compare?
[04:36:40] rippa: has joined #ruby
[04:36:45] darkf: has joined #ruby
[04:37:42] mistermocha: has joined #ruby
[04:38:01] Ox0dea: dingus: https://eval.in/461378
[04:38:27] Ox0dea: In this case, it's just the block parameters getting swapped around and the extra line being unnecessaary.
[04:38:38] htmldrum: has joined #ruby
[04:39:15] Ox0dea: The "grouped block parameters" I mentioned aren't there; those are apparently only applicable when the collection being reduced contains Arrays, not Hashes.
[04:40:59] Ox0dea: >> [[1, 2], [3, 4], [5, 6]].each_with_object([]) { |(a, b), tally| tally << a + b }
[04:41:00] ruboto: Ox0dea # => [3, 7, 11] (https://eval.in/461380)
[04:41:08] jessemcgilallen: has joined #ruby
[04:41:19] Ox0dea: The grouping parentheses are needed there, elseways `a` gets the whole Array and `b` is nil.
[04:42:15] Dingus: Ox0dea: thank you very much! i'll go study this some more and see if i can grok it
[04:42:16] Ox0dea: Er, no, `b` would mistakenly take the place of `tally`, and `tally` would be nil.
[04:42:47] Dingus: Ox0dea: the more i know about ruby the more i realize how little i know
[04:42:56] Ox0dea: dingus: It's a really big language.
[04:49:24] mh_laakso: has joined #ruby
[04:50:58] mh_laakso: has joined #ruby
[04:53:29] kiki_lamb: has joined #ruby
[04:56:55] TheNet: has joined #ruby
[04:59:43] Rollabunna: has joined #ruby
[04:59:46] guest1241234: has joined #ruby
[05:00:01] karapetyan: has joined #ruby
[05:00:52] d34th4ck3r: has joined #ruby
[05:01:19] juanpablo__: has joined #ruby
[05:02:56] jwaldrip: has joined #ruby
[05:03:43] Dakuan: has joined #ruby
[05:03:47] skade: has joined #ruby
[05:04:31] dheeraj_t: has joined #ruby
[05:04:34] blackmesa: has joined #ruby
[05:07:24] dheeraj_t: has joined #ruby
[05:07:53] dheeraj_t: which is the best editor for ruby?
[05:08:21] towski_: has joined #ruby
[05:10:08] l_tonz: sublime :]
[05:11:19] dheeraj_t: has left #ruby: ()
[05:12:13] dheeraj_t: has joined #ruby
[05:12:22] dheeraj_t: which is the best editor for ruby?
[05:12:33] leafybasil: has joined #ruby
[05:13:31] Radar: dheeraj_t: Who can truly say what it means to be "the best"?
[05:13:40] Ox0dea: dheeraj_t: Editors are a myth.
[05:14:06] Radar: I just get other people to write my code for me
[05:14:14] Radar: (that is actually what I've kinda been doing all day today)
[05:14:22] Ox0dea: Project manager, then?
[05:14:23] Radar: So really, the editors I use are called "Sal" and "Brad"
[05:14:49] Radar: Ox0dea: co project manager :P Current tech lead boss now has a team of 10 and it's getting hard for him to manage alone
[05:15:05] Radar: (it was 4 this time last year)
[05:16:00] Ox0dea: Whale, that's one of them good problems, I suppose.
[05:16:50] shinenelson: has joined #ruby
[05:16:55] raazdaan: has joined #ruby
[05:19:03] Ox0dea: Do Brad and Sal respect .editorconfig?
[05:19:27] benlieb: has joined #ruby
[05:20:54] mndoci: has joined #ruby
[05:21:33] Radar: yeah although there can be some idiosyncrasies.
[05:21:51] Radar: Need to start up a trello board for those issues :P
[05:23:18] tmtwd: has joined #ruby
[05:23:19] shevy: a troll board??
[05:23:58] bradleyprice: has joined #ruby
[05:25:29] roxtrongo: has joined #ruby
[05:25:42] Ox0dea: >> %w[trelloboard aboredtroll].map { |_| _.chars.sort }.reduce :==
[05:25:43] ruboto: Ox0dea # => true (https://eval.in/461399)
[05:26:06] Ox0dea: Radar: I hate it when software seems to have a mind of its own. :P
[05:26:46] Ox0dea: That's not to say I don't welcome our inevitable robot overlords, mind.
[05:27:12] mary5030: has joined #ruby
[05:30:13] weemsledeux: has joined #ruby
[05:30:54] rgtk: has joined #ruby
[05:30:55] dheeraj_t: has left #ruby: ()
[05:32:14] Musashi007: has joined #ruby
[05:38:46] justinweiss: has joined #ruby
[05:48:41] favadi: has joined #ruby
[05:50:54] rbennacer: has joined #ruby
[05:51:50] zenguy_pc: has joined #ruby
[05:53:37] cwong_on_irc: has joined #ruby
[05:57:06] malcolmva: has joined #ruby
[05:57:24] northband: has joined #ruby
[05:58:58] krz: has joined #ruby
[05:59:26] lxsameer: has joined #ruby
[05:59:47] vigintas: has joined #ruby
[05:59:49] northband: has joined #ruby
[06:00:27] houhoulis: has joined #ruby
[06:00:49] haxrbyte: has joined #ruby
[06:02:10] haxrbyte_: has joined #ruby
[06:02:16] baroquebobcat: has joined #ruby
[06:03:46] Dingus: has joined #ruby
[06:04:28] Dakuan: has joined #ruby
[06:05:10] mndoci: has joined #ruby
[06:05:20] blackmesa: has joined #ruby
[06:05:25] m3_del: has joined #ruby
[06:07:15] northband: I'm trying to port over some Python to Ruby and a certain item is confusing me. Curious if any fellow Rubyists would consider looking over a gist for me and help answer a couple questions.
[06:07:52] Dingus: Ox0dea: I'm back with more questions!
[06:09:01] trosborn: has joined #ruby
[06:11:06] northband: has left #ruby: ()
[06:11:30] northband: has joined #ruby
[06:11:35] Radar: northband: sure, fire away
[06:11:38] Xzanron: has joined #ruby
[06:11:53] Radar: just left :( too slow
[06:11:59] Ox0dea: dingus: Your turn, then. :)
[06:12:25] northband_: has joined #ruby
[06:12:46] krz: has joined #ruby
[06:14:01] arup_r: has joined #ruby
[06:14:37] Xeago: has joined #ruby
[06:16:12] dhjondoh: has joined #ruby
[06:16:36] haxrbyte: has joined #ruby
[06:18:24] TheNet: has joined #ruby
[06:19:01] Dingus: Ox0dea: is it possible to store additional variables inside the each_with_object block? let's say I wanted to calculate an average score per player
[06:19:46] gener1c: has joined #ruby
[06:20:23] djbkd: has joined #ruby
[06:20:47] pontiki: has joined #ruby
[06:21:40] Ox0dea: dingus: It's possible, but there's a better way.
[06:21:51] Dingus: Ox0dea: my instinct is to use a loop and compare a precalculated hash/array of games played per player with a precalculated hash/array of scores per player but that seems clunky
[06:22:10] Ox0dea: dingus: Aye, that's a little clunky.
[06:22:48] Dingus: Ox0dea: what's the better way?
[06:24:10] Ox0dea: dingus: Instead of tallying with addition, push each player's wins into an Array.
[06:25:25] Dingus: Ox0dea: then what?
[06:25:46] Ox0dea: dingus: Then, like a good chef, you'll have all your ingredients ready.
[06:26:10] gener1c_: has joined #ruby
[06:28:13] mistermocha: has joined #ruby
[06:28:51] Dingus: Ox0dea: i have one each_with_object block counting total score per player, and another counting games played per player. are you saying there's a way to do this in one go?
[06:29:07] cwong_on_irc: has joined #ruby
[06:29:52] pepperbreath: has joined #ruby
[06:30:00] pepperbreath: has left #ruby: ()
[06:30:10] Ox0dea: dingus: No, that's almost the opposite of what I was suggesting.
[06:30:49] notnoyyyyy: has joined #ruby
[06:31:03] l_tonz: has joined #ruby
[06:31:11] Ox0dea: dingus: Observe what happens if you replace that `0` with `[]`.
[06:31:21] gener1c: has joined #ruby
[06:32:27] pontiki: yesss, cooking metaphors :)
[06:32:34] Ox0dea: Oh, sorry; you'll have to do a little more tweaking than that: https://eval.in/461407
[06:32:47] duncannz: has joined #ruby
[06:33:11] Ox0dea: dingus: But that's a really nice result, isn't it? You've got the number of games, the total wins, and the average falls out easily enough.
[06:33:14] l_tonz: has joined #ruby
[06:33:26] mployee8: has joined #ruby
[06:34:50] rapidjammer: has joined #ruby
[06:35:00] dionysus69: has joined #ruby
[06:35:03] cwong_on_irc: has joined #ruby
[06:36:43] trautwein: has joined #ruby
[06:40:04] timonv: has joined #ruby
[06:41:14] mistermocha: has joined #ruby
[06:42:05] mistermocha: has joined #ruby
[06:43:19] arup_: has joined #ruby
[06:43:35] Dingus: Ox0dea: I changed my scores to floats and now I'm getting ``+': no implicit conversion of Float into Array (TypeError)`. Why does it stop working?
[06:44:19] Ox0dea: dingus: Why did you change your scores to floats?
[06:45:15] neanderslob: has joined #ruby
[06:45:18] Ox0dea: >> xs = [4,8,15,16,23,42]; xs.reduce(:+) / xs.size.to_f
[06:45:19] ruboto: Ox0dea # => 18.0 (https://eval.in/461416)
[06:45:40] Ox0dea: Better to convert one value than a bunch of 'em.
[06:45:46] tagrudev: has joined #ruby
[06:47:46] Dingus: Ox0dea: i'm playing around with various scenarios, e.g. a list of purchases and getting the average purchase price per customer
[06:49:13] Ox0dea: dingus: Fair enough. That error indicates you're trying to do some operation with a Float and an Array as the operands, and that tends not to go well.
[06:49:34] Ox0dea: You should debug-print the relevant values to determine where your assumptions have gone amiss.
[06:50:05] juanpablo__: has joined #ruby
[06:51:35] devbug_: has joined #ruby
[06:51:47] Motoservo: has joined #ruby
[06:52:23] yardenbar: has joined #ruby
[06:53:00] arooni: has joined #ruby
[06:54:41] lubarch: has joined #ruby
[06:56:32] aganov: has joined #ruby
[06:56:59] jessemcgilallen: has joined #ruby
[06:58:39] mclee_: has joined #ruby
[06:58:51] Dingus: Ox0dea: I gave up on reduce for now and tried out zip instead :)
[06:59:38] Azulinho: has joined #ruby
[07:00:35] Rollabunna: has joined #ruby
[07:01:47] lubarch: has joined #ruby
[07:04:15] mndoci: has joined #ruby
[07:05:41] DoubleMalt: has joined #ruby
[07:06:07] blackmesa: has joined #ruby
[07:07:25] m3_del: has joined #ruby
[07:08:15] pocketprotector: has joined #ruby
[07:09:57] finisherr: has joined #ruby
[07:13:23] htmldrum: has joined #ruby
[07:19:00] jessemcgilallen: has joined #ruby
[07:21:57] lsmola: has joined #ruby
[07:23:11] lukaszes: has joined #ruby
[07:27:14] firstdayonthejob: has joined #ruby
[07:30:11] karapetyan: has joined #ruby
[07:30:44] kalusn: has joined #ruby
[07:32:06] trosborn: has joined #ruby
[07:32:06] rgtk: has joined #ruby
[07:35:06] Peteykun: has joined #ruby
[07:35:50] finisherr: When a module has a method that looks like this: def self.method_name what is the receiver of the method?
[07:37:25] claw: has joined #ruby
[07:37:55] notnoyyyyy: has joined #ruby
[07:38:00] unsymbol: has joined #ruby
[07:38:16] jpfuentes2: has joined #ruby
[07:40:49] karapetyan: hello, how to make regexp that get all characters before "/*" i'tried next .*\/\* but it takes all text "blahblahblah/*"
[07:40:57] djellemah: finisherr: the module
[07:41:23] Ox0dea: karapetyan: Are you parsing C?
[07:41:54] mistermocha: has joined #ruby
[07:41:59] Ox0dea: finisherr: Debug-printing `self` can provide great insight in times of confusion.
[07:42:18] karapetyan: Ox0dea: well, yes
[07:42:23] Ox0dea: karapetyan: Really?
[07:43:04] karapetyan: no, i try to solve my daily kata )
[07:43:11] Ox0dea: >> 'some c code /*'[/(.*)\/\*/, 1] # karapetyan
[07:43:12] ruboto: Ox0dea # => "some c code " (https://eval.in/461433)
[07:43:45] Ox0dea: The trick is to "capture" the part you're interested in.
[07:44:14] karapetyan: Ox0dea: well, what does mean [] ?
[07:44:32] djellemah: ?ri String#[]
[07:44:32] ruboto: String#[], I don't know anything about ri
[07:44:34] [spoiler]: karapetyan: its a method on string
[07:44:36] djellemah: &ri String#[]
[07:44:36] `derpy: http://www.rubydoc.info/stdlib/core/String#%5B%5D-instance_method
[07:45:05] ruboto: I don't know anything about mr
[07:45:29] Ox0dea: >> 'karapetyan'[2, 4]
[07:45:30] ruboto: Ox0dea # => "rape" (https://eval.in/461434)
[07:45:37] Ox0dea: String#[] is a pretty fancy method.
[07:46:21] Ox0dea: Given a Regexp, it's basically just String#match, but you can provide a numeric second argument to pluck out a capture group.
[07:46:27] finisherr: I was trying to stub out a method in a module for my tests but had some troubles.
[07:46:35] karapetyan: well, should i use it instead gsub?
[07:46:35] [spoiler]: Ox0dea: it's the most "overloaded" method I know of in Ruby
[07:46:37] solars: has joined #ruby
[07:46:39] Ox0dea: karapetyan: Yes.
[07:46:40] Blaguvest: has joined #ruby
[07:46:56] erbesharat: has joined #ruby
[07:47:47] djellemah: finisherr: Have you met binding.pry ?
[07:47:55] vigintas: has joined #ruby
[07:48:05] Ox0dea: [spoiler]: In my sickness, I tried to push it even further: https://bugs.ruby-lang.org/issues/11100
[07:48:23] baweaver: has joined #ruby
[07:48:56] karapetyan: Ox0dea: what does mean [..., 1] ? the 1? in your regexp?
[07:49:08] Ox0dea: karapetyan: Given a Regexp, it's basically just String#match, but you can provide a numeric second argument to pluck out a capture group.
[07:49:27] [spoiler]: personally my advice is to use #match or #scan, if you need to extract shit from a string; i find them more readable than `#[/ohmygosh/]` even if its shorter and "clever-er"
[07:49:47] finisherr: I remember about binding since it???s passed as a param to some ERB method
[07:49:55] finisherr: but that???s all i remembered about it
[07:50:14] Ox0dea: It's not even about cleverness; that "English" can't also be noise is nonsense.
[07:50:24] [spoiler]: 11100 nice issue number, Ox0dea :D
[07:50:28] Ox0dea: [spoiler]: Right?
[07:50:41] Ox0dea: I got 11300 too: https://bugs.ruby-lang.org/issues/11300
[07:51:05] shinnya: has joined #ruby
[07:51:31] djellemah: finisherr: http://pryrepl.org/
[07:51:39] [spoiler]: ` realize this is essentially an outline of why not to implement this feature, but (...)` :D LOL
[07:53:30] mattwildig: has joined #ruby
[07:53:49] darkhex: has joined #ruby
[07:54:11] [spoiler]: Interesting, I didn't ever think to use #hex and #oct actually, I used to_i(and friends) if I needed it
[07:54:22] zenguy_pc: has joined #ruby
[07:55:26] [spoiler]: djellemah: no!
[07:55:33] Ox0dea: I feel like we've discussed this, but I wish Ruby had Clojure's numeric literals.
[07:55:37] djellemah: doh! nevermind.
[07:55:39] Ox0dea: >> /(?<stuff>\w+)/ =~ 'important'; stuff # karapetyan
[07:55:40] ruboto: Ox0dea # => "important" (https://eval.in/461436)
[07:55:51] Ox0dea: In case you want your Regexp to inject some locals.
[07:55:56] [spoiler]: djellemah: It was in contrast to "yes?" :P
[07:56:51] karapetyan: http://rubular.com/r/VaKiSzytDG how to get text that goes before /*
[07:57:03] Ox0dea: karapetyan: Are you a goldfish?
[07:57:17] karapetyan: no, but your example don't work
[07:57:35] [spoiler]: karapetyan: what example? his example ought to work
[07:57:48] [spoiler]: what is your code
[07:58:28] [spoiler]: [side note: you shouldn't use regexp like this to parse code anyway]
[07:58:59] Ox0dea: karapetyan: Is your kata to write a regular expression, or to write a Ruby program?
[07:59:41] karapetyan: look, in understood that i can use somestring[regexp_here] and it's nice. also i read about #match / #scan. but anyway i have a problem with regexp
[07:59:59] agit0: has joined #ruby
[08:00:15] skade: has joined #ruby
[08:01:03] lsmola: has joined #ruby
[08:01:15] Ox0dea: karapetyan: Whatever. You need to use a positive lookahead: http://rubular.com/r/aOYVc98HYu
[08:01:39] karapetyan: Ox0dea: a write a Ruby program. (but there no description how to write it. Use loops for parsing chars or regexp)
[08:02:05] Ox0dea: I hope it catches fire.
[08:02:33] [spoiler]: His kata? Is this some kind of karate company you work at? what
[08:02:45] ibouvousaime: has joined #ruby
[08:02:46] Ox0dea: [spoiler]: A kata is like daily exercise for programming.
[08:02:57] karapetyan: Ox0dea: thank you!
[08:03:00] Ox0dea: karapetyan: No.
[08:03:07] Ox0dea: [spoiler]: That's its modern definition, anyhow.
[08:03:18] [spoiler]: I didn't know
[08:03:20] [spoiler]: that is nice
[08:03:26] [spoiler]: I should do that!
[08:03:33] karapetyan: Ox0dea: why not?)
[08:03:50] TheNet: has joined #ruby
[08:04:02] mistermocha: has joined #ruby
[08:04:04] Ox0dea: karapetyan: Because your eye(s?) is/are a plus sign, and symbols make [spoiler]'s head hurt.
[08:04:52] karapetyan: ok, sorry then )
[08:05:15] Ox0dea: So now you're a disemfaced mouth?
[08:05:48] [spoiler]: symbols make me head 'urt?
[08:06:06] Ox0dea: > more readable than `#[/ohmygosh/]`
[08:06:14] Ox0dea: That was clearly intended to be pejorative.
[08:06:34] bruno-: has joined #ruby
[08:06:38] vigintas: has joined #ruby
[08:06:39] Ox0dea: I've said it before: it's okay for code to look like code.
[08:06:43] Musashi007: has joined #ruby
[08:06:55] blackmesa: has joined #ruby
[08:08:09] m3_del: has joined #ruby
[08:08:13] [spoiler]: Ox0dea: the point was that [//,1] wasn't immediately obvious (to karapetyan, and I suppose that applies to other ruby new comers, too)
[08:09:29] Stan: has joined #ruby
[08:09:40] Ox0dea: [spoiler]: Why should new knowledge be immediately obvious? Doesn't that undermine the foundations of exploratory learning?
[08:09:43] ruurd: has joined #ruby
[08:09:51] ponga: has joined #ruby
[08:11:01] trosborn: has joined #ruby
[08:12:03] skcin7: has joined #ruby
[08:12:04] [spoiler]: Ox0dea: hmm. I guess you're right
[08:12:06] SCHAAP137: has joined #ruby
[08:12:07] lukaszes: has joined #ruby
[08:12:11] timonv: has joined #ruby
[08:12:16] Ox0dea: That was not my intention.
[08:13:40] krz: has joined #ruby
[08:14:06] joonty: has joined #ruby
[08:15:46] l_tonz: has joined #ruby
[08:15:47] Ox0dea: That is, I didn't mean to word it so convincingly; I had hoped you'd come back at me on it that I might solidify my ability to defend it.
[08:15:55] notnoyyyyy: has joined #ruby
[08:17:59] benlieb: has joined #ruby
[08:18:50] dheeraj_t: has joined #ruby
[08:20:23] [spoiler]: certainty: yo \o
[08:22:25] trosborn: has joined #ruby
[08:23:04] mistermocha: has joined #ruby
[08:23:35] djellemah: Ox0dea: it depends how different the new knowledge is to what you already know.
[08:23:58] darkxploit: has joined #ruby
[08:25:17] jas02: has joined #ruby
[08:26:39] roxtrongo: has joined #ruby
[08:27:55] Ox0dea: djellemah: That's certainly the case, but the glad suffering of fools puts an egg in neither party's beer.
[08:28:17] vondruch: has joined #ruby
[08:28:17] htmldrum: has joined #ruby
[08:29:09] mistermocha: has joined #ruby
[08:29:14] Ox0dea: It's just unfathomably easy to find precisely the information one is looking for in our modern times; it's infuriating to watch people forsake that privilege.
[08:31:08] riotjones: has joined #ruby
[08:31:16] aspiers: has joined #ruby
[08:33:11] colegatron: has joined #ruby
[08:35:48] terminalrecluse: has joined #ruby
[08:36:17] [spoiler]: Ox0dea: what... why'd you put an egg in beer?
[08:36:58] Ox0dea: [spoiler]: It's an idiom I learned this weekend: http://www.thesaurus.com/browse/egg%20in%20one's%20beer
[08:37:33] DEA7TH: has joined #ruby
[08:37:46] valkyrka: has joined #ruby
[08:38:30] [spoiler]: Uselessness of the expression is meta
[08:38:34] sundhell: has joined #ruby
[08:38:49] juanpablo__: has joined #ruby
[08:39:00] [spoiler]: It's as useless as the very thing it describes
[08:39:33] kimegede: has joined #ruby
[08:41:37] kalusn: has joined #ruby
[08:42:35] ibouvousaime: has joined #ruby
[08:43:41] shredding: has joined #ruby
[08:44:21] Ox0dea: [spoiler]: Did you see the Sinatra app? >:)
[08:44:34] dopieee: has joined #ruby
[08:44:37] [spoiler]: Which sinatra app?
[08:44:58] [spoiler]: you mean *the* app, or something built using sinatra?
[08:45:00] Ox0dea: This one: http://i.imgur.com/94jou4v.png
[08:45:14] [spoiler]: Oh yeah someone linked it the other day :D
[08:45:18] Ulfalizer: has joined #ruby
[08:45:27] [spoiler]: it's beautiful
[08:46:59] ta: has joined #ruby
[08:48:47] kiddorails: has joined #ruby
[08:51:30] trosborn: has joined #ruby
[08:51:51] ruurd: has joined #ruby
[08:52:31] Hounddog: has joined #ruby
[08:52:57] lipoqil: has joined #ruby
[08:54:17] cwong_on_irc: has joined #ruby
[08:54:33] al2o3-cr: has joined #ruby
[08:58:10] bruno-: has joined #ruby
[08:59:17] astrobun_: has joined #ruby
[08:59:18] nfk|laptop: has joined #ruby
[08:59:40] gener1c_: has joined #ruby
[08:59:42] skade: has joined #ruby
[09:01:13] devoldmx: has joined #ruby
[09:01:30] Rollabunna: has joined #ruby
[09:03:34] bruno-: has joined #ruby
[09:04:41] gener1c: has joined #ruby
[09:07:06] SCHAAP137: has joined #ruby
[09:08:53] blackmesa: has joined #ruby
[09:08:56] m3_del: has joined #ruby
[09:08:57] bruno-_: has joined #ruby
[09:09:47] machan: has joined #ruby
[09:09:50] darkxploit: has joined #ruby
[09:11:34] akem: has joined #ruby
[09:13:30] matcouto: has joined #ruby
[09:14:01] ruurd: has joined #ruby
[09:14:38] bruno-_: has joined #ruby
[09:16:35] bmalum: has joined #ruby
[09:19:23] blackmesa: has joined #ruby
[09:20:04] bruno-_: has joined #ruby
[09:21:55] ta: has joined #ruby
[09:25:30] bruno-: has joined #ruby
[09:27:25] Azulinho: has joined #ruby
[09:29:18] ruurd: has joined #ruby
[09:29:39] sepp2k: has joined #ruby
[09:30:06] gener1c: has joined #ruby
[09:30:36] djellemah: Ox0dea: It is possible to choose to not let people in-fury-ate you. Just let them run off your back like a duck typing. I have no idea where I learned that idiom :-p
[09:30:38] l_tonz: has joined #ruby
[09:31:45] yojimmbo: has joined #ruby
[09:32:02] Ox0dea: djellemah: That's arguably a metaphysical assertion, but I do realize that offense cannot be given. The bit about the duck is lost on me, I'm afraid.
[09:32:11] riotjones: has joined #ruby
[09:32:43] rgtk: has joined #ruby
[09:33:17] ibouvousaime: has joined #ruby
[09:33:42] jordanloky: has joined #ruby
[09:34:04] jakko: has joined #ruby
[09:35:09] mark4: has joined #ruby
[09:36:41] baweaver: has joined #ruby
[09:37:49] skade: has joined #ruby
[09:38:14] mndoci: has joined #ruby
[09:39:12] vondruch: has joined #ruby
[09:39:12] bigkevmcd: has joined #ruby
[09:39:40] lukaszes: has joined #ruby
[09:40:26] djellemah: Ox0dea: No worries - stoopid joke. Stopping now before I accumulate too much OT.
[09:42:09] ruurd: has joined #ruby
[09:42:41] tulak: has joined #ruby
[09:45:57] bruno-: has joined #ruby
[09:46:49] Ox0dea: ~ $ ruby -e 'send def ot; "#{ot}" end' || echo ok?
[09:46:53] Ox0dea: Well, that can't be good.
[09:47:10] d34th4ck3r: has joined #ruby
[09:48:09] apeiros: that looks like a creative infinite loop?
[09:48:21] Ox0dea: apeiros: Well, sure, but nothing bad happened?
[09:48:29] apeiros: I didn't run it
[09:48:35] apeiros: why interpolate?
[09:48:41] Ox0dea: No, I meant on my end.
[09:49:10] apeiros: ran it now. getting the expected stack level too deep (SystemStackError)
[09:49:11] nfk|laptop: has joined #ruby
[09:49:17] apeiros: ACTION brb
[09:49:19] Ox0dea: It was in response to djellemah's "accumulate too much OT".
[09:49:24] jwaldrip: has joined #ruby
[09:49:30] User458764: has joined #ruby
[09:50:45] rdark: has joined #ruby
[09:50:45] rdark: has joined #ruby
[09:51:19] mistermocha: has joined #ruby
[09:51:24] bruno-: has joined #ruby
[09:51:42] Peg-leg: has joined #ruby
[09:52:05] Rollabunna: has joined #ruby
[09:53:35] darkxploit: has joined #ruby
[09:54:01] Blaguvest: has joined #ruby
[09:54:22] mattwildig: has joined #ruby
[09:54:24] zenguy_pc: has joined #ruby
[09:55:28] vigintas: has joined #ruby
[09:57:52] beauby: has joined #ruby
[09:58:36] brazenbraden: has joined #ruby
[09:59:03] tulak: has joined #ruby
[10:00:00] ruurd: has joined #ruby
[10:01:04] djellemah: Phew, well I guess it's all ok?
[10:03:54] Ox0dea: djellemah: `send def foo; foo; end` returns immediately on current HEAD; that's probably very not okay.
[10:04:18] Ox0dea: Maybe the core team have solved the halting problem.
[10:04:19] machan: has joined #ruby
[10:04:27] TheHodge: has joined #ruby
[10:05:52] sepp2k: has joined #ruby
[10:06:24] skade: has joined #ruby
[10:07:32] Guest7171: has joined #ruby
[10:07:36] djellemah: Hah, look at that. Someone coloured in autoconf since the last time I built ruby.
[10:07:54] dionysus69: has joined #ruby
[10:08:32] djellemah: I like it when the OS does something unexpected that's also pleasant.
[10:08:37] dionysus69: has joined #ruby
[10:08:58] mistermocha: has joined #ruby
[10:09:10] Ox0dea: djellemah: Hm? How's the OS have anything to do with it?
[10:09:27] User458764: has joined #ruby
[10:09:37] dopie: has joined #ruby
[10:09:44] m3_del: has joined #ruby
[10:10:17] djellemah: gotta go. Back later.
[10:10:25] Ox0dea: Damn. I thought I had a trunk buddy.
[10:10:58] Ox0dea: `define_method(:foo, &:bar)` for a free SIGSEGV once your compilation finishes.
[10:12:06] Alina-malina: has joined #ruby
[10:12:07] ruurd: has joined #ruby
[10:13:10] Ulfalizer: is the meaning of the rake pkg/, ports/, and tmp/ directories documented anywhere?
[10:13:23] krz: has joined #ruby
[10:13:42] TheNet: has joined #ruby
[10:14:44] yorickpeterse: pkg/ is where built .gem files end up
[10:14:55] yorickpeterse: tmp/ is where rake-compiler does most of its packaging work (before copying things to pkg/)
[10:14:58] yorickpeterse: ports/ I have no idea
[10:15:05] skade: has joined #ruby
[10:15:15] stamina: has joined #ruby
[10:15:31] Xeago: has joined #ruby
[10:18:00] ruurd: has joined #ruby
[10:18:16] Oog: has joined #ruby
[10:20:25] leafybasil: has joined #ruby
[10:20:52] leafybasil: has joined #ruby
[10:23:25] lkba: has joined #ruby
[10:27:14] timonv: has joined #ruby
[10:27:35] juanpablo__: has joined #ruby
[10:27:56] vev_: has joined #ruby
[10:29:31] vev_: a scientific in neuronal network say to me see with ruby programming language
[10:30:06] vev_: we are voluntary on #libreidea and we re looking for a dev to help in this project >> http://www.libreidea.org/Autumn_ideas_of_tagtree
[10:30:33] mistermocha: has joined #ruby
[10:30:36] vev_: the goal is to represents ideas thanns to a tree
[10:30:58] vev_: but it will better to do it like a neuronal network or a mindmap
[10:31:26] yorickpeterse: What is your question?
[10:31:45] Musashi007: has joined #ruby
[10:31:47] vev_: is something existing to do what i want?
[10:32:15] yorickpeterse: No idea, have you tried searching for anything?
[10:32:16] vev_: a graphic representation in 3d of a mindmap or a neuron network?
[10:32:34] vev_: i did not yorickpeterse
[10:33:34] yorickpeterse: well, time to start searching then :)
[10:33:41] krz: has joined #ruby
[10:33:49] vev_: any idea whare?
[10:34:50] Ox0dea: vev_: http://www.scipy.org/ + http://www.nltk.org/
[10:35:19] vev_: merci Ox0dea
[10:35:36] Ox0dea: vev_: I did not expect you to be French, but you're welcome.
[10:36:29] Ox0dea: Hey, are you trolling?
[10:36:37] platzhirsch: has joined #ruby
[10:36:44] vev_: i am just asking are you fr?
[10:36:59] Ox0dea: Oh, so you are. I thought you randomly switched to Spanish.
[10:37:08] vev_: je suis fr
[10:37:10] htmldrum: has joined #ruby
[10:37:18] Ox0dea: Not French.
[10:37:37] trosborn: has joined #ruby
[10:37:48] baweaver: has joined #ruby
[10:37:54] vev_: do you understand what the project i? Ox0dea
[10:37:59] apeiros: I don't think "tu es?" is spanish :D
[10:38:17] Ox0dea: vev_: Enough of it to realize that you probably want SciPy and/or NLTK, I guess.
[10:38:19] adaedra: Right, it's missing a ??
[10:38:28] beauby: has joined #ruby
[10:38:55] Ox0dea: adaedra: It'd be "??Eres tu?", I believe.
[10:39:01] Silverfall: has joined #ruby
[10:39:30] vev_: my dev is also looking for someone to make the core of this project >> http://www.libreidea.org/Collaborative_keywords_mixing_project
[10:39:39] Ox0dea: vev_: Now you're spamming.
[10:39:39] adaedra: I don't know Spanish well enough for that.
[10:40:02] vev_: our project is innovative and it uses collaboration intelligence
[10:40:14] Ox0dea: I hope it catches fire.
[10:40:31] yorickpeterse: Ox0dea: calm down
[10:41:03] Ox0dea: yorickpeterse: With what incentive do you propose I ought to strive to attenuate the quantity of decibels I'm producing?
[10:41:04] vev_: if you want to know more about #libreidea i ll be there
[10:41:25] vev_: if you are a motivated dev, you ll be very welcome :p
[10:41:57] ruurd: has joined #ruby
[10:42:14] Xeago: vev_: I am here because I feel welcome even when not motivated.
[10:42:32] yorickpeterse: Ox0dea: don't be a cock
[10:42:39] Ox0dea: yorickpeterse: Turn down for what!
[10:42:44] yorickpeterse: vev_: and this isn't the right place to solicit work
[10:43:00] yorickpeterse: errr s/work/devs
[10:43:10] adaedra: Yeah, no work in this place.
[10:43:21] yorickpeterse: I'm just looking at a DB misbehave
[10:43:33] adaedra: DBs can do something else?
[10:43:45] vev_: and good ideas are welcome on libreidea.org
[10:43:52] vev_: also research questions
[10:44:09] vigintas: has joined #ruby
[10:45:11] yorickpeterse: vev_: you can stop advertising now
[10:45:44] vev_: merci pour les infos scipy
[10:45:52] vev_: and nltk
[10:46:05] adaedra: hard time switching languages, eh?
[10:46:23] vev_: scipy is not python?
[10:46:53] haxrbyte: has joined #ruby
[10:47:22] vev_: or is it compatible with ruby?
[10:47:59] skade: has joined #ruby
[10:48:50] subscope: has joined #ruby
[10:49:40] Ox0dea: self.sides.send :orbit
[10:50:12] karapetyan: has joined #ruby
[10:51:51] teclator: has joined #ruby
[10:51:58] zylogz80: has joined #ruby
[10:52:59] trosborn: has joined #ruby
[10:55:17] kirun: has joined #ruby
[10:56:22] beauby: has joined #ruby
[10:59:29] ruurd: has joined #ruby
[11:00:10] karapetyan: has joined #ruby
[11:00:40] fumduq: has joined #ruby
[11:01:37] leafybas_: has joined #ruby
[11:01:58] devoldmx: has joined #ruby
[11:02:11] vigintas: has joined #ruby
[11:04:39] trosborn: has joined #ruby
[11:06:13] mprelude: has joined #ruby
[11:06:25] vigintas: has joined #ruby
[11:07:11] symm-: has joined #ruby
[11:08:38] djellemah: Ox0dea: for sha 840e6b630 using send def foo; foo; end I get SystemStackError: stack level too deep
[11:09:20] Ox0dea: djellemah: That's interesting.
[11:10:23] Ox0dea: djellemah: How about `define_method(:foo, &:bar)`?
[11:10:30] m3_del: has joined #ruby
[11:11:26] favadi: has joined #ruby
[11:11:54] vigintas: has joined #ruby
[11:12:06] djellemah: ACTION waits for gcc
[11:12:21] ruurd: has joined #ruby
[11:12:56] Ox0dea: Yay, Gentoo. :P
[11:13:38] Ox0dea: I'm rebuilding from scratch in case ccache managed to bork something.
[11:14:05] htmldrum: has joined #ruby
[11:15:01] JammyHammy: has joined #ruby
[11:15:03] notnoyyyyy: has joined #ruby
[11:15:32] moeabdol: has joined #ruby
[11:16:00] Ropeney: has joined #ruby
[11:16:11] tulak_: has joined #ruby
[11:16:15] djellemah: Ox0dea: Yip, SEGV for define_method(:foo, &:bar)
[11:17:55] Ox0dea: djellemah: It's weird, because actually invoking #to_proc "works": https://eval.in/461527
[11:18:36] Ox0dea: But nobu has been doing some interesting things to optimize Symbol#to_proc (eliding bits and pieces of critical environment along the way, it seems).
[11:18:43] djellemah: Was just trying that.
[11:20:38] rickmasta: has joined #ruby
[11:22:16] TheBrayn: how can I tell rubocop to check the syntax for a specific ruby-version?
[11:22:28] djellemah: Ox0dea: gcc (Gentoo 4.8.4 p1.8, pie-0.6.1) 4.8.4 . You?
[11:22:38] TheBrayn: my local machine is running the most recent version but the server where the code should be deployed is running 2.0.0
[11:22:45] ruurd: has joined #ruby
[11:22:56] bougyman: what to do when Nokogiri can't search a doc?
[11:23:16] bougyman: The Doc: http://www.redhat.com/security/data/cvrf/2015/cvrf-rhsa-2015-0008.xml
[11:23:34] bougyman: with .xpath, I can't find anything, not even cvrfdoc (the root)
[11:23:50] bougyman: with .css, I can find stuff in part of the document but not others.
[11:23:54] bougyman: xmllint says the doc is fine.
[11:24:00] bougyman: and nokogiri doesn't complain in parsing.
[11:24:05] yorickpeterse: bougyman: that's because the XML document uses a non default XML namespace
[11:24:29] yorickpeterse: <cvrfdoc xmlns="http://www.icasi.org/CVRF/schema/cvrf/1.1" xmlns:cvrf="http://www.icasi.org/CVRF/schema/cvrf/1.1">
[11:24:32] yorickpeterse: note the xmlns
[11:24:48] blueOxigen: has joined #ruby
[11:24:57] bougyman: yorickpeterse: so.... shouldn't css still work?
[11:25:00] bougyman: doc.css('DocumentTracking InitialReleaseDate').text
[11:25:00] bougyman: => "2015-01-05T19:36:00Z"
[11:25:00] bougyman: [21] pry(main)> doc.css('Vulnerability')
[11:25:01] bougyman: [22] pry(main)> doc.xpath('//cvrfdoc')
[11:25:05] bougyman: it works for some of the tags.
[11:25:24] yorickpeterse: IIRC nokogiri lets you do something like some_doc.xpath('foo:cvrfdoc/foo:DocumentTitle', nil, 'foo' => 'http://www.icasi.org/CVRF/schema/cvrf/1.1')
[11:25:48] bougyman: would your xml parser handle this better?
[11:25:57] startupality: has joined #ruby
[11:26:02] yorickpeterse: No, because it's XML specified behaviour
[11:26:06] Ox0dea: djellemah: gcc (GCC) 5.2.0
[11:26:13] yorickpeterse: Though in Oga you can just use "*" as the namespace name and it will match
[11:26:17] yorickpeterse: but you have to use it for every node
[11:26:18] djellemah: Ox0dea: k, so not a gcc thing then.
[11:26:24] bougyman: i'm still confused as to why it can't .css the file
[11:26:27] bougyman: nokogiri, that is.
[11:28:01] yorickpeterse: bougyman: https://gist.github.com/YorickPeterse/8170807b68b4ef361502
[11:29:30] djellemah: bougyman: Nokogiri::XML::Document#remove_namespaces! might help. Careful of unintended consequences though.
[11:29:33] bougyman: doc.xpath('//xmlns:cvrfdoc').xpath('xmlns:DocumentTitle')
[11:29:41] bougyman: seems to work.
[11:29:53] bougyman: but not for Vulnerability
[11:30:22] bougyman: the ns changes for each section.
[11:30:28] bougyman: Vulnerability xmlns="http://www.icasi.org/CVRF/schema/vuln/1.1"
[11:30:34] bougyman: different xmlns
[11:30:55] FernandoBasso: has joined #ruby
[11:31:46] yorickpeterse: You can also just strip the namespaces
[11:32:13] bonemind: has joined #ruby
[11:32:58] bougyman: it looks like remove_namespaces! works, here.
[11:33:00] riotjones: has joined #ruby
[11:33:02] bougyman: but it worries the crap out of me.
[11:33:13] yorickpeterse: How so? It shouldn't matter when just querying
[11:33:21] yorickpeterse: XML namespaces are bullshit anyway
[11:33:26] bougyman: probably right.
[11:33:26] Gi0: has joined #ruby
[11:33:38] rgtk: has joined #ruby
[11:33:41] vigintas: has joined #ruby
[11:34:51] codecop: has joined #ruby
[11:34:52] Kedare: has joined #ruby
[11:37:16] bmalum: has joined #ruby
[11:37:17] l_tonz: has joined #ruby
[11:37:18] tulak: has joined #ruby
[11:37:41] leafybasil: has joined #ruby
[11:38:37] baweaver: has joined #ruby
[11:38:39] jwaldrip: has joined #ruby
[11:38:41] akem: has joined #ruby
[11:40:40] Ox0dea: Uh... wow. http://git.io/vlgGn + https://bugs.ruby-lang.org/issues/11618#note-1
[11:40:48] Ox0dea: Did nobu just go over matz?
[11:41:04] trosborn: has joined #ruby
[11:42:07] yorickpeterse: something something should've been specced out properly
[11:42:42] ruurd: has joined #ruby
[11:42:52] adaedra: specs? Where we're going we don't need specs.
[11:43:16] Pisuke: has joined #ruby
[11:43:20] juanpablo__: has joined #ruby
[11:43:25] sebstrax: has joined #ruby
[11:44:13] Ox0dea: I like how he tagged #11537 and not #11618.
[11:45:24] TheNet: has joined #ruby
[11:46:59] vev_: has joined #ruby
[11:52:39] Ox0dea: djellemah: Well, whatever that was, it's in the ether; rebuilding fixed it and I don't know how to read ccache manifests.
[11:53:03] l_tonz: has joined #ruby
[11:53:12] vigintas: has joined #ruby
[11:54:19] zenguy_pc: has joined #ruby
[11:54:23] joonty: has joined #ruby
[11:55:19] mattwildig: has joined #ruby
[11:56:48] lukaszes: has joined #ruby
[11:56:59] ruurd: has joined #ruby
[11:59:51] syath: has joined #ruby
[12:00:45] subscope: has joined #ruby
[12:03:00] subscope: has joined #ruby
[12:03:42] blackmesa: has joined #ruby
[12:04:00] leafybasil: has joined #ruby
[12:06:08] vev_: has joined #ruby
[12:07:45] krz: has joined #ruby
[12:09:28] leafybasil: has joined #ruby
[12:11:19] m3_del: has joined #ruby
[12:11:35] skade: has joined #ruby
[12:11:48] Xeago: has joined #ruby
[12:12:16] Hanmac: has joined #ruby
[12:14:07] colegatron: has joined #ruby
[12:15:36] Oatmeal: has joined #ruby
[12:17:40] radgeRayden_: has joined #ruby
[12:21:52] trosborn: has joined #ruby
[12:23:00] marr: has joined #ruby
[12:28:30] User458764: has joined #ruby
[12:28:33] lacrymology: has joined #ruby
[12:29:08] lacrymology: I'm using rbenv and bundle, I've got the right version of ruby activated (with rbenv): ruby 2.1.5p273 (2014-11-13 revision 48405) [x86_64-linux]
[12:29:10] trosborn: has joined #ruby
[12:29:23] lacrymology: but bundle install says Your Ruby version is 2.2.3, but your Gemfile specified 2.1.5
[12:29:26] ruurd: has joined #ruby
[12:30:39] vev_: has joined #ruby
[12:30:43] zotherstupidguy: has joined #ruby
[12:31:02] hemelskonijn: has joined #ruby
[12:31:03] roxtrongo: has joined #ruby
[12:32:07] kalusn: has joined #ruby
[12:32:17] segfalt``: has joined #ruby
[12:32:46] vev_: has joined #ruby
[12:33:30] havenwood: lacrymology: Is Bundler installed on 2.1.5? Already rehashed?
[12:34:05] lacrymology: havenwood: I might be using the system executable now that you mention it
[12:34:28] mistermocha: has joined #ruby
[12:35:05] lacrymology: havenwood: gem install bundler died horribly
[12:36:02] houhoulis: has joined #ruby
[12:36:29] sgambino: has joined #ruby
[12:36:34] hemelskonijn: has left #ruby: ("Leaving")
[12:38:11] lacrymology: /home/lacrymology/.rbenv/versions/2.1.5/lib/ruby/2.1.0/rdoc/generator/markup.rb:135: [BUG] Segmentation fault at 0x00000000000000
[12:38:14] lacrymology: ruby 2.1.5p273 (2014-11-13 revision 48405) [x86_64-linux]
[12:39:08] AMERICAN_PSYCHO: has joined #ruby
[12:39:44] vigintas: has joined #ruby
[12:39:52] lacrymology: it seems to work regardless..
[12:41:11] Peteykun: has joined #ruby
[12:41:18] lacrymology: is there a difference between "bundle install" and "bundler install"?
[12:41:20] s00pcan: has joined #ruby
[12:41:33] lacrymology: no, they seem to be the same
[12:42:52] skade: has joined #ruby
[12:43:12] Mon_Ouie: has joined #ruby
[12:43:15] vigintas: has joined #ruby
[12:43:53] mndoci: has joined #ruby
[12:44:56] vigintas: has joined #ruby
[12:47:17] ruurd: has joined #ruby
[12:47:59] Icey: has joined #ruby
[12:47:59] Icey: has joined #ruby
[12:48:40] vigintas: has joined #ruby
[12:48:40] p0wn3d__: has joined #ruby
[12:48:59] tkuchiki: has joined #ruby
[12:49:51] tkuchiki: has joined #ruby
[12:51:36] radgeRayden: has joined #ruby
[12:52:33] absolutejam: has joined #ruby
[12:53:48] vigintas: has joined #ruby
[12:54:11] duckpuppy: has joined #ruby
[12:54:16] haxrbyte_: has joined #ruby
[12:55:40] vigintas1: has joined #ruby
[12:58:34] vigintas: has joined #ruby
[12:59:11] vigintas1: has joined #ruby
[12:59:31] vigintas: has joined #ruby
[13:00:21] Guest53: has joined #ruby
[13:01:19] ruurd: has joined #ruby
[13:01:25] CloCkWeRX: has joined #ruby
[13:02:44] atomical: has joined #ruby
[13:02:45] devoldmx: has joined #ruby
[13:03:17] slackbotgz: has joined #ruby
[13:04:47] diegoaguilar: has joined #ruby
[13:06:01] joonty: has joined #ruby
[13:06:08] Bloomer: has joined #ruby
[13:06:13] djellemah: A few days ago, someone here was looking for a symbolic algebra library. How about http://sciruby.com/blog/2015/08/17/ruby-wrappers-for-symengine/
[13:07:07] wprice: has joined #ruby
[13:07:19] skade: has joined #ruby
[13:07:40] blackmesa: has joined #ruby
[13:09:39] tmtwd: has joined #ruby
[13:10:29] Rollabunna: has joined #ruby
[13:11:48] mattwildig: has joined #ruby
[13:12:00] m3_del: has joined #ruby
[13:12:49] haxrbyte: has joined #ruby
[13:16:03] TheNet: has joined #ruby
[13:16:13] gagrio: has joined #ruby
[13:16:56] ruurd: has joined #ruby
[13:17:29] absolutejam: has joined #ruby
[13:20:32] minimalism: has joined #ruby
[13:21:41] diegoaguilar: has joined #ruby
[13:21:51] cornerma1: has joined #ruby
[13:22:25] vev_: we are voluntary on #libreidea and we re looking for a dev to help in this project >> http://www.libreidea.org/Autumn_ideas_of_tagtree
[13:22:37] Randroid: has joined #ruby
[13:22:49] ruby-lang803: has joined #ruby
[13:23:43] claw: has joined #ruby
[13:24:51] skade: has joined #ruby
[13:26:49] jwaldrip: has joined #ruby
[13:28:37] gusTester: has joined #ruby
[13:28:41] djbkd: has joined #ruby
[13:28:50] nettoweb: has joined #ruby
[13:29:23] subscope: has joined #ruby
[13:29:36] lacrymology: is there a difference in gems between different versions of ruby? I'm having trouble making a project work and I wonder if it's because I installed the rails gem for a different version of ruby
[13:29:37] gusTester: has left #ruby: ()
[13:29:53] apeiros: lacrymology: some gems may require a specific ruby version
[13:30:05] apeiros: so yes, depending on your setup, a different ruby may result in a different gem version
[13:30:53] apeiros: or do you mean if you have a ruby version manager? in that case: yes, the ruby version managers I'm aware of will keep gems separate for each ruby version it manages.
[13:31:54] ruurd: has joined #ruby
[13:31:59] Jardayn: has joined #ruby
[13:32:06] sdothum: has joined #ruby
[13:32:07] juanpablo__: has joined #ruby
[13:32:22] lacrymology: apeiros: I'm using rbenv, and as far as I can tell I have the right version of ruby activated, but things won't work. I'm using 2.1.5 but gems are being installed in ~/.gem/ruby/2.2.0/, which raises a flag in my untrained eyes
[13:32:51] apeiros: 2.2.0 seems indeed wrong for ruby 2.1.5, I'd expect 2.1.0 there.
[13:33:08] apeiros: but I'm not using rbenv, so can't help you much there.
[13:33:16] radgeRayden_: has joined #ruby
[13:33:25] apeiros: you can use `gem env` to get the ruby your gem is run under
[13:33:35] lacrymology: should I just uninstall all gems I have and retry somehow? I don't mind, it's a new setup so there's nothing too complicated there
[13:33:42] ibouvousaime: has joined #ruby
[13:33:48] riotjones: has joined #ruby
[13:34:00] dorei: has joined #ruby
[13:34:19] lacrymology: apeiros: weird http://dpaste.com/2CX2D47
[13:34:21] terlar: has joined #ruby
[13:34:22] rgtk: has joined #ruby
[13:34:55] taylorrf: has joined #ruby
[13:34:58] lacrymology: I know the problem
[13:35:00] riotjones: has joined #ruby
[13:35:07] lacrymology: I've got GEM_HOME exported
[13:35:42] l_tonz: has joined #ruby
[13:37:03] synthroid: has joined #ruby
[13:37:14] mostlybadfly: has joined #ruby
[13:41:19] baweaver: has joined #ruby
[13:41:21] mwlang: has joined #ruby
[13:42:04] CloCkWeRX: has left #ruby: ()
[13:42:14] lxsameer: has joined #ruby
[13:42:14] lxsameer: has joined #ruby
[13:44:27] machan: has joined #ruby
[13:46:29] RobertBirnie: has joined #ruby
[13:48:25] JDiPierro: has joined #ruby
[13:50:00] ruurd: has joined #ruby
[13:51:10] mag42c: has joined #ruby
[13:51:25] Jerrod: Is net/ldap in the standard library?
[13:51:29] mistermocha: has joined #ruby
[13:52:04] leafybasil: has joined #ruby
[13:52:06] jwaldrip: has joined #ruby
[13:52:44] vayan: has joined #ruby
[13:53:05] MuffinPimp: has joined #ruby
[13:54:28] Jerrod: Ohh, I see now. It's in ruby-net-ldap.
[13:55:30] s00pcan_: has joined #ruby
[13:55:55] zenguy_pc: has joined #ruby
[13:57:41] krz: has joined #ruby
[13:58:11] ruurd: has joined #ruby
[13:59:59] CloCkWeRX: has joined #ruby
[14:01:41] bruno-: has joined #ruby
[14:02:03] seitensei: has joined #ruby
[14:02:27] malconis: has joined #ruby
[14:02:51] sankaber: has joined #ruby
[14:03:36] purplexed-: has joined #ruby
[14:03:36] purplexed-: has joined #ruby
[14:04:34] ekinmur: has joined #ruby
[14:04:41] dionysus69: has joined #ruby
[14:05:37] kfpratt: has joined #ruby
[14:06:25] queequeg1: has joined #ruby
[14:08:09] treehug88: has joined #ruby
[14:08:23] zylogz80: has joined #ruby
[14:08:37] arup_r: has joined #ruby
[14:09:01] InternetFriend: has joined #ruby
[14:10:06] rgtk: has joined #ruby
[14:12:23] troulouliou_div2: has joined #ruby
[14:12:48] devoldmx: has joined #ruby
[14:12:49] m3_del: has joined #ruby
[14:13:20] machan: has joined #ruby
[14:13:22] ibouvousaime: has joined #ruby
[14:15:26] lukaszes: has joined #ruby
[14:17:20] Dennis1: has left #ruby: ("http://quassel-irc.org - Chat comfortably. Anywhere.")
[14:17:42] sandals: has joined #ruby
[14:18:01] ziprar: has joined #ruby
[14:18:21] p0wn3d__: has joined #ruby
[14:18:49] nettoweb: has joined #ruby
[14:20:32] desmondhume: has joined #ruby
[14:21:30] DEA7TH: has joined #ruby
[14:22:07] gagrio: has joined #ruby
[14:22:24] Mia: has joined #ruby
[14:22:24] Mia: has joined #ruby
[14:22:32] desmondhume: has joined #ruby
[14:24:49] babblebre: has joined #ruby
[14:25:03] akem: has joined #ruby
[14:25:31] Guest53: has joined #ruby
[14:25:57] ruurd: has joined #ruby
[14:27:07] desmondhume: has joined #ruby
[14:27:28] desmondhume: has joined #ruby
[14:27:46] desmondhume: has joined #ruby
[14:29:10] odigity: has joined #ruby
[14:30:01] kfpratt: has joined #ruby
[14:30:07] odigity: One can check the gem namespace by searching on rubygems.org before naming one's gem, but how does one check the *module/class* namespace across all registered gems? How do I determine who (if anyone) is currently using a module/class named Repo?
[14:30:14] ekleog: has joined #ruby
[14:30:32] adaedra: You pray everyone named their namespaces correctly
[14:30:40] odigity: I'd think rubydoc.info would be an appropriate place for a feature like that, since they parse all gem code...
[14:30:47] apeiros: odigity: out of luck
[14:30:47] mikeharris22: has joined #ruby
[14:30:57] apeiros: there's no reasonable way to do so
[14:31:01] supergeek: has joined #ruby
[14:31:10] apeiros: but IMO any gem which violates naming conventions deserves to be shot down.
[14:31:18] timonv: has joined #ruby
[14:31:50] roxtrongo: has joined #ruby
[14:31:51] apeiros: so as long as your gem only uses the namespace its name suggest, the other party is to blame for any namespace-conflict
[14:31:58] alexherbo2: has joined #ruby
[14:32:00] pathrocle: has joined #ruby
[14:32:01] herbst: has joined #ruby
[14:32:13] odigity: apeiros, rubydoc.info parses all gem code to generate RDoc, and in the process encounters the vast majority of module and class names. It would be possible to add a search function to that if they'd be willing to accept such a contribution.
[14:32:23] herbst: i need to create a unique list of domains, some have www some not, i need to keep it as it is. how do i do that?
[14:32:26] apeiros: odigity: wrong
[14:32:32] apeiros: it parses *some* gems. not all.
[14:32:39] herbst: obviously www.example.com and example.com should be the same
[14:32:44] odigity: apeiros, wouldn't it be fair to say it parses most gems?
[14:32:45] apeiros: at least afaik it only parses gems on demand.
[14:32:52] newdan: has joined #ruby
[14:33:10] colegatron: has joined #ruby
[14:33:12] apeiros: odigity: doesn't matter. your approach requires to have all gems. and you don't get that.
[14:33:17] odigity: apeiros, yes, but if a gem is so unpopular that no one's looked at the docs on rdoc.info, than I'm less concerned about collision. the problem solves itself, as long as perfection is not the goal
[14:33:21] apeiros: and IMO it doesn't matter anyway.
[14:33:30] nettoweb: has joined #ruby
[14:33:35] desmondhume: herbst what do you mean?
[14:33:56] apeiros: odigity: as said: as long as your gem only uses the namespace its name suggest, the other party is to blame for any namespace-conflict
[14:33:59] djellemah: LOL at # If any parameters are empty, we freak out and yell at the user.
[14:34:16] mistermocha: has joined #ruby
[14:34:21] apeiros: herbst: but www.example.com and example.com are not the same.
[14:34:23] odigity: apeiros, I do generally stick to my gem's namespace. However, I'm currently building a command-line tool that, like Bundler and Vagrant, supports a ruby config file, and it'd be nice if uses only had to type Repo.config do |config| instead of DevProd::Repo.config do |config|
[14:34:25] herbst: like i have ["hodor.example.com", "mimi.momo.com", "www.example.com", "example.com"] and would like to .uniq that list ignoring www. that the result is ["hodor.example.com", "mimi.momo.com", "www.example.com"]
[14:34:44] apeiros: herbst: i.e. they don't need to point at the same server, and even if they point at the same IP, they might be different pages.
[14:34:45] desmondhume: why keeping "www.example.com" instead of "example.com"?
[14:34:46] odigity: apeiros, especially since the code is only loaded in the context of my tool, and I can test for collisions before deploying
[14:34:48] andywojo: has joined #ruby
[14:34:59] herbst: desmondhume: i dont care actually, the first is ok
[14:34:59] mistermocha: has joined #ruby
[14:35:08] apeiros: odigity: don't.
[14:35:16] apeiros: odigity: include DevProd; Repo.config
[14:35:31] CloCkWeRX: has joined #ruby
[14:35:43] herbst: apeiros: its a internal tool. all our www and non www behave the same
[14:36:05] apeiros: herbst: then use a hash where you strip the www. for the keys.
[14:36:15] odigity: apeiros, not as pretty as Vagrantfile, which is "Vagrant.configure(2) do |config|". :)
[14:36:17] djellemah: herbst: take a look at Enumerable#uniq - it takes a block
[14:36:17] apeiros: and then .values
[14:36:27] djellemah: or what apeiros said
[14:36:31] desmondhume: maybe some regex
[14:36:37] herbst: apeiros: djellemah: thanks both of you! i am sure one of that will work
[14:36:39] desmondhume: ignoring the first www.
[14:36:42] odigity: apeiros, I suppose I can just shorten it to DevProd.config; not as pretty as Repo.config, but short, and within my namespace.
[14:37:03] apeiros: odigity: all better than violating namespaces :)
[14:37:06] odigity: thanks for the feedback
[14:37:16] Randroid: has joined #ruby
[14:37:31] desmondhume: apeiros answer looks good btw
[14:37:43] CloCkWeRX: has left #ruby: ()
[14:37:45] apeiros: odigity: it coincidentally makes exploring code easier too, since it means you can infer from where some code stems
[14:37:50] ruurd: has joined #ruby
[14:38:04] odigity: apeiros, true -- and I hate both inconsistency and magic
[14:38:06] apeiros: with a plain `Repo.config` - a reader has no idea from which gem it is, given that there probably is no "repo" gem.
[14:38:11] mistermo_: has joined #ruby
[14:38:20] odigity: apeiros, thank you, that sold me. I'm now at peace.
[14:38:35] apeiros: convinced another one! yay!
[14:39:30] cdg: has joined #ruby
[14:39:36] roxtrongo: has joined #ruby
[14:41:04] NullVoxPopuli_: has joined #ruby
[14:41:12] NullVoxPopuli_: I recently found this: https://github.com/suryagaddipati/linqr
[14:41:28] NullVoxPopuli_: and am wondering if there are plans to eventualyl incorporate linq-esque syntax in to ruby
[14:41:45] subscope: has joined #ruby
[14:42:05] baweaver: has joined #ruby
[14:43:18] umgrosscol: has joined #ruby
[14:43:51] Xzanron: NullVoxPopuli_, I prefer the more functional style, even in C#. I just find it easier to read. e.g. list.first(5).map()
[14:44:17] skade: has joined #ruby
[14:44:24] ekleog: has joined #ruby
[14:44:27] Ivision: has joined #ruby
[14:44:31] NullVoxPopuli_: Xzanron, what about where clauses?
[14:44:36] jhn: has joined #ruby
[14:44:38] Ivision: has left #ruby: ()
[14:44:38] NullVoxPopuli_: I know you can just use `select{}`
[14:44:41] odigity: Since there's no thor channel: Does anyone know how the template() method works?
[14:44:43] NullVoxPopuli_: in ruby, anyway
[14:44:52] axl_: has joined #ruby
[14:45:26] TheNet: has joined #ruby
[14:45:37] ziprar: has joined #ruby
[14:45:37] lubarch: has joined #ruby
[14:48:03] User458764: has joined #ruby
[14:48:27] synthroid: has joined #ruby
[14:49:13] uris: has joined #ruby
[14:51:43] skade: has joined #ruby
[14:51:52] ruurd: has joined #ruby
[14:52:29] newdan: has joined #ruby
[14:52:55] seitensei: has joined #ruby
[14:53:47] rodfersou: has joined #ruby
[14:53:56] ESpiney: has joined #ruby
[14:54:53] karapetyan: has joined #ruby
[14:55:08] xaxisx: has joined #ruby
[14:55:52] musou: has joined #ruby
[14:56:26] subscope: has joined #ruby
[14:58:19] polishdub: has joined #ruby
[14:59:05] whippythellama: has joined #ruby
[15:00:11] jmonreal: has joined #ruby
[15:00:34] inate: has joined #ruby
[15:00:54] jmonreal: when parsing a json, how can I make that for empty arrays to interpret as a 0
[15:02:20] freerobby: has joined #ruby
[15:03:23] ibouvousaime: has joined #ruby
[15:03:44] malconis: has joined #ruby
[15:03:46] yorickpeterse: that's not how JSON works
[15:03:53] yorickpeterse: An empty array is not 0
[15:04:34] NullVoxPopuli_: json.presance || 0 would do it
[15:04:39] tvon: has joined #ruby
[15:04:52] gregf_: has joined #ruby
[15:04:55] malconis: has joined #ruby
[15:05:27] FernandoBasso: has joined #ruby
[15:05:54] cdg_: has joined #ruby
[15:06:20] ruurd: has joined #ruby
[15:06:40] The_Phoenix: has joined #ruby
[15:07:56] Guest53: has joined #ruby
[15:08:50] rbennacer: has joined #ruby
[15:09:12] yorickpeterse: There's no "presence" method in regular Ruby
[15:09:19] subscope: has joined #ruby
[15:09:50] ghoti: has joined #ruby
[15:11:05] rickmasta: has joined #ruby
[15:11:16] weemsledeux: has joined #ruby
[15:11:24] fibbel: has joined #ruby
[15:13:16] ddv: presance doesn't exist in activesupport either
[15:13:34] m3_del: has joined #ruby
[15:13:43] sankaber: has joined #ruby
[15:15:11] andll: has joined #ruby
[15:15:38] bigkevmcd: has joined #ruby
[15:15:46] mattwildig: has joined #ruby
[15:15:50] Motoservo: has joined #ruby
[15:16:35] xMopxShell: has joined #ruby
[15:17:43] cwong_on_irc: has joined #ruby
[15:18:17] lukaszes: has joined #ruby
[15:20:11] mallu: has joined #ruby
[15:20:54] juanpablo__: has joined #ruby
[15:20:55] beauby: has joined #ruby
[15:21:18] lacrymology: how safe is it to just remove ~/.gem to start anew?
[15:22:21] slawrence00: has joined #ruby
[15:22:24] ruurd: has joined #ruby
[15:22:44] dravine_: has joined #ruby
[15:23:49] voker57: has joined #ruby
[15:24:42] shevy: lacrymology it is safe, gem will recreate the files it requires; I always keep backups of my .gems too so reinstalling is trivial
[15:25:07] dhollinger: has joined #ruby
[15:26:14] ruurd_: has joined #ruby
[15:26:38] helpa: has joined #ruby
[15:26:57] pathrocle: has joined #ruby
[15:27:12] sundhell_: has joined #ruby
[15:27:20] kies^: has joined #ruby
[15:27:47] segfalt: has joined #ruby
[15:27:57] im0b_: has joined #ruby
[15:28:01] zzak_: has joined #ruby
[15:28:12] MuffinPimp_: has joined #ruby
[15:28:13] mwlang_: has joined #ruby
[15:28:50] `scootaloo: has joined #ruby
[15:29:03] l_tonz: has joined #ruby
[15:29:15] prasselpikachu_: has joined #ruby
[15:29:22] diprotic: has joined #ruby
[15:29:22] diprotic: has joined #ruby
[15:30:13] gregf: has joined #ruby
[15:30:22] twistedpixels_: has joined #ruby
[15:30:23] favadi: has joined #ruby
[15:30:26] Muz_: has joined #ruby
[15:30:26] eregon_: has joined #ruby
[15:30:27] charles81_: has joined #ruby
[15:30:35] frode15243_: has joined #ruby
[15:30:41] abra0_: has joined #ruby
[15:30:43] jorb_: has joined #ruby
[15:30:57] atomical: has joined #ruby
[15:31:03] momomomomo: has joined #ruby
[15:31:03] lacrymology: I'm a bit lost on what's the best policy to do certain things when working with rbenv or similar.
[15:31:17] lacrymology: There's some commands that I'll want to use globally
[15:31:21] vondruch_: has joined #ruby
[15:31:21] Gnubie__: has joined #ruby
[15:31:32] lacrymology: gem-prune, gem-path, I'm sure there's more
[15:32:01] lacrymology: is there an easy way to install those globally and the rest in their specific environments?
[15:32:18] umgrosscol_: has joined #ruby
[15:32:21] lacrymology: then again, those two work on the gems directories.. will they work with version-specific gems if I do that?
[15:32:26] mikeharr_: has joined #ruby
[15:32:53] Azulinho: has joined #ruby
[15:33:02] boshhead_: has joined #ruby
[15:33:10] newdan: has left #ruby: ()
[15:34:06] Radar_: has joined #ruby
[15:34:19] yosafbridge`: has joined #ruby
[15:34:41] \13k_: has joined #ruby
[15:35:25] lkba: has joined #ruby
[15:35:40] sepp2k: has joined #ruby
[15:35:41] riotjones: has joined #ruby
[15:35:57] Dfoolz: has joined #ruby
[15:36:14] omegahm: has joined #ruby
[15:36:16] ekem: has joined #ruby
[15:36:23] kp666: has joined #ruby
[15:36:44] levifig: has joined #ruby
[15:36:46] icedragon: has joined #ruby
[15:37:23] kp666: has joined #ruby
[15:37:31] jlyndon: has joined #ruby
[15:37:38] torpig: has joined #ruby
[15:37:39] ruurd: has joined #ruby
[15:37:47] dnomyar: has joined #ruby
[15:37:52] yorickpeterse: ddv: No, it comes with the Gem engrish
[15:38:00] taylorrf: has joined #ruby
[15:38:04] gregf: has joined #ruby
[15:38:09] ddv: yorickpeterse: :-)
[15:38:11] kp666: has joined #ruby
[15:38:18] patdohere: has joined #ruby
[15:38:26] apeiros: has joined #ruby
[15:38:27] yorickpeterse: pruts "hello wrold"
[15:38:51] ddv: yorickpeterse: prutser 'hello world'
[15:39:04] tkuchiki: has joined #ruby
[15:39:17] _blizzy_: has joined #ruby
[15:39:47] i: has joined #ruby
[15:40:36] bjmllr: has joined #ruby
[15:41:03] skade: has joined #ruby
[15:41:09] adambeynon: has joined #ruby
[15:41:13] majjoha: has joined #ruby
[15:41:22] nettoweb: has joined #ruby
[15:41:51] YaknotiS: has joined #ruby
[15:42:17] Xeago: has joined #ruby
[15:42:26] constantinexvi: has joined #ruby
[15:42:41] diegoaguilar: has joined #ruby
[15:42:46] existensil: has joined #ruby
[15:42:47] baweaver: has joined #ruby
[15:42:57] Sou|cutter: has joined #ruby
[15:43:16] mclee_: has joined #ruby
[15:43:26] dopamean_: has joined #ruby
[15:43:40] tenderlove: has joined #ruby
[15:44:37] glowcoil: has joined #ruby
[15:45:43] tonini: has joined #ruby
[15:45:43] cek: has joined #ruby
[15:45:47] cstrahan: has joined #ruby
[15:47:00] mic_e: has joined #ruby
[15:47:05] solocshaw: has joined #ruby
[15:47:25] moredhel: has joined #ruby
[15:47:45] avdi: has joined #ruby
[15:47:50] snick007: has joined #ruby
[15:47:50] chouhoulis: has joined #ruby
[15:47:58] mission712: has joined #ruby
[15:48:48] User458764: has joined #ruby
[15:48:52] huddy: has joined #ruby
[15:48:55] djbkd: has joined #ruby
[15:48:56] Guest85414______: has joined #ruby
[15:49:03] vigintas: has joined #ruby
[15:49:05] dhollinger: has joined #ruby
[15:49:59] sankaber: has joined #ruby
[15:50:00] zenguy_pc: has joined #ruby
[15:50:08] Channel6: has joined #ruby
[15:50:37] deimos: has joined #ruby
[15:50:56] Heero: has joined #ruby
[15:51:20] kellabyte: has joined #ruby
[15:52:09] MiracleBlue: has joined #ruby
[15:52:34] joaomdmoura: has joined #ruby
[15:53:34] baroquebobcat: has joined #ruby
[15:53:52] tenseiten: has joined #ruby
[15:53:52] tenseiten: has joined #ruby
[15:54:30] tenderlove: has joined #ruby
[15:55:13] Lloyd: has joined #ruby
[15:55:45] yqt: has joined #ruby
[15:56:08] ruurd: has joined #ruby
[15:56:13] rgtk: has joined #ruby
[15:57:12] `derpy: has joined #ruby
[15:57:16] jessemcgilallen: has joined #ruby
[15:58:26] tjohnson: has joined #ruby
[15:59:25] djbkd: has joined #ruby
[15:59:40] thesheff17: has joined #ruby
[16:00:03] karapetyan: how can i convert "strin\ng" to 'strin\ng'
[16:00:27] startupality: has joined #ruby
[16:01:30] patdohere: has joined #ruby
[16:01:36] blackmesa: has joined #ruby
[16:03:25] Outlastsheep: has joined #ruby
[16:03:41] kaleido: has joined #ruby
[16:03:52] Alina-malina: has joined #ruby
[16:04:16] idefine: has joined #ruby
[16:06:41] GarethAdams: has joined #ruby
[16:06:41] GarethAdams: has joined #ruby
[16:06:48] skade: has joined #ruby
[16:07:12] arooni: has joined #ruby
[16:07:23] shevy: has joined #ruby
[16:08:04] umgrosscol: has joined #ruby
[16:08:49] pwnd_nsfw: has joined #ruby
[16:09:03] freerobby: has joined #ruby
[16:09:16] adaedra: that's not clear what you want
[16:09:18] dgarstang: has joined #ruby
[16:09:30] adaedra: if you speak of output when inspecting, you don't.
[16:09:41] adaedra: >> [ 'single', "double" ]
[16:09:43] ruboto: adaedra # => ["single", "double"] (https://eval.in/461713)
[16:09:50] dgarstang: In ruby, how can I test a variable, and if it's not set have it return false?
[16:10:25] adaedra: &ri Object#defined?
[16:10:25] `derpy: No results
[16:10:50] C0deMaver1ck: has joined #ruby
[16:10:51] dstarh: has joined #ruby
[16:11:09] adaedra: dgarstang: use `defined?`.
[16:11:25] dgarstang: adaedra: isn't false == defined?
[16:11:33] druonysus: has joined #ruby
[16:11:48] dgarstang: adaedra: In python, I can just test it. if it's nil or false, the conditional returns false, if it's true, it returns true
[16:11:49] pathrocle: has joined #ruby
[16:12:27] adaedra: `defined? a` will return nil if a variable is not defined.
[16:12:46] dgarstang: adaedra: I want to put it in an if statement, so I need true/false
[16:12:48] adaedra: if you want to test if its truthy or falsy (nil/false), just use it as boolean expression, i.e. `if a`
[16:13:06] mattwildig: has joined #ruby
[16:13:07] adaedra: `if defined?(a)` works.
[16:13:10] dgarstang: adaedra: doesn't work. if I don't define it first, and I test it, I get an error
[16:13:34] ruurd: has joined #ruby
[16:14:13] adaedra: so if you want it to exist *and* be truthy, it would be `if defined?(a) && a`
[16:14:23] m3_del: has joined #ruby
[16:14:47] dgarstang: adaedra: thanks
[16:15:40] zenguy_pc: has joined #ruby
[16:16:05] frozenfoxx: has left #ruby: ()
[16:16:13] mikolalysenko: has joined #ruby
[16:16:31] TheNet: has joined #ruby
[16:17:26] bmalum_: has joined #ruby
[16:19:30] EminenceHC: has joined #ruby
[16:19:56] diegoaguilar: has joined #ruby
[16:20:01] Renich: has joined #ruby
[16:21:48] mary5030: has joined #ruby
[16:22:48] mary5030: has joined #ruby
[16:23:58] mary5030: has joined #ruby
[16:24:45] Eminence_: has joined #ruby
[16:24:58] dopie: has joined #ruby
[16:25:35] mwlang: does xpath and ???//section??? not work for nokogiri?
[16:25:42] ruurd: has joined #ruby
[16:27:20] Spami: has joined #ruby
[16:28:21] cdg: has joined #ruby
[16:28:46] malconis: has joined #ruby
[16:29:45] vev_: has joined #ruby
[16:30:42] mordocai: has joined #ruby
[16:30:43] RobertBirnie: has joined #ruby
[16:32:26] momomomomo: has joined #ruby
[16:33:14] desmondhume: has joined #ruby
[16:35:08] User458764: has joined #ruby
[16:35:20] mikeharris22: has joined #ruby
[16:36:05] mwlang: has left #ruby: ()
[16:36:14] mwlang: has joined #ruby
[16:37:19] agit0: has joined #ruby
[16:38:01] mattwildig: has joined #ruby
[16:38:31] ruurd: has joined #ruby
[16:39:45] solocshaw: has joined #ruby
[16:40:35] mahlon: has joined #ruby
[16:40:51] mistermocha: has joined #ruby
[16:41:18] bricker: has joined #ruby
[16:41:44] pandaant: has joined #ruby
[16:42:24] l_tonz: has joined #ruby
[16:43:25] baweaver: has joined #ruby
[16:43:46] mndoci: has joined #ruby
[16:45:01] denver: has joined #ruby
[16:46:10] adac: has joined #ruby
[16:47:09] adac: Guys, When I install ruby by hand, do you know which paths I need to set for the storages of the gems and the bundles so that a normal user can also use gem install and bundler? BUNDLE_PATH and GEM_HOME? is there anything else?
[16:47:21] mistermocha: has joined #ruby
[16:47:31] ledestin: has joined #ruby
[16:47:52] luckyme: has joined #ruby
[16:47:54] shevy: adac what --prefix will you use?
[16:48:05] mistermocha: has joined #ruby
[16:48:09] tno: has joined #ruby
[16:48:30] shevy: normal users also have the option to install into their home dir btw, via 'gem install --user-install'
[16:48:43] skade: has joined #ruby
[16:48:50] l_tonz: has joined #ruby
[16:49:06] machan: has joined #ruby
[16:49:34] adac: shevy, Hmm ok I see. But i wanted to solve this by setting the paths via environment variable since I want to use it within a docker image as a different user then root
[16:49:48] DiCablo: has joined #ruby
[16:50:07] adac: shevy, not so sure what "--prefix" is about? can you tell me more about that eventually?
[16:50:16] vev_: we are voluntary on #libreidea and we re looking for a dev to help in this project >> http://www.libreidea.org/Autumn_ideas_of_tagtree
[16:50:43] purplexed-: has joined #ruby
[16:51:30] dorei: is there a way to find out which methods were defined via attr_reader, attr_writer, etc ?
[16:51:38] juanpablo__: has joined #ruby
[16:52:18] purplexed-: has joined #ruby
[16:52:18] purplexed-: has joined #ruby
[16:52:26] idefine: has joined #ruby
[16:52:46] mwlang: given a Node, is it possible to tell nokogiri to tell me what it???s xpath is?
[16:52:56] chouhoulis: has joined #ruby
[16:52:56] Fire-Dragon-DoL: has joined #ruby
[16:53:35] dorei: mwlang: that's a really good question
[16:53:45] mwlang: for example, if I parse an HTML doc and manually drill down to any one specific node, can I do something in console like ???node.xpath??? and see what it???s selector would be?
[16:53:58] LLamaRider: has joined #ruby
[16:54:20] mwlang: my biggest hurdle with nokogiri is almost always getting the xpath selector right.
[16:54:36] kimegede: has joined #ruby
[16:54:46] axl_: has joined #ruby
[16:55:08] Jackneill: has joined #ruby
[16:55:36] tvon: has joined #ruby
[16:55:47] mikeharris22: has joined #ruby
[16:55:55] JuanDaugherty: has joined #ruby
[16:57:03] Ray`: mwlang: I ended up using a cheatsheet, but I've lost the URL
[16:57:12] Ray`: because xpath has always bugged me
[16:57:26] dorei: there's a nice page with useful examples, let me find it
[16:57:48] dorei: http://zvon.org/xxl/XPathTutorial/General/examples.html
[16:58:16] mwlang: Ray`: yeah, I struggle even with the most basic. I have an HTML doc with four or five table elements on it, but doc.xpath('//table').count => 0 so I have to imagine it???s me doing something rather dumb at the basic level.
[16:58:43] Oatmeal: has joined #ruby
[16:59:15] idefine: has joined #ruby
[17:00:34] SCHAAP137: has joined #ruby
[17:00:42] s2013: has joined #ruby
[17:00:53] stannard: has joined #ruby
[17:01:59] druonysuse: has joined #ruby
[17:02:31] mwlang: dorei: good examples to look at.
[17:03:00] mark4: has left #ruby: ("PART #RubyOnRails :PART #jquery :PART #reactjs :PART ##javascript :PART #elixir-lang :PART #debian :PART #zsh :PART #nethunter :PONG :card.freenode.net")
[17:04:16] dionysus69: has joined #ruby
[17:07:36] l_tonz: has joined #ruby
[17:08:16] aspiers: has joined #ruby
[17:08:28] atomical: has joined #ruby
[17:09:14] Alayde: has joined #ruby
[17:09:48] tulak: has joined #ruby
[17:10:03] krz: has joined #ruby
[17:10:21] jessemcgilallen: has joined #ruby
[17:10:58] Alayde: has left #ruby: ()
[17:11:27] druonysuse: has joined #ruby
[17:11:34] seitensei: has joined #ruby
[17:11:55] karapetyan: has joined #ruby
[17:12:20] idefine: has joined #ruby
[17:14:17] Motoservo: has joined #ruby
[17:15:17] m3_del: has joined #ruby
[17:16:08] qpls: has joined #ruby
[17:16:46] ahegyi: has joined #ruby
[17:17:42] Ox0dea: Ray`: You lost the URL *because* XPath bugs you?
[17:17:50] Ox0dea: > Holding onto anger is like drinking poison and expecting the other person to die.
[17:18:22] Ox0dea: adaedra: How did you figure `defined?` could be a method? :P
[17:19:34] adaedra: Ox0dea: I ended on http://ruby-doc.org/docs/keywords/1.9/Object.html#method-i-defined-3F and didn't look at the address in full. Looked like a method.
[17:19:36] arooni: has joined #ruby
[17:19:44] adaedra: At least, documentation-wise.
[17:20:11] Ox0dea: It's syntax.
[17:21:07] Ray`: Ox0dea: haha no, I stopped needing it eventually
[17:21:12] Ray`: so I don't have it to hand
[17:21:31] towski_: has joined #ruby
[17:22:22] akem: has joined #ruby
[17:23:30] crdpink: has joined #ruby
[17:24:10] syath: has joined #ruby
[17:26:03] shevy: adac you wrote "by hand", so I assume you mean that you will compile ruby from source right? so typically one uses --prefix; system installs would have --prefix=/usr, if --prefix is omitted it normally will default to --prefix=/usr/local
[17:26:58] shevy: adac these built-in system variables will be available in RbConfig; for instance, RbConfig::CONFIG['host'] # => 'i686-pc-linux-gnu'
[17:29:43] Motoservo: has joined #ruby
[17:30:44] podman: has joined #ruby
[17:31:37] mission712_: has joined #ruby
[17:32:24] xMopxShell: has joined #ruby
[17:32:47] mikeharris22: has joined #ruby
[17:32:52] musl: has joined #ruby
[17:33:03] bkzl: has joined #ruby
[17:34:31] Renich: has joined #ruby
[17:36:28] mwlang: oh, my. I think I finally figured out why I can???t get at any of the table elements with nokogiri. In pry, if I print the parsed html (???p doc???), I can scroll down and clearly see the info???s there. But doc.xpath(???//table???) returns nothing. If I feed that doc to Nokogiri and print the resulting HTML, all the tables are missing! That is, Nokogiri::HTML.fragment(doc.to_html).to_html => an HTML output with ~90% of the content missing
[17:36:30] rbennacer: has joined #ruby
[17:36:32] riotjones: has joined #ruby
[17:37:17] mwlang: ACTION working on making a reproduceable example for gist.
[17:37:20] Ox0dea: mwlang: Are you sure you don't have two documents?
[17:37:35] dorei: mwlang: why fragment and not Nokogiri::HTML(doc) ?
[17:37:39] benlieb: has joined #ruby
[17:38:03] mwlang: dorei: trying to remove a bunch of badly formatted crap
[17:38:12] pathrocle: has joined #ruby
[17:38:50] mwlang: you???re supposed to be able to clear blank lines and indentation with fragment (if I understand the documentation correctly)
[17:38:55] musl: has joined #ruby
[17:39:09] scottstamp: has joined #ruby
[17:40:09] Channel6: has joined #ruby
[17:40:30] Eminence_: has joined #ruby
[17:40:58] SenpaiSilver: has joined #ruby
[17:42:49] wprice_: has joined #ruby
[17:42:50] olblak: has joined #ruby
[17:42:53] vev_: has joined #ruby
[17:45:55] TheNet: has joined #ruby
[17:46:05] BTRE: has joined #ruby
[17:47:18] spew: has joined #ruby
[17:47:51] idefine_: has joined #ruby
[17:47:56] EminenceHC: has joined #ruby
[17:48:47] PaulCapestany: has joined #ruby
[17:49:02] mistermocha: has joined #ruby
[17:49:51] xMopxShell: has joined #ruby
[17:50:23] idefine: has joined #ruby
[17:52:26] symm-: has joined #ruby
[17:52:54] Mon_Ouie: has joined #ruby
[17:52:59] mistermocha: has joined #ruby
[17:53:37] idefine_: has joined #ruby
[17:53:49] mistermocha: has joined #ruby
[17:53:50] baweaver: has joined #ruby
[17:54:02] Xeago: has joined #ruby
[17:54:12] prettiestPony11: has joined #ruby
[17:54:16] EminenceHC: has joined #ruby
[17:54:52] xMopxShell: has joined #ruby
[17:55:39] Guest47571: has joined #ruby
[17:56:30] rakm: has joined #ruby
[17:57:26] freerobby: has joined #ruby
[17:59:39] olblak: has joined #ruby
[17:59:58] Musashi007: has joined #ruby
[18:01:00] _blizzy_: has joined #ruby
[18:01:18] mwlang: man, oh, man???.all this time ??? it was a byte encoding issue. open-uri was returning the page as encoded US-ASCII instead of UTF-8.
[18:02:08] mwlang: so html = open-uri(some_url).force_encoding(???utf-8???) first, then doc = Nokogiri::HTML(html) and then all the xpath stuff works just fine.
[18:02:16] benlieb: has joined #ruby
[18:02:58] mwlang: The <meta charset="UTF-8" /> appears to be ignored altogether.
[18:03:40] crayfishx: has joined #ruby
[18:03:41] last_staff: has joined #ruby
[18:06:10] Timba-as: has joined #ruby
[18:06:31] jobewan: has joined #ruby
[18:06:40] benlieb: has joined #ruby
[18:08:04] apeiros: mwlang: if the server sends a content-type header, then that has priority iirc
[18:08:17] idefine: has joined #ruby
[18:08:47] shadoi: has joined #ruby
[18:08:47] apeiros: might also be that openuri doesn't do anything about the encoding and just uses default_internal
[18:08:58] mwlang: apeiros: it may very well be sending an overriding header. I just didn???t think to check that setting.
[18:09:14] qpls: has joined #ruby
[18:09:28] apeiros: mwlang: I'm curious, though - what's your Encoding.default_internal and .default_external?
[18:09:45] Guest53: has joined #ruby
[18:09:52] druonysuse: has joined #ruby
[18:09:53] druonysuse: has joined #ruby
[18:10:19] diegoaguilar: has joined #ruby
[18:10:42] mwlang: apeiros: surprisingly???[Encoding.default_internal, Encoding.default_external] => [nil, #<Encoding:US-ASCII>]
[18:11:03] mwlang: shouldn???t both of those bee UTF-8?
[18:11:04] apeiros: ok, I think openuri doesn't do a thing
[18:11:15] Ox0dea: mwlang: "Overriding" isn't the right word; open-uri doesn't parse XML, and that's really what you want.
[18:11:22] apeiros: if internal is set, all IO will translate iirc
[18:11:53] apeiros: I haven't actually experimented enough with those things
[18:12:00] apeiros: I always set encodings explicitly
[18:12:04] mwlang: I guess my question really is, what *should* these be for most Ruby environments?
[18:12:23] apeiros: mwlang: I think internal nil, external utf-8
[18:12:41] apeiros: and then make sure you actually pass the encoding if your external source is not utf-8
[18:13:56] mwlang: apeiros: ok, I???ll do a little more research on these two settings before I start just setting them blindly in all projects, but I do think I???m going to have to start more actively managing the encoding setting with international projects.
[18:13:59] druonysuse: has joined #ruby
[18:14:06] karapetyan: Ox0dea: well ))) https://gist.github.com/karapetyan/bc08e8edd4e7a8a23ac5
[18:14:28] karapetyan: Ox0dea: my stupid brain + 3hrs and it's done)
[18:14:33] dfockler: has joined #ruby
[18:14:35] itgold: has joined #ruby
[18:14:42] freerobby: has joined #ruby
[18:14:44] itgold: hi there, friends
[18:14:54] mwlang: I almost never encounter encoding issues with US-based clients and projects, but with International projects, I find that even if the ecosystem is set up with intent to serve UTF-8 everywhere, it???s not always the case.
[18:15:04] mwlang: (as in this example!)
[18:15:55] shevy: one day we will use the one true encoding to bind them all
[18:15:56] m3_del: has joined #ruby
[18:16:15] mrchris: has joined #ruby
[18:16:25] zenguy_pc: has joined #ruby
[18:16:26] adac: has joined #ruby
[18:16:40] mwlang: shevy: UTF-16? :-o
[18:17:59] druonysus: has joined #ruby
[18:18:34] karapetyan: Ox0dea: and it's should be: code.gsub(/(\/\*.+?\*\/)|(\/\/.+)/,"") =)
[18:18:54] mrchris: Anyone here know of any GUI or CLI tools for viewing & running Sphinx queries?
[18:19:21] speakingcode: has joined #ruby
[18:20:40] mwlang: __chris: rails! :-D
[18:20:43] zotherstupidguy: has joined #ruby
[18:21:42] _djbkd: has joined #ruby
[18:21:57] mwlang: __chris: although answered somewhat in jest ??? I usually code it up in rspec as well as just getting a simple search submission form working early on.
[18:22:42] mrchris: Thanks for your ideas
[18:23:25] kalusn: has joined #ruby
[18:24:53] shevy: mwlang no clue, I am UTF free, but isn't UTF-8 superior to UTF-16?
[18:25:32] desmondhume: has joined #ruby
[18:25:55] vdamewood: has joined #ruby
[18:26:10] bricker: has joined #ruby
[18:26:40] baweaver: has joined #ruby
[18:26:48] arooni: has joined #ruby
[18:27:00] roxtrongo: has joined #ruby
[18:27:57] mwlang: shevy: depends on the predominent language, I think. I think UTF-8 will use single byte for characters in the ASCII range and 2 bytes only as needed. UTF-16 uses 2 bytes always ??? IIRC.
[18:28:15] mwlang: (in other words, I don???t really know) :-)
[18:28:32] solars: has joined #ruby
[18:30:31] SCHAAP137: has joined #ruby
[18:30:34] [Butch]: has joined #ruby
[18:30:48] baroquebobcat: has joined #ruby
[18:31:46] iamvery: has joined #ruby
[18:32:42] chris2: utf-16 uses 2 bytes if they are enough
[18:33:06] User458764: has joined #ruby
[18:34:34] jackjackdripper: has joined #ruby
[18:34:48] jschoolcraft: has joined #ruby
[18:35:19] sphex_: has joined #ruby
[18:35:22] c_nick: has joined #ruby
[18:35:24] mwlang: so, for nokogiri, I can ask for the text of a node via the xpath like this node.at_xpath(???td[3]/div[1]/a/text()???).to_s but how do I retrieve the ???href??? context of that same node with xpath?
[18:35:29] yokel: has joined #ruby
[18:35:54] jackjackdripper: has joined #ruby
[18:36:39] c_nick: while installing mysql2 i ran into bit of trouble .. i have mysql server installed (no client) for which i downloaded mysql-c- connectors-no-install i pointed to the libs and include folder of that while installing but it still failed with cannot find mysql client
[18:36:54] JuanDaugherty: has joined #ruby
[18:37:28] c_nick: ruby 2.0 32 bit and mysql 5.6
[18:38:12] vev_: has joined #ruby
[18:38:31] shevy: you should put the full error on a pastie site c_nick
[18:39:16] dnomyar: has joined #ruby
[18:40:23] juanpablo__: has joined #ruby
[18:40:41] mattwildig: has joined #ruby
[18:41:07] pietr0: has joined #ruby
[18:41:26] jackjackdripper1: has joined #ruby
[18:41:55] jackjackdripper1: has joined #ruby
[18:42:00] spider-mario: has joined #ruby
[18:42:11] c_nick: shevy: http://stackoverflow.com/questions/5841406/cannot-install-mysql2-gem
[18:42:48] c_nick: similar to this .. i tried the solutions no luck however i m not sure if devkit is installed (will check tomorrow at work)
[18:43:27] prettiestPony11: has joined #ruby
[18:43:49] tenderlove: has joined #ruby
[18:44:00] bricker1: has joined #ruby
[18:44:32] c_nick: yeah there is devkit
[18:44:44] synthroid: has joined #ruby
[18:46:00] baweaver: Ox0dea: https://github.com/franzejr/ruby-tricks - why aren't you contributing here?
[18:47:01] Ox0dea: baweaver: I tried.
[18:47:27] Ox0dea: Most of my stuff is too crazy even for there, but the "two blocks" trick seemed suitable.
[18:47:42] Ox0dea: >> 0x10001.times.each_with_object({}) { |cp, h| c = '' << cp rescue next; h[c.bytesize] ||= c }
[18:47:44] ruboto: Ox0dea # => {1=>"\u0000", 2=>"\u0080", 3=>"???", 4=>"????"} (https://eval.in/461754)
[18:47:44] lacrymology: has joined #ruby
[18:47:54] Ox0dea: In case anybody wanted to know the first codepoint that requires four bytes.
[18:47:56] odigity: Is there a version of attr_accessor that creates accessors that take an option value, like foo(val=nil), that is both getter and setter at the same time? (That way you don't need to preface it with self. when using it as a setter)
[18:49:01] Ox0dea: odigity: No, but Gandhi is relevant: "Be the change you wish to see in the world."
[18:49:22] odigity: Ox0dea, I've already start writing my own, just surprised it doesn't already exist
[18:49:47] yardenbar: has joined #ruby
[18:50:15] Yzguy: has joined #ruby
[18:51:00] petricore: has joined #ruby
[18:51:34] c_nick: odigity: i like that idea
[18:51:52] c_nick: but there already something in the libraries that satisfies my laziness :D
[18:52:30] odigity: c_nick, thanks. reason it matters is because I'm creating a config file format (like Gemfile or Vagrantfile), and want people to be able call setters in context, but the classical ones need to be prefixed with self. to prevent ruby from thinking you're referencing a local variable, and that's ugly and likely error-prone
[18:52:32] djellemah: mwlang: td[3]/div[1]/a/@href I think http://www.w3.org/TR/xpath20/#abbrev
[18:53:06] c_nick: anyone with the mysql2 gem error like me?
[18:54:38] evanjs_: has joined #ruby
[18:54:56] radgeRayden: has joined #ruby
[18:54:58] kaldrenon: has joined #ruby
[18:55:04] rgtk: has joined #ruby
[18:55:20] tcrypt: has joined #ruby
[18:56:13] shevy: you use windows?
[18:56:16] karapetyan: has joined #ruby
[18:56:32] roxtrongo: has joined #ruby
[18:57:02] duckpuppy: has joined #ruby
[18:57:26] Ox0dea: odigity: Explicit self is much less error-prone than implicit.
[18:57:34] kaldrenon: I'm having a strange issue that's proving hard to google for: when I do rake -T I get invalid option: -T -- and when I do rake -v I get rake: version unknown
[18:57:42] kaldrenon: How to I deal with that?
[18:58:04] odigity: Ox0dea, not for setting. it's way too easy to write "foo = 42" instead of "self.foo = 42" and then wonder why your config isn't being parsed...
[18:58:06] Ox0dea: odigity: Why not just do it like all the other (sane) DSLs do and #instance_eval a block, thereby giving the user the freedom to choose what to say instead of `self` and not introducing any undue magic?
[18:58:22] baweaver: has joined #ruby
[18:58:30] Ox0dea: Or #instance_exec, as the case may be.
[18:59:44] odigity: Ox0dea, I tried to determine prior art this morning. I explored the source for Bundler, Sequel, and Vagrant to see how they load Gemfile, migrations, and Vagrantfile, respectively. I couldn't figure out the last one. Bundler puts you in a DSL instance (so you're using implicit self to call methods like 'gem'). Sequel asks you to write Sequel.migration do at the top, and then hands the block to a DSL class.
[19:00:27] odigity: Ox0dea, however, what I couldn't figure out was if I give them a method to call (let's day Foo.config do), then I basically have to capture the return value in order to use the result of their config, and that seems very fragile.
[19:00:55] machan: has joined #ruby
[19:00:55] odigity: I'm very much open to suggestions, since this is new territory for me.
[19:01:21] Ox0dea: odigity: I'm not sure I follow; you don't trust Ruby's return semantics?
[19:01:44] malconis: has joined #ruby
[19:01:48] c_nick: i m off to sleep now .. i have a battle with mysql2 tomorrow morning
[19:01:59] c_nick: i also need to shave :(
[19:02:08] odigity: I don't trust the user not to put something at the end of the file after the Foo.config block which will result in the wrong thing being returned. I like building tools that don't rely on unstated assumptions that result in surprising, negative user experiences.
[19:02:29] Ox0dea: odigity: What does/should a config block return?
[19:02:31] odigity: Ox0dea, can you think of a better way of capturing the result of their action?
[19:02:35] ibouvousaime: has joined #ruby
[19:02:50] Ox0dea: odigity: Don't you control the definition of #config?
[19:02:51] odigity: Ox0dea, I was thinking it would return an initialized Foo::Repo object (it's a repoconfig file)
[19:02:55] odigity: Ox0dea, I do
[19:02:59] ESpiney: has joined #ruby
[19:03:04] Ox0dea: odigity: Then you're golden.
[19:03:07] c_nick: has left #ruby: ()
[19:03:28] firstdayonthejob: has joined #ruby
[19:03:38] odigity: Ox0dea, can you explain to me how the plumbing should be done at each step? What would you have Foo.config do, and how would you capture the initialized Foo::Repo instance at the end?
[19:03:41] _djbkd: has joined #ruby
[19:03:58] diegoviola: has joined #ruby
[19:04:37] odigity: (without using global variables or the equivalent, as I'd like to be able to load multiple repoconfig files in the same process)
[19:04:52] shinnya: has joined #ruby
[19:04:58] Guest53: has joined #ruby
[19:05:19] Ox0dea: odigity: https://eval.in/461756
[19:05:23] mistermocha: has joined #ruby
[19:05:39] odigity: I thought about maybe doing: 1. Foo.config will create the object and add it to an array class variable 2. afterwards, I fetch the last object in the array -- but in theory, they could call Foo.config twice in the same file and create two objects. :) I don't like edge cases...
[19:05:51] Ox0dea: Please see the link. :P
[19:06:01] odigity: was just in the middle of typing when you posted it...
[19:06:21] odigity: Ox0dea, not familiar with tap, lemme go look that up first
[19:06:32] Ox0dea: odigity: It's the most elegant Ruby method.
[19:06:40] odigity: then I should tap it
[19:07:12] Ox0dea: odigity: https://github.com/ruby/ruby/blob/trunk/object.c#L687-L692
[19:07:23] Ox0dea: Purest simplicity and utility.
[19:08:21] Ox0dea: Without the surrounding #tap, Foo.config would evaluate to the last expression in the block, but you want it to return the Foo::Repo being created.
[19:09:08] odigity: Ox0dea, ok, I've read your snippet (very nice, btw), and I think I get it. But I would rather the user use accessors (var) rather than directly reference instance vars (@var), which brings us back to my original point. traditionally setters require self., and are thus very error prone. (I make that mistake all the time, and I'm not a complete noob)
[19:09:41] Ox0dea: odigity: Oh, sorry, I did forget that detail, but it's very easy to incorporate.
[19:09:44] odigity: Ox0dea, that is a very nice improvement over my implementation which solves that problem, and will definitely use it
[19:10:06] odigity: Now I just need my accessors. I'm going to call the macro attr_unified, since it makes one method that's both setter and getter.
[19:10:10] RegulationD: has joined #ruby
[19:10:26] Ox0dea: But... why?
[19:10:55] Ox0dea: odigity: https://eval.in/461757
[19:10:57] odigity: Ox0dea, I've already explained several times -- because people often forget to type self., thereby setting a local instead of an attribute, and then wonder why it's not working
[19:11:12] Ox0dea: odigity: Have you ever seen a gemspec?
[19:11:37] odigity: Ox0dea, that's better. I don't mind a prefix var (Vagrantfiles use |config| by convention), because it's clear form the opening line that you should be using it. that's an improvement over expecting them to remember self.
[19:11:41] odigity: Ox0dea, I have.
[19:11:44] platzhirsch: has joined #ruby
[19:11:57] odigity: Ox0dea, I totally forget to add gemspec to my list of prior art. :)
[19:12:03] michaeldeol: has joined #ruby
[19:12:35] agentmeerkat: has joined #ruby
[19:12:41] odigity: Ox0dea, ok, great. your second snippet (gemspec style with tap for object retrieval) should be all I need
[19:12:48] Ox0dea: odigity: Bless you. <3
[19:13:09] odigity: Ox0dea, but for the record... I still think attr_unified is an obviously useful general helper that should be in ActiveSupport. :)
[19:13:53] Ox0dea: odigity: I'm all for sexy magic, but setters should at least vaguely resemble setters.
[19:14:21] odigity: Ox0dea, I assume it's been a long time since you forgot to write self....
[19:14:30] Ox0dea: Well, sure, but see above?
[19:15:05] shevy: what is attr_unified doing?
[19:15:13] Ox0dea: odigity: Imagine if this were a picture of a Corgi: https://upload.wikimedia.org/wikipedia/commons/3/3b/Irish_setter_head.jpg
[19:15:54] yqt: has joined #ruby
[19:15:57] Ox0dea: Incalculable confusion and chaos would surely descend upon the talk page.
[19:16:00] shevy: Corgi is uglier than alot http://goo.gl/vFhLtB
[19:16:00] odigity: Ox0dea, I agree that traditionally setters are superior in most ways -- for example, you couldn't use ||= with my attr_unified accessors
[19:16:08] nertzy: has joined #ruby
[19:16:28] Ox0dea: odigity: And you want that, yeah?
[19:16:30] odigity: Ox0dea, and I use traditional accessors in my own code. but in a case like this, with a config file intended to be used by possibly non-ruby programs, attr_unified isn't a *terrible* idea...
[19:16:32] jaequery: has joined #ruby
[19:16:41] m3_del: has joined #ruby
[19:16:42] odigity: non-ruby programmers, I mean
[19:17:02] shevy: grandmas hacking away on ruby code
[19:17:09] Ox0dea: odigity: I did all I could to put the safety back on your footgun.
[19:17:13] mattwildig: has joined #ruby
[19:17:17] odigity: shevy, attr_unified was a class method I proposed to Ox0dea that would create a single accessor that accepts an optional value -- foo(val=nil) instead of foo() + foo=(val)
[19:17:42] Ox0dea: odigity: May I see your definition of #attr_unified?
[19:17:42] odigity: though come to think of it, that couldn't handle setting the value to nil. :)
[19:17:53] odigity: Ox0dea, I didn't finish writing it because your solution was better
[19:18:11] odigity: But I'm sure you can imagine what it would be.
[19:18:19] mwlang: the neighbor???s dogs aren???t happy. they???ve been barking for 5 minutes straight???then I toggle over to here to see Irish Setters and Corgi???s???
[19:18:38] odigity: well, it was a fun thought experiment, anyway
[19:18:47] BraddPit1: has joined #ruby
[19:18:54] Ox0dea: mwlang: Blame odigity.
[19:18:56] BraddPit1: has left #ruby: ()
[19:19:03] odigity: I'm used to it.
[19:20:02] shevy: mwlang haha
[19:20:15] shevy: dogs and cats - the things that secretly power the www
[19:20:58] Ox0dea: odigity: Jeeze, you've got me considering the notion of private Symbols now.
[19:21:03] odigity: Ox0dea, one more question: what exactly does &proc do in your snippet? is it some kind of shortcut to wrap a passed in block or something?
[19:21:44] Ox0dea: odigity: `proc` is an alias for `Proc.new`, which uses the block passed into the surrounding method if you don't give it one explicitly.
[19:21:59] odigity: Ox0dea, ok, cool
[19:22:22] sankaber: has joined #ruby
[19:22:57] odigity: Ox0dea, I just realized your solution still doesn't solve the object capture problem. Because Foo.config is being called in the config file, the return value is also returned in the config file -- not to me, the guy loading and evaling the contents of the config file
[19:23:21] purplexed-: has joined #ruby
[19:23:22] purplexed-: has joined #ruby
[19:23:34] Ox0dea: odigity: People deserve what they get if they're using the return value of #load.
[19:23:43] Ox0dea: Or is that not how you meant?
[19:23:51] timonv: has joined #ruby
[19:23:58] odigity: Ox0dea, then how am I to capture the object being created within the config file from outside the config file?
[19:25:11] Ox0dea: odigity: Are you sure you need to know about the object after it's left #config?
[19:25:11] ta: has joined #ruby
[19:25:32] odigity: Ox0dea, that's the whole point of loading a config file. to get back an initialized Repo object.
[19:25:40] odigity: so I can then operate on it
[19:26:12] Guest97: has joined #ruby
[19:26:13] fantazo: has joined #ruby
[19:26:27] Ox0dea: odigity: You're just gonna be operating on it willy-nilly?
[19:26:37] odigity: Ox0dea, I don't understand the question.
[19:26:43] momomomomo: has joined #ruby
[19:26:58] Ox0dea: odigity: At what point are you afraid you'll lose sight of the object?
[19:27:37] h99h9h88: has joined #ruby
[19:27:38] symm-_: has joined #ruby
[19:27:46] djellemah: It's a pity you can't magically (that is, from outside the block) cause @binding = binding in the config block. Then you could just assign local variables, and later pull out the ones you want.
[19:27:49] odigity: Ox0dea, in my tool, I need to load the config file and then access the resulting Repo object. When the config file is loaded, the Foo.config method will call with the block, and return an initialized Repo object, but no one is there to catch it. So I end up with nothing.
[19:28:26] Ox0dea: odigity: You have access to the Repo in #config, irrespective of whence it was called.
[19:28:34] dnomyar: has joined #ruby
[19:29:34] odigity: Ox0dea, sure, but that's a Foo class method that returns a Repo instance. The only way I could get access to it afterwards is if I also have the config method save it to a class attribute, and then check it after the file loads.
[19:29:53] Ox0dea: odigity: Does this help clarify? https://eval.in/461763
[19:29:53] odigity: Foo.config is called *inside* the config file.
[19:30:08] Ox0dea: You can do anything you please with `r` there.
[19:30:50] Sceko: has joined #ruby
[19:30:50] odigity: Ox0dea, nope, you're still returning the repo object from the config method, which is still running *inside* the config file, not in my tool. When you say "foo = Foo.config", you're capturing it inside the config file in a local foo that won't be available to me when load() returns
[19:31:15] Ox0dea: odigity: But Foo is your tool.
[19:31:32] cpup: has joined #ruby
[19:31:38] odigity: Ox0dea, yes. But that doesn't mean I magically know the correct functionality to add to make this work. That's why I'm here.
[19:32:03] odigity: Ox0dea, I already suggested the most naive solution, which is have Foo.config stash it in a class var and then fetch it afterwards. I'm hoping to improve on that.
[19:32:29] VeryBewitching: has joined #ruby
[19:32:29] Ox0dea: odigity: Aye, and I'm just trying to make sure that's in line with what you actually want.
[19:33:04] Ox0dea: Why does $thing need to be able to pluck Foo::Repos out of the air?
[19:33:21] odigity: I want to access the repo object in my tool, the tool that is calling load() on the config file. Currently, your snippet shows the object being return within the config file and set to a local named foo. But my tool doesn't have access to foo after load finishes running.
[19:33:37] odigity: Ox0dea, are you seriously asking me why my tool needs access to my tool's config file?
[19:33:54] skcin7: has joined #ruby
[19:33:58] Ox0dea: odigity: Yeah, that's exactly what I asked you.
[19:34:16] odigity: Ox0dea, because the config file contains information that will drive the tool's behavior.
[19:34:28] Ox0dea: odigity: Oh, wow. Tell me some more things.
[19:34:40] odigity: suddenly this no longer seems like a productive conversation
[19:34:50] Ox0dea: odigity: Disclaimer: I have no idea what the fuck I'm talking about.
[19:35:15] odigity: Ox0dea, well, thanks for teaching me about tap, anyway. I guess I'll use the obvious naive solution and worry about it if and when I find a reason it's not good enough.
[19:36:36] freerobby: has joined #ruby
[19:36:51] codecop: has joined #ruby
[19:37:18] riotjones: has joined #ruby
[19:38:24] postmodern: has joined #ruby
[19:39:07] mikeharris22: has joined #ruby
[19:39:25] yeticry: has joined #ruby
[19:39:26] Rollabunna: has joined #ruby
[19:40:23] craysiii: has joined #ruby
[19:42:04] mikeharris22: has joined #ruby
[19:42:50] Aquish: has joined #ruby
[19:42:56] Aquish: has left #ruby: ()
[19:43:15] yardenbar: has joined #ruby
[19:43:59] axl_: has joined #ruby
[19:44:10] machan: has joined #ruby
[19:45:13] veg: has joined #ruby
[19:45:28] ibouvousaime: has joined #ruby
[19:46:15] mndoci: has joined #ruby
[19:47:40] mistermocha: has joined #ruby
[19:49:28] karapetyan: has joined #ruby
[19:50:42] finisherr: has joined #ruby
[19:51:34] shevy: tap tap the lap
[19:53:06] ledestin: has joined #ruby
[19:53:43] arup_r: has joined #ruby
[19:54:26] dhollinger: has joined #ruby
[19:54:44] _djbkd: has joined #ruby
[19:54:55] baweaver: has joined #ruby
[19:55:08] momomomomo: has joined #ruby
[19:57:07] bruno-: has joined #ruby
[19:59:11] mloy: has joined #ruby
[20:00:33] baweaver: has joined #ruby
[20:02:37] bruno-: has joined #ruby
[20:03:00] Sceko: has left #ruby: ()
[20:04:30] leafybasil: has joined #ruby
[20:05:19] prettiestPony11: has joined #ruby
[20:06:28] Musashi007: tap tap teh what
[20:06:31] roxtrongo: has joined #ruby
[20:07:39] Musashi007: lol - have you guys ever considered a TS/Vent server to hang out on?
[20:08:03] bruno-: has joined #ruby
[20:08:51] d5sx43: has joined #ruby
[20:09:48] mloy: Musashi007 A Mumble server would be better imo
[20:09:52] uris: has joined #ruby
[20:09:58] Musashi007: sure or something
[20:10:07] synthroid: has joined #ruby
[20:10:36] eam: sounds terrible, no pun intended
[20:11:08] juanpablo__: has joined #ruby
[20:12:26] Musashi007: Someone showed me some new app that was like slack but enabled voice chat.. discord or something like that
[20:12:39] Musashi007: @eam what about it sounds terrible?
[20:13:36] m3_del: has joined #ruby
[20:14:32] eam: well, the value of irc is that it's only weakly synchronous. I'm not interested in giving you my attention all day
[20:14:36] shevy: the more you write, the more awful it sounds
[20:14:46] s2013: has joined #ruby
[20:14:51] eam: and spoken conversations are inherently serialized
[20:15:25] eam: not to mention, you can never search in it, can't represent code (which is what we're here to talk about), and it's slow and just ... zero upside
[20:15:30] yfeldblum: has joined #ruby
[20:16:33] m3_del: has joined #ruby
[20:16:53] zenguy_pc: has joined #ruby
[20:17:18] momomomomo_: has joined #ruby
[20:17:25] karapetyan: has joined #ruby
[20:18:12] tubbo: yeah agreed
[20:18:28] tubbo: the only upside a voice-chat server would have is with clients
[20:18:41] mozzarella: has joined #ruby
[20:18:50] tubbo: but even then, you can just call them and do a conference call. it's a solved problem :D
[20:19:01] eam: "well if you're paying me"
[20:19:20] eam: heck, I'll even put on pants and we can do video
[20:20:41] Hanmac: shevy did you watched gravity falls?
[20:21:06] itgold: def feed.items; "" end
[20:21:16] Ox0dea: itgold: That's not very many items.
[20:21:16] diegoaguilar: has joined #ruby
[20:21:33] itgold: how to change this declaration so it will work in feed.items.each
[20:21:35] braincra-: has joined #ruby
[20:22:01] Ox0dea: itgold: Have it return something Enumerable?
[20:22:22] itgold: yes, how to do this in ruby?
[20:22:38] Musashi007: Eh, I guess you guys are right
[20:22:50] Ox0dea: > I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.
[20:23:00] shevy: hanmac nope; I don't get to see a lot of new stuff lately :(
[20:24:05] karapetyan: has joined #ruby
[20:24:12] itgold: def feed.items; Enumerable.new end
[20:24:34] Ox0dea: itgold: Whence are these items coming?
[20:24:47] itgold: from the parsed feed
[20:24:53] Ox0dea: itgold: I bet it's Enumerable.
[20:25:24] itgold: feed = RSS::Parser.parse(body)
[20:25:31] itgold: feed.items.each do |item|
[20:25:38] Ox0dea: itgold: And that doesn't work just fine?
[20:26:06] itgold: this thing is complaining about .each (no such method exception) :(
[20:26:22] karapetyan: has joined #ruby
[20:27:06] Channel6: has joined #ruby
[20:27:14] Ox0dea: itgold: Debug-print `feed.items.class`.
[20:27:26] agentmeerkat: has joined #ruby
[20:27:36] mpistone: has joined #ruby
[20:28:06] jordanloky: has joined #ruby
[20:28:11] kadoppe: has joined #ruby
[20:28:21] h99h9h88: has joined #ruby
[20:28:33] Ox0dea: What'dya get?
[20:29:19] itgold: :items=>Array
[20:29:57] eam: what's superman's favorite ruby class?
[20:30:04] Ox0dea: itgold: Well, Array most definitely responds to #each, so that can't possibly actually be the class of `feed.items`.
[20:30:32] eam: Array (a ray)
[20:30:35] FernandoBasso: has joined #ruby
[20:32:51] itgold: right, I'm sorry. The real problem is: Error: undefined method `items'
[20:32:59] itgold: I'll check feed class
[20:33:12] Ox0dea: Good idea.
[20:33:41] northfurr: has joined #ruby
[20:34:08] bradland: has joined #ruby
[20:34:19] itgold: :feed=>NilClass
[20:34:52] Ox0dea: >> require 'rss'; RSS::Parser.parse 'invalid rss data' # itgold
[20:34:55] ruboto: Ox0dea # => nil (https://eval.in/461791)
[20:35:37] solocshaw: has joined #ruby
[20:36:24] cwong_on_irc: has joined #ruby
[20:36:59] Alina-malina: has joined #ruby
[20:37:01] dorei: >> [1,2,3].tap { |o| o.instance_exec { undef :each } }
[20:37:02] ruboto: dorei # => [1, 2, 3] (https://eval.in/461792)
[20:38:54] karapetyan: has joined #ruby
[20:39:15] Ox0dea: dorei: Symbol not necessary, for what that's worth.
[20:39:19] Ox0dea: `undef` is like `alias`.
[20:40:02] colegatron: has joined #ruby
[20:40:05] dorei: i've just noticed that pry doesn't like arrays that have their #each removed
[20:40:52] _stu_: has joined #ruby
[20:40:55] shevy: Baguette.
[20:41:09] Ox0dea: dorei: I can't imagine why. :P
[20:42:07] RegulationD: has joined #ruby
[20:42:09] dorei: Ox0dea: irb seems more relaxed :p
[20:42:28] momomomomo: has joined #ruby
[20:42:42] diegoaguilar: has joined #ruby
[20:43:04] jordanloky: has joined #ruby
[20:43:42] adaedra: shevy: oh wow, how original.
[20:43:51] mistermocha: has joined #ruby
[20:43:57] ruurd: has joined #ruby
[20:44:12] Ox0dea: adaedra: Cr??me fra??che.
[20:44:33] tkuchiki: has joined #ruby
[20:44:50] adaedra: Ox0dea: well, I know you can.
[20:46:15] Ox0dea: dorei: https://eval.in/private/01c98a86e62533
[20:46:19] shevy: adaedra yeah, you were very original with Bonsoir :)
[20:46:37] Ox0dea: It turns out clearing all the Strings is a no-no.
[20:46:58] Steve_Jobs: has joined #ruby
[20:47:24] shevy: you people are again not writing useful code
[20:47:31] adaedra: shevy: you're sad because I didn't ??Guten Abend???
[20:47:50] shevy: adaedra we must use english!
[20:47:59] adaedra: how original.
[20:48:11] Ox0dea: > inb4 i speak PIE
[20:48:21] eam: >> ObjectSpace.each_object(String) { |s| s.clear rescue true}
[20:48:22] ruboto: eam # => /tmp/execpad-9d52922cb886/source-9d52922cb886:2: [BUG] Segmentation fault at 0x4ae9c689 ...check link for more (https://eval.in/461796)
[20:48:25] eam: whooooa
[20:48:38] Ox0dea: eam: What'dya expect?
[20:48:49] eam: didn't segv on my end, I actually was left with a working irb
[20:48:57] bender_unit: has joined #ruby
[20:49:15] Ox0dea: eam: Same here until I entered anything else.
[20:49:19] EminenceHC: has joined #ruby
[20:49:27] adaedra: yep, same here too.
[20:50:04] consumerism: has joined #ruby
[20:50:17] Ox0dea: eam: Why did you switch it to use exceptions as control flow?
[20:51:24] consumerism: in php and bash (and others), i can write "somevariable || 'fallback string'" and if somevariable is false, then 'fallback string' is assigned/echoed/whatever instead. how do i do the same in ruby?
[20:51:34] Ox0dea: consumerism: Just like that.
[20:51:39] adaedra: >> false || 'another string'
[20:51:40] ruboto: adaedra # => "another string" (https://eval.in/461797)
[20:51:56] adaedra: someone didn't test before asking.
[20:52:15] Ox0dea: Someone isn't really looking for answers.
[20:52:18] consumerism: well i did test but i'm missing something evidently... thanks for confirming
[20:52:49] agentmeerkat: has joined #ruby
[20:52:53] consumerism: ok, it's because an empty string isn't false
[20:53:20] shevy: drugs are bad and so is php
[20:54:01] trosborn: has joined #ruby
[20:54:04] shevy: speaking of php ... http://www.darkcoding.net/software/facebooks-code-quality-problem/
[20:54:06] craysiii: but which is worse?
[20:54:22] ruboto: shevy, this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related topics. Thanks!
[20:54:35] Ox0dea: ~ $ python -c "print('' or 'i suck too')"
[20:54:37] Ox0dea: i suck too
[20:54:49] shevy: adaedra french is also offtopic
[20:55:29] adaedra: that's why I discuss about it there, usually.
[20:55:39] baweaver: has joined #ruby
[20:56:18] Eminence_: has joined #ruby
[20:57:21] tubbo: facebook should cost a lot less to operate than it does.
[20:57:31] tubbo: at least, seemingly
[20:57:38] tubbo: it does do a lot of stuff though :D
[20:58:22] itgold: Ox0dea: you are right, this is most likely invalid feed data
[20:58:30] shevy: I don't know what it does but I find the interconnection things annoying; on twitch.tv you can only chat if you have a facebook account so I am excluded
[20:58:36] itgold: I just want to ignore this and keep going
[20:59:39] Ox0dea: itgold: At least do it sanely; check the return value of RSS::Parser.parse and don't take the happy path if's `nil`.
[20:59:56] platzhirsch: has left #ruby: ()
[21:00:27] itgold: should I check by return class type?
[21:00:28] sdrew: has joined #ruby
[21:00:33] stacybird: has left #ruby: ()
[21:00:54] mistermocha: has joined #ruby
[21:01:08] Ox0dea: itgold: No, all `nils` are the same.
[21:01:21] Ox0dea: >> [nil, nil, nil].map(&:object_id)
[21:01:22] ruboto: Ox0dea # => [4, 4, 4] (https://eval.in/461799)
[21:02:40] Ox0dea: >> ['', '', ''].map(&:object_id) # "All nils are alike; each empty string is empty in its own way."
[21:02:41] ruboto: Ox0dea # => [539502400, 539502380, 539502660] (https://eval.in/461800)
[21:03:18] cdg: has joined #ruby
[21:03:28] blackmesa: has joined #ruby
[21:03:37] Guest53: has joined #ruby
[21:04:36] renier: has joined #ruby
[21:04:42] zenguy_pc: has joined #ruby
[21:05:59] adaedra: well, do you see the string half-full or half-empty?
[21:06:20] itgold: I'm not sure I understand this. what does this .map thing mean?
[21:06:28] adaedra: &ri Array#map
[21:06:28] `derpy: http://www.rubydoc.info/stdlib/core/Array#map-instance_method
[21:07:01] Ox0dea: itgold: Are you learning Ruby?
[21:07:34] Ox0dea: itgold: Put your clothes on.
[21:07:45] adaedra: Ox0dea: you're gonna teach him/her your ways? :p
[21:08:18] Ox0dea: adaedra: It's just odd they're parsing RSS and haven't encountered #map.
[21:08:28] shevy: you are too sceptical!
[21:08:35] itgold: if I would be a woman, I would say "Yeah, teach me your way, babe!"
[21:08:36] shevy: when someone says he is a noodle, believe him
[21:08:46] Ox0dea: itgold: Wat.
[21:09:29] danman: has joined #ruby
[21:09:29] itgold: I'm not parsing this rss thing, I'm just trying to fix an issues with the plugin I've got
[21:10:15] Ox0dea: itgold: Despite the old trope, tossing a child into the deep end is not the proper way to teach them how to swim.
[21:10:16] based_pdev_: has joined #ruby
[21:10:38] mary5030: has joined #ruby
[21:11:12] itgold: I'm pretty sure I will swim! :)
[21:11:31] itgold: just give me your lesson
[21:11:40] baweaver: has joined #ruby
[21:11:41] mary5030: has joined #ruby
[21:11:50] DEA7TH: has joined #ruby
[21:12:44] shevy: it seems one can use $stdin.gets('//').chomp to have multiline input with // as trailing sequence; but is there a way to have multiple (different) end tokens? such as: $stdin.gets('//','\\').chomp
[21:12:56] al2o3-cr: has joined #ruby
[21:13:06] northfurr: has joined #ruby
[21:13:10] Ox0dea: itgold: I shall give you two; lesson the first: https://youtu.be/GlKL_EpnSp8?t=29
[21:13:28] Ox0dea: shevy: Use a regular expression.
[21:13:39] itgold: good one! :)
[21:14:06] Ox0dea: itgold: But for real, though.
[21:14:33] itgold: I know, just don't have time to do it right away
[21:14:51] Ox0dea: itgold: Then this is you: https://www.youtube.com/watch?v=TRqGmmCy8aU
[21:14:58] Alina-malina: has joined #ruby
[21:15:28] northfurr: has joined #ruby
[21:15:32] Ox0dea: Does that look like a particularly efficient way to get around?
[21:15:41] Glenny: has joined #ruby
[21:16:03] Ox0dea: Guess what happens every time there's a wall in front of him?
[21:16:15] Ox0dea: (He joins #ruby to ask questions he should've been able to answer himself.)
[21:16:21] bradland: when using alternation in Regex, how does the regex engine scope the alternation characters.
[21:16:33] mozzarella: has joined #ruby
[21:16:34] Ox0dea: bradland: "Scope"?
[21:16:41] bradland: for example, in this code, is the alternation between 4|5 safe? as in, will the engine expand to include additional chars?
[21:16:44] bradland: http://pastie.org/10525225
[21:16:47] machan: has joined #ruby
[21:16:51] Guest97: has joined #ruby
[21:16:52] itgold: I got your point, and I think you right
[21:16:55] lukaszes: has joined #ruby
[21:17:01] itgold: but now I need to fix this crazy issue
[21:17:03] Ox0dea: bradland: Nah, you need explicit grouping there.
[21:17:12] Ox0dea: itgold: But the fix is to get a better hold on your tool.
[21:17:28] northfurr: has joined #ruby
[21:17:41] itgold: this thing is that it is exception, not my primary tool
[21:17:55] Ox0dea: Then why did you say you're trying to learn Ruby?
[21:18:07] bradland: Ox0dea: so group around the alternation, like this? http://pastie.org/10525229
[21:18:11] bradland: that makes it more explicit
[21:18:14] pipework: Ox0dea: I'm always trying to learn ruby.
[21:18:19] Ox0dea: bradland: It makes it correct.
[21:18:21] bradland: also, would you prefer the ALTERNATION option or the CLASS syntax
[21:18:25] itgold: I need to learn a bit for fixing the issues
[21:18:54] Ox0dea: bradland: /Version : 4|5/ matches any string contaning '5'.
[21:19:04] stamina: has joined #ruby
[21:19:15] bradland: so /Version: 4|5/ is "Version: 4" or "5" ?
[21:19:20] Ox0dea: bradland: Just so.
[21:19:34] Ox0dea: A character class is best in this case, but don't let that put you off alternation.
[21:19:58] bradland: gotcha, the only reason i was looking at alternation was because i felt like it communicated intent better
[21:20:15] bradland: with the group and alternation, i create a capture group that i won't use
[21:20:26] bradland: not sure how horrible that is
[21:20:35] pipework: Ox0dea: I did a thing where I wanted to have a nice DSL at the class level where methods took blocks and then I wanted to take those blocks and change their binding to the instance as whale as yield a value to them. It was pretty fun. I had to define a temporary method on the instance's eigenclass, pass the block in as the block for define_singleton_method, grab the method object, call with the value and then delete the method from the
[21:20:35] pipework: eigenclass.
[21:20:41] Ox0dea: bradland: Well, you can create a non-capturing group.
[21:21:00] Ox0dea: bradland: Character classes are essentially alternation at the character level, which is precisely what you want here.
[21:21:02] pipework: Basically, I just wanted to change the binding of a block from the class it was defined in to the instance.
[21:22:05] Ox0dea: pipework: My kinda convolution! :P
[21:22:14] pipework: Ox0dea: YEAH!
[21:22:19] bradland: Ox0dea: I see, so that means either really communicates what I want, provided the reader understands regex.
[21:22:19] Ox0dea: Was binding_of_caller out of the question, then?
[21:22:22] pipework: I did it without adding a banister gem either.
[21:22:22] bradland: Thanks for the feedback!
[21:22:29] Ox0dea: bradland: Happy to help.
[21:22:38] Ox0dea: pipework: You know me too well.
[21:23:04] itgold: how about this thing: if item.class == nil:NilClass next end
[21:23:10] pipework: Ox0dea: You still have to change the binding. I had the binding of the caller, the instance, I just needed to swap the binding of the proc to the instance and not the class.
[21:23:19] Ox0dea: pipework: Ah, right.
[21:23:21] pipework: Ox0dea: Will gist example up in a bit.
[21:23:43] pipework: DSLol goodness.
[21:24:13] pipework: DSCodeSmell?
[21:24:14] adaedra: itgold: you're going too far. nil is the same as false, in the eyes of if (and unless).
[21:24:28] itgold: ah, thank you, got it
[21:25:32] zquad: has joined #ruby
[21:25:58] zquad: Im using capistrano 3, I am trying to require "capistrano/rsync" but getting error: LoadError: cannot load such file -- capistrano/rsync ??how do I install it
[21:26:28] Ox0dea: zquad: The gem is called capistrano-rsync.
[21:26:39] Ox0dea: I don't know why they gave it such a confusing name.
[21:26:51] zquad: I already installed it via gem install capistrano-rsync though
[21:27:15] Ox0dea: zquad: Are you using a Ruby version manager?
[21:27:24] guardian: has joined #ruby
[21:27:25] hxegon: has joined #ruby
[21:27:48] zquad: I have it
[21:28:00] Ox0dea: zquad: Pardon?
[21:28:11] zquad: I have it installed, don't know if I am using it
[21:28:18] zquad: do I use rvm to install gems?
[21:28:29] dikaio: has joined #ruby
[21:28:34] Ox0dea: I'm going to defer to kinder souls.
[21:29:02] skade: has joined #ruby
[21:29:12] northfurr: has joined #ruby
[21:29:47] havenwood: zquad: There are multiple Ruby version managers and installers. RVM is an option that does both of those tasks.
[21:29:59] hxegon: zquad: also rbenv
[21:30:00] axl_: has joined #ruby
[21:30:10] pipework: Also chruby and ruby-install
[21:30:32] havenwood: zquad: RubyGems ships with Ruby these days. So the `gem` command comes with Ruby.
[21:31:02] havenwood: zquad: So you use Ruby's built-in RubyGems to install gems, like: gem install gem_name_here
[21:31:22] havenwood: zquad: http://guides.rubygems.org/rubygems-basics/
[21:31:28] pipework: havenwood: except gem install ??spec isn't supported because evidently fuck unicode.
[21:31:33] northfurr: has joined #ruby
[21:33:00] bruno-: has joined #ruby
[21:33:25] itgold: def item.pubDate; "" end
[21:33:41] itgold: what it will do if item.pubDate already defined?
[21:34:03] ruboto: Why don't you try it and see for yourself?
[21:34:12] northfurr: has joined #ruby
[21:35:02] shevy: itgold did you not ask this already several times before?
[21:35:06] neanderslob: has joined #ruby
[21:35:19] havenwood: itgold: You can redefine methods in Ruby but your example looks funky.
[21:36:41] northfurr: has joined #ruby
[21:37:14] pipework: Ox0dea: Yesterday I realized: `private def something;:something;end`
[21:38:04] riotjones: has joined #ruby
[21:38:19] Ox0dea: >> defined? private # pipework
[21:38:20] ruboto: Ox0dea # => "method" (https://eval.in/461803)
[21:38:22] bruno-: has joined #ruby
[21:38:22] Ox0dea: Yay, Ruby.
[21:39:12] northfurr: has joined #ruby
[21:39:28] pipework: >> method(:private)
[21:39:29] ruboto: pipework # => #<Method: main.private> (https://eval.in/461804)
[21:39:44] momomomomo: has joined #ruby
[21:40:18] Rollabunna: has joined #ruby
[21:40:23] EminenceHC: has joined #ruby
[21:40:58] _blizzy_: has joined #ruby
[21:41:26] m3_del: has joined #ruby
[21:42:35] jondot: has joined #ruby
[21:44:08] graydot: has joined #ruby
[21:44:34] Ox0dea: pipework: Do you know why the NSA love Ruby?
[21:45:10] pipework: Ox0dea: Because it hides no secrets?
[21:45:17] Ox0dea: >> public == private # Indeed.
[21:45:18] ruboto: Ox0dea # => true (https://eval.in/461808)
[21:45:36] skade: has joined #ruby
[21:45:36] pipework: >> public === private
[21:45:37] ruboto: pipework # => true (https://eval.in/461809)
[21:45:44] pipework: Threequals, so you know it's srs.
[21:45:48] Ox0dea: For realsies.
[21:46:26] itgold: ah, I think I finally got it working
[21:46:35] itgold: desc = item.description rescue nil if !desc def item.description; "" end end
[21:47:18] Ox0dea: And that head baby got to the other side of the room.
[21:47:35] itgold: how would you do this?
[21:47:50] solocshaw: has joined #ruby
[21:47:56] itgold: this is the only way it is not throwing that NoMethodError
[21:47:56] Ox0dea: itgold: I would figure out why I had an object with no #description method where I expected to have one that did.
[21:48:40] Ox0dea: This is exactly the same runaround as we had the other day with #pubDate.
[21:49:07] itgold: right. I'm just adding new feeds and it is complaining about different things
[21:49:36] itgold: the reason why it is not there: all the sources of data are not ideal, they might miss various things
[21:49:54] Ox0dea: itgold: Are you sure?
[21:49:59] benlieb: has joined #ruby
[21:50:03] Ox0dea: Last time it was that you had an object of the wrong class.
[21:50:15] itgold: that is what I'm getting
[21:50:31] Ox0dea: Then your assertion that the data is wrong was... what, exactly?
[21:50:48] rakm: has joined #ruby
[21:51:37] ZeeNoodleyGamer: has joined #ruby
[21:51:56] itgold: some feeds has description field, some has their own proprietary name for description, for example
[21:52:02] Ropeney: has joined #ruby
[21:52:09] Ox0dea: DublinCore is not a proprietary format, per se.
[21:52:21] yosafbridge: has joined #ruby
[21:52:23] itgold: what is DublinCore?
[21:52:27] Ox0dea: I have no idea.
[21:52:48] Ox0dea: itgold: I'm a bot.
[21:52:56] itgold: no, you are not!
[21:52:59] Ox0dea: Prove it.
[21:53:17] itgold: you are too smart for bot :)
[21:53:31] itgold: you showed me a video with the head baby
[21:53:33] RegulationD: has joined #ruby
[21:53:39] zwdr: has joined #ruby
[21:53:45] tkuchiki: has joined #ruby
[21:53:49] purplexed-: has joined #ruby
[21:54:00] Ox0dea: We robots love humorous moving pictures as much as you fleshies.
[21:54:51] tcrypt: has joined #ruby
[21:55:05] zack6849: has joined #ruby
[21:55:05] zack6849: has joined #ruby
[21:55:12] itgold: if you'd be a robot you would write another bots on ruby and conquer the world in an hour
[21:55:14] adaedra: Greetings, fleshies.
[21:55:37] Ox0dea: itgold: That is not how recursive self-improvement works.
[21:56:44] northfurr: has joined #ruby
[21:58:29] Ox0dea: itgold: What you're doing is called "exceptions as control flow", and it just shovels the problem under the rug.
[21:58:51] bruno-: has joined #ruby
[21:59:07] Ox0dea: itgold: This is you: http://gunshowcomic.com/comics/20130109.png
[21:59:09] `based_pdev`: has joined #ruby
[21:59:28] eam: I mean, exceptions *are* flow control
[21:59:29] Liam`: has joined #ruby
[21:59:47] itgold: yes, that is true
[21:59:52] juanpablo__: has joined #ruby
[22:00:00] itgold: but I can't fix the data sources, right?
[22:00:19] itgold: and I don't have control over the .parse method
[22:01:01] itgold: I have to deal with the results of those two factors working together
[22:01:14] pullcheezy: has joined #ruby
[22:01:15] momomomomo: has joined #ruby
[22:01:33] Ox0dea: eam: You want "flow of control" there; it's not the flow that's being controlled, it's the control that's being flown.
[22:01:36] Timba-as: has joined #ruby
[22:01:51] Ox0dea: Well, it's true.
[22:02:09] roxtrongo: has joined #ruby
[22:03:01] northfurr: has joined #ruby
[22:03:12] Ox0dea: itgold: Have you considered upgrading to 2.3?
[22:04:06] itgold: upgrading what?
[22:04:46] Ox0dea: If you did, you could say `item.?description.to_s`.
[22:05:08] itgold: is it new feature of ruby?
[22:05:40] havenwood: itgold: (Ruby 2.3.0 will be released on Christmas day but 2.3.0-dev is available now.)
[22:05:45] _djbkd: has joined #ruby
[22:06:20] itgold: unfortunately I don't have control over this thing as well. Working with the specific framework and a plugin for it. I'm using predefined ruby version
[22:06:56] Ox0dea: itgold: Do you remember the #respond_to? method that no fewer than four different people advised you to use last time?
[22:07:03] Guest53: has joined #ruby
[22:07:06] xaxisx: has joined #ruby
[22:07:28] itgold: yes, what is about it?
[22:07:33] Ox0dea: itgold: You should use it.
[22:07:41] itgold: I can use it instead of recue?
[22:08:00] itgold: great, thank you! Will give it a try
[22:08:13] Eiam_: has joined #ruby
[22:08:20] Ox0dea: I always wanted a goldfish.
[22:08:42] havenwood: itgold: Exceptions should be an exceptional case not flow control.
[22:09:19] itgold: yes, I understand guys. This is the best I can get, I think
[22:10:26] Ox0dea: I wonder how the conflation of "control flow" with "flow control" came to be so widespread.
[22:10:41] swgillespie: has joined #ruby
[22:13:26] Trynemjoel: has joined #ruby
[22:13:38] havenwood: Ox0dea: dyslexia doesn't help
[22:13:40] shevy: is it yin-yang time again with havenwood and Ox0dea
[22:13:57] Ox0dea: havenwood: I wasn't taking a shot, mind.
[22:14:11] jessemcgilallen: has joined #ruby
[22:14:11] Ox0dea: ~4.5k hits for "flow control graph".
[22:15:29] neohunter: has joined #ruby
[22:15:41] Ray`: wikipedia ain't helping - In computer science, control flow (or alternatively, flow of control) is the order in which individual statements, instructions or function calls of an imperative program are executed or evaluated.
[22:16:35] Ox0dea: Ray`: "Control flow" is for branching, "flow control" for data.
[22:16:40] jackjackdripper: has joined #ruby
[22:16:54] Ox0dea: >> 'flow control' == 'flow of control'
[22:16:55] ruboto: Ox0dea # => false (https://eval.in/461812)
[22:16:55] Ray`: "flow of control" isn't helping the situation though
[22:17:09] Ray`: it's in the control flow entry
[22:17:25] itgold: if !item.respond_to?('description') def item.description; "" end end
[22:17:34] CanTonic: has joined #ruby
[22:18:05] neohunter: Hi, I want to access HISTORY from IRB, I've readed source and it has module IRB; module HistorySavingAbility;
[22:18:10] Ox0dea: itgold: desc = item.respond_to?(:description) ? item.description : ""
[22:18:14] neohunter: that last module has a var called HISTORY
[22:18:16] LoganG: has joined #ruby
[22:18:17] neohunter: how to access it frmo console
[22:18:32] neohunter: i've tried with IRB::HistorySavingAbility.class_eval {HISTORY}
[22:18:35] neohunter: but didnt work
[22:18:40] itgold: even better. Thank you Ox0dea
[22:18:47] Ox0dea: itgold: Sure thing.
[22:19:14] shredding: has joined #ruby
[22:19:18] bruno-: has joined #ruby
[22:19:19] Ray`: Ox0dea is actually a refactoring library with a natural language api
[22:19:19] Ox0dea: neohunter: You want the Array of previously evaluated expressions, yeah?
[22:19:53] neohunter: 1) yes I want that, 2) I also want to learn and know how to access that HISTORY var if I should use class_eval or instance_eval
[22:19:59] freerobby: has joined #ruby
[22:20:44] itgold: the only thing. I wanted to initialize an original object with the missing method initially. But it looks like local variable would work as well.
[22:20:48] freerobby1: has joined #ruby
[22:21:06] patchedmonkey: has joined #ruby
[22:22:17] bender_unit: has joined #ruby
[22:24:09] freerobby: has joined #ruby
[22:26:35] freerobby: has joined #ruby
[22:27:43] Xeago: has joined #ruby
[22:29:24] iamvery: has joined #ruby
[22:30:09] bmalum: has joined #ruby
[22:32:21] neohunter: neohunter: you can use puts Readline::HISTORY.to_a to view the recent commands history, not sure about your other question
[22:32:31] neohunter: neohunter: thanks! you are awesome
[22:32:33] neohunter: neohunter: np
[22:32:49] freerobby: has joined #ruby
[22:33:08] yfeldblum: has joined #ruby
[22:33:21] rgrmatt: has joined #ruby
[22:34:47] bruno-: has joined #ruby
[22:36:15] skade: has joined #ruby
[22:37:42] patdohere: has joined #ruby
[22:37:55] jessemcgilallen: has joined #ruby
[22:39:22] Ox0dea: neohunter: And if irb has been invoked with the `--noreadline` flag?
[22:40:13] bruno-: has joined #ruby
[22:40:17] Limix: has joined #ruby
[22:40:24] EminenceHC: has joined #ruby
[22:43:35] Ox0dea: neohunter: As to your latter question, despite observing the principles of object orientation, the IRB module actively resists being used outside of irb. :/
[22:45:36] bruno-: has joined #ruby
[22:48:40] baweaver: has joined #ruby
[22:48:42] mistermo_: has joined #ruby
[22:48:59] baweaver: has joined #ruby
[22:52:35] s2013: has joined #ruby
[22:53:12] opensource_ninja: has joined #ruby
[22:55:34] mattwildig: has joined #ruby
[22:55:51] roxtrongo: has joined #ruby
[22:56:25] lemur: has joined #ruby
[22:57:07] ellisTAA: has joined #ruby
[22:57:39] _djbkd: has joined #ruby
[22:58:40] danman: has joined #ruby
[23:03:46] blue_deref: has joined #ruby
[23:04:44] htmldrum: has joined #ruby
[23:05:14] zenguy_pc: has joined #ruby
[23:06:29] Trynemjoel: has joined #ruby
[23:07:11] Ulfalizer: has joined #ruby
[23:08:45] duckpuppy: has joined #ruby
[23:10:31] m3_del: has joined #ruby
[23:11:09] blackmes1: has joined #ruby
[23:12:51] pullcheezy: has joined #ruby
[23:15:23] northfurr: has joined #ruby
[23:15:40] baweaver: has joined #ruby
[23:17:09] jessemcgilallen: has joined #ruby
[23:18:10] cwong_on_irc: has joined #ruby
[23:18:16] to_json: has joined #ruby
[23:18:17] to_json: has joined #ruby
[23:18:25] levifig: has joined #ruby
[23:19:15] Zai00: has joined #ruby
[23:20:14] skweek: has joined #ruby
[23:21:23] ruby-lang044: has joined #ruby
[23:21:34] m3_del: has joined #ruby
[23:22:00] havenwood: ruby-lang044: hellooo
[23:23:48] BigDiesel007: has joined #ruby
[23:25:20] skweek: I'm wondering if I can ask for some help writing a script, I guess I'm just illiterate when it comes to writing a script, which sucks because I try a lot and I feel dumb, but I'm trying to move anything with the extension mp3 to a folder as long as there are mp3s and m4as in that folder, of a directory of folders containing mostly m4as and some mp3s and m4as, mp3 and m4a file types
[23:28:43] hxegon: skweek: have you written anything yet?
[23:29:00] hxegon: is there a way to load a specific file from github through bundler?
[23:29:14] skweek: i've read a few books on ruby and written scripts that are instructed
[23:29:16] s00pcan: has joined #ruby
[23:30:09] hxegon: skweek: but as far as the script goes, you haven't started?
[23:30:09] northfurr: has joined #ruby
[23:30:26] duckpuppy: has joined #ruby
[23:30:33] hxegon: skweek: also, what OS are you using?
[23:30:54] dorei: hxegon: no idea about a specific file but you can tell bundler to fetch a "gem" from github
[23:31:26] skweek: no, linux
[23:31:30] hxegon: dorei: I'm not trying to fetch a gem though, its a lib file from someones project (that isn't a gem)
[23:31:31] ViniciusBrito: has joined #ruby
[23:32:06] dorei: hxegon: http://bundler.io/git.html
[23:32:12] dorei: hxegon: check the github section
[23:32:45] hxegon: skweek: well I'm not going to spoon feed you (because I'm trying to break the habit), but I'll help you. You might have to give me a minute first to deal with this git/bundler thing
[23:33:10] EminenceHC: has joined #ruby
[23:33:11] skweek: k, thanks
[23:33:15] northfurr: has joined #ruby
[23:33:55] hxegon: dorei: I've checked that and it seems to need a .gemspec file to work, so maybe bundler isn't the right tool? I might be looking for git submodules
[23:34:24] sandals: has joined #ruby
[23:35:34] Ox0dea: has joined #ruby
[23:35:55] northfurr: has joined #ruby
[23:36:13] Ox0dea: hxegon: Do you trust GitHub?
[23:36:14] hxegon: skweek: first thing while I deal with this, break down you problem into component parts. e.g. list the contents of a folder, get file extensions from those, etc.
[23:36:26] Yzguy: has joined #ruby
[23:36:46] hxegon: Ox0dea: not with anything too sensitive, but thats not specific to Github. Should I actively distrust them?
[23:36:47] Ox0dea: skweek: Which Ruby books have you read, if you don't mind my prying?
[23:37:01] havenwood: skweek: Want some code to get you started or trying to figure it out yourself?
[23:37:08] Ox0dea: hxegon: No, I don't think so, but I asked pursuant to suggesting that you could just use open-uri + eval. :P
[23:37:36] mistermocha: has joined #ruby
[23:38:02] ss_much: has joined #ruby
[23:38:20] northfurr: has joined #ruby
[23:38:23] hxegon: Ox0dea: hmm... I'll consider it if git submodules turns out to be a bad fit. Thanks for the suggestion though, not something I had thought of before
[23:38:32] Eminence_: has joined #ruby
[23:38:37] shevy: I want my xmas ruby
[23:38:54] freerobby: has joined #ruby
[23:38:55] riotjones: has joined #ruby
[23:39:06] Ox0dea: hxegon: Please ignore me on this one.
[23:40:01] hxegon: Ox0dea: Don't suggest that kind of stuff to me, because those kinds of things are just tempting enough for me to use in production because inexperience + enthusiasm
[23:40:17] hahuang65: has joined #ruby
[23:40:47] skweek: head first ruby, ruby wizardry, and a two youtube ruby tutorial series' Ox0dea
[23:41:09] Ox0dea: skweek: Hm, not the worst list, I guess. :P
[23:41:14] Ox0dea: skweek: http://git.io/vlK6Y
[23:41:16] Rollabunna: has joined #ruby
[23:41:23] Ox0dea: I think that might get you started in the right direction.
[23:41:46] northfurr: has joined #ruby
[23:42:28] hxegon: skweek: any questions about that gist?
[23:42:43] karapetyan: has joined #ruby
[23:43:59] shevy: skank the weed
[23:44:03] shevy: skweek the wank
[23:44:08] northfurr: has joined #ruby
[23:44:44] skweek: so it lists mp3s and their directories, and then list m4as, and then move those listed items to a directory, and then remove m4as from the computer
[23:45:53] hxegon: skweek: specific folders or your entire computer?
[23:46:01] shevy: keep a backup!
[23:46:07] Coldblackice: has joined #ruby
[23:46:18] hxegon: skweek: I'm guessing that this is all taking place in a 'Music' folder or something
[23:46:28] shevy: as usual, the solution is to use arrays there
[23:46:41] havenwood: skweek: Did you want some code to give you ideas for getting started or want to figure it out from scratch?
[23:46:59] mistermocha: has joined #ruby
[23:47:02] weaksauce: skweek think in smaller chunks and only do the actual destructive commands when you fully know that it works
[23:47:05] northfurr: has joined #ruby
[23:47:50] tlaxkit: has joined #ruby
[23:48:04] hxegon: skweek: destructive meaning actually changing something in a potential irreversible way
[23:48:41] juanpablo__: has joined #ruby
[23:50:59] hxegon: skweek: clarify 'remove m4a from computer' pls. as in it removes the file completely, or it copies it to a location and destroys the original?
[23:51:09] rbowlby: has joined #ruby
[23:51:26] skweek: i'm converting m4a to mp3 and deleting m4a
[23:51:55] m3_del: has joined #ruby
[23:52:03] Renich: has joined #ruby
[23:52:10] towski__: has joined #ruby
[23:52:34] northfurr: has joined #ruby
[23:53:13] skweek: only some mp3s have been converted out of the directories
[23:54:15] skweek: so list m4as from directories, list mp3s from directories, compare and list m4as, remove m4as? does that sound broken down
[23:54:29] tkuchiki: has joined #ruby
[23:54:38] rickmasta: has joined #ruby
[23:54:59] hxegon: skweek: so you only want to convert m4as in directories where mp3s also exist?
[23:55:05] northfurr: has joined #ruby
[23:55:45] hxegon: skweek: or are you trying to prevent m4as getting converted that already have mp3 conversions?
[23:56:13] skweek: I have partially converted m4as into mp3s of several directories
[23:56:39] ghoti: has joined #ruby
[23:56:44] skweek: I'm trying to remove the m4as that have already been converted to mp3s
[23:58:02] hxegon: skweek: alright, before we get into the meat of this, I'm just going to get something out of the way first
[23:58:25] dfockler: has joined #ruby
[23:59:15] hxegon: skweek: bash/zsh is probably a better tool in this situation. that said, doing this in ruby will be a good excersize, and it's not 'bad' to do it in ruby.