« Back to channel list

#ruby - 29 March 2016

« Back 1 day Forward 1 day »
[00:01:23] cdg: has joined #ruby
[00:06:57] dn`: has joined #ruby
[00:07:15] mistermocha: has joined #ruby
[00:08:03] mistermo_: has joined #ruby
[00:08:06] youch: has joined #ruby
[00:09:13] Moosashi: has joined #ruby
[00:10:06] kolpal: has joined #ruby
[00:10:25] bhaak: has joined #ruby
[00:10:27] Kero: has joined #ruby
[00:10:58] RegulationD: has joined #ruby
[00:25:16] drewo: has joined #ruby
[00:26:47] sudoubuntu: has joined #ruby
[00:29:36] yfeldblum: has joined #ruby
[00:31:01] baweaver: has joined #ruby
[00:36:06] hxegon: has joined #ruby
[00:36:21] _stu_: has joined #ruby
[00:37:35] Dimik: i case you guys wondered i fixed that sql "SELECT id FROM table ORDER BY id DESC LIMIT 1"
[00:37:50] Dimik: that kept coming back as array
[00:38:01] Dimik: i did .to_s and then .to_i
[00:38:06] Dimik: that seemed to work i'm happy.
[00:38:50] davedev24: has joined #ruby
[00:39:10] shevy: ruby makes you happy
[00:39:13] shevy: with just a few characters!
[00:39:30] Moosashi: has joined #ruby
[00:43:46] kolpal: has joined #ruby
[00:43:47] allcentury: has joined #ruby
[00:45:39] cpup: has joined #ruby
[00:46:37] hotpancakes: has joined #ruby
[00:48:38] cisco: has joined #ruby
[00:48:56] CloCkWeRX: has joined #ruby
[00:55:07] chouhoulis: has joined #ruby
[00:56:43] bkxd: has joined #ruby
[00:57:49] ramfjord: has joined #ruby
[00:59:07] benlieb: has joined #ruby
[00:59:23] LaT0rtue: has joined #ruby
[01:01:31] Moosashi: has joined #ruby
[01:03:01] htmldrum: has joined #ruby
[01:03:01] htmldrum_: has joined #ruby
[01:03:10] Inside: has joined #ruby
[01:03:38] existensil: has joined #ruby
[01:04:24] sudoubuntu: has joined #ruby
[01:04:45] drewo: has joined #ruby
[01:04:49] _blizzy_: has joined #ruby
[01:09:37] daguilaraguilar: has joined #ruby
[01:11:43] cpup: has joined #ruby
[01:13:53] mistermocha: has joined #ruby
[01:17:43] growGROW: has joined #ruby
[01:20:01] pawnbox: has joined #ruby
[01:23:41] shazaum_: has joined #ruby
[01:27:29] sauvin: has joined #ruby
[01:29:32] Rubie: has joined #ruby
[01:29:55] RobertBirnie: has joined #ruby
[01:31:03] benlieb: has joined #ruby
[01:32:03] uglybandersnatch: has joined #ruby
[01:32:14] systemsgotyou: has joined #ruby
[01:32:43] systemsgotyou: what are the best ways to put myself in the top 10% of webdevs?
[01:34:23] baweaver: systemsgotyou: why 10%?
[01:34:57] Ropeney: systemsgotyou, by not following the 90%
[01:35:04] baweaver: (* ignoring the fact that this is utterly impossible to qualify)
[01:35:25] sp4rrow: has joined #ruby
[01:35:51] dtzuzu: has joined #ruby
[01:37:26] hxegon: has joined #ruby
[01:37:53] goodroot: make big contributions to popular open source projects, blog about profound things, ???, profit
[01:39:12] moeabdol: has joined #ruby
[01:39:29] ellisTAA: has joined #ruby
[01:40:10] shevy: I especially like the ???
[01:40:29] aspiers: has joined #ruby
[01:41:15] leon_e: has joined #ruby
[01:42:03] threh: has joined #ruby
[01:42:26] brentw: the old underpants gnome business model
[01:42:43] freerobby: has joined #ruby
[01:43:15] elifoster: has joined #ruby
[01:45:07] rkazak: has joined #ruby
[01:45:17] nando293921: has joined #ruby
[01:51:16] patrick_star_2: has joined #ruby
[01:52:36] morochena: has joined #ruby
[01:52:56] yatish27: has joined #ruby
[01:53:26] paradisaeidae: has joined #ruby
[01:56:15] duncannz: has joined #ruby
[01:56:26] Radar: systemsgotyou: Work really damn hard to build a cult of personality for 10+ years.
[01:56:37] Radar: systemsgotyou: Over that time, merge your Twitter ego and real ego into the same being.
[02:03:50] ellisTAA: has joined #ruby
[02:04:53] sgambino: has joined #ruby
[02:06:26] jenrzzz: has joined #ruby
[02:08:02] benlieb: has joined #ruby
[02:09:14] LaT0rtue: has joined #ruby
[02:09:25] mistermocha: has joined #ruby
[02:11:32] baweaver: so be like Radar :P
[02:11:42] Moosashi: has joined #ruby
[02:12:15] Radar: What could go wrong
[02:12:23] RegulationD: has joined #ruby
[02:12:42] bkxd: has joined #ruby
[02:13:23] jdawgaz: has joined #ruby
[02:14:03] sorbo_: has joined #ruby
[02:14:39] Anderson69s: has joined #ruby
[02:14:49] KensoDev: has joined #ruby
[02:21:02] jackjackdripper: has joined #ruby
[02:21:15] sorbo_: has left #ruby: ()
[02:21:35] morochena: has joined #ruby
[02:21:50] RickHull: to become in the top 10% of webdevs you only need one simple product: GRO
[02:22:07] RickHull: github repo optimization. from the same people who brought you search engine optimization
[02:22:42] mistermocha: has joined #ruby
[02:22:50] RickHull: we take starfarms to places linkfarms have never even heard of
[02:23:47] rbennacer: has joined #ruby
[02:24:14] ramfjord: has joined #ruby
[02:24:30] Radar: baweaver: ha
[02:26:59] mistermo_: has joined #ruby
[02:27:28] lkba: has joined #ruby
[02:28:01] djbkd: has joined #ruby
[02:31:39] claw: has joined #ruby
[02:32:46] benlieb: has joined #ruby
[02:33:17] Asher: has joined #ruby
[02:34:51] chagel: has joined #ruby
[02:37:01] darkf: has joined #ruby
[02:37:09] devbug: has joined #ruby
[02:38:33] Sadin: has joined #ruby
[02:40:02] Rubie: has joined #ruby
[02:40:32] Chagel_: has joined #ruby
[02:41:39] ellisTAA: has joined #ruby
[02:43:13] darkf: has joined #ruby
[02:44:36] jdawgaz: has joined #ruby
[02:46:01] daguilaraguilar: has joined #ruby
[02:46:46] jdawgaz: has joined #ruby
[02:46:47] Dopagod: has joined #ruby
[02:49:41] pawnbox: has joined #ruby
[02:57:27] chipotle: has joined #ruby
[02:58:27] jdawgaz: has joined #ruby
[02:59:06] Moosashi: has joined #ruby
[02:59:37] jdawgaz: has joined #ruby
[03:00:35] jdawgaz: has joined #ruby
[03:03:19] fedexo: has joined #ruby
[03:04:10] nando293921: has joined #ruby
[03:04:43] bronson: has joined #ruby
[03:04:51] cisco: has joined #ruby
[03:05:08] cisco: has joined #ruby
[03:05:10] rkazak: has joined #ruby
[03:05:30] cisco: has joined #ruby
[03:05:52] cisco: has joined #ruby
[03:06:13] cisco: has joined #ruby
[03:06:29] MrSamuel: has joined #ruby
[03:06:41] hotpancakes: has joined #ruby
[03:06:44] cisco: has joined #ruby
[03:07:11] cisco: has joined #ruby
[03:07:24] arescorpio: has joined #ruby
[03:09:13] sgambino: has joined #ruby
[03:09:21] zast: has joined #ruby
[03:09:43] jdawgaz: has joined #ruby
[03:14:44] jkahn: has joined #ruby
[03:15:45] sudoubuntu: has joined #ruby
[03:18:42] braincrash: has joined #ruby
[03:19:02] chagel: has joined #ruby
[03:19:33] pawnbox: has joined #ruby
[03:21:15] spuk: has joined #ruby
[03:27:47] ellisTAA: has joined #ruby
[03:28:17] RobertBirnie: has joined #ruby
[03:33:19] davee_: has joined #ruby
[03:33:27] nando293921: has joined #ruby
[03:33:37] htmldrum: has joined #ruby
[03:33:38] htmldrum_: has joined #ruby
[03:34:47] vith: has joined #ruby
[03:38:23] floatingpoint: has joined #ruby
[03:38:34] vith: is there any good preset for reek to raise the signal to noise ratio? or another "idiom" linter, if you can call it that?
[03:39:15] vith: i'm new to ruby so i'd appreciate these kinds of hints but the defaults seem really noisy and i don't want to spend a lot of time configuring tooling
[03:40:52] Moosashi: has joined #ruby
[03:41:44] noService: has joined #ruby
[03:41:47] gix: has joined #ruby
[03:42:12] djbkd: has joined #ruby
[03:42:42] LaT0rtue: has joined #ruby
[03:43:21] bkxd: has joined #ruby
[03:43:41] esclavodeltikita: has joined #ruby
[03:44:42] Radar: vith: what's the output that you're seeing now from that?
[03:45:01] sneakerhax: has joined #ruby
[03:45:51] Spami: has joined #ruby
[03:46:23] madgen_: has joined #ruby
[03:47:08] noService: has joined #ruby
[03:47:16] vith: TooManyInstanceVariables for classes with 5 or more; NestedIterators, TooManyStatements, UncommunicativeVariableName for basically the doc examples of using optparse
[03:48:08] RickHull: vith: i like Reek, but if it's noisy today and you don't see a noise problem, you could just not use it as a valid workaround
[03:48:11] GnuYawk: has joined #ruby
[03:49:26] pawnbox: has joined #ruby
[03:50:53] mistermocha: has joined #ruby
[03:51:14] quazimodo: has joined #ruby
[03:51:17] linocisco: has joined #ruby
[03:51:18] quazimodo: https://gist.github.com/siassaj/618e3230f713fb1fc26d
[03:51:35] RobertBirnie: has joined #ruby
[03:51:35] linocisco: perl monk, python zealord, ruby what?????
[03:51:41] quazimodo: is a sort of syntax similar to the first example available to us ?
[03:53:34] Radar: linocisco: rockstar, of course
[03:54:00] linocisco: Radar, are you Ryan?
[03:54:04] Radar: Good thanks.
[03:54:26] linocisco: Radar, thanks to see you online
[03:56:03] vith: ah i just found RuboCop, i'll give that a shot instead
[03:56:52] Radar: vith: Rubocop can be just as opinionated :)
[03:57:05] linocisco: how do you all think Ruby Motion? not better than swift2, right?
[03:57:22] nanoz: has joined #ruby
[03:58:12] last_staff: has joined #ruby
[03:58:35] quazimodo: I tried https://gist.github.com/siassaj/618e3230f713fb1fc26d which appears to be ~ok
[03:59:08] vith: Radar: indeed, it has a lot more warnings for me. but at least they all look like things i should actually fix now
[03:59:18] jdawgaz: has joined #ruby
[03:59:26] davedev24: has joined #ruby
[03:59:27] Radar: vith: You can customise it to disable certain things with a .rubocop.yml file at the root of your project.
[03:59:45] sarlalian: has joined #ruby
[04:01:43] Ox0dea: >> def (special = Object.new).foo; 42; end; special.foo # quazimodo
[04:01:44] ruby[bot]: Ox0dea: # => 42 (https://eval.in/543711)
[04:01:47] Ox0dea: Probably don't do that, though.
[04:02:45] bronson: has joined #ruby
[04:06:36] bronson: has joined #ruby
[04:08:34] roshanavand: has joined #ruby
[04:09:21] quazimodo: Ox0dea: yeah I'll stick to tap for now
[04:09:46] quazimodo: it would have been nice to do Object.new do def self.whatever... etc
[04:10:37] Ox0dea: quazimodo: https://eval.in/543712
[04:11:06] howdoi: has joined #ruby
[04:11:30] Ox0dea: Er, that's missing an `if block_given?`, but you get the idea.
[04:12:41] Devalo: has joined #ruby
[04:13:14] RegulationD: has joined #ruby
[04:13:15] hk238: has joined #ruby
[04:13:33] Ox0dea: That Object.new doesn't use its block does seem like a missed trick.
[04:16:34] roshanavand: has joined #ruby
[04:18:02] chipotle: has joined #ruby
[04:19:52] quazimodo: Ox0dea: Interesting monkey patch :P
[04:20:01] CloCkWeRX: has joined #ruby
[04:20:10] hxegon: has joined #ruby
[04:20:19] quazimodo: would be nice if ruby came with that hu
[04:20:24] pawnbox: has joined #ruby
[04:20:31] ramfjord: has joined #ruby
[04:20:31] quazimodo: javascript made me cognizant of the usefulness of eigenclasses
[04:20:46] Ox0dea: What, before Ruby did?
[04:20:47] quazimodo: well, constructs that are similar in function to eigenclasses
[04:21:20] quazimodo: Ox0dea: yeah but only because *i* didn't use the functionality in ruby but i ended up using things that appeared mechanically similar to me in JS
[04:21:35] quazimodo: then it made sense where/how to use them in ruby
[04:21:57] jenrzzz: has joined #ruby
[04:21:58] quazimodo: you like them?
[04:22:22] Ox0dea: Is there a useful distinction between "eigenclass" and "singleton class"?
[04:23:02] quazimodo: are they different things at all?
[04:23:41] Ox0dea: I don't think so, but then why say "eigenclass"?
[04:24:21] Ox0dea: "Class methods" are just singleton methods; you've been using "eigenclasses" in Ruby from the first.
[04:24:47] quazimodo: Ox0dea: yeah i discovered that when i looked at what class << self means
[04:25:09] quazimodo: but I wasn't aware of that distinction before. I didn't know it was done that way on classes in ruby implementations
[04:25:22] quazimodo: though, of course it makes perfect sense
[04:25:26] jdawgaz: has joined #ruby
[04:26:09] Ox0dea: Yep, Ruby's object hierarchy and method resolution plan are both remarkably simple for all their power.
[04:26:30] Ox0dea: The crucial observation is to realize that classes are just instances of the Class class.
[04:26:37] quazimodo: is eigenclass or singleton class the stardand word used in comp sci?
[04:26:58] quazimodo: Ox0dea: yeah that was a head trip that I had when I first started learning a couple years ago
[04:27:00] Ox0dea: Everybody's got their favorite. :/
[04:27:03] quazimodo: but, it does make sense
[04:27:06] Ox0dea: You'll also see "metaclass".
[04:27:09] jdawgaz: has joined #ruby
[04:27:22] quazimodo: Ox0dea: i like eigenclass just because I studied mechanical/mechatronic engineering
[04:27:27] quazimodo: we had several eigen-things
[04:27:38] Ox0dea: It's certainly the fanciest, and probably the most technically correct.
[04:28:04] Ox0dea: But that you can't instantiate singleton classes makes that name quite fitting as well.
[04:30:32] zenergi: has joined #ruby
[04:30:41] sorbo_: has joined #ruby
[04:31:12] b2zeldafreak: has joined #ruby
[04:32:10] gregf: has joined #ruby
[04:32:34] RobertBirnie: has joined #ruby
[04:33:55] quazimodo: i like ruby
[04:34:04] quazimodo: but i don't like metaprogramming using strings
[04:35:05] Ox0dea: You'd hate Tcl.
[04:35:43] mujeres: has joined #ruby
[04:38:11] Gooer: has joined #ruby
[04:38:17] Rubie: has joined #ruby
[04:39:29] quazimodo: i've heard words about it
[04:40:46] jackjackdripper: has joined #ruby
[04:42:19] Ox0dea: http://archive.is/TD1lQ#selection-575.0-591.83
[04:42:58] LaT0rtue: has joined #ruby
[04:43:08] pawnbox: has joined #ruby
[04:44:05] bkxd: has joined #ruby
[04:45:37] brentw: has joined #ruby
[04:46:10] mujeres: eh, does ruby have any kind of reflection or metaobject protocol?
[04:48:44] Ox0dea: mujeres: Ruby makes it pretty easy to do everything that might fit under those umbrellas except modifying a class's ancestor chain.
[04:48:49] Ox0dea: You have to get your hands dirty to do that.
[04:49:57] hightower2: has joined #ruby
[04:50:04] mujeres: but it's still possible then?
[04:50:44] mujeres: what I mean to ask is if ruby is part of it's own environment (ugh I don't really know how to phrase this)
[04:51:04] mujeres: like smalltalk and lisp (on which I've heard it's inspired)
[04:51:30] Ox0dea: Yes, those are direct ancestors, but Ruby isn't homoiconic.
[04:51:44] Ox0dea: It's an "easy" language, not a simple one.
[04:51:47] bluOxigen: has joined #ruby
[04:52:48] Ox0dea: Just shy of infinitely.
[04:53:16] RobertBirnie: has joined #ruby
[04:54:29] mujeres: that's good
[04:56:38] hotpancakes: has joined #ruby
[04:56:50] _strggler: has joined #ruby
[04:57:33] jkahn: has joined #ruby
[04:59:44] _strggler: If I have a Hash where some of the keys are :brand, and I want to reduce it into a hash with single instances of a each brand, with the accumulated values... How do I start?
[04:59:55] _strggler: Some sort of Hash.reduce
[05:00:50] Ox0dea: _strggler: You'll have to clarify; a Hash can't have duplicate keys.
[05:01:25] _strggler: Array of hashes. That result from json parse
[05:02:18] baweaver: [{a: 1, b: 2}, {a: 2, b: 2}].group_by { |h| h[:b] }
[05:02:26] baweaver: >> [{a: 1, b: 2}, {a: 2, b: 2}].group_by { |h| h[:b] }
[05:02:27] ruby[bot]: baweaver: # => {2=>[{:a=>1, :b=>2}, {:a=>2, :b=>2}]} (https://eval.in/543714)
[05:03:38] merida: has joined #ruby
[05:07:29] hotpancakes: has joined #ruby
[05:08:14] Ox0dea: _strggler: I sink you vant somesink like zis: https://eval.in/543715
[05:08:16] Gooer: /msg nickserv set enforce ON
[05:09:48] rmulligan: has joined #ruby
[05:11:26] Devalo: has joined #ruby
[05:11:37] _strggler: You guys are amazing..
[05:12:48] astrobunny: has joined #ruby
[05:14:18] pawnbox_: has joined #ruby
[05:15:09] Es0teric: has joined #ruby
[05:15:25] fschuindt: has joined #ruby
[05:15:42] solocshaw: has joined #ruby
[05:17:40] fschuindt: I want to provide a API service to evaluate Ruby code. Receives code as string and returns the code's console output also as string. Doing it in a safe way of course, like virtual environments. Any tip to start with?
[05:19:04] _strggler: just use eval? If it is in a sandbox
[05:19:11] CloCkWeRX: has joined #ruby
[05:19:42] Radar: fschuindt: ask Charlie how he did it: https://eval.in/
[05:20:50] Ox0dea: fschuindt: https://github.com/thestinger/playpen
[05:21:14] fschuindt: Radar: this is exactly what I'm looking for. I'm currently using the Hacker Earth. Does the same but provides an API. Now I'm trying to implement this part myself.
[05:21:58] fschuindt: Ox0dea: ty!
[05:22:12] Ox0dea: fschuindt: Sure thing. I'm pretty sure that's what jhass uses for https://carc.in/
[05:22:23] sarlalian: has joined #ruby
[05:23:31] mujeres: wow ruby is more malleable than I thought
[05:24:32] mujeres: there goes my good night sleep
[05:24:37] Ox0dea: fschuindt: There's also seccomp if you want finer-grained control over the whitelist, and you might consider looking into systemd-nspawn as well.
[05:26:17] Ox0dea: The latter takes some configuring, but then you can essentially spin up little one-off "containers" whenever you wish.
[05:26:52] chagel: has joined #ruby
[05:27:23] fschuindt: Ox0dea: Cool, that's definitely lot of study for me now. I really appreciate, thank you.
[05:27:25] RobertBirnie: has joined #ruby
[05:27:36] Ox0dea: Happy to help.
[05:28:27] yfeldblum: has joined #ruby
[05:31:28] krz: has joined #ruby
[05:32:25] lopin: has joined #ruby
[05:34:50] RobertBirnie: has joined #ruby
[05:37:43] Chagel_: has joined #ruby
[05:39:54] mujeres: continuations are a thing in ruby?
[05:41:37] ayonkhan: has joined #ruby
[05:41:56] joonty: has joined #ruby
[05:42:09] RobertBirnie: has joined #ruby
[05:43:31] mujeres: oh they are
[05:43:53] Cohedrin: has joined #ruby
[05:44:07] User458764: has joined #ruby
[05:45:33] Ox0dea: The actual Continuation library is deprecated, but suspending and resuming a computation is certainly still a thing.
[05:46:30] mujeres: well there's more to continuations isn't there?
[05:46:36] mujeres: (at least theoretically :9)
[05:46:47] systemsgotyou: what use are hash tables in web dev when you can use a DBase?
[05:47:47] chagel: has joined #ruby
[05:48:07] cpup: has joined #ruby
[05:48:41] aganov: has joined #ruby
[05:49:36] Ox0dea: mujeres: https://eval.in/543728
[05:50:29] Ox0dea: That infinite loop closes over some state and can be jumped into from wherever.
[05:51:39] Devalo: has joined #ruby
[05:52:22] Rubie: has joined #ruby
[05:52:26] xsdfdfsa: has joined #ruby
[05:52:27] tildes: has joined #ruby
[05:54:54] mujeres: Ox0dea: wait... that << operator
[05:55:13] mujeres: kind of looks like monadic stuff........
[05:55:27] mujeres: d-does that exist in ruby?
[05:55:55] Ox0dea: Well, it's just a regular-ol' method here, but monads can be implemented in any Turing-complete language.
[05:56:59] mujeres: I was looking at the docs and saw that ios << object, so I thought 'monads!' :P
[05:57:36] mujeres: I guess OO gives a feel for monads
[05:57:56] mujeres: (after all monads are implemented in a type system resembling OOP)
[05:58:03] Suntzu: has joined #ruby
[05:58:34] Ox0dea: `<<` is colloquially referred to as the "shovel" operator; it tends to get used wherever that verb makes sense. :)
[05:58:59] Ox0dea: It's #push for Array, #yield for Enumerator::Yielder, and #write for IO and its descendants.
[06:01:25] mujeres: like context in perl huh?
[06:01:35] Ox0dea: Just method aliasing, really.
[06:02:11] _strggler: systemsgotyou: I'm with you. json is blech..
[06:02:35] rmulligan: has joined #ruby
[06:02:40] Renich: has joined #ruby
[06:04:42] Ox0dea: mujeres: Oh! Do you like Haskell's list comprehensions?
[06:07:03] mujeres: ruby has that too?
[06:07:07] merida: has joined #ruby
[06:07:12] mujeres: doesn't surprise me
[06:07:35] hotpancakes: has joined #ruby
[06:07:54] Ox0dea: No, not quite, but you can hack it in. :)
[06:08:10] mujeres: cool. Metaprogramming it's what it's all about
[06:08:18] mujeres: mmmmm there's map
[06:09:35] Ox0dea: Ruby is Smalltalk + Lisp + an explosion at the syntax factory.
[06:10:29] RobertBirnie: has joined #ruby
[06:11:09] mujeres: I'm starting to notice, yeah
[06:11:49] bronson: has joined #ruby
[06:11:57] mujeres: now, I'm just starting out. And I already found a bunch of advanced books on ruby
[06:12:02] mujeres: I need one for a beginner though
[06:12:17] mujeres: (one that goes straight to the point plz, not why's)
[06:12:44] Ropeney: well grounded rubyist
[06:14:06] rodfersou: has joined #ruby
[06:15:36] mujeres: I'll take your word
[06:20:38] LaT0rtue: has joined #ruby
[06:22:06] shevy: I'll take your ranch!
[06:22:51] sandstrom: has joined #ruby
[06:24:02] mujeres: b-bully, my lunch!
[06:24:42] hotpancakes: has joined #ruby
[06:25:13] brt: has joined #ruby
[06:26:05] lele: has joined #ruby
[06:26:25] mujeres: is it always interpreted? or is there a sort of VM that runs a compiled bytecode?
[06:27:08] Ox0dea: It's always the latter.
[06:27:14] Ox0dea: For MRI, at any rate.
[06:27:39] Es0teric: has joined #ruby
[06:27:40] ur5us: has joined #ruby
[06:27:57] bronson: has joined #ruby
[06:28:05] dling: has joined #ruby
[06:28:07] dling`: has joined #ruby
[06:29:38] Ox0dea: The Ruby interpreter you're using.
[06:29:43] Ox0dea: But there are several other ones.
[06:30:48] baweaver: has joined #ruby
[06:31:05] andikr: has joined #ruby
[06:33:44] CausaMortis: has joined #ruby
[06:35:01] Citoplasma: has joined #ruby
[06:35:32] mujeres: well I should sleep
[06:35:46] mujeres: thanks guys
[06:36:01] kirillzh: has joined #ruby
[06:37:20] _strggler: I knew that guy when I last toyed with programming. "well grounded rubyist"
[06:40:42] User458764: has joined #ruby
[06:40:56] _strggler: 'well rounded rubyist' is if you've eaten like I have since those days
[06:44:40] lsmola: has joined #ruby
[06:44:49] lyoshajapan: has joined #ruby
[06:45:02] bkxd: has joined #ruby
[06:48:52] leon_ee: has joined #ruby
[06:54:31] chancy: has joined #ruby
[06:54:36] htmldrum: has joined #ruby
[06:54:37] htmldrum_: has joined #ruby
[06:54:47] scepticulous: has joined #ruby
[06:54:57] chancy: Could any harm come from defining a module method named #test - ?
[06:55:40] chancy: I want to have MyModule.test ... but I discovered that there's a private builtin #test, and there's also a Kernel#test
[06:56:07] djbkd: has joined #ruby
[06:57:18] mfaeh: has joined #ruby
[06:57:50] noServic1: has joined #ruby
[07:00:05] leon_e: has joined #ruby
[07:00:06] shevy: chancy nah as long as they reside in different namespaces
[07:00:09] DoubleMalt: has joined #ruby
[07:00:15] vondruch: has joined #ruby
[07:00:23] Ox0dea: chancy: Those're the same method, mind.
[07:01:35] chancy: Ah hah, interesting.
[07:02:17] valetudo: has joined #ruby
[07:02:40] chancy: Not sure about the Module private #test method, though: I realized there's an issue when doing TDD: when I expected to use MyModule.test, instead of getting 'method not found', i got 'attempting to access private method'
[07:02:41] Ox0dea: Invoking it as `MyModule.test` certainly won't conflict, and nor will bare `test` as long as `self` is MyModule.
[07:03:00] Ox0dea: chancy: Ah, that means you defined it as an instance method.
[07:03:03] chancy: That 'private method error' tipped me off
[07:03:06] Timba-as_: has joined #ruby
[07:03:15] troulouliou_div2: has joined #ruby
[07:03:31] chancy: yep, defined like `def self.test`
[07:03:39] astrobunny: has joined #ruby
[07:03:42] chancy: Or actually, scratch that ...
[07:03:59] chancy: not defined at all --- called from my test as `MyModule.test`
[07:04:33] Ox0dea: You'll probably want to define it, then. :P
[07:04:52] chancy: But it's saying it is defined, just private.
[07:05:07] chancy: I think going with a diff name like `MyModule.check` is the safest
[07:05:18] blackgoat: has joined #ruby
[07:05:51] Ox0dea: That private method error means you don't actually have a `MyModule.test` method.
[07:06:07] hotpancakes: has joined #ruby
[07:06:27] LaT0rtue: has joined #ruby
[07:06:38] chancy: really? Oh, this is interesting: yep, the error message actually says both: "private method `test' called for SmallModule:Module (NoMethodError)"
[07:06:50] chancy: what in the world
[07:07:07] Ox0dea: Post code?
[07:07:13] merida: has joined #ruby
[07:07:48] kam270: has joined #ruby
[07:08:17] Ox0dea: `SmallModule.test` doesn't exist, so it's going up the ancestor chain and invoking Object#test (from Kernel); it's private, so you can't invoke it with an explicit receiver.
[07:08:27] chancy: interesting...
[07:08:39] chancy: yep, here's what i get for check: "undefined method `check' for SmallModule:Module (NoMethodError)"
[07:08:55] djellemah_: has joined #ruby
[07:09:26] chancy: Sorry, i can't post code ATM, but i get the odd error with one line: module M; end; M.test
[07:09:43] Ox0dea: You should get the private method error.
[07:10:20] chancy: ok, i guess this is making sense, the more i think about it
[07:10:39] chancy: it IS still a NoMethodError ... it's just the description that says 'private'
[07:11:04] lyoshajapan: has joined #ruby
[07:11:11] Ox0dea: Right, that's Ruby letting you know that there is actually a method there, but you're not meant to call it that way. :P
[07:11:17] Ox0dea: Familiar with #puts?
[07:11:26] Ox0dea: Well, it's the same deal.
[07:11:34] chancy: very interesting
[07:11:35] Ox0dea: >> 'foo'.puts rescue $!
[07:11:36] ruby[bot]: Ox0dea: # => #<NoMethodError: private method `puts' called for "foo":String> (https://eval.in/543820)
[07:12:08] chancy: very interesting
[07:12:27] chancy: >> module M; end; M.puts
[07:12:29] ruby[bot]: chancy: # => private method `puts' called for M:Module (NoMethodError) ...check link for more (https://eval.in/543822)
[07:12:33] CausaMortis_: has joined #ruby
[07:12:43] AlexJakeGreen: has joined #ruby
[07:12:52] agit0: has joined #ruby
[07:13:15] Ox0dea: In `foo.bar`, `foo` is an "explicit receiver", on which private methods can't be invoked directly.
[07:13:22] cjheath: has joined #ruby
[07:14:37] SCHAAP137: has joined #ruby
[07:16:32] bronson: has joined #ruby
[07:19:19] astrobunny: has joined #ruby
[07:21:53] Ox0dea: chancy: https://eval.in/543842
[07:21:54] tildes: chancy if for some reason you must call the private method anyway, you can use send, like so: Module.send(:test)
[07:22:11] dtzuzu: has joined #ruby
[07:22:36] chancy: ah hah, cool
[07:22:56] tildes: (you would need a good reason to do this, I would use it only for debugging and perhaps for tests)
[07:24:06] hotpancakes: has joined #ruby
[07:24:39] mark2: has joined #ruby
[07:24:42] darkf: has joined #ruby
[07:25:05] merida: has joined #ruby
[07:25:19] bronson: has joined #ruby
[07:26:11] aufi: has joined #ruby
[07:28:39] the_drow: has joined #ruby
[07:29:49] sandstrom: has joined #ruby
[07:31:07] jaruga: has joined #ruby
[07:31:56] djellemah: has joined #ruby
[07:32:12] rkazak: has joined #ruby
[07:34:16] drewo: has joined #ruby
[07:37:53] nanoz: has joined #ruby
[07:40:32] ausum_possum: has joined #ruby
[07:40:46] LoneHermit: has joined #ruby
[07:43:10] uglybandersnatch: has joined #ruby
[07:43:12] futilegames: has joined #ruby
[07:43:14] sp4rrow: has joined #ruby
[07:43:41] bronson: has joined #ruby
[07:44:45] codecop: has joined #ruby
[07:44:47] codecop_: has joined #ruby
[07:49:31] last_staff: has joined #ruby
[07:50:26] biberu: has joined #ruby
[07:51:30] binaryplease1: has joined #ruby
[07:53:05] edwinvdgraaf: has joined #ruby
[07:56:06] yfeldblum: has joined #ruby
[07:57:06] joonty: has joined #ruby
[08:04:40] pawnbox: has joined #ruby
[08:04:48] Emmanuel_Chanel: has joined #ruby
[08:05:33] hotpancakes: has joined #ruby
[08:07:35] jenrzzz: has joined #ruby
[08:07:54] alexherbo2: has joined #ruby
[08:08:46] n008f4g_: has joined #ruby
[08:10:02] LaT0rtue: has joined #ruby
[08:11:25] vondruch: has joined #ruby
[08:13:46] Stan: has joined #ruby
[08:15:42] bkxd: has joined #ruby
[08:16:49] rkoller: has joined #ruby
[08:22:32] Couch: has joined #ruby
[08:23:25] Xiti: has joined #ruby
[08:23:26] AnoHito: has joined #ruby
[08:23:27] odin__: has joined #ruby
[08:24:05] odin__: Hi, I want to erase the last line from stdout in ruby for a kind of "simon says" game. Any ideas on how to do it?
[08:24:20] tristanp: has joined #ruby
[08:24:31] sp4rrow: has joined #ruby
[08:24:41] jenrzzz: has joined #ruby
[08:25:02] monoprotic: has joined #ruby
[08:25:02] monoprotic: has joined #ruby
[08:25:09] f4cl3y: has joined #ruby
[08:27:22] hays: has joined #ruby
[08:27:26] zenspider: has joined #ruby
[08:27:31] merida: has joined #ruby
[08:27:35] sarbs: has joined #ruby
[08:27:42] mdw: has joined #ruby
[08:27:46] psmolen: has joined #ruby
[08:28:12] dionysus69: has joined #ruby
[08:28:13] skislak: has joined #ruby
[08:28:13] sauvin: has joined #ruby
[08:28:41] Nuck: has joined #ruby
[08:28:42] mdw7: has joined #ruby
[08:29:00] malademental: Hi, I want to erase the last line from stdout in ruby for a kind of "simon says" game. Any ideas on how to do it?
[08:30:49] htmldrum: has joined #ruby
[08:30:50] htmldrum_: has joined #ruby
[08:31:11] ur5us: has joined #ruby
[08:34:38] crankharder: has joined #ruby
[08:34:46] mrgrieves: has joined #ruby
[08:35:30] hays: has joined #ruby
[08:35:33] NuckingFuts: has joined #ruby
[08:36:03] mozzarella: has joined #ruby
[08:36:06] jonee: has joined #ruby
[08:36:49] binaryplease: has joined #ruby
[08:37:03] ljarvis: malademental: print "foo\r"; print "bar"
[08:37:09] blackmesa: has joined #ruby
[08:37:38] ljarvis: probably to flush stdout too
[08:39:34] lkba: has joined #ruby
[08:41:06] skade: has joined #ruby
[08:41:07] lyoshajapan: has joined #ruby
[08:42:08] M-Kodo: has joined #ruby
[08:42:10] ByronJohnson: has joined #ruby
[08:42:29] M-shine: has joined #ruby
[08:42:59] Suntzu: has joined #ruby
[08:44:24] neanderslob_: has joined #ruby
[08:44:44] last_staff: has joined #ruby
[08:45:09] hotpancakes: has joined #ruby
[08:46:14] pandaant: has joined #ruby
[08:47:20] janmejay: has joined #ruby
[08:48:35] janmejay: help me at https://gist.github.com/anonymous/1be62b4d39e286c9fac9
[08:49:43] janmejay: when i run thi file without argument it runs successfully but when i give arguments it throwa error
[08:50:25] janmejay: anyone there?
[08:50:26] sp4rrow: has joined #ruby
[08:51:01] malademental: that works ljarvis , thanks!
[08:51:41] AlexJakeGreen: ljarvis, >> print "Hello world!"; print "\b"*3
[08:52:00] aupadhye: has joined #ruby
[08:52:04] LaT0rtue: has joined #ruby
[08:52:13] AlexJakeGreen: sorry, malademental
[08:52:34] M-mistake: has joined #ruby
[08:53:09] ferr: has joined #ruby
[08:55:00] binaryplease: has joined #ruby
[08:55:41] tristanp: has joined #ruby
[08:55:58] Gasher: has joined #ruby
[08:56:05] dgncn: has joined #ruby
[08:56:47] Gasher: has joined #ruby
[08:57:26] binaryplease: has joined #ruby
[08:58:35] drewo: has joined #ruby
[08:58:42] agent_white: has joined #ruby
[09:00:03] araujo: has joined #ruby
[09:01:15] AlexJakeGreen: janmejay, it's because 'gets' returns the next line from the current file in ARGF http://ruby-doc.org/core-2.0.0/ARGF.html
[09:01:23] araujo: has joined #ruby
[09:01:38] the_drow: has joined #ruby
[09:01:47] auzty: has joined #ruby
[09:02:24] anisha: has joined #ruby
[09:02:59] AlexJakeGreen: use STDIN.gets.chomp
[09:06:40] ssiris: has joined #ruby
[09:08:04] boontdustie: has joined #ruby
[09:08:20] evidex: has joined #ruby
[09:13:06] al2o3-cr: has joined #ruby
[09:13:37] futilegames: has joined #ruby
[09:14:51] SegFaultAX: has joined #ruby
[09:17:19] alem0lars: has joined #ruby
[09:17:46] sepp2k: has joined #ruby
[09:17:59] Klumben: has joined #ruby
[09:18:44] workmad3: has joined #ruby
[09:19:01] Karix: has joined #ruby
[09:22:51] marcoecc: has joined #ruby
[09:24:00] platzhirsch: has joined #ruby
[09:24:58] hotpancakes: has joined #ruby
[09:26:30] lxsameer: has joined #ruby
[09:27:22] fexilal: has joined #ruby
[09:27:25] troulouliou_div2: has joined #ruby
[09:29:17] Spami: has joined #ruby
[09:30:08] the_drow: has joined #ruby
[09:30:23] hays: has joined #ruby
[09:31:04] Gasher: has joined #ruby
[09:31:12] madgen_: has joined #ruby
[09:35:20] sp4rrow: has joined #ruby
[09:35:54] Gasher: has joined #ruby
[09:37:08] ByronJohnson: has joined #ruby
[09:37:49] Moosashi: has joined #ruby
[09:37:56] TinkerTyper: has joined #ruby
[09:38:00] hays: has joined #ruby
[09:38:24] M-shine: has joined #ruby
[09:38:34] kies: has joined #ruby
[09:38:50] stannard: has joined #ruby
[09:41:20] zeroDivisible: has joined #ruby
[09:42:17] snowy: has joined #ruby
[09:46:13] marr: has joined #ruby
[09:47:03] dtzuzu: has joined #ruby
[09:48:46] baweaver: has joined #ruby
[09:49:38] zadrot_ebaniy: has joined #ruby
[09:50:58] lxsameer: has joined #ruby
[09:50:58] lxsameer: has joined #ruby
[09:54:35] davidblko: has joined #ruby
[09:55:47] mrgrieves: has joined #ruby
[09:56:07] jmorgado: has joined #ruby
[09:57:00] RobertBirnie: has joined #ruby
[09:57:06] araujo: has joined #ruby
[09:57:13] noway: has joined #ruby
[09:58:33] araujo: has joined #ruby
[10:00:19] alxgsv: has joined #ruby
[10:02:52] last_staff: has joined #ruby
[10:03:52] pawnbox: has joined #ruby
[10:05:38] atmosx: Hello, I'm playing with ruby threads. I have a code that does what I do, but it's not dynamic enough. I need to stop generating new threads when 'something happens' (e.g. I get an http req == '404') https://gist.github.com/atmosx/9afd96911515fc60ee4e ... but I'm not sure how to go about this. I'm thinking about a "loop do [...] break ... [...] end" but even that isn't clear enough in my mind and doesn't seem clear/good as a solution. I don't like using
[10:05:38] atmosx: break for anything.
[10:05:47] atmosx: any ideas/thoughts welcome
[10:06:19] hotpancakes: has joined #ruby
[10:09:18] mfaeh: has joined #ruby
[10:09:18] chipotle: has joined #ruby
[10:16:25] bkxd: has joined #ruby
[10:18:37] roshanavand: has joined #ruby
[10:21:14] mikecmpbll: has joined #ruby
[10:21:49] mrgrieves: has joined #ruby
[10:24:25] dtzuzu: has joined #ruby
[10:24:30] hotpancakes: has joined #ruby
[10:26:22] htmldrum: has joined #ruby
[10:26:23] htmldrum_: has joined #ruby
[10:27:25] RobertBirnie: has joined #ruby
[10:28:11] blackmesa: has joined #ruby
[10:30:35] wethu: has joined #ruby
[10:30:48] DanielJack: How do I get [1,2,3] + [5,6,7] = [[1,5], [2, 6], [3, 7]]?
[10:32:05] apeiros: >> [1,2,3].zip([5,6,7])
[10:32:06] ruby[bot]: apeiros: # => [[1, 5], [2, 6], [3, 7]] (https://eval.in/544103)
[10:32:53] User458764: has joined #ruby
[10:35:07] uglybandersnatch: has joined #ruby
[10:38:48] al2o3-cr: has joined #ruby
[10:39:05] madgen_: has joined #ruby
[10:42:57] weeperscreepers: has joined #ruby
[10:43:12] pawnbox: has joined #ruby
[10:44:01] FooMunki: has joined #ruby
[10:44:22] LaT0rtue: has joined #ruby
[10:45:21] weeperscreepers: using serverspec, I defined some custom resource to describe a particular type of file and some of it's attributes (it exists, type of content, etc) but now I'm having an issue, which is, in production, before any of the commands I need to run can be successfully executed, I need to perform some authentication with kerberos. I know how to do this part, my question is - what's the cleanest / correct-m
[10:45:27] weeperscreepers: ost way of plugging the authentication before any command in my custom resource type is run?
[10:45:57] dvinciguerra__: has joined #ruby
[10:46:39] the_drow: has joined #ruby
[10:46:44] drewo: has joined #ruby
[10:47:23] pdimqh: has joined #ruby
[10:49:13] agit0: has joined #ruby
[10:50:20] tvw: has joined #ruby
[10:52:48] mdw: has joined #ruby
[10:53:48] n008f4g_: has joined #ruby
[10:54:43] big|bad|wolf: has joined #ruby
[10:56:18] ytti: has joined #ruby
[10:56:21] mrgrieves: has joined #ruby
[10:58:51] skade: has joined #ruby
[11:03:51] trinaldi: has joined #ruby
[11:05:56] hotpancakes: has joined #ruby
[11:06:21] avenj: has joined #ruby
[11:06:54] sandstrom: has joined #ruby
[11:08:14] madgen_: has joined #ruby
[11:09:09] benlovell: has joined #ruby
[11:09:24] weckl: has joined #ruby
[11:09:34] freerobby: has joined #ruby
[11:12:00] dtzuzu: has joined #ruby
[11:13:35] RobertBirnie: has joined #ruby
[11:16:21] bronson: has joined #ruby
[11:21:15] TomyLobo: has joined #ruby
[11:22:38] ghormoon: has left #ruby: ("Leaving")
[11:23:29] johnmilton: has joined #ruby
[11:24:17] hahuang61: has joined #ruby
[11:24:39] hotpancakes: has joined #ruby
[11:25:38] DarkBushido: has joined #ruby
[11:25:38] DarkBushido: has joined #ruby
[11:26:52] que: has joined #ruby
[11:26:53] uglybandersnatch: has joined #ruby
[11:27:10] que: how can i replace one character in multiline string that i wont delete others ?
[11:27:29] que: one last character *
[11:29:12] hiyosi: has joined #ruby
[11:30:35] Apocalypse: has joined #ruby
[11:30:39] tobiasvl: que: what do you mean by "one last character"? the last character in the string?
[11:31:26] que: i want to remove last character in string, and it is multiline.
[11:31:48] djellemah: atmosx: Thread#value will give back the last value in the thread block, or re-raise any exception. That might help structure your code.
[11:32:23] que: tobiasvl: and i want to remove "," character that is last here http://paste.ofcode.org/4jyLurVKcetwEFPxYTWjSp
[11:33:37] tobiasvl: >> 'abc'[-1] = ''
[11:33:38] ruby[bot]: tobiasvl: # => "" (https://eval.in/544198)
[11:33:49] tobiasvl: >> a = 'abc'; a[-1] = ''; puts a
[11:33:50] ruby[bot]: tobiasvl: # => ab ...check link for more (https://eval.in/544199)
[11:35:21] Gasher: hello. is there a way to make integers display in hexadecimal instead of decimal in Ruby? even if I wrote something like "num=ff" it just returns 255 and the only way for me to even see hexadecimals is "num.to_s(16)"
[11:35:23] sdothum: has joined #ruby
[11:35:52] FooMunki: has joined #ruby
[11:36:04] que: tobiasvl: so simple thx man
[11:36:43] but3k4: has joined #ruby
[11:36:52] tobiasvl: que: if you only want to do it if it's a comma you'll have to add checks, and maybe regex is a way to deal with more complicated cases, but there's nothing special about multiline strings at least
[11:38:30] oddmunds: >> "abc,\ndef,".sub(/,\z/m,'')
[11:38:38] but3k4: has joined #ruby
[11:38:46] apeiros: >> "%04x" % 255 # Gasher
[11:38:48] ruby[bot]: apeiros: # => "00ff" (https://eval.in/544207)
[11:39:14] apeiros: and yes, to_s(16) is another way
[11:39:34] oddmunds: how come my thing didn't output?
[11:40:10] apeiros: //m is only affecting .
[11:40:18] apeiros: if you don't have . in your regex, //m is pointless
[11:40:42] drewo: has joined #ruby
[11:41:00] oddmunds: ah, thanks. i thought it meant that it saw the whole multiline string as one, instead of many individual strings.
[11:41:06] apeiros: and ruby[bot] requires you to be registered in order to use several of its commands
[11:41:10] oddmunds: makes sense
[11:41:47] oddmunds: anyway, que, tobiasvl, the regex above (with or without /m) removes a trailing comma if there is one
[11:42:00] apeiros: no, regexen always affect the whole string. but . will not match newlines without the m-flag
[11:42:22] oddmunds: i understand
[11:46:24] woodruffw: has joined #ruby
[11:46:54] woodruffw: has joined #ruby
[11:48:45] adaedra: apeiros: bot down
[11:48:54] tobiasvl: bot is kill
[11:49:40] apeiros: experimentation time
[11:49:46] baweaver: has joined #ruby
[11:52:20] ldnunes: has joined #ruby
[11:53:06] noService: has joined #ruby
[11:54:51] Gasher: I thought String would inherit from Array in Ruby, but that's not the case apparently... can I do an "unshift" on a String in an easier way than converting it to an array and then back to a string?
[11:55:21] ruby[bot]: has joined #ruby
[11:55:21] ChanServ: +o ruby[bot]
[11:55:24] andywojo: has joined #ruby
[11:55:38] benlovell: has joined #ruby
[11:56:27] tobiasvl: Gasher: string = 'a' + string
[11:56:34] apeiros: >> str = "foo"; str[0,0] = "x"; str
[11:56:38] ruby[bot]: apeiros: # => "xfoo" (https://eval.in/544215)
[11:56:49] Gasher: well, works too tobiasvl
[11:57:05] oddmunds: most idomatic way would be "#{a}#{string}"?
[11:57:06] joonty: has joined #ruby
[11:57:19] adaedra: >> a = "foo"; a.insert 0, 'x'; a
[11:57:20] ruby[bot]: adaedra: # => "xfoo" (https://eval.in/544216)
[11:58:09] tobiasvl: https://en.wikipedia.org/wiki/There%27s_more_than_one_way_to_do_it
[11:58:44] godzillaenlacasa: has joined #ruby
[11:58:47] adaedra: well, we have many ways now, time to BENCHMARK
[11:58:50] Gasher: I think insert works best, thanks
[11:59:17] mrmortondk: has joined #ruby
[12:00:36] th0m_: has joined #ruby
[12:00:45] oddmunds: as long as speed is what you're going for, https://github.com/JuanitoFatas/fast-ruby is pretty interesting
[12:01:07] adaedra: Too bad it's not updated for 2.3
[12:02:30] rickmasta: has joined #ruby
[12:02:45] gregf_: *wonders if unshift is the right term.. one would prefer prepend?*
[12:03:29] gregf_: its just string concatenation after all... feels theres better code to think about and write than concatenating strings *weeps and hides*
[12:03:44] noService: has joined #ruby
[12:03:51] tobiasvl: _why would also weep at this discussion
[12:04:08] Vile`: has joined #ruby
[12:04:41] jmorgado: has joined #ruby
[12:06:13] benlovel1: has joined #ruby
[12:06:20] hotpancakes: has joined #ruby
[12:08:00] AlexRussia: has joined #ruby
[12:09:54] roshanavand1: has joined #ruby
[12:09:56] apeiros: gregf_: I think people didn't catch on to your hint :)
[12:10:08] apeiros: >> foo = "foo"; foo.prepend "x"
[12:10:10] ruby[bot]: apeiros: # => "xfoo" (https://eval.in/544230)
[12:10:19] apeiros: only in newer rubies, though. I keep forgetting about it.
[12:11:13] benlovell: has joined #ruby
[12:11:46] benlovell: has joined #ruby
[12:12:04] mrgrieve1: has joined #ruby
[12:13:31] quazimodo: has joined #ruby
[12:13:34] moeabdol1: has joined #ruby
[12:14:17] roshanavand__: has joined #ruby
[12:14:29] Gooer: has joined #ruby
[12:15:22] htmldrum: has joined #ruby
[12:15:23] htmldrum_: has joined #ruby
[12:17:17] bkxd: has joined #ruby
[12:17:52] allcentury: has joined #ruby
[12:18:48] al2o3-cr: has joined #ruby
[12:19:07] Guest51402: has joined #ruby
[12:25:27] hotpancakes: has joined #ruby
[12:27:23] al2o3-cr: has joined #ruby
[12:27:56] Yiota_: has joined #ruby
[12:27:57] darkxploit: has joined #ruby
[12:32:00] aupadhye: has joined #ruby
[12:33:46] Macaveli: has joined #ruby
[12:34:09] krz: has joined #ruby
[12:34:52] gregf_: apeiros: heh
[12:34:56] sudoubuntu: has joined #ruby
[12:35:04] gregf_: nor did i *runs*
[12:35:05] y0da: has joined #ruby
[12:36:21] apeiros: gregf_: lol, really? :D
[12:38:09] gregf: has joined #ruby
[12:38:25] rickmasta: has joined #ruby
[12:39:11] al2o3-cr1: has joined #ruby
[12:39:18] htmldrum: has joined #ruby
[12:39:19] htmldrum_: has joined #ruby
[12:40:37] CloCkWeRX: has joined #ruby
[12:41:28] pawnbox: has joined #ruby
[12:42:15] pawnbox: has joined #ruby
[12:49:06] but3k4: has joined #ruby
[12:49:25] User458764: has joined #ruby
[12:49:40] sinanislekdemir: has joined #ruby
[12:50:21] Gooer: has joined #ruby
[12:50:50] myntcake: has joined #ruby
[12:51:34] malconis: has joined #ruby
[12:51:36] kam270: has joined #ruby
[12:52:47] madgen_: has joined #ruby
[12:53:15] kam270: has joined #ruby
[12:54:46] kam270: has joined #ruby
[12:55:15] malconis: has joined #ruby
[12:55:19] graffix: has joined #ruby
[12:55:51] blandflakes: has joined #ruby
[12:56:59] unl0ckd: has joined #ruby
[12:57:02] kam270: has joined #ruby
[12:57:38] ChiefAlexander: has joined #ruby
[12:57:52] Xeago: has joined #ruby
[12:58:14] Infra-Red: has joined #ruby
[12:58:35] GodFather: has joined #ruby
[12:58:44] kam270: has joined #ruby
[12:59:20] Xeago: has joined #ruby
[12:59:30] ChiefAlexander: has joined #ruby
[13:00:17] andywojo: has joined #ruby
[13:01:09] LaT0rtue: has joined #ruby
[13:01:28] sgambino: has joined #ruby
[13:02:03] dtzuzu: has joined #ruby
[13:06:52] jdawgaz: has joined #ruby
[13:06:54] hotpancakes: has joined #ruby
[13:08:04] jdawgaz: has joined #ruby
[13:08:15] jottr: has joined #ruby
[13:09:15] graffix: has left #ruby: ()
[13:10:01] merida: has joined #ruby
[13:10:11] mhenson: has joined #ruby
[13:12:51] BSaboia: has joined #ruby
[13:14:22] decoponio: has joined #ruby
[13:14:39] valetudo: has joined #ruby
[13:14:51] mhenson: how can I get rbenv-vars working with rake tasks? Currently got rbenv-vars working in multiple environments (dev, test, staging, prod) and it works perfectly fine with Spring for tests. When I attempt to run a rake task, the ENV hash is empty. Any ideas on what I am missing?
[13:16:54] bronson: has joined #ruby
[13:17:11] allcentury: has joined #ruby
[13:17:58] joonty: has joined #ruby
[13:21:55] soc42: has joined #ruby
[13:22:24] neilhwatson: has joined #ruby
[13:25:38] hotpancakes: has joined #ruby
[13:28:49] joconcepts: has joined #ruby
[13:29:53] kobain: has joined #ruby
[13:30:22] swills: has joined #ruby
[13:30:43] kobain: has joined #ruby
[13:32:07] platzhirsch: has left #ruby: ()
[13:34:44] hxegon: has joined #ruby
[13:35:04] GodFodder: has joined #ruby
[13:35:34] apes: has joined #ruby
[13:35:49] GodFodder: has joined #ruby
[13:36:35] millerti: has joined #ruby
[13:37:01] Ropeney: has joined #ruby
[13:37:52] yekta: has joined #ruby
[13:37:52] ChiefAlexander: has joined #ruby
[13:38:29] dede: has joined #ruby
[13:39:33] yekta: Hello, if I have begin; file = File.open(filepath); file.close; rescue; raise SomeError; end, will that leave a possibility for file objects that weren’t closed lingering in memory and never being garbage collected?
[13:40:24] apeiros: yekta: since you presumably do something between open and close - yes.
[13:40:36] uglybandersnatch: has joined #ruby
[13:40:41] apeiros: if you can, use open with a block. if you can't, put the close in an ensure.
[13:41:07] yekta: I know how to use an open block in python but not in Ruby, I’ll look that up
[13:42:23] yekta: The thing is, file.close inside the ensure was raising the error in the first place, if the file path/url doesn’t exist. I was trying to avoid that with a 404
[13:43:34] RegulationD: has joined #ruby
[13:43:50] jschoolcraft: has joined #ruby
[13:44:30] apeiros: yekta: block form has an example in the docs.
[13:44:41] yekta: yeah I see it now, thanks
[13:46:49] blackms: has joined #ruby
[13:47:05] Balzrael: has joined #ruby
[13:49:59] Bounga: has joined #ruby
[13:50:45] baweaver: has joined #ruby
[13:52:08] hotpancakes: has joined #ruby
[13:53:21] SShrike: has joined #ruby
[13:54:03] whippythellama: has joined #ruby
[13:54:23] andywojo: has joined #ruby
[13:58:13] bungoman: has joined #ruby
[13:58:16] davedev24: has joined #ruby
[13:58:51] lxsameer: has joined #ruby
[13:58:57] ixti: has joined #ruby
[13:59:52] schemanic: has joined #ruby
[14:00:10] lxsameer: has joined #ruby
[14:00:10] lxsameer: has joined #ruby
[14:01:16] lkba: has joined #ruby
[14:01:21] schemanic: Is there a way to use an ambiguous identifier when getting a value out of a hash?
[14:01:42] apeiros: schemanic: I don't follow - care to elaborate?
[14:01:43] Gasher: hi everyone. I'm writing to a file with r+ permissions, but it just appends what I want to write instead of wiping the file and writing the thing
[14:01:58] Gasher: how to make it wipe the file and then write what I want to write?
[14:02:19] dhollinger: has joined #ruby
[14:02:32] haylon: has joined #ruby
[14:03:21] eam: Gasher: you can use File#truncate, or open it with mode O_TRUNC
[14:03:26] apeiros: Gasher: use w+ instead of r+. see IO.new for all modes.
[14:03:46] schemanic: apeiros - I have a 4 'level' hash. I want to get a specific 4th level descendant without having to iterate over 3rd level decendants
[14:03:53] Gasher: apeiros, thing is, I want to read from it, wipe it and write to it again
[14:04:00] schemanic: whats the pastebin of choice here?
[14:04:06] eam: Gasher: w+ is read/write
[14:04:33] Gasher: eam, and it also overwrites the file
[14:04:55] apeiros: schemanic: hash access is not iterating. you mean nested hash, right?
[14:04:56] schemanic: www.pastebin.com
[14:05:03] eam: Gasher: correct. the w/r/a stuff is from libc's f* family of functions and is a somewhat clumsy represenatation of what the system does
[14:05:06] schemanic: apeiros yes
[14:05:11] anisha: has joined #ruby
[14:05:20] eam: Gasher: I tend to avoid it and use the actual open flags instead
[14:05:36] havenwood: schemanic: gist.github.com
[14:05:46] schemanic: I want to be able to say hash[1][2][any of 3][specific 4]
[14:06:11] apeiros: schemanic: no can do. you'd have to implement that as a custom class. for that you'll have to iterate over 3rd level indeed.
[14:06:33] schemanic: CSS does stuff like that
[14:06:48] schemanic: I know its apples/oranges
[14:06:52] havenwood: schemanic: Does CSS work for what you're doing? Maybe use that?
[14:07:20] schemanic: havenwood - just stomping my foot. Thanks
[14:07:39] apeiros: schemanic: then implement a class which can be queried like css.
[14:08:42] schemanic: no no no. All I'm doing is expressing emotional content. I'm grateful for and accept your advice.
[14:08:58] blackmesa: has joined #ruby
[14:09:56] Gasher: it looks like truncate did the thing, thanks
[14:09:57] lyoshajapan: has joined #ruby
[14:10:47] Dysp: has joined #ruby
[14:11:12] shevy: schemanic css is quite nice especially when you dabble into some of the toolkits like ruby-gnome2... I'd wish all the styling would consistently be css rather than weird rcfiles (resource files)... not sure how much gtk3 improved on that but it makes me want to use css
[14:11:15] havenwood: schemanic: Should the [specific 4] return four values? Or is that something else?
[14:11:47] Dysp: Hey! I have a simple question. https://gist.github.com/anonymous/1419c67c73795b69f9ac Why am I getting a "false" when checking for '*.pdf', when there clearly is a pdf in the folder? Also, if I change the name without the asterix, it returns true.
[14:12:00] Dysp: I'm guessing that I don't understand the proper use of asterixes.
[14:12:15] havenwood: schemanic: If it's multiple values you're returning there's Hash#values_at for that part.
[14:12:16] schemanic: havenwood - no. [specific 4] is a key that I know, but I don't know which parent it has and I don't want to iterate over the keys at level 3
[14:12:18] apeiros: Dysp: Array#include? does not do any glob expansion
[14:12:24] havenwood: schemanic: Ah, gotcha.
[14:12:32] Dysp: Glob expansion? :P
[14:12:45] apeiros: *.pdf is a glob expression
[14:13:12] apeiros: but you have an array of strings, and that tests for ==, and you don't have a string "*.pdf" in your array.
[14:13:23] Dysp: That is true.
[14:13:49] aufi: has joined #ruby
[14:13:54] apeiros: you can use .any? with File.fnmatch
[14:14:21] Dysp: I've tried fnmatch, but didnt do any better with that. Ill have another go at it
[14:14:44] apeiros: well, you can gist your fnmatch code and we can tell you what you did wrong.
[14:14:53] Dysp: True story :P
[14:14:58] floatingpoint: has joined #ruby
[14:16:26] Dysp: File.fnmatch('*.pdf', './')
[14:16:37] Dysp: Would that be correct? It's not, though :p
[14:17:06] apeiros: that will test whether './' (the string, not the directory) matches the "*.pdf" glob, so no
[14:17:26] apeiros: >> File.fnmatch("*.pdf", "tester.pdf")
[14:17:27] ruby[bot]: apeiros: # => true (https://eval.in/544332)
[14:17:32] apeiros: that's how it is used.
[14:17:47] manveru: any idea when Gem.available? was removed?
[14:17:57] apeiros: hence I said "use any? with File.fnmatch"
[14:18:02] bkxd: has joined #ruby
[14:18:29] Dysp: I guess my question then is.. How do I search a directory to see if it contains files of a certain extension?
[14:19:06] apeiros: a) use use Dir.glob right away, or b) you use your current code with Dir.entries, and test the array of strings with .any? and File.fnmatch.
[14:21:06] Dysp: I guess the "glob" method (is that correct?) is what I was searching for all along
[14:21:14] Dysp: Thank you very much. Ill return if I can't get it to work
[14:21:42] shevy: he may never be back now :(
[14:21:44] schemanic: I'm working on someone else's code and I'm seeing a variable as the last line of a method before 'end' - this is a return statement without the keyword yes?
[14:21:58] shevy: schemanic yea
[14:22:09] schemanic: Thanks. I wasn't sure
[14:22:33] blackjid: has joined #ruby
[14:22:52] apeiros: schemanic: all expressions in ruby evaluate to the last expression within it. methods too.
[14:22:56] drewo: has joined #ruby
[14:22:57] rbennacer: has joined #ruby
[14:22:59] apeiros: >> def foo; "hello"; end; foo
[14:23:00] ruby[bot]: apeiros: # => "hello" (https://eval.in/544334)
[14:23:15] apeiros: >> (1; 2; 3)
[14:23:17] ruby[bot]: apeiros: # => 3 (https://eval.in/544335)
[14:23:28] manveru: >> def foo; end
[14:23:30] ruby[bot]: manveru: # => :foo (https://eval.in/544336)
[14:23:36] rbennacer: has joined #ruby
[14:23:49] bry4n_: has joined #ruby
[14:24:35] jpoole: has left #ruby: ()
[14:24:38] djellemah: >> ha = {one: 1, two: 2, tre: 3}; ha.each{|k,v| break v if k == :two}
[14:24:40] ruby[bot]: djellemah: # => 2 (https://eval.in/544337)
[14:25:09] fdfmxs: has joined #ruby
[14:25:15] apeiros: that's a rather poor implementation of hash.fetch(key, hash) :-p
[14:25:57] cdg: has joined #ruby
[14:26:01] Spami_: has joined #ruby
[14:28:45] graffix: has joined #ruby
[14:30:33] Gooer: has joined #ruby
[14:31:36] freerobby: has joined #ruby
[14:32:03] Rubie: has joined #ruby
[14:34:34] ChiefAlexander: has joined #ruby
[14:34:46] benlovell: has joined #ruby
[14:35:17] BackEndCoder: has joined #ruby
[14:35:52] JakFrist: has joined #ruby
[14:36:48] tlaxkit: has joined #ruby
[14:41:30] axl_: has joined #ruby
[14:42:00] cpup: has joined #ruby
[14:42:10] smathy: has joined #ruby
[14:42:17] merida: has joined #ruby
[14:42:25] User458764: has joined #ruby
[14:44:16] dhollinger: has joined #ruby
[14:44:40] tvon: has joined #ruby
[14:45:04] idletask: has joined #ruby
[14:48:32] andywojo: has joined #ruby
[14:48:47] merida_: has joined #ruby
[14:50:59] rippa: has joined #ruby
[14:51:58] mhenson: has joined #ruby
[14:55:41] _stu_: has joined #ruby
[14:56:24] djellemah: apeiros: Sure is. But break has return-like semantics in a block...
[14:56:24] graffix: has joined #ruby
[14:56:29] djellemah: >> def meth; rv = [1,2].each{|i| break :early; :later }; [rv, :value] end; meth
[14:56:31] ruby[bot]: djellemah: # => [:early, :value] (https://eval.in/544372)
[14:56:37] andikr: has joined #ruby
[14:56:50] graffix: has left #ruby: ()
[14:57:10] apeiros: djellemah: I know. it's still a poor (re-)implementation of hash.fetch(key, hash)
[14:57:16] Xeago: has joined #ruby
[14:57:19] greynetic: has joined #ruby
[14:57:41] apeiros: if it didn't have return-like semantics, it'd just be equivalent to `hash`.
[14:57:46] greynetic: has joined #ruby
[15:01:23] jottr: has joined #ruby
[15:01:39] blackmesa: has joined #ruby
[15:03:24] Dysp: apeiros: I have another question for you!
[15:05:09] Dysp: https://gist.github.com/anonymous/64bede133d8057881071 - This works fine.
[15:06:15] Dysp: https://gist.github.com/anonymous/559761b19b5c7ec45460 - This doesnt work.
[15:06:23] apeiros: uuugh, you do know that $vars are globals, yes?
[15:07:03] apeiros: also, if you name your files *.rb in gist, we get highlighted code.
[15:07:05] marxarelli: has joined #ruby
[15:07:29] Dysp: I thought I did. Okay, wait.
[15:07:32] apeiros: and last but not least "does not work" is not a problem description (unless you intend to pay me by the hour - then I'll happily spend as much time as it takes to figure out what you could possibly mean by it)
[15:07:37] ja: Danish variable names, fuck yeah!
[15:07:41] apeiros: you can just update the existing gist
[15:07:59] Dysp: It has been done without a user. Im at work.
[15:08:05] cpup: has joined #ruby
[15:08:18] Dysp: Well, that global variabal was the only way that it would pass into the function.
[15:08:24] apeiros: iirc as long as you keep the session open you can still edit
[15:08:26] RIK: is there a padrino irc channel?
[15:08:39] RIK: or did they move entirely over to gitter?
[15:08:39] Dysp: I tried with @, but didn't seem to work.
[15:08:55] apeiros: methods don't care how you pass values to them. so no, that's not a reason to use globals.
[15:09:25] zast: has joined #ruby
[15:09:48] Alina-malina: has joined #ruby
[15:09:51] Amnez777: has joined #ruby
[15:10:04] Dysp: Hm. But before I defined a var outside a function and it didn't pass into it.
[15:10:14] Dysp: When I changed it to global or whatevs, then it worked.
[15:10:29] Alina-malina: has joined #ruby
[15:11:17] apeiros: you'll have to be more specific. but I can already tell you that that's not how scoping works.
[15:11:46] Dysp: I'm sure it doesn't. I'm learning here.
[15:11:51] rigsby: has joined #ruby
[15:12:21] apeiros: sure, and if I get a proper description of what doesn't work, I'll help you learn. until then - nothing I can/want to do
[15:12:37] neohunter: has joined #ruby
[15:12:59] bweston92: has joined #ruby
[15:13:10] Dysp: Yes. Sure. Im trying things out :p
[15:15:14] Amnez777: has joined #ruby
[15:16:08] baweaver: has joined #ruby
[15:16:26] djellemah: Dysp: http://www.sitepoint.com/understanding-scope-in-ruby/
[15:17:04] Dysp: Ill bookmark it for later, thank you.
[15:17:30] drewo: has joined #ruby
[15:18:46] bronson: has joined #ruby
[15:19:36] Aswebb_: has joined #ruby
[15:19:36] Dysp: Okay, apeiros
[15:19:37] Dysp: https://gist.github.com/anonymous/037b586feb895ceb7e9d
[15:19:42] Dysp: I've put the return in the bottom
[15:19:58] freerobby: has joined #ruby
[15:20:18] Dysp: https://gist.github.com/anonymous/62f33e11e9cd072f2ae3
[15:20:32] ghr: String#slice! returns the deleted part of the string
[15:20:49] ghr: so you're ending up with:
[15:20:57] ghr: Prawn::Document.generate(".xlsx" + ".pdf")
[15:21:01] Dysp: Exactly.
[15:21:16] Dysp: I've also tried the other way around, with slice!
[15:21:26] mtkd: has joined #ruby
[15:21:59] ghr: You need to do:
[15:22:00] ghr: $excel_name.slice!(".xlsx")
[15:22:00] ghr: Prawn::Document.generate($excel_name + ".pdf") do
[15:22:22] Dysp: Why can't I do it inside the generate?
[15:22:32] ghr: because slice! returns the deleted portion of the string
[15:22:37] hotpancakes: has joined #ruby
[15:22:50] Dysp: Problem is - I need $excel_name to run the calculation I am also doing
[15:23:05] chouhoulis: has joined #ruby
[15:23:24] ghr: Just use File.basename instead http://ruby-doc.org/core-2.1.0/File.html#method-c-basename
[15:23:27] jottr: has joined #ruby
[15:23:41] mistermo_: has joined #ruby
[15:23:52] Dysp: I've tried doing like filename = $excel_name.slice...
[15:23:58] Ropeney: has joined #ruby
[15:24:20] Dysp: But that seems to break the whole thing; I am not quite sure why, though. I guess it slices the $excel_name also.
[15:24:42] Marsupermammal: has joined #ruby
[15:24:56] Dysp: I could use basename, however I already have the name loaded in the string.
[15:25:36] apeiros: >> name = "foo.xlsx"; return_value = name.slice(".xslx"); {name: name, return_value: return_value}
[15:25:37] ruby[bot]: apeiros: # => {:name=>"foo.xlsx", :return_value=>nil} (https://eval.in/544396)
[15:25:49] teoric: has joined #ruby
[15:25:55] apeiros: >> name = "foo.xlsx"; return_value = name.slice!(".xslx"); {name: name, return_value: return_value}
[15:25:57] ruby[bot]: apeiros: # => {:name=>"foo.xlsx", :return_value=>nil} (https://eval.in/544397)
[15:26:09] apeiros: wait what, did I typo?
[15:26:46] sgambino: has joined #ruby
[15:26:46] apeiros: >> name = "foo.xlsx"; return_value = name.slice(".xlsx"); {name: name, return_value: return_value}
[15:26:47] ruby[bot]: apeiros: # => {:name=>"foo.xlsx", :return_value=>".xlsx"} (https://eval.in/544398)
[15:26:53] nugit: has joined #ruby
[15:26:53] apeiros: >> name = "foo.xlsx"; return_value = name.slice!(".xlsx"); {name: name, return_value: return_value}
[15:26:55] ruby[bot]: apeiros: # => {:name=>"foo", :return_value=>".xlsx"} (https://eval.in/544399)
[15:27:05] dgncn: has joined #ruby
[15:27:06] apeiros: Dysp: compare how the two methods work
[15:27:32] barajasfab: has joined #ruby
[15:28:13] Dysp: That sure explains why I get what I get.
[15:28:53] madgen_: has joined #ruby
[15:29:06] chouhoulis: has joined #ruby
[15:29:19] andrewvos: has joined #ruby
[15:29:37] pandaant: has joined #ruby
[15:29:41] mostlybadfly: has joined #ruby
[15:30:21] brendan-: has joined #ruby
[15:31:35] TomyLobo: has joined #ruby
[15:32:51] jottr: has joined #ruby
[15:33:26] drewo: has joined #ruby
[15:33:34] rkazak: has joined #ruby
[15:34:11] Devalo: has joined #ruby
[15:36:18] elifoster: has joined #ruby
[15:38:16] maokomioko: has joined #ruby
[15:39:18] nando293921: has joined #ruby
[15:39:28] ensyde_: has joined #ruby
[15:39:55] evidex: has joined #ruby
[15:40:07] maokomioko: has joined #ruby
[15:40:10] Xeago: has joined #ruby
[15:41:47] valetudo: has joined #ruby
[15:43:04] andywojo: has joined #ruby
[15:43:06] evidex: has joined #ruby
[15:43:17] diegoaguilar: has joined #ruby
[15:44:07] pelegreno: has joined #ruby
[15:44:20] Amnez777: has joined #ruby
[15:44:46] sgambino: has joined #ruby
[15:45:51] chipotle: has joined #ruby
[15:45:56] Alina-malina: has joined #ruby
[15:46:00] bluOxigen_: has joined #ruby
[15:46:05] cdg_: has joined #ruby
[15:46:35] Alina-malina: has joined #ruby
[15:47:40] hotpancakes: has joined #ruby
[15:48:13] tvw: has joined #ruby
[15:48:46] pelegreno: has joined #ruby
[15:48:50] bkxd: has joined #ruby
[15:49:14] x77686d: has joined #ruby
[15:49:14] mistermo_: has joined #ruby
[15:49:23] ivanskie: has joined #ruby
[15:49:43] xue: has joined #ruby
[15:50:16] x77686d: Is it the case that subclass methods can always access superclass fields? (via @some_superclass_var)
[15:51:05] noService: has joined #ruby
[15:52:25] evidex: has joined #ruby
[15:53:06] Rubie: has joined #ruby
[15:53:13] smathy: x77686d, yes.
[15:53:57] sandstrom: has joined #ruby
[15:54:02] Amnez777: has joined #ruby
[15:54:13] panic_: has joined #ruby
[15:54:45] siaW: has joined #ruby
[15:54:47] haylon: has joined #ruby
[15:56:14] hotpancakes: has joined #ruby
[15:56:17] mistermo_: has joined #ruby
[15:57:16] hotpanca_: has joined #ruby
[15:57:21] amclain: has joined #ruby
[15:57:45] pietr0: has joined #ruby
[16:00:16] shakes: has joined #ruby
[16:01:32] joconcepts: has joined #ruby
[16:02:52] bkxd: has joined #ruby
[16:03:06] Dimik: has joined #ruby
[16:03:17] joconcepts: has joined #ruby
[16:03:20] but3k4: has joined #ruby
[16:03:52] User458764: has joined #ruby
[16:05:46] al2o3-cr: has joined #ruby
[16:06:45] xue: has joined #ruby
[16:07:39] RobertBirnie: has joined #ruby
[16:08:17] xue: has joined #ruby
[16:08:55] d0nn1e: has joined #ruby
[16:09:37] blackmesa: has joined #ruby
[16:10:01] xue: has joined #ruby
[16:10:26] LaT0rtue_: has joined #ruby
[16:10:54] bkxd: has joined #ruby
[16:13:17] thoraxe: has joined #ruby
[16:13:49] thoraxe: hmm... trying to use middleman+asciidoc(tor) and having a hell of a time figuring out how to customize the template/generated output for stuff (titles/headings, specifically)
[16:15:07] benlieb: has joined #ruby
[16:15:33] andywojo: has joined #ruby
[16:16:41] cpup: has joined #ruby
[16:19:56] pawnbox: has joined #ruby
[16:21:25] ccc999: has joined #ruby
[16:21:40] dikaio: has joined #ruby
[16:21:53] drewo: has joined #ruby
[16:22:39] bronson: has joined #ruby
[16:22:43] brentw: had a question regarding opinions to solve a maze problem
[16:23:00] rcvalle: has joined #ruby
[16:23:00] dhollinger: has joined #ruby
[16:23:32] RegulationD: has joined #ruby
[16:23:40] brentw: the program gets a file as an input which has a maze, and then you must get through the maze, this is an example of what the input an d output should look like http://hastebin.com/banahicigi.mel
[16:24:06] tildes_: has joined #ruby
[16:24:37] joconcepts: has joined #ruby
[16:24:56] brentw: my initial thoughts was to make a multi-dimensional array w/ the lines and then write some logic to find the Starting spot and then make a move to an empty spot in the array
[16:25:22] dravine_: has joined #ruby
[16:25:26] brentw: wondering if that makes sense, or if there is a better way i should look into
[16:25:29] r1nuz: the most simple solution is 'touching a wall' on either the left side or the right side
[16:25:51] joconcepts: has joined #ruby
[16:25:58] r1nuz: https://en.wikipedia.org/wiki/Maze_solving_algorithm#Wall_follower
[16:26:35] al2o3-cr: has joined #ruby
[16:29:39] but3k4: has joined #ruby
[16:30:20] cschneid: has joined #ruby
[16:30:46] symm-: has joined #ruby
[16:30:49] rickmasta: has joined #ruby
[16:31:08] hotpancakes: has joined #ruby
[16:32:01] brentw: r1nuz, basically have it it always move along a wall, and change it's direction based on where the corner wall is located
[16:32:48] r1nuz: yeah, just always imagine having your left wall out touching the wall
[16:32:56] hotpancakes: has joined #ruby
[16:33:05] r1nuz: so when you hit a wall, move right so that your left hand touches that wall
[16:33:27] r1nuz: just start walking left until you hit a wall and follow that algo
[16:33:48] r1nuz: and whenever there is no wall to your left, move left to go around corners
[16:33:53] brentw: does breaking the lines into a multi dimensional array make sense? lines = File.readlines(file); maze = []; lines.each {|l| maze << [l]
[16:34:16] dravine: has joined #ruby
[16:34:18] r1nuz: i'm quite new to ruby, but usually a 2d array makes sense for this kind of thing yes
[16:34:59] brentw: cool. i'll give it a shot w/ that logic
[16:35:03] apeiros: brent_: I'd create a Maze class which contains a 2d array as you say to represent the maze itself, and an array of coordinates for your path and a couple of methods for navigating
[16:36:19] brentw: apeiros: like after breaking it into a 2d array, find all the empty spaces and add them to an array?
[16:36:28] brentw: is that waht you mean by and array of coordinates for your path?
[16:37:37] apeiros: I mean for you to draw those "X", you must keep track of where you move in your maze solving algorithm
[16:37:50] apeiros: and that movement I'd store in an array of coordinates
[16:38:02] snockerton: has joined #ruby
[16:39:02] r1nuz: brent_ note btw that this only works if all the walls are connected (no wall 'islands')
[16:39:03] Cohedrin: has joined #ruby
[16:39:27] apeiros: r1nuz: I think you can detect wall islands
[16:39:40] r1nuz: yeah you probably can with some extra logic
[16:39:50] apeiros: test whether you've visited a coordinate already ;-)
[16:39:58] r1nuz: that would be one simple way yeah
[16:40:04] r1nuz: helps if you already have that path array
[16:40:18] Cohedrin: has joined #ruby
[16:40:44] brentw: would you need to store positions you'e visited, if you've already marked them?
[16:41:01] brentw: couldn't you just check to make sure it's empty or not "x"
[16:41:07] shinnya: has joined #ruby
[16:41:54] merida: has joined #ruby
[16:41:57] Spami_: has joined #ruby
[16:41:57] apeiros: that's an option. I prefer to keep things separated.
[16:42:07] r1nuz: you could, i guess that's a matter of memory vs computation resources
[16:42:15] r1nuz: the one is more memory intensive (saving all visited fields)
[16:42:24] r1nuz: the other more computation intensive (searching field values in the 2d array)
[16:42:41] r1nuz: or well maybe, depends how you search
[16:42:46] LaT0rtue: has joined #ruby
[16:43:59] r1nuz: i would probably go with apeiros' suggestion, since you can then also keep the path ordered
[16:44:27] r1nuz: with step 1..n
[16:44:43] r1nuz: (eg, you can easily say, what was step 20)
[16:47:59] rbennacer: has joined #ruby
[16:48:04] PaulePanter: Hi. `ois.sum{|oi| oi["quantity"].to_i}`
[16:48:37] PaulePanter: Is there a better way, to deal with (a few) instances where `oi["quantity"]` is nil?
[16:48:45] skweek: has joined #ruby
[16:49:05] apeiros: given that you use .sum, I assume you're in rails, PaulePanter?
[16:49:30] apeiros: ruby 2.3 or older?
[16:50:00] PaulePanter: apeiros: Older. 2.1.
[16:50:11] apeiros: you should specify that. standard assumption is newest.
[16:50:22] PaulePanter: Sorry, I forgot that.
[16:50:23] apeiros: `ois.sum{|oi| oi["quantity"].try(:to_i) || 0}` then
[16:50:59] apeiros: assuming ois is actually an ARRelation, then I'd suggest to add a proper where clause, though.
[16:51:20] marr: has joined #ruby
[16:52:45] PaulePanter: apeiros: Thanks. In this case, `try()` shouldn’t be needed, as `to_i` is defined on `nil` in Rails, right?
[16:53:29] apeiros: oh, right. that's true. and it'll give zero anyway.
[16:53:39] PaulePanter: How would you do it in Ruby 2.3? ois.sum{|oi| oi["quantity"]&.(:to_i) || 0} ?
[16:53:40] apeiros: so… you don't actually need to change your code at all
[16:54:00] apeiros: I think I'd just keep it as your original code. in all rubies.
[16:54:17] PaulePanter: apeiros: Sorry for the misunderstanding. I know the code is correct, but wondered if I could get rid of the `to_i` to each element.
[16:54:29] renier: has joined #ruby
[16:55:00] apeiros: ah, quantity is already an integer and only there to handle nil? I see.
[16:55:13] sgambino: has joined #ruby
[16:55:22] apeiros: well, then the only improvement I see is excluding those records beforehand - e.g. as said via a proper where clause.
[16:55:40] PaulePanter: ois is a Hash.
[16:56:04] shevy: aptly named
[16:56:17] PaulePanter: Sorry, I think that was wrong.
[16:56:38] PaulePanter: I think I leave it as is.
[16:56:39] SCHAAP137: has joined #ruby
[16:56:55] rippa: has joined #ruby
[16:56:55] PaulePanter: ACTION tries to be more understandable next time.
[16:57:05] mikecmpbll: has joined #ruby
[16:57:11] smathy: ( oi["quantity"] || 0 ).to_i
[16:58:47] ljames: has joined #ruby
[16:59:02] apeiros: smathy: given that nil.to_i is 0, I think that's unnecessary
[16:59:06] ramfjord: has joined #ruby
[16:59:21] apeiros: I didn't think of it either on my first response :)
[17:00:01] Gasher: has joined #ruby
[17:04:04] helpa-bot: has joined #ruby
[17:04:34] Marsjan: has joined #ruby
[17:04:38] mistermo_: has joined #ruby
[17:04:47] haylon_: has joined #ruby
[17:04:57] boboc: has joined #ruby
[17:04:59] roelof: smathy: It seems that I have to use a if then clause with multiple puts
[17:05:08] err_ok_: has joined #ruby
[17:05:10] ItSANgo: has joined #ruby
[17:05:12] smathy: roelof, if you want to put up some code in a gist or something and ask specific questions we'll be happy to help.
[17:05:21] jord_: has joined #ruby
[17:05:26] _kfpratt: has joined #ruby
[17:06:11] matt_d_: has joined #ruby
[17:06:14] hahuang61: has joined #ruby
[17:06:23] itaipu: has joined #ruby
[17:06:25] bratchle1: has joined #ruby
[17:06:25] giraffe-: has joined #ruby
[17:06:28] DEac-_: has joined #ruby
[17:06:31] bjmllr_: has joined #ruby
[17:06:32] DarkBushido_: has joined #ruby
[17:06:36] llua`: has joined #ruby
[17:06:39] julieeharshaw: has joined #ruby
[17:06:41] danjack: has joined #ruby
[17:06:43] yokel_: has joined #ruby
[17:06:52] D9: has joined #ruby
[17:06:55] unsymbol_: has joined #ruby
[17:06:56] yeticry: has joined #ruby
[17:06:57] twistedpixels_: has joined #ruby
[17:07:14] saltsa_: has joined #ruby
[17:07:18] TvL: has joined #ruby
[17:07:19] soraher: has joined #ruby
[17:07:24] avenj_: has joined #ruby
[17:07:36] DanKnox: has joined #ruby
[17:07:36] demophoon: has joined #ruby
[17:07:36] cschneid_: has joined #ruby
[17:07:37] davedev24: has joined #ruby
[17:07:37] epochwolf|2: has joined #ruby
[17:07:37] Apocalyp-: has joined #ruby
[17:07:37] ELCALOR_: has joined #ruby
[17:07:38] dikaio_: has joined #ruby
[17:07:38] Steve_Jobs: has joined #ruby
[17:07:38] rvchangue_: has joined #ruby
[17:07:38] epochwolf|2: has joined #ruby
[17:07:38] Apocalyp-: has joined #ruby
[17:07:46] platzhirsch1: has joined #ruby
[17:07:47] ddv: has joined #ruby
[17:07:48] theRealAlexz: has joined #ruby
[17:07:48] theRealAlexz: has joined #ruby
[17:07:49] colegatron: has joined #ruby
[17:07:51] tekacs: has joined #ruby
[17:07:55] coffeejunk: has joined #ruby
[17:07:55] ceej: has joined #ruby
[17:07:56] teotwaki: has joined #ruby
[17:08:04] ELCALOR_: has joined #ruby
[17:08:05] greister: has joined #ruby
[17:08:06] patrick_star_2: has joined #ruby
[17:08:07] Phanes: has joined #ruby
[17:08:07] Phanes: has joined #ruby
[17:08:10] Rasi: has joined #ruby
[17:08:14] twe4ked: has joined #ruby
[17:08:19] armyriad: has joined #ruby
[17:08:23] ddfreyne_: has joined #ruby
[17:08:23] gaf_: has joined #ruby
[17:08:29] nchambers: has joined #ruby
[17:08:30] Seich: has joined #ruby
[17:08:44] JoL1hAHN: has joined #ruby
[17:08:53] shiver: has joined #ruby
[17:08:53] shiver: has joined #ruby
[17:09:00] Liam`: has joined #ruby
[17:09:05] Caelum_: has joined #ruby
[17:09:19] ctrlrsf: has joined #ruby
[17:10:21] rigsby: has joined #ruby
[17:10:28] weemsledeux: has joined #ruby
[17:10:35] varesa: has joined #ruby
[17:10:38] barajasfab: has joined #ruby
[17:11:12] varesa: has joined #ruby
[17:11:38] bkxd: has joined #ruby
[17:12:24] roelof: Is this a good solution : https://gist.github.com/rwobben/c967f46c2a0356b50f4bbf23abe1a1b5 or can I improve more ?
[17:12:29] moei: has joined #ruby
[17:12:49] itaipu: I'm struggling with something like perl -d , to try to debug https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=818260, I'm not a ruby expert, as you can see, but anyone can guide me to debug, since simple googling 'ruby debugger' is really shit
[17:12:52] elifoster: has joined #ruby
[17:12:52] but3k4: has joined #ruby
[17:13:18] eam: itaipu: try using pry
[17:14:26] baweaver: has joined #ruby
[17:14:34] Didac: has joined #ruby
[17:14:41] rickmasta: has joined #ruby
[17:14:42] Ox0dea: roelof: Whoops! "1 bottles of beer" is ungrammatical.
[17:14:57] alxndr: has joined #ruby
[17:15:17] sneakerhax: has joined #ruby
[17:15:17] roelof: Ox0dea: oke, I will try to find a solution for that one
[17:15:22] washt: has joined #ruby
[17:15:34] eam: roelof: consider 99.downto(1) { |bottles| }
[17:16:40] benlieb: has joined #ruby
[17:16:53] catbusters: has joined #ruby
[17:17:23] saneax_AFK: has joined #ruby
[17:17:30] angiebadillo: has joined #ruby
[17:17:32] rflot: has joined #ruby
[17:17:33] deeprave: has joined #ruby
[17:17:33] mroth: has joined #ruby
[17:17:43] blackjid: has joined #ruby
[17:17:59] nyandoge: has joined #ruby
[17:18:11] chrisseaton: has joined #ruby
[17:18:12] jxf: has joined #ruby
[17:18:30] Hanmac: has joined #ruby
[17:18:51] cardoni: has joined #ruby
[17:19:11] ramblinpeck: has joined #ruby
[17:19:16] manveru: has joined #ruby
[17:19:29] daxroc: has joined #ruby
[17:19:35] caw: has joined #ruby
[17:19:40] jimeh: has joined #ruby
[17:19:43] vcoinminer: has joined #ruby
[17:20:19] boxrick1: has joined #ruby
[17:20:33] jtoy: has joined #ruby
[17:20:48] smathy: roelof, but generally, yes, that's a good approach. You've not repeated the parts of the string that are common to all cases.
[17:21:13] akitada: has joined #ruby
[17:21:23] mrsolo: has joined #ruby
[17:21:23] bove: has joined #ruby
[17:21:27] daemonwrangler: has joined #ruby
[17:21:42] incomprehensibly: has joined #ruby
[17:22:02] smathy: roelof, consider moving your decrement up above the conditional, then you don't have to repeat the -1 stuff.
[17:22:08] jcp: has joined #ruby
[17:22:11] gheegh: has joined #ruby
[17:22:15] pmarreck: has joined #ruby
[17:22:27] brentw: if you don't do eam's downto, i would to bottle -=1 earlier so you don't have to keep doing #{bottles -1}
[17:22:31] kireevco: has joined #ruby
[17:22:45] brentw: smathy beat me to it
[17:22:50] roshanavand: has joined #ruby
[17:22:50] thesheff17: has joined #ruby
[17:22:58] choke: has joined #ruby
[17:23:26] Sadin: has joined #ruby
[17:23:48] smathy: :) I kicked myself after saying it too, should have just pointed to the repeated `bottle - 1` and let him work it out. So easy to forget how much fun it is to work that stuff out for yourself when you're starting off.
[17:23:51] amitchellbullard: has joined #ruby
[17:23:52] AdamMeghji: has joined #ruby
[17:23:58] siaW: has joined #ruby
[17:24:04] Ox0dea: roelof: Consider using a helper method to extract out all the "complexity" around the number of bottles.
[17:24:24] Ox0dea: Your solution contains 14 occurrences of "bottles"; I got mine down to 7. :P
[17:24:32] eam: bottle_msg_for(bottle_count)
[17:24:37] optimaleatscout: has joined #ruby
[17:24:59] RegulationD: has joined #ruby
[17:25:27] Ox0dea: ^ And you could use that to handle 0 and 1 specially all in one place.
[17:26:19] brentw: Ox0dea did you see my maze problem? http://hastebin.com/banahicigi.mel agree best way is to break the lines into a 2d array and then create logic for it to move along the wall?
[17:26:45] Ox0dea: brent_: It's the easiest approach, but there's all sorts of room for optimization.
[17:26:54] User458764: has joined #ruby
[17:27:15] itaipu: has joined #ruby
[17:27:23] brentw: is there an algorithm that i should maybe look into learning?
[17:27:25] roshanavand1: has joined #ruby
[17:27:28] brentw: that would be well used?
[17:27:49] User458764: has joined #ruby
[17:28:57] Ox0dea: brent_: Loads of fun and learning in here: https://qiao.github.io/PathFinding.js/visual/
[17:29:11] Ox0dea: The research term is "pathfinding".
[17:30:48] Ox0dea: In general, you want some fitness function for choosing which direction seems best to go in, and the ability to backtrack in case that doesn't play out.
[17:31:33] skweek: has joined #ruby
[17:31:50] brentw: i'll take a look
[17:31:56] roelof: how can I take this part out of x bottles of bear on the wall. x bottles of bear ?
[17:32:02] itaipu: eam: how do I set a break point, I'm running the script but it runs til the exception, I would like to set the bp in that line
[17:32:08] roelof: maybe a helper function /
[17:32:14] baweaver: has joined #ruby
[17:32:31] spider-mario: has joined #ruby
[17:33:36] eam: itaipu: binding.pry
[17:33:46] eam: http://yorickpeterse.com/articles/debugging-with-pry/
[17:33:48] smathy: roelof, well the "of beer" is common, but the "x bottle(s)" and where x is either a number or the string "no more" definitely screams out one or two helper methods.
[17:34:16] platzhirsch1: has left #ruby: ()
[17:34:20] jottr: has joined #ruby
[17:34:45] roelof: Oke, I was thinking of a helper function that checks if bottles are 1 or not
[17:34:59] Ox0dea: roelof: I guess your learning material hasn't addressed it, but there's a nifty syntax for simple conditionals: `condition ? if_true : if_false`.
[17:35:13] smathy: roelof, yep, good direction.
[17:35:21] eam: itaipu: if you're familiar with perl -d, it's like $DB::single = 1
[17:36:01] smathy: With or without the ternary, you can still have a helper that builds "bottle" or "bottles"
[17:36:02] Caelum: has joined #ruby
[17:36:19] gheegh: hey all, having a stupid little problem wtih ruby, Amazon's EMR, and my files stored on S3. The JSON files as pushed by Ruby don't have \n on them.. that means that the mapper merges them all together, and they are not pareable by the ruby mapper (invalid JSON). Without completely changing infrastructure, anyone have any suggestions? It's kinda a ruby question.. :-)
[17:36:35] RegulationD: has joined #ruby
[17:36:55] gheegh: i'm trying to avoid having ot change languages out of Ruby.. :-)
[17:37:28] bronson: has joined #ruby
[17:37:53] kent\n: has joined #ruby
[17:37:53] kent\n: has joined #ruby
[17:38:53] systemsgotyou: might be a long shot - but does anyone know of a program or maybe a lender site that could lend me $200/month for me to learn/code with the intention of getting a job within 6 months
[17:39:11] systemsgotyou: (then I pay them back + interest
[17:40:01] thoraxe: https://forum.middlemanapp.com/t/v3-asciidoc-asciidoctor-customized-generator-template-for-titles/2169/3?u=thoraxe hmm I'm really close here...
[17:42:25] uglybandersnatch: has joined #ruby
[17:42:48] smathy: systemsgotyou, https://www.lendingclub.com/ https://www.prosper.com/ ?
[17:43:35] mrgrieves: has joined #ruby
[17:45:05] tildes_: has joined #ruby
[17:45:36] ramfjord: has joined #ruby
[17:46:30] Suntzu: has joined #ruby
[17:46:35] camilasan: has joined #ruby
[17:47:32] CloCkWeRX: has joined #ruby
[17:49:14] dc2: has joined #ruby
[17:49:53] ivanskie: has joined #ruby
[17:50:52] Dimik: pry is awesome
[17:50:54] rolha: has joined #ruby
[17:52:05] dc2: has joined #ruby
[17:54:09] kirillzh: has joined #ruby
[17:54:26] weeperscreepers: has joined #ruby
[17:54:28] ytti: yeah should ship it with ruby standard
[17:54:31] ytti: like gem started
[17:54:46] ytti: pry is reason i converted one pythonista to ruby
[17:55:04] ytti: alas i think i've lost that person to golang since
[17:55:37] ytti: started my second golang project (1st one 2 years back) and ugh, it feels idiomatic golang favours long files, long methods
[17:55:48] ytti: lot of files in directory
[17:56:25] rbennacer: has joined #ruby
[17:56:35] ytti: i dislike how golang and python force filesystem structure to imply package/module structure
[17:56:51] ytti: i greatly feel that i can freely decide what is module/package and how the files are organized inside that
[17:57:24] apeiros: I find consistent mapping of modules/classes to files helpful
[17:57:31] apeiros: especially in large projects
[17:58:03] smathy: ...so does autoload.
[18:00:04] dmr8: has joined #ruby
[18:00:24] skweek: has joined #ruby
[18:00:45] blackjid: has joined #ruby
[18:01:54] shevy: autoload all the things
[18:01:55] ytti: apeiros, for corp stuff, i love to do "module company;class X....;end:End" without adding identation
[18:02:00] ytti: apeiros, to get own namespace
[18:02:08] ytti: apeiros, and being able to do taht in separate gems
[18:02:14] ytti: apeiros, in python/golang i can't do that
[18:02:40] shevy: hah I am guilty of that too
[18:02:45] ytti: apeiros, so forcing namespace == directory, to me, is too restrictive
[18:03:05] freerobby: has joined #ruby
[18:03:30] shevy: do you follow one class per .rb file ytti?
[18:04:01] blackmesa: has joined #ruby
[18:04:10] Es0teric: has joined #ruby
[18:04:17] drewo: has joined #ruby
[18:04:20] apeiros: ytti: I don't see how having to put Company::X into a file company/x.rb stops you from writing your code as "module Company;class X....;end;end"
[18:05:00] roelof: one thing I could not find . How can I do puts " #{bottles} and after the the call to count and then the rest of the sentence ?
[18:06:25] sdwrage: has joined #ruby
[18:06:35] llua: has joined #ruby
[18:06:38] shevy: is half of that sentence missing :)
[18:06:59] ytti: apeiros, no it does not, i'm saying you can't do that reasonably in python or golang
[18:07:35] ramfjord: has joined #ruby
[18:07:39] SCHAAP137: has joined #ruby
[18:07:45] apeiros: I think I miss your link to directory structure then.
[18:08:31] schemanic: has joined #ruby
[18:08:56] pikajude: has joined #ruby
[18:08:56] pikajude: has joined #ruby
[18:09:35] millerti: has joined #ruby
[18:10:11] skade: has joined #ruby
[18:10:30] IrishGringo: has joined #ruby
[18:10:43] B1n4r10: has joined #ruby
[18:11:05] lannonbr: has joined #ruby
[18:12:16] davee_: has joined #ruby
[18:12:26] bkxd: has joined #ruby
[18:14:11] baweaver: has joined #ruby
[18:14:15] codecop: has joined #ruby
[18:14:21] jrafanie: has joined #ruby
[18:14:46] n008f4g_: has joined #ruby
[18:15:22] araujo: has joined #ruby
[18:16:58] RobertBirnie: has joined #ruby
[18:17:42] troulouliou_div2: has joined #ruby
[18:18:16] sandelius: has joined #ruby
[18:20:09] baweaver: has joined #ruby
[18:24:38] dionysus69: has joined #ruby
[18:26:06] Macaveli: has joined #ruby
[18:27:02] sandstrom: has joined #ruby
[18:31:17] Es0teric: has joined #ruby
[18:31:57] Es0teric: has joined #ruby
[18:32:37] Es0teric: has joined #ruby
[18:32:40] rmulligan: has joined #ruby
[18:33:17] x77686d: has joined #ruby
[18:35:07] jottr: has joined #ruby
[18:40:31] edwinvdgraaf: has joined #ruby
[18:42:21] grizlo42: has joined #ruby
[18:42:25] grizlo42: has left #ruby: ()
[18:43:33] swills: has joined #ruby
[18:44:16] edwinvdgraaf: has joined #ruby
[18:47:18] vdamewood: has joined #ruby
[18:48:07] TheCubeLord: has joined #ruby
[18:50:50] prestorium: has joined #ruby
[18:51:43] nocontrol: has joined #ruby
[18:51:58] kotk: has joined #ruby
[18:52:16] Devalo: has joined #ruby
[18:52:28] b|ackwolf: has joined #ruby
[18:53:25] kotk: has joined #ruby
[18:53:45] shevy: hanmac do you like C++ or C more, including ruby bindings for them?
[18:54:15] madgen_: has joined #ruby
[18:54:26] hxegon: has joined #ruby
[18:55:12] cdg: has joined #ruby
[18:55:17] gregf: has joined #ruby
[18:55:21] Hanmac: shevy C++ code is more nice, but ruby cant bind C++ directly so i do cheat in my bindings
[18:55:23] Cohedrin_: has joined #ruby
[18:55:28] ruby[bot]: TheCubeLord: You can find a list of my commands on http://ruby-community.com/ruboto/commands and my factoids on http://ruby-community.com/ruboto/facts
[18:56:20] TheCubeLord: ?coffee TheCubeLord
[18:56:20] ruby[bot]: TheCubeLord: here's a coffee, you seem to need it: ☕
[18:56:35] TheCubeLord: i do actually need it brb
[18:56:58] Macaveli: has joined #ruby
[18:57:51] TheCubeLord: what language is ruby[bot] programmed in (most likely ruby)
[18:58:30] TheGreatGudsby: has joined #ruby
[18:59:11] mdw: has joined #ruby
[18:59:57] Es0teric: has joined #ruby
[19:00:10] Moosashi: has joined #ruby
[19:00:37] shevy: what kind of question was that TheCubeLord :P
[19:02:14] tobiasvl: TheCubeLord: ruby obviously
[19:02:20] last_staff: has joined #ruby
[19:02:41] moeabdol2: has joined #ruby
[19:03:08] pizzaops: Anybody familiar with net/ssh?
[19:03:08] rbennacer: has joined #ruby
[19:03:15] shadoi: has joined #ruby
[19:03:20] pizzaops: I'm trying to use the request pty error and it just fails (but I have no problem getting a pty via stadnard ssh)
[19:03:26] pizzaops: Exception `Net::SSH::ChannelRequestFailed' at /opt/puppetlabs/puppet/lib/ruby/gems/2.1.0/gems/net-ssh-3.1.0/lib/net/ssh/connection/channel.rb:566 - Net::SSH::ChannelRequestFailed
[19:03:56] hotpancakes: has joined #ruby
[19:04:18] rolha: has joined #ruby
[19:04:22] shevy: TheCubeLord I don't like those version splits, languages should always try to make the switch to the latest and greatest if that is possible
[19:04:39] shevy: else you end up like centos
[19:04:47] TheCubeLord: shevy: tell that to #python
[19:05:26] TheCubeLord: ?coffee ruby[bot]
[19:05:26] ruby[bot]: ruby[bot]: here's a coffee, you seem to need it: ☕
[19:06:43] MuffinPimp: has joined #ruby
[19:07:04] sgambino: has joined #ruby
[19:09:44] vinleod: has joined #ruby
[19:12:59] siaW: has joined #ruby
[19:13:44] eichenwald: has joined #ruby
[19:14:39] MuffinPimp: has joined #ruby
[19:15:20] jtoy: has joined #ruby
[19:15:32] baweaver: has joined #ruby
[19:16:32] yfeldblum: has joined #ruby
[19:16:32] ssiris: has joined #ruby
[19:17:53] graffix: has joined #ruby
[19:17:54] pawnbox: has joined #ruby
[19:19:39] graffix: has left #ruby: ()
[19:20:04] rbennacer: has joined #ruby
[19:20:39] robbyoconnor: has joined #ruby
[19:22:25] jackjackdripper: has joined #ruby
[19:23:28] benlieb: has joined #ruby
[19:24:14] blackmesa: has joined #ruby
[19:24:39] stannard: has joined #ruby
[19:25:22] dionysus69: has joined #ruby
[19:28:32] binaryplease: has joined #ruby
[19:29:29] mdw7: has joined #ruby
[19:32:49] postmodern: has joined #ruby
[19:33:47] mostlybadfly: has joined #ruby
[19:34:16] choke: has joined #ruby
[19:35:11] robbyoconnor: has joined #ruby
[19:37:10] jottr: has joined #ruby
[19:37:48] Devalo: has joined #ruby
[19:37:57] bronson: has joined #ruby
[19:38:40] sdwrage: has joined #ruby
[19:39:12] the_drow: has joined #ruby
[19:41:15] baweaver: has joined #ruby
[19:43:41] cisco: has joined #ruby
[19:43:51] JohnBat26: has joined #ruby
[19:44:08] cisco: has joined #ruby
[19:44:48] cisco: has joined #ruby
[19:44:56] shevy: hanmac hmm
[19:45:17] symm-: has joined #ruby
[19:46:06] helpa: has joined #ruby
[19:47:17] jmorgado: has joined #ruby
[19:49:03] floatingpoint: how can i determine which exception type I should raise? for example, if I run a commandline program and it returns output in stderr, i need to raise an exception. which one though?
[19:49:47] KayKayKay: has joined #ruby
[19:50:16] shevy: depends on how specific you want to be
[19:50:22] shevy: e. g. you can write your own exception types
[19:50:49] djellemah: floatingpoint: just raise "your message here" is fine, unless you need to rescue by class
[19:51:01] shevy: the general one would be "raise Exception", which is the same as just "raise" I think. Missing files should raise LoadError; all of this has implications if you want to rescue a specific exception too
[19:51:37] smathy: No, don't raise Exception.
[19:51:44] dualbus: I just noticed that: puts "%{foo}s" % {'foo'=>'bar'}
[19:51:53] floatingpoint: yeah, i thought "exception" was god enough, but my boss thinks it's Very Bad
[19:51:55] dualbus: gives key{foo} not found
[19:52:06] dualbus: because %{foo} is looking for the :foo symbol
[19:52:35] smathy: floatingpoint, docs here: http://ruby-doc.org/core-2.3.0/Exception.html Shows defaults, `raise "foo"` is good enough for most situations.
[19:52:53] floatingpoint: yes smathy i've seen this list before
[19:53:05] dualbus: Is there a way around this? %<foo> is the same thing. Both look for symbols. I guess there should be a better way than converting my hash
[19:53:39] floatingpoint: what error class would an error thrown by a commandline program be part of
[19:54:11] rickmasta: has joined #ruby
[19:54:21] djellemah: floatingpoint: RuntimeError, or a subclass of that
[19:54:32] floatingpoint: why do you say that
[19:54:33] smathy: floatingpoint, depends what the error is.
[19:54:40] blackmesa: has joined #ruby
[19:54:43] itaipu: has joined #ruby
[19:55:01] KayKayKay: has joined #ruby
[19:55:10] n008f4g_: has joined #ruby
[19:55:23] smathy: floatingpoint, and just in case this is what you're asking, exceptions aren't some system-level thing, ie. they don't cross process boundaries.
[19:55:27] weeperscreepers: has joined #ruby
[19:55:30] shevy: what error upcoming can you see floatingpoint
[19:55:31] djellemah: floatingpoint: all the other standard exception classes already have well-defined meanings. RuntimeError is the base class for your errors.
[19:55:46] floatingpoint: shevy well, the underslying program is rsync
[19:55:51] floatingpoint: so hundreds of things can go wrong
[19:55:54] shevy: so networking errors
[19:55:56] shevy: these suck
[19:56:04] floatingpoint: could be something else though
[19:56:15] floatingpoint: rsync breaks in strange an magical ways
[19:56:18] smathy: floatingpoint, right, and so you'll be calling it with `system` or something, and that will have a return value, not an exception.
[19:56:27] shevy: let me show you the errors I catch in one class there floatingpoint
[19:56:46] jenrzzz: has joined #ruby
[19:56:46] jenrzzz: has joined #ruby
[19:56:59] shevy: rescue Errno::EINVAL EOFError SocketError Zlib::BufError Net::ReadTimeout Net::OpenTimeout Errno::ECONNREFUSED Errno::ETIMEDOUT Errno::ENETUNREACH OpenURI::HTTPError
[19:57:10] shevy: all of these showed up!
[19:57:24] shevy: over a period of like 6 months or so; all the script does is to check a remote webforum for activity
[19:57:34] shevy: I don't think I'd do that ever again...
[19:57:51] baweaver: has joined #ruby
[19:57:58] manveru: that looks almost the same as some of our code here that tries to fetch random html pages :P
[19:58:08] manveru: well, just that we have like 10 more
[19:58:34] manveru: temporary networking errors are such a pain
[19:58:39] smathy: None of those are relevant shevy if he's using rsync.
[19:59:00] shevy: but does he not connect to something that is remote
[19:59:00] manveru: well, that's true, if you use the rsync executable you won't notice those specifics
[19:59:04] floatingpoint: several of those could be of use
[19:59:17] smathy: ACTION gives up
[19:59:19] manveru: all you'll get is a non-0 exit code
[19:59:21] floatingpoint: i'm not going that deep in
[19:59:33] lyoshajapan: has joined #ruby
[19:59:49] floatingpoint: my PM doesn't care about this thing being robust, but he does care about raising a generic exception
[20:00:04] manveru: floatingpoint: how do you call rsync?
[20:00:11] smathy: shevy, his ruby process isn't, no. It's calling `rsync`, exceptions don't bubble up out of sub-processes into ruby.
[20:00:11] manveru: via librsync or via the executable?
[20:00:17] floatingpoint: Open3.capture3(cmd)
[20:00:25] floatingpoint: where cmd = some rsync string
[20:00:27] manveru: then you won't get execeptions
[20:00:28] diegoaguilar: has joined #ruby
[20:00:31] manveru: *exceptions
[20:00:49] floatingpoint: i raise an exception if stderr has a length > 0
[20:00:56] smathy: ACTION said this already
[20:00:59] x0F: has joined #ruby
[20:01:09] manveru: why are we still talking about that :P
[20:01:37] shevy: problem solved
[20:01:50] TheGreatGudsby: has joined #ruby
[20:02:04] floatingpoint: for the record, i hate not being able to write robust code because of arbitrary project deadlines
[20:02:17] smathy: Type quicker.
[20:02:45] hahuang61: has joined #ruby
[20:03:09] floatingpoint: nope. that'd just mean i'd have to write more shitty code over a shorter time period
[20:03:10] shevy: then he may do more errors
[20:03:17] manveru: type smarter
[20:03:25] shevy: type softer!
[20:03:35] manveru: type static.
[20:03:37] floatingpoint: the correct answer is: quit job and go somewhere that thinks longer term
[20:03:41] smathy: The ;) was implied, sorry for not making it clearer.
[20:03:50] rickmasta: has joined #ruby
[20:03:54] ramfjord: has joined #ruby
[20:04:47] blackgoat: has joined #ruby
[20:05:16] floatingpoint: i suppose there's a delicate balance between writing The Most Robust Code Possible and submitting code in a timely manner
[20:05:44] shevy: there are always tradeoffs
[20:06:09] shevy: like those 20 lines exception handling in my code!
[20:06:11] floatingpoint: i just feel dirty when i know i am sending half-baked code out to other devs to use
[20:06:31] floatingpoint: i hate it when people send me shitty code
[20:07:30] Don_John: has joined #ruby
[20:07:30] manveru: hey, at least you care about stderr and exit status of rsync...
[20:07:47] floatingpoint: well yeah, because it's the right thing to do
[20:07:50] manveru: i mean, there are plenty of projects that'd just use system and ignore it
[20:08:07] manveru: so consider yourself non-half-baked :)
[20:08:30] Bounga`: has joined #ruby
[20:08:37] floatingpoint: i try to write code that i'd be ok reading / debugging
[20:08:52] Suntzu: has joined #ruby
[20:10:13] ur5us: has joined #ruby
[20:10:16] lyoshajapan: has joined #ruby
[20:10:26] KayKayKay: The reason you think the code is shitty is because you're not good enough to read It
[20:10:37] floatingpoint: shotsfired.gif
[20:10:48] shevy: nah these were not shots
[20:10:48] r1nuz: firesshot.png
[20:10:55] shevy: bad code stays bad
[20:11:09] apeiros: !badnick KayKayKay
[20:11:10] ruby[bot]: +bbb $a:KayKayKay$#ruby-banned KayKayKay!*@*$#ruby-banned *!*@172.58.24.86$#ruby-banned
[20:11:12] baweaver: !troll KayKayKay
[20:11:25] ruby[bot]: ruby[bot] kicked KayKayKay: is not suitable for this channel, see http://ruby-community.com/pages/user_rules
[20:11:34] apeiros: thought that guy had been permabanned… well
[20:12:26] adaedra: In the dump I have, they're partially banned.
[20:12:35] TheGreatGudsby: has joined #ruby
[20:12:57] apeiros: maybe used !ban instead of !badnick. !badnick bans the nick indefinitely.
[20:13:15] bkxd: has joined #ruby
[20:13:20] adaedra: In a few moments I'll be able to see what mask is concerned :p
[20:13:41] tubbo: has joined #ruby
[20:14:04] cdg: has joined #ruby
[20:14:04] zerowaitstate: has joined #ruby
[20:15:07] rickmasta: has joined #ruby
[20:15:16] ok: has joined #ruby
[20:15:25] ok: http://ah.pe/bCJ
[20:15:30] Moosashi: has joined #ruby
[20:16:00] hxegon: has joined #ruby
[20:16:09] dopie: has joined #ruby
[20:18:46] dubek: has joined #ruby
[20:18:57] apeiros: !ban *!*@*119.159.117.176 !T 3d spam
[20:18:57] ruby[bot]: apeiros: Could not process command, usage: !ban nick [channel] [duration] [reason][ "|" secret_reason]
[20:19:13] apeiros: +b *!*@*119.159.117.176
[20:19:16] apeiros: -o apeiros
[20:19:27] apeiros: right, that's still on my todo list.
[20:19:28] ruby[bot]: -b+b *!*@*119.159.117.176 *!*@*119.159.117.176$#ruby-banned
[20:19:46] siaW: has joined #ruby
[20:19:54] polyidus: has joined #ruby
[20:20:58] Frem: has joined #ruby
[20:21:05] chipotle: has joined #ruby
[20:21:23] blackgoat: has joined #ruby
[20:21:47] CloCkWeRX: has joined #ruby
[20:21:54] TheGreatGudsby: has joined #ruby
[20:24:02] darkf: has joined #ruby
[20:25:36] mrgrieves: has joined #ruby
[20:29:14] mojo2016: has joined #ruby
[20:30:01] sandelius: has joined #ruby
[20:30:20] jdawgaz: has joined #ruby
[20:31:31] sdwrage: has joined #ruby
[20:31:50] rolha: has joined #ruby
[20:31:59] mistermocha: has joined #ruby
[20:32:11] Guest71201: has left #ruby: ()
[20:32:19] jenrzzz: has joined #ruby
[20:32:20] jenrzzz: has joined #ruby
[20:32:42] shevy: hmm first april is upcoming and people already are in joke mood
[20:32:56] qhp_: has joined #ruby
[20:33:19] Aswebb_: has joined #ruby
[20:34:57] mistermo_: has joined #ruby
[20:36:13] j5s7: has joined #ruby
[20:37:32] patrick-sartent: has joined #ruby
[20:38:00] jottr: has joined #ruby
[20:39:14] mistermocha: has joined #ruby
[20:40:02] stunder: has joined #ruby
[20:40:31] j5s7: has joined #ruby
[20:42:46] kirillzh: has joined #ruby
[20:43:22] Sdwrage_: has joined #ruby
[20:43:28] x77686d: has joined #ruby
[20:47:21] Xeago: has joined #ruby
[20:47:30] sudoubuntu: has joined #ruby
[20:48:12] jkahn: has joined #ruby
[20:49:06] itaipu: has joined #ruby
[20:49:34] spuk: has joined #ruby
[20:49:40] drewo: has joined #ruby
[20:49:47] andywojo: has joined #ruby
[20:51:13] Moosashi: has joined #ruby
[20:54:22] agit0: has joined #ruby
[20:56:00] FooMunki: has joined #ruby
[20:56:25] jottr: has joined #ruby
[20:57:21] choke: has joined #ruby
[21:00:07] polyidus: has joined #ruby
[21:00:21] hahuang61: has joined #ruby
[21:03:44] jmorgado: has joined #ruby
[21:04:23] dcope: is there an easy way to check if a string contains emoji?
[21:06:00] sonOfRa: has joined #ruby
[21:07:11] David_H_Smith: has joined #ruby
[21:07:48] davedev24: has joined #ruby
[21:07:51] tobiasvl: dcope: well, you'll have to check several unicode blocks
[21:08:14] r1nuz: that's why so many unicode parsers fail
[21:08:17] r1nuz: you have to read ahead
[21:08:31] adaedra: there may be a gem capable of giving character categories
[21:08:40] hightower2: Hey, I have a non-interactive ruby process running which got stuck on some syscall. Is there a way I can obtain a ruby backtrace from it?
[21:08:41] Xeago: has joined #ruby
[21:10:06] adaedra: ^C gives nothing?
[21:12:20] wilbert: has joined #ruby
[21:14:08] bkxd: has joined #ruby
[21:14:27] mistermocha: has joined #ruby
[21:15:30] devbug: has joined #ruby
[21:16:40] russt: has joined #ruby
[21:17:33] tobiasvl: dcope: http://stackoverflow.com/questions/24672834/how-do-i-remove-emoji-from-string/24673322#24673322
[21:17:39] skade: has joined #ruby
[21:17:49] drewo: has joined #ruby
[21:19:09] baweaver: has joined #ruby
[21:19:54] Gasher: has joined #ruby
[21:20:18] rolha: has joined #ruby
[21:20:29] Trynemjoel: has joined #ruby
[21:20:43] skade: has joined #ruby
[21:20:58] uglybandersnatch: has joined #ruby
[21:21:22] TheGreatGudsby: has joined #ruby
[21:23:43] crayon: has joined #ruby
[21:23:46] crayon: what is specs.4.8?
[21:25:24] apeiros: I'm continually amazed by what people consider to be an appropriate amount of context
[21:25:35] crayon: https://rubygems.org/specs.4.8.gz
[21:25:45] dcope: tobiasvl: awesome, thank you!
[21:26:00] Papierkorb: crayon: the gem database or something
[21:26:08] apeiros: crayon: part of the url?
[21:26:11] r1nuz: apeiros what is the solution to my problems?
[21:26:20] apeiros: r1nuz: 42, obviously
[21:26:42] r1nuz: see, context is overrated
[21:27:05] Trynemjoel: has joined #ruby
[21:27:20] crayon: was it updated recently or something
[21:27:46] crayon: why would that be getting pushed into my jenkins dirs
[21:27:49] apeiros: the file? that's probably in the headers. and afair it's always updated.
[21:28:27] crayon: /.gem/specs/rubygems.org%80/specs.4.8
[21:28:31] ivanskie: has joined #ruby
[21:28:33] crayon: odd placement, no?
[21:28:42] Papierkorb: crayon: is there an issue with that file?
[21:29:29] stannard: has joined #ruby
[21:29:32] adaedra: crayon: that's a database rubygems caches when doing requests to registry. It looks totally normal here.
[21:29:39] Radar: The file is a gzip'd list of all the gems on RubyGems. It's what RubyGems and/or Bundler downloads in order to do dependency resolution.
[21:29:54] Dimik: how can i do this a,b = db.execute "SELECT id,name from TABLE" and f,b.each{|row|puts row}
[21:30:08] Dimik: f,b = a,b sorry
[21:30:19] Radar: Dimik: look at the Sequel gem.
[21:30:21] babblebre: has joined #ruby
[21:30:41] skade: has joined #ruby
[21:30:47] goodroot: has joined #ruby
[21:30:49] crayon: whats the sha256 of the official version?
[21:30:51] Dimik: i got the gem
[21:31:06] araujo_: has joined #ruby
[21:31:42] Ox0dea: crayon: 994f7b...
[21:31:49] crayon: btw, thank you Radar, adaedra, and Papierkorb
[21:32:08] crayon: do you have the full sha256?
[21:33:10] mistermocha: has joined #ruby
[21:33:47] crayon: how can i load this file in marshal and decode?
[21:34:04] adaedra: What are you trying to do?
[21:34:12] crayon: investigate something
[21:34:14] Radar: Marshal.load File.read("specs.4.8") after you've unzipped it
[21:34:23] Radar: crayon: Being vague is not going to get you much help here.,
[21:34:28] hiyosi: has joined #ruby
[21:34:29] nando293921: has joined #ruby
[21:34:31] Spami_: has joined #ruby
[21:34:59] wldcordeiro: has joined #ruby
[21:35:58] adaedra: It's getting late, good night
[21:35:59] sp4rrow: has joined #ruby
[21:36:05] Radar: The SHA256 I have here is 9072ae2bcbb2bfd2100676d7deb214b89704537e8ed8971aac2d11096d649eed.
[21:36:21] Radar: But this file changes whenever a new gem is added.
[21:36:24] apeiros: won't that be perpetually changing as the file is updated all the time?
[21:36:27] Radar: or gem version
[21:36:29] Radar: apeiros: yes
[21:36:40] agit0: has joined #ruby
[21:37:05] Radar: IMO it's very silly for RubyGems to be serving this file every single time. It should do an incremental update based on the time that you last fetched the file.
[21:37:16] Radar: But I am not a RubyGem dev so my opinion doesn't matter :D
[21:37:26] riceandbeans: is rdoc the main/preferred auto documentation generator?
[21:37:46] apeiros: I wondered about that too. base file which changes in set intervals (e.g. weekly) + delta file. but I don't know how practical that is.
[21:37:47] weeperscreepers: has joined #ruby
[21:37:57] crayon: Radar, can i PM
[21:37:59] apeiros: riceandbeans: rdoc and yard are the most popular
[21:38:04] Radar: crayon: go ahead
[21:38:06] ramfjord_: has joined #ruby
[21:38:21] gheegh: has joined #ruby
[21:39:14] Devalo: has joined #ruby
[21:39:55] bronson: has joined #ruby
[21:40:35] Trynemjoel: has joined #ruby
[21:41:06] yfeldblum: has joined #ruby
[21:41:46] rigsby: has joined #ruby
[21:42:46] riceandbeans: apeiros: which is better?
[21:42:57] apeiros: define "better"
[21:43:01] apeiros: I prefer yard
[21:43:05] araujo__: has joined #ruby
[21:43:21] riceandbeans: better being !apeiros.preference
[21:43:25] riceandbeans: just kidding-
[21:43:44] weeperscreepers: has joined #ruby
[21:43:44] riceandbeans: better being more commonly accepted in the community, easier to use, more extensive in coverage
[21:44:44] Timba-as_: has joined #ruby
[21:45:01] Radar: YARD is more actively developed iirc.
[21:46:37] myntcake: has joined #ruby
[21:46:50] shevy: I want something new and 1000x better than both!
[21:46:56] davedev24: has joined #ruby
[21:47:02] myntcake: I have a question
[21:47:26] myntcake: has anyone read the whole Ruby documentation?
[21:47:35] myntcake: do most programmers read it entirely?
[21:47:35] shevy: you mean stdlib and core classes?
[21:47:37] apeiros: somebody probably has
[21:47:44] Radar: myntcake: Yes that person is Ox0dea.
[21:47:57] Radar: Ox0dea knows all the trivial classes and methods.
[21:47:59] myntcake: Radar: is that a bot? haha
[21:48:00] s00pcan: has joined #ruby
[21:48:01] hotpancakes: has joined #ruby
[21:48:10] Radar: He writes Ruby that would make Perl programmers vomit.
[21:48:12] shevy: myntcake I read documentation for the main classes... some other addons, but other than that, I have never read everything. I never finished the pickaxe appendix either
[21:48:38] myntcake: shevy: ok, that's a relief haha
[21:48:42] riceandbeans: my friend learned ruby by memorizing the stdlib and core
[21:48:43] Radar: myntcake: I found the Koans more helpful thank reading pages and pages of docs
[21:48:55] nohitall: has left #ruby: ()
[21:49:10] riceandbeans: he couldn't write much, but if I asked him if there was something related to x, y, or z he could rattle it off and I could use it
[21:49:31] myntcake: I've started a ruby teaching program called launch school and it keeps making me read ruby documentation
[21:49:41] myntcake: so i was wondering if i must read the whole thing to be good at it haha
[21:49:47] apeiros: oh teh horror
[21:49:48] symm-: has joined #ruby
[21:49:52] riceandbeans: you have to use it and practice it to be good at it
[21:50:09] myntcake: riceandbeans: yeah i'm following their curriculum
[21:50:11] Azure: has joined #ruby
[21:50:12] riceandbeans: also, you have to not do anything I ever talk about to be good at it
[21:50:14] Radar: myntcake: I generally only read the methods that I need at the time.
[21:50:50] shevy: I try to "think" in ruby when I see something unknown
[21:50:52] apeiros: myntcake: it's a good idea to study the full core docs once. not necessarily reading the full documentation of all methods, but getting an overview which classes exist and what methods.
[21:50:53] myntcake: well, the thing is like... every Ruby page is huge... and I understand like half of that
[21:51:04] shevy: object.size ... object.some_operation_whose_name_should_make_sense
[21:51:13] apeiros: if you don't know what's there, you don't know how to solve problems in a nice way.
[21:51:26] myntcake: apeiros: yeah I agree
[21:51:44] r1nuz: ain't no wheel like a reinvented wheel though
[21:51:47] apeiros: stdlib I'd at least gloss over the classes
[21:52:01] myntcake: what exactly is stdlib stdout stderr and all that?
[21:52:03] shevy: myntcake yeah the documentation is not ruby's strongest part but when you "think" in ruby, it becomes very simple and logical (for like... 98% of the time)
[21:52:32] apeiros: stdlib is the standard library and unrelated to stdin/stdout/stderr
[21:52:37] myntcake: shevy: haha, yeah i realized most classes and methods are very similar to spoken english ^^
[21:52:44] myntcake: apeiros: oh ok
[21:52:47] apeiros: the latter three are the three common IOs every *nix process has at start.
[21:53:09] apeiros: core = the part which is loaded in ruby at start
[21:53:28] apeiros: stdlib = the part which is installed along with ruby (usually - some distros suck and split it up), but needs to be explicitly required
[21:54:04] symm-: has joined #ruby
[21:54:57] myntcake: i'm dealing with file creating in Ruby, and it came up
[21:55:43] DikshitNijjer: has joined #ruby
[21:55:49] DikshitNijjer: hello all i am from india
[21:56:28] Radar: !ban DikshitNijjer
[21:56:28] ruby[bot]: +bbb $a:DikshitNijjer$#ruby-banned DikshitNijjer!*@*$#ruby-banned *!*@gateway/web/cgi-irc/kiwiirc.com/ip.45.65.14.10$#ruby-banned
[21:56:29] ruby[bot]: ruby[bot] kicked DikshitNijjer: offense, see http://ruby-community.com/pages/user_rules
[21:56:32] Radar: Bullshit you are.
[21:58:31] cjheath: Annoyed at Hash#map. It should return a Hash. I’m thinking a definition like this (I propose to call it remap():
[21:58:33] cjheath: inject({}) { |n, (k, v)| n[k] = yield v; n }; end
[21:58:37] cjheath: your thoughts?
[21:58:54] apeiros: cjheath: take a look at active support
[21:59:04] apeiros: it already has all the mapping variants for hash iirc
[21:59:09] cjheath: I.e. it returns a new Hash with the same keys, but mapped values
[21:59:22] cjheath: Oooh thanks; what does Activesupport call this one?
[21:59:30] apeiros: don't remember
[21:59:31] davedev24: has joined #ruby
[21:59:32] ayonkhan: has joined #ruby
[22:00:28] baweaver: has joined #ruby
[22:00:44] Radar: cjheath: transform_values?
[22:00:57] drewo: has joined #ruby
[22:01:05] Moosashi: has joined #ruby
[22:01:37] cjheath: Radar: Right, thanks. Craziness that Ruby got this so wrong
[22:01:54] Radar: cjheath: patches welcome
[22:02:25] cjheath: non est possible. Plus ca change, plus c’est le meme chose.
[22:02:36] cjheath: I.e. you’d break the Ruby world
[22:03:17] cjheath: That transforms the keys, but transform_values is the thing I meant
[22:03:26] s00pcan: has joined #ruby
[22:03:30] cjheath: oh sorry, was looking at transform_keys
[22:04:08] apeiros: hm, transform_values and _keys only map keys/values, not the pairs.
[22:04:21] apeiros: I thought it had one for pairs too. but can't find it.
[22:04:37] cjheath: Don’t want pairs.
[22:04:44] Vircung: has joined #ruby
[22:04:54] apeiros: ah I see, your implementation only maps the values either.
[22:05:41] Vircung: has joined #ruby
[22:05:44] baweaver: cjheath: DreamInCode?
[22:05:46] PaulCapestany: has joined #ruby
[22:06:05] baweaver: name looks familiar
[22:06:34] cjheath: baweaver: Why did you mention DreamInCode? First I’ve heard of that.
[22:06:51] quazimodo: has joined #ruby
[22:07:00] baweaver: Someone else has a similar actual name to yours that goes to that site
[22:07:00] Radar: cjheath: I meant a patch to add transform_values to Ruby itself so that you don't need the AS dep
[22:07:26] ecksit: has joined #ruby
[22:07:28] d10n-work: has joined #ruby
[22:07:37] PaulCapestany: has joined #ruby
[22:08:00] shevy: cjheath I think .map on hash should logically modify both keys and values at the same time, but you can always find alternative explanations; perhaps one would also have to add .map_keys and .map_values
[22:08:29] shevy: method names with "transform" in it scare me, they remind me of scary transformers :\
[22:08:47] cjheath: My complaint is that the methods that iterate over Arrays should work on Hash, passing just the value to the block; and returning a Hash of the same keys where the Array method returned an Array
[22:08:51] Ox0dea: Hash#select and #reject are the only ones that behave "appropriately"; it's definitely a wart, by my lights.
[22:09:40] apeiros: yeah, sort/sort_by/map should IMO return a Hash
[22:09:44] Moosashi: has joined #ruby
[22:09:50] apeiros: though I'd expect Hash#map to yield pairs
[22:09:57] apeiros: not just the value
[22:10:17] dfinninger: has joined #ruby
[22:11:02] cjheath: I’d expect Hash#select to yield just the value. Good that it returns a new Hash though
[22:11:50] cjheath: the hash contains the value, stored under the key; the same way an Array stores values under an index
[22:12:06] cjheath: so anything in Array that yields the index should yield the key in Hash
[22:12:07] Vircung: has joined #ruby
[22:12:20] cjheath: and anything that yields the value in Array should yield the value in Hash
[22:12:33] apeiros: I actually wouldn't mind having an index yielded in Enumerable#select/#reject etc.
[22:12:54] cjheath: one way or the other; Ruby has some bits each way
[22:13:18] hahuang61: has joined #ruby
[22:13:22] cjheath: select_with_key
[22:13:41] apeiros: well, it used to be consistent in that earlier rubies' Hash#select, #reject returned arrays too
[22:13:44] cjheath: or yet; detect the block arity and yield just the value, or the value and the key
[22:13:51] apeiros: please not.
[22:14:16] cjheath: it’s just curried
[22:14:54] shevy: "<cjheath> or yet; detect the block arity and yield just the value, or the value and the key"
[22:15:01] shevy: like programming... so many "or" and "and"
[22:15:52] cjheath: I’m trying to get some stronger FP things in my Ruby; but the inconsistency of the standard library is in the way
[22:16:20] ruby-lang964: has joined #ruby
[22:16:32] baweaver: >>by_key=->key{->k,v{ k == key}}; {a: 1}.select(&by_key(:a))
[22:16:34] ruby[bot]: baweaver: # => undefined method `by_key' for main:Object (NoMethodError) ...check link for more (https://eval.in/544577)
[22:17:15] polyidus: has joined #ruby
[22:17:25] Ox0dea: You wanted `[:a]`.
[22:17:37] baweaver: >>by_key=->key{->k,v{ k == key}}; {a: 1}.select(&by_key[:a])
[22:17:38] ruby[bot]: baweaver: # => {:a=>1} (https://eval.in/544578)
[22:18:48] baweaver: >>by_val=->val{->k,v{v == val}}; {a: 1}.select(&by_val[1])
[22:18:50] ruby[bot]: baweaver: # => {:a=>1} (https://eval.in/544579)
[22:19:03] ruby-lang964: Are there other chat rooms for introduction to programming or ruby?
[22:19:33] baweaver: you can ask questions here and we can get you to resources if that's what you mean
[22:19:40] chipotle: has joined #ruby
[22:20:52] skweek: has joined #ruby
[22:21:45] wethu: has joined #ruby
[22:23:58] _blizzy_: has joined #ruby
[22:24:11] mikeiniowa: has joined #ruby
[22:25:24] mustmodify_: has joined #ruby
[22:25:30] rigsby: has joined #ruby
[22:25:34] Don_John: has joined #ruby
[22:28:10] _joes_: has joined #ruby
[22:28:13] Ox0dea: This is a really good idea, right? https://eval.in/544582
[22:28:15] mustmodify_: So I'm trying to build a UDP listener and I suspect my code is right but it just isn't working. Anyone have experience with that?
[22:28:26] blackmesa: has joined #ruby
[22:28:54] apeiros: Ox0dea: please amend for kwargs
[22:28:57] cjheath: mustmodify_: How far are you getting?
[22:29:02] apeiros: and then it'll be the best idea in the world
[22:29:23] Ox0dea: kwargs in the block parameters?
[22:30:43] shevy: what did Radar say about Ox0dea ... shall I look at the pastie or rather not...
[22:30:58] Radar: It's neat.
[22:31:02] ytti: mustmodify_, here is super simple udp receiver which may or may not help you - https://github.com/NLNOG/ring-sqa/blob/master/lib/ring/sqa/poller/receiver.rb
[22:31:03] Ox0dea: You're neat.
[22:31:20] shevy: I shall look ...
[22:31:35] htmldrum: has joined #ruby
[22:31:36] htmldrum_: has joined #ruby
[22:31:41] mustmodify_: cjheath: I took the example from the docs (which works for me) and split it up into a listener and a sender. And it doesn't work.
[22:31:55] mustmodify_: So apparently when they are in the same code, it works fine. When I split it up, no.
[22:32:27] mustmodify_: To be fair, I don't know what IO.select([udp]) does, so I need to research that.
[22:32:50] tatsuo: has joined #ruby
[22:32:50] r1nuz: socket multiplexing bro
[22:32:51] apeiros: it blocks until udp is readable
[22:32:59] cjheath: “man 2 select” will tell you about the operating system paradigm it’s exposing
[22:33:14] mustmodify_: apeiros: oh, good, that's what I want.
[22:33:48] x77686d: has joined #ruby
[22:33:50] apeiros: and by readable I mean: has actually stuff in the buffer to read (even if that stuff is just EOF)
[22:34:04] Aswebb_: has joined #ruby
[22:34:05] mustmodify_: yeah, I took that as your meaning.
[22:34:22] cjheath: Ox0dea: wtf does “proc.parameters” do in this context?
[22:34:32] Ox0dea: ¯\_(ツ)_/¯
[22:34:48] cjheath: I get “ArgumentError: tried to create Proc object without a block"
[22:34:51] mustmodify_: So I run the listener and it sits there looping. Then I run the sender. Nothing.
[22:35:03] Ox0dea: cjheath: Are you on a very old Ruby?
[22:35:16] apeiros: cjheath: you didn't have an lvar named proc then, right?
[22:35:17] cjheath: 2.2.2 to be precise
[22:35:23] apeiros: which would mean it invoked Kernel#proc
[22:35:32] mustmodify_: Speaking of very old rubies, I was just thinking about how long 1.8.7 was around.
[22:35:43] cjheath: so that’s changed since 2.2.2
[22:35:49] apeiros: proc in a method will get you the block passed to the method
[22:35:56] cjheath: hence my wtf
[22:35:56] apeiros: I think that was the case in 1.8.7 too
[22:36:10] Ox0dea: It's a very old feature.
[22:36:12] cjheath: Oh ok. Not seen that - tried it outsiode a method
[22:36:19] apeiros: >> def foo; proc; end; block= foo { |x| x+1 }; block.call(2)
[22:36:20] ruby[bot]: apeiros: # => 3 (https://eval.in/544584)
[22:36:34] apeiros: i.e. equivalent to do:
[22:36:46] cjheath: or rather, tried it in a method that had no block passed
[22:36:47] apeiros: >> def foo(&block); block; end; block= foo { |x| x+1 }; block.call(2)
[22:36:48] ruby[bot]: apeiros: # => 3 (https://eval.in/544585)
[22:37:00] mustmodify_: So why would I want recvfrom_nonblock + IO.select instead of just udp.recvfrom ?
[22:37:44] cjheath: shite. and people think testing arity is a bad idea… but they accept this sort of crap?
[22:37:58] cjheath: I mean, Ruby is less… arbitrary than Perl, but not much
[22:38:02] Ox0dea: cjheath: We were all having a laugh?
[22:38:13] Ox0dea: Modulo you, I guess.
[22:38:28] cjheath: I don’t meam what you proposed, but the fact that proc has different modes like this
[22:38:35] Moosashi_: has joined #ruby
[22:38:55] apeiros: cjheath: I guess you don't know the different variants of super yet then? :)
[22:39:04] apeiros: i.e. super vs super() vs super(&nil)
[22:39:10] Ox0dea: Well, every method already takes an implicit block; why shouldn't you be able to get hold of it "implicitly" as well?
[22:39:20] cjheath: so many methods do different unrelated things. I mean. I love Ruby, used it sine 2001, but it seems to get stranger the more use it
[22:39:27] Ox0dea: It's symmetrical once you know what's going on.
[22:39:38] zenlot: has joined #ruby
[22:40:03] cjheath: Yeah, I think I know about implicit blocks… just not access to them via proc
[22:40:40] cjheath: I’ve wrutten a lot of Ruby in the last decade and a half… but there are many idioms that you get by reading code more than by writing
[22:40:41] LHdez: has joined #ruby
[22:40:46] Devalo: has joined #ruby
[22:41:18] Ox0dea: Also, water is wet.
[22:41:33] cjheath: 0xdea: Did you see __why’s (ab)use of “class Foo < method_call…” in Camping?
[22:41:34] apeiros: not always
[22:41:43] cjheath: just to weird people out
[22:42:01] apeiros: IMO no abuse. there's neat things you can do with it.
[22:42:06] Ox0dea: cjheath: I don't know if that's where I first encountered it, but I pretty quickly caught on that you put full-on expressions just about anywhere.
[22:42:12] apeiros: also a rare thing but pretty nice: you can subclass Module :)
[22:42:14] cjheath: Yep, and I’ve done them.
[22:42:20] cjheath: but not in code I want others to read :)
[22:42:45] cjheath: you can pass a block to a superclass too; I’ve even used that
[22:43:08] cjheath: “class Foo < method { …}; def’s…; end"
[22:43:47] Ox0dea: You can subclass "from" any expression as long as it evaluates to a Class.
[22:43:53] hightower2: adaedra, can't ctrl+c it, it's a non-interactive process without a controlling terminal, so I can't ctrl+c it or kill it in a way that would print the stderr anywhere
[22:44:20] mustmodify_: Ah ha! I have it working. But it seems like I need to supply the sender's port as well as my own... which ... seems ... not right?
[22:44:35] Aviio: has joined #ruby
[22:45:03] Timba-as_: has joined #ruby
[22:45:20] mustmodify_: ah, never mind. Extraneous code.
[22:45:30] cjheath: mustmodify_: You need to listen on a port. You don’t have to bind to a specific IP address, but (unless promiscuous) you need a to send to and receive from a port
[22:46:20] y2mq37: has joined #ruby
[22:46:23] uglybandersnatch: has joined #ruby
[22:47:03] ytti: promiscuous means that there is no DMAC filter on interafce
[22:47:08] ytti: nothing to do wiht L3
[22:47:15] mustmodify_: cjheath: right
[22:47:44] mustmodify_: cjheath: there's no 'listen' option, though. Seems like, at least in this class, it's bind or nothing.
[22:48:15] mustmodify_: which is fine for my use-case.
[22:48:35] cjheath: listen() in the TCP api doesn’t listen - it sets the queue size for accept
[22:48:36] dome22xl: has joined #ruby
[22:48:54] mustmodify_: I'm doing UDP
[22:48:56] cjheath: I wasn’t referring to that (misnamed) function
[22:49:26] cjheath: I just mean you need to grab packets sent to a specific port
[22:49:49] trinaldi: has joined #ruby
[22:50:17] cjheath: ytti: What is it called when you receive packets sent to any port then? I thought that was part of promiscuous mode (which as you point out, is to receive packets sent to other ppl’s IP addresses)
[22:51:32] hightower2: has joined #ruby
[22:52:20] malconis: has joined #ruby
[22:53:44] quazimodo: has joined #ruby
[22:55:08] madgen_: has joined #ruby
[22:56:50] polyidus: has joined #ruby
[22:57:45] elifoster: has joined #ruby
[22:58:03] Es0teric: has joined #ruby
[22:59:01] rbennacer: has joined #ruby
[22:59:49] bkxd: has joined #ruby
[23:00:18] mistermocha: has joined #ruby
[23:06:06] wldcordeiro: has joined #ruby
[23:08:04] cjheath: >>5.times{p ‘x’}
[23:08:05] ruby[bot]: cjheath: # => undefined local variable or method `‘x’' for main:Object (NameError) ...check link for more (https://eval.in/544594)
[23:08:24] cjheath: darn Colloquy adding smart quotes :)
[23:12:23] xlegoman: has joined #ruby
[23:13:39] rehat: has joined #ruby
[23:13:55] djbkd: has joined #ruby
[23:14:42] shevy: your regular ' seem weird too
[23:17:02] mostlybadfly: has joined #ruby
[23:17:12] polyidus: has joined #ruby
[23:18:23] baweaver: has joined #ruby
[23:20:15] dfockler: has joined #ruby
[23:22:41] stunder: has joined #ruby
[23:23:37] cjheath: 3.times{p 'fixed, I hope'}
[23:23:50] cjheath: >> 3.times{p 'fixed, I hope'}
[23:23:52] ruby[bot]: cjheath: # => "fixed, I hope" ...check link for more (https://eval.in/544595)
[23:24:02] cjheath: Hah, noice
[23:24:26] agit0: has joined #ruby
[23:24:40] Xeago: has joined #ruby
[23:26:57] choke: has joined #ruby
[23:28:02] ramfjord: has joined #ruby
[23:28:19] rikkipitt: has joined #ruby
[23:28:27] mistermocha: has joined #ruby
[23:29:51] baweaver: has joined #ruby
[23:29:59] shevy: cjheath hah indeed
[23:30:27] shevy: cjheath before I would see it like this http://shevegen.square7.ch/screenshot.png - notice that hightower2's ' appear normal. now, your ' also appear normal \o/
[23:30:49] cjheath: shevy: Set your reader to UTF-8
[23:30:50] mistermocha: has joined #ruby
[23:30:53] djbkd: has joined #ruby
[23:31:40] hotpancakes: has joined #ruby
[23:31:52] Vile`: has joined #ruby
[23:31:56] djbkd: has joined #ruby
[23:32:04] jkahn: has joined #ruby
[23:32:06] shevy: even the bot failed!
[23:33:51] CloCkWeRX: has joined #ruby
[23:35:12] rkazak: has joined #ruby
[23:35:37] rmulligan: has joined #ruby
[23:36:42] symm-: has joined #ruby
[23:39:08] DLSteve: has joined #ruby
[23:39:54] uglybandersnatch: has joined #ruby
[23:40:12] RegulationD: has joined #ruby
[23:41:47] bronson: has joined #ruby
[23:43:55] hotpancakes: has joined #ruby
[23:45:14] rmulligan: has joined #ruby
[23:47:04] choke: has joined #ruby
[23:49:37] troynt: has joined #ruby
[23:49:58] ivanskie: has joined #ruby
[23:51:41] chipotle: has joined #ruby
[23:51:42] kam270: has joined #ruby
[23:52:20] NET||abu-: has joined #ruby
[23:52:30] torandu: has joined #ruby
[23:53:47] stunder: has joined #ruby
[23:54:54] rkazak: has joined #ruby
[23:55:57] workmad3: has joined #ruby
[23:57:13] ramfjord: has joined #ruby
[23:58:03] mistermocha: has joined #ruby
[23:58:18] hahuang61: has joined #ruby
[23:59:24] mistermocha: has joined #ruby