« Back to channel list

#ruby - 09 December 2015

« Back 1 day Forward 1 day »
[00:02:03] bmurt: has joined #ruby
[00:03:04] BTRE: has joined #ruby
[00:04:27] diegoviola: has joined #ruby
[00:04:34] ledestin: has joined #ruby
[00:06:43] diegoviola: has joined #ruby
[00:09:48] weemsledeux: has joined #ruby
[00:10:02] shanemcd: has joined #ruby
[00:16:30] Rodya_: has joined #ruby
[00:16:39] nettoweb: has joined #ruby
[00:17:18] lacuna: has joined #ruby
[00:17:19] lacuna: has joined #ruby
[00:17:39] supermar_: has joined #ruby
[00:18:55] hahuang65: has joined #ruby
[00:18:55] sphex: has joined #ruby
[00:19:04] Axy: has joined #ruby
[00:19:04] Axy: has joined #ruby
[00:19:36] hakunin: has joined #ruby
[00:21:13] wildlander: has joined #ruby
[00:21:55] ghoti: has joined #ruby
[00:23:14] ascarter: has joined #ruby
[00:23:16] dlitvak: has joined #ruby
[00:23:20] minimalism: has joined #ruby
[00:23:21] Symbiosisz: has joined #ruby
[00:23:25] adam_: has joined #ruby
[00:23:46] davejlong: has joined #ruby
[00:24:51] solocshaw: has joined #ruby
[00:25:14] davejlong: has joined #ruby
[00:25:40] amclain_: has joined #ruby
[00:25:47] jrvlima: has joined #ruby
[00:26:36] chandlerbing: has joined #ruby
[00:26:38] klaas: has joined #ruby
[00:28:34] klaas: has joined #ruby
[00:29:17] bmurt: has joined #ruby
[00:29:25] nateberkopec: has joined #ruby
[00:29:41] axl__: has joined #ruby
[00:31:09] RegulationD: has joined #ruby
[00:31:09] jbrhbr: has joined #ruby
[00:32:35] maneco: has joined #ruby
[00:36:58] JDiPierro: has joined #ruby
[00:37:06] colleenmcguckin: has joined #ruby
[00:38:38] supermarin: has joined #ruby
[00:39:27] jhonglim: has joined #ruby
[00:40:05] ap4y: has joined #ruby
[00:44:02] edwinvdgraaf: has joined #ruby
[00:44:16] jbrhbr: has joined #ruby
[00:44:30] CloCkWeRX: has joined #ruby
[00:44:51] amclain_: has joined #ruby
[00:47:41] DLSteve: has joined #ruby
[00:48:48] Asher: has joined #ruby
[00:49:10] diego1: has joined #ruby
[00:49:56] amclain: has joined #ruby
[00:51:15] asteros: has joined #ruby
[00:52:52] ascarter: has joined #ruby
[00:54:13] bronson: has joined #ruby
[00:54:22] Mon_Ouie: has joined #ruby
[00:56:20] banister: has joined #ruby
[00:59:08] axl_: has joined #ruby
[00:59:46] [k-: has joined #ruby
[00:59:53] jessemcgilallen: has joined #ruby
[01:01:16] zeroDivisible: has joined #ruby
[01:01:41] skweek: has joined #ruby
[01:02:29] veduardo: has joined #ruby
[01:03:53] crdpink2: if I seed random for the purpose of a single method is it considered best practice at the end to reset it to previous seed value, leave as is, or reseed.
[01:08:26] supermarin: has joined #ruby
[01:09:08] jhass: crdpink2: use Random.new and let it fall out of scope at the end of the method
[01:09:23] jgt3: has joined #ruby
[01:10:11] crdpink2: jhass: that makes perfect sense. thanks!
[01:10:58] slackbotgz: has joined #ruby
[01:11:29] wildlander: has joined #ruby
[01:15:29] diego1: has joined #ruby
[01:15:37] cdg: has joined #ruby
[01:15:43] wldcordeiro: has joined #ruby
[01:20:44] akem: has joined #ruby
[01:21:48] sankaber: has joined #ruby
[01:24:01] asteros: has joined #ruby
[01:25:27] bruce_lee2: has joined #ruby
[01:28:43] supermar_: has joined #ruby
[01:31:12] gigetoo: has joined #ruby
[01:31:46] skweek: has joined #ruby
[01:32:18] CloCkWeRX1: has joined #ruby
[01:32:23] RegulationD: has joined #ruby
[01:32:52] djbkd: has joined #ruby
[01:33:04] shout-user41: has joined #ruby
[01:37:56] CrazyEddy: has joined #ruby
[01:38:59] pwnd_nsfw: has joined #ruby
[01:39:18] dlitvak_: has joined #ruby
[01:40:16] diego1: has joined #ruby
[01:40:39] christiandsg: has joined #ruby
[01:40:55] diego1: has joined #ruby
[01:41:03] MartynKeigher: has joined #ruby
[01:42:20] thiagofm: has joined #ruby
[01:42:31] dstarh: has joined #ruby
[01:44:06] asteros: has joined #ruby
[01:44:27] cdg: has joined #ruby
[01:44:27] akem: has joined #ruby
[01:45:43] nbdy: has joined #ruby
[01:46:01] MartynKeigher: hey all.. having an issue getting mysql2 ruby gem to show the value of a sql query. here is the code... http://pastebin.com/KWhKu8Ru. can someone spot whats wrong with that? thanks.
[01:46:02] ruboto: MartynKeigher, we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/9d53cee64abaa6e8d87f
[01:46:02] ruboto: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[01:46:13] dlitvak: has joined #ruby
[01:50:07] shout-user41: has left #ruby: ("undefined")
[01:50:50] jeffreylevesque: has joined #ruby
[01:50:54] jeffreylevesque: anyone know how to install an npm package to a specified directory via command line?
[01:51:57] skweek: has joined #ruby
[01:53:01] djbkd_: has joined #ruby
[01:53:33] jeffreylevesque: i was trying to `npm install -g --prefix /where/to/save/myPackage`, based on https://github.com/jeff1evesque/machine-learning/issues/2309#issuecomment-16307093. But, i don't see in in `/where/to/save/myPackage`
[01:54:19] jpfuentes2: has joined #ruby
[01:55:11] jhass: ?crosspost MartynKeigher
[01:55:12] ruboto: MartynKeigher, Please do not crosspost without at least telling so and mentioning provided suggestions and their outcome in all channels. Experience shows that people don't do either, and not doing so is considered rude.
[01:55:55] MartynKeigher: sorry ruboto ... didnt know which chan id have the best of luck with
[01:57:56] Arnvald: has joined #ruby
[01:58:09] nerium: has joined #ruby
[01:59:21] devoldmx: has joined #ruby
[01:59:35] IrishGringo: has joined #ruby
[02:00:28] djbkd: has joined #ruby
[02:00:34] diego1: has joined #ruby
[02:01:17] diego1: has joined #ruby
[02:03:01] blackmesa: has joined #ruby
[02:05:56] babblebre: has joined #ruby
[02:08:58] jbrhbr: never anger mr. ruboto
[02:09:33] govg: has joined #ruby
[02:10:20] dlitvak_: has joined #ruby
[02:11:56] TomPeed: has joined #ruby
[02:12:46] nertzy: has joined #ruby
[02:14:36] devoldmx: has joined #ruby
[02:15:29] pdoherty: has joined #ruby
[02:15:40] BTRE: has joined #ruby
[02:15:44] skweek: has joined #ruby
[02:15:46] RobertBirnie: has joined #ruby
[02:16:25] thelasti_: has joined #ruby
[02:18:28] colleenmcguckin: has joined #ruby
[02:20:59] devoldmx: has joined #ruby
[02:21:34] devoldmx_: has joined #ruby
[02:23:36] shiver: has joined #ruby
[02:23:37] ixti: has joined #ruby
[02:24:58] cdg: has joined #ruby
[02:27:50] havenwood: MartynKeigher: Do you mean to use `results`?
[02:28:22] havenwood: MartynKeigher: You assign it but at least in your Gist it's not used thereafter.
[02:31:00] pwnd_nsfw: has joined #ruby
[02:31:37] rismoney1: has joined #ruby
[02:32:20] supermarin: has joined #ruby
[02:33:32] malconis: has joined #ruby
[02:34:39] rismoney1: I have a regex for a string in code [[:alpha:]]{2,4}[[:digit:]]{0,1} which is 2 to 4 alpha characters followed optionally by a single digit, but I want to change the regex to be 2-4 alpha but if 4 no digit
[02:35:16] jhass: rismoney1: match 2-3 alpha and a digit or 4 alpha
[02:35:40] jhass: (?:...|...)
[02:36:37] rismoney1: i am regex impaired :( and losing my mind
[02:37:05] jhass: http://rubular.com
[02:40:56] shiver: has left #ruby: ("leaving")
[02:41:09] jhass: rismoney1: http://rubular.com/r/JDNKQaa6DU anchor with \A and \z instead of ^ and $ if you match against strings containing just your match
[02:41:57] dstarh: has joined #ruby
[02:42:04] rismoney1: this is awesome
[02:42:10] havenwood: rismoney1: The parens that begin with a ?: inside is a non-capture group: (?:THEN_STUFF|OR_OTHER_STUFF_SEPARATED_BY_PIPES)
[02:42:29] havenwood: THIS_STUFF* rather
[02:43:02] havenwood: rubular has everything explained other than the non-capture groups
[02:43:41] havenwood: (since you already came bearing posix bracket expressions
[02:44:54] havenwood: http://ruby-doc.org/core/Regexp.html#class-Regexp-label-Grouping
[02:45:23] DavidDudson: has joined #ruby
[02:47:28] crdpink2: where did they say they didn't want a capture group?
[02:47:45] patdohere: has joined #ruby
[02:47:55] jhass: where did they say they want one?
[02:48:03] jhass: their original regex didn't had one
[02:48:05] skweek: has joined #ruby
[02:48:48] crdpink2: I think for someone learning it is less to digest, and the output is easier to match to the components of the regex
[02:50:02] ascarter: has joined #ruby
[02:50:14] jhass: way too few people use non-capturing groups, creating harder to decipher access to the actually relevant ones. I rather teach what I consider good habits from the start. The capture groups seems superfluous here, so I omitted it
[02:51:37] pwnd_nsfw: has joined #ruby
[02:53:05] bubbys: has joined #ruby
[02:56:43] user083: has joined #ruby
[02:57:18] akem: has joined #ruby
[02:58:49] maloik: has joined #ruby
[02:59:41] user083: has joined #ruby
[02:59:56] TomPeed: has joined #ruby
[03:01:07] user083: has joined #ruby
[03:01:34] pwnd_nsfw: has joined #ruby
[03:01:55] maneco: has left #ruby: ("WeeChat 1.3")
[03:02:19] ajaiswal: has joined #ruby
[03:02:37] skweek: has joined #ruby
[03:05:11] devoldmx: has joined #ruby
[03:06:18] blackmesa: has joined #ruby
[03:06:42] kobain: has joined #ruby
[03:07:37] crdpink2: Use them where it makes sense to. But just let groups be unless you explicitly want to ignore some, and if you need them then go the other way and explicitly name them with (?<name>...) for clarity. I see your opinion, but would not teach it personally :)
[03:07:41] elton: has joined #ruby
[03:07:55] bubbys: has joined #ruby
[03:07:59] shanemcd: has joined #ruby
[03:08:14] havenwood: crdpink2: It's faster to use non-capture groups and it's more portable, in that methods that care about captures don't get borked.
[03:09:00] myztic: has joined #ruby
[03:09:01] cdg: has joined #ruby
[03:09:15] DLSteve: has joined #ruby
[03:09:50] havenwood: crdpink2: I like the idea of keeping it simple but when in the land of regex... ;)
[03:09:55] crdpink2: numbered capture groups are riskier than named
[03:10:14] aibot: has joined #ruby
[03:10:18] crdpink2: havenwood: well I certainly agree there.
[03:10:39] tropico: has joined #ruby
[03:12:18] bb010g: has joined #ruby
[03:13:13] diegoviola: has joined #ruby
[03:13:55] patdohere: has joined #ruby
[03:14:27] Mia: has joined #ruby
[03:14:28] Mia: has joined #ruby
[03:15:07] fullofcaffeine: has joined #ruby
[03:15:23] Yzguy: has joined #ruby
[03:15:28] diegoviola: has joined #ruby
[03:15:57] Moosashi: has joined #ruby
[03:17:58] nateberkopec: has joined #ruby
[03:18:23] uris: has joined #ruby
[03:18:33] krzkrzkrz: has joined #ruby
[03:20:28] patdohere: has joined #ruby
[03:22:11] Renich: has joined #ruby
[03:23:32] houhoulis: has joined #ruby
[03:24:08] ajaiswal: has joined #ruby
[03:28:02] slackbotgz: has joined #ruby
[03:28:51] patdohere: has joined #ruby
[03:28:54] zacts: is the well grounded rubyist still recommended as a book?
[03:28:59] zacts: (the latest edition)
[03:29:14] zacts: or what is a good book for a total ruby newbie, who knows a bit of Perl5?
[03:29:24] zacts: (I say Perl5 as Perl6 is soon to be released I hear)
[03:30:07] B1n4r10: has joined #ruby
[03:31:10] bronson: has joined #ruby
[03:33:14] RegulationD: has joined #ruby
[03:33:57] codecop: has joined #ruby
[03:37:11] MartynKeigher: has left #ruby: ("Leaving")
[03:37:22] devoldmx: has joined #ruby
[03:37:48] i: has joined #ruby
[03:38:58] user1138: has joined #ruby
[03:39:17] BlackCoyote: has joined #ruby
[03:41:06] DiCablo: has joined #ruby
[03:41:40] Rodya_: has joined #ruby
[03:42:25] patdohere: has joined #ruby
[03:44:40] QualityAddict: has joined #ruby
[03:45:34] devoldmx: has joined #ruby
[03:46:16] diegoviola: has joined #ruby
[03:48:19] diegoviola: has joined #ruby
[03:49:08] diegoviola: has joined #ruby
[03:49:51] devoldmx: has joined #ruby
[03:50:44] dling: has joined #ruby
[03:51:01] devoldmx: has joined #ruby
[03:52:01] devoldmx: has joined #ruby
[03:52:13] DavidDudson: has joined #ruby
[03:52:50] fullofcaffeine: has joined #ruby
[03:53:19] devoldmx: has joined #ruby
[03:55:03] djbkd: has joined #ruby
[03:58:40] Spami: has joined #ruby
[03:58:57] berserk_ren: has joined #ruby
[04:01:40] aibot: has joined #ruby
[04:03:02] gguggi: has joined #ruby
[04:03:22] devbug: has joined #ruby
[04:08:07] blackmesa: has joined #ruby
[04:10:14] colegatron: has joined #ruby
[04:11:35] braincrash: has joined #ruby
[04:11:44] yeticry: has joined #ruby
[04:11:49] jhn: has joined #ruby
[04:11:49] zast: has joined #ruby
[04:12:54] Didac: has joined #ruby
[04:13:05] calderonroberto: has joined #ruby
[04:15:44] ascarter: has joined #ruby
[04:20:39] edwinvdgraaf: has joined #ruby
[04:23:23] DavidDudson: has joined #ruby
[04:28:22] pandb: has joined #ruby
[04:29:05] nerium: has joined #ruby
[04:30:04] pandb: What might be the cause of the error: "could not find FOO-x.y.z in any of the sources; Run `bundle install` to install missing gems," when I execute a command outside of the directory it was built in?
[04:30:45] pandb: it works fine i'm in the directory, but i'd like to be able to use the command outside it
[04:32:50] will_wielder: has joined #ruby
[04:33:20] supermarin: has joined #ruby
[04:33:21] JDiPierro: has joined #ruby
[04:34:08] gix: has joined #ruby
[04:34:29] devoldmx_: has joined #ruby
[04:35:55] revengeofbigd: has joined #ruby
[04:38:30] [k-_: has joined #ruby
[04:40:03] CrazyEddy: has joined #ruby
[04:40:48] tjad: has joined #ruby
[04:43:08] cjbottaro: has joined #ruby
[04:44:03] safe: has joined #ruby
[04:44:16] ramfjord: has joined #ruby
[04:45:28] lacuna: has joined #ruby
[04:45:28] lacuna: has joined #ruby
[04:45:43] govg: has joined #ruby
[04:46:05] elton: has joined #ruby
[04:46:08] inteq: has joined #ruby
[04:47:01] elton: has joined #ruby
[04:50:33] skweek: has joined #ruby
[04:50:40] devoldmx: has joined #ruby
[04:52:25] boxofrox: pandb: are you using rvm or rbenv?
[04:52:31] mallu: has joined #ruby
[04:53:18] christia1: has joined #ruby
[04:54:38] boxofrox: pandb: sounds like you're having trouble with the loadpath. perhaps this could shed some light. http://www.justinweiss.com/articles/how-do-gems-work/
[04:55:05] ascarter: has joined #ruby
[04:55:06] iateadonut: has joined #ruby
[04:56:04] will_wielder: has left #ruby: ()
[05:00:08] Puffball: has joined #ruby
[05:00:38] tjbiddle: has joined #ruby
[05:02:56] uris: has joined #ruby
[05:04:04] lyoshajapan: has joined #ruby
[05:05:28] astrobunny: has joined #ruby
[05:07:30] lyoshajapan: has joined #ruby
[05:10:27] blackmesa: has joined #ruby
[05:12:35] sarkis: has joined #ruby
[05:12:37] pandb: thanks boxofrox, and i'm using rvm
[05:21:25] djellemah_: has joined #ruby
[05:21:57] crdpink: has joined #ruby
[05:22:40] sarkis: has joined #ruby
[05:22:59] diego1: has joined #ruby
[05:23:50] diego1: has joined #ruby
[05:24:03] darkf: has joined #ruby
[05:25:41] boxofrox: pandb: rvm may be switching your gem environment when you leave the command's directory.
[05:26:30] devoldmx_: has joined #ruby
[05:27:13] tjbiddle: has joined #ruby
[05:30:13] supermarin: has joined #ruby
[05:32:51] sarkis: has joined #ruby
[05:33:58] RegulationD: has joined #ruby
[05:34:02] bronson: has joined #ruby
[05:34:08] yfeldblum: has joined #ruby
[05:35:08] yfeldblum: has joined #ruby
[05:38:12] delsol: has joined #ruby
[05:40:16] arooni: has joined #ruby
[05:40:56] diego1: has joined #ruby
[05:41:28] delsol: Question: So if I have a has_many THINGS relation... that 95+% of the time, DOESNT have any... rather than check the other associations table for the relations (if any), and active record querying the DB potentially a few hundred times to get COUNT of 0, couldn't I just use a has_many with a condition statement, and store THINGS 0/1 as a boolean in the main table?
[05:42:14] delsol: since its getting table.* anyways, at least then it wouldn't be loading the other tables unless there were actually records going to be there.
[05:42:41] delsol: ? Or should I just eager load/preload the relation and not care about the extra potential hundreds of queries?
[05:42:59] sarkis: has joined #ruby
[05:43:35] cwong_on_irc: has joined #ruby
[05:44:00] delsol: has joined #ruby
[05:44:00] delsol: has joined #ruby
[05:44:31] supermarin: has joined #ruby
[05:49:13] Rubie: has joined #ruby
[05:50:37] Arnvald: has joined #ruby
[05:51:37] chadmandoo: has joined #ruby
[05:51:50] chadmandoo: i have some issues installing RVM on OSX
[05:52:02] chadmandoo: i have to low of a version of bash
[05:52:11] chadmandoo: but if i brew upgrade bash then i have to high of a version
[05:53:10] crdpink: delsol: 4.1.2.3 :counter_cache http://guides.rubyonrails.org/association_basics.html sounds like it may be what you want
[05:54:53] sarkis: has joined #ruby
[05:59:52] stannard: has joined #ruby
[06:01:52] juddey: has joined #ruby
[06:02:46] Arnvald: has joined #ruby
[06:03:08] sarkis: has joined #ruby
[06:04:54] troys: has joined #ruby
[06:05:01] diego1: has joined #ruby
[06:11:30] exadeci: has joined #ruby
[06:11:57] evlute: has joined #ruby
[06:13:23] sarkis: has joined #ruby
[06:13:30] blackmesa: has joined #ruby
[06:13:46] ascarter: has joined #ruby
[06:14:29] djbkd: has joined #ruby
[06:14:38] delsol: crdpink: I don't suppose you'd know of a really easy way to time every function, to figure out where the squeaky wheel is performance wise?
[06:16:54] QualityAddict: has joined #ruby
[06:17:54] arup_r: has joined #ruby
[06:19:28] ohaibbq: has joined #ruby
[06:19:37] dionysus69: has joined #ruby
[06:21:26] wldcordeiro: has joined #ruby
[06:21:53] haxrbyte: has joined #ruby
[06:22:16] nbdy: has joined #ruby
[06:22:21] CpuID: has joined #ruby
[06:23:31] sarkis: has joined #ruby
[06:24:30] kp666: has joined #ruby
[06:26:45] haxrbyte: has joined #ruby
[06:27:05] passerine: has joined #ruby
[06:27:13] Symbiosisz: has joined #ruby
[06:29:48] lubarch: has joined #ruby
[06:31:10] elton: has joined #ruby
[06:33:36] sarkis: has joined #ruby
[06:34:04] Rubie: has joined #ruby
[06:34:16] trautwein: has joined #ruby
[06:35:22] haxrbyte: has joined #ruby
[06:36:22] steffkes: has joined #ruby
[06:36:22] steffkes: has joined #ruby
[06:38:26] elton: has joined #ruby
[06:39:22] lubarch: has joined #ruby
[06:39:29] skade: has joined #ruby
[06:39:58] mgorbach: has joined #ruby
[06:41:03] devoldmx: has joined #ruby
[06:42:10] sandstrom: has joined #ruby
[06:44:17] shanemcd: has joined #ruby
[06:45:31] sarkis: has joined #ruby
[06:46:40] haxrbyte: has joined #ruby
[06:49:57] haxrbyte: has joined #ruby
[06:50:05] lacuna: has joined #ruby
[06:51:05] mooe: has joined #ruby
[06:51:54] fullofcaffeine: has joined #ruby
[06:52:49] lyoshajapan: has joined #ruby
[06:53:41] bmalum: has joined #ruby
[06:55:12] fullofcaffeine: has joined #ruby
[06:56:23] lxsameer: has joined #ruby
[06:56:24] dopie: has joined #ruby
[06:57:31] sarkis: has joined #ruby
[06:59:05] maloik: has joined #ruby
[06:59:10] jackcom: has joined #ruby
[06:59:11] aufi: has joined #ruby
[07:00:59] djbkd: has joined #ruby
[07:02:51] Arnvald_: has joined #ruby
[07:03:54] Cohedrin: has joined #ruby
[07:04:33] claw: has joined #ruby
[07:04:38] puria: has joined #ruby
[07:05:32] evlute: has joined #ruby
[07:07:12] fullofcaffeine: has joined #ruby
[07:08:17] fullofcaffeine: has joined #ruby
[07:09:29] sarkis: has joined #ruby
[07:09:57] supermarin: has joined #ruby
[07:10:17] christiandsg: has joined #ruby
[07:10:23] sphex_: has joined #ruby
[07:10:33] jgt3: has joined #ruby
[07:13:03] Bloomer: has joined #ruby
[07:14:59] timonv: has joined #ruby
[07:16:07] jas02: has joined #ruby
[07:16:32] blackmesa: has joined #ruby
[07:19:32] sarkis: has joined #ruby
[07:19:40] fullofcaffeine: has joined #ruby
[07:20:06] yardenbar: has joined #ruby
[07:21:27] ndancer: has joined #ruby
[07:21:38] andikr: has joined #ruby
[07:21:50] dionysus69: has joined #ruby
[07:21:54] emilkarl: has joined #ruby
[07:24:05] baroquebobcat: has joined #ruby
[07:24:53] B1n4r10: has joined #ruby
[07:26:25] lemur: has joined #ruby
[07:28:06] gagrio_: has joined #ruby
[07:28:58] baweaver_: has joined #ruby
[07:29:16] lyoshajapan: has joined #ruby
[07:29:42] ixti: has joined #ruby
[07:29:45] sarkis: has joined #ruby
[07:31:00] fullofcaffeine: has joined #ruby
[07:31:50] fullofcaffeine: has joined #ruby
[07:32:45] fullofcaffeine: has joined #ruby
[07:33:29] sucks: has joined #ruby
[07:33:35] fullofcaffeine: has joined #ruby
[07:34:35] fullofcaffeine: has joined #ruby
[07:35:25] fullofcaffeine: has joined #ruby
[07:37:01] aganov: has joined #ruby
[07:37:58] agit0: has joined #ruby
[07:38:25] bigkevmcd: has joined #ruby
[07:39:53] sarkis: has joined #ruby
[07:41:52] benhuda: has joined #ruby
[07:43:26] lubarch: has joined #ruby
[07:44:52] anisha: has joined #ruby
[07:47:06] lemur: has joined #ruby
[07:47:08] dlitvak: has joined #ruby
[07:48:10] baweaver_: has joined #ruby
[07:49:15] coderhut: has joined #ruby
[07:49:58] sarkis: has joined #ruby
[07:50:54] rawrwx: has joined #ruby
[07:53:10] coderhut: Hi experts, how can I avoid user to paste "</script><script>alert('XSS');</script>" this into input box and avoid get it executed?
[07:53:31] steffkes: has joined #ruby
[07:53:32] steffkes: has joined #ruby
[07:53:55] bruce_lee2: has joined #ruby
[07:54:17] Sam0163141155: has joined #ruby
[07:54:36] Sam0163141155: Does anyone know where I can find documentation for interpolation in Ruby?
[07:54:38] Moosashi: has joined #ruby
[07:54:57] jbrhbr: has joined #ruby
[07:55:57] DeXterbed: has joined #ruby
[07:56:05] elton: has joined #ruby
[07:57:53] cornerma1: has joined #ruby
[07:59:07] linc01n: has joined #ruby
[08:00:10] sarkis: has joined #ruby
[08:00:15] fullofcaffeine: has joined #ruby
[08:03:48] lyoshajapan: has joined #ruby
[08:04:53] lyoshajapan: has joined #ruby
[08:05:35] sandstrom: has joined #ruby
[08:05:57] SCHAAP137: has joined #ruby
[08:06:50] tjad: has joined #ruby
[08:07:35] vivekananda: has joined #ruby
[08:08:03] futilegames: has joined #ruby
[08:09:50] jud: has joined #ruby
[08:09:51] jud: has joined #ruby
[08:10:13] RobertoS: has joined #ruby
[08:10:18] sarkis: has joined #ruby
[08:11:18] christiandsg: has joined #ruby
[08:11:26] lyoshajapan: has joined #ruby
[08:11:51] dionysus69: what is best way to thoroughly learn ruby? any book online course?
[08:11:58] maloik: has joined #ruby
[08:14:45] devoldmx: has joined #ruby
[08:14:50] coderhut: Hi experts, how can I avoid user to paste "</script><script>alert('XSS');</script>" this into input box and avoid get it executed?
[08:15:55] G: has joined #ruby
[08:16:39] djbkd: has joined #ruby
[08:17:29] arup_r: has joined #ruby
[08:17:30] elton: has joined #ruby
[08:17:51] brunto: has joined #ruby
[08:19:15] edwinvdgraaf: has joined #ruby
[08:19:21] ta: has joined #ruby
[08:19:33] blackmesa: has joined #ruby
[08:20:23] sarkis: has joined #ruby
[08:20:43] evlute: has joined #ruby
[08:22:03] wmdrossard: has joined #ruby
[08:29:58] wsewolod: has joined #ruby
[08:30:05] blaxter: has joined #ruby
[08:30:18] TomyWork: has joined #ruby
[08:30:35] sarkis: has joined #ruby
[08:32:28] blackms: has joined #ruby
[08:33:30] [k-: has joined #ruby
[08:33:36] Pumukel: has joined #ruby
[08:34:57] Moosashi: has joined #ruby
[08:37:57] hahuang65: has joined #ruby
[08:38:03] dlitvak: has joined #ruby
[08:38:10] TheHodge: has joined #ruby
[08:38:32] solars: has joined #ruby
[08:38:35] juddey: has joined #ruby
[08:38:44] arup_r: has joined #ruby
[08:39:04] brunto: has joined #ruby
[08:39:57] Hounddog: has joined #ruby
[08:40:32] anisha: has joined #ruby
[08:40:39] sarkis: has joined #ruby
[08:40:41] mark4: has joined #ruby
[08:43:20] skade: has joined #ruby
[08:44:15] tvw: has joined #ruby
[08:45:08] iwmrby: has joined #ruby
[08:47:34] bronson: has joined #ruby
[08:50:51] sarkis: has joined #ruby
[08:51:27] iwmrby: Hi. One small question. Newbie trying to create a blog app in Ruby. I have articles and comments. I am working on the controller for comments: when a new comment is created and saved I want to redirect back to the article with the id from params. Can I do that by doing redirect to /articles/#{params[:article_id]}? All the examples I find online are for more complicated things.
[08:51:38] Mon_Ouie: has joined #ruby
[08:51:39] blackmesa: has joined #ruby
[08:54:31] lubarch: has joined #ruby
[08:56:37] joonty: has joined #ruby
[08:57:33] Janno: @iwmrby I think you should do something like this: redirect_to article_path(id: params[:article_id])
[08:58:08] Janno: better yet, you could get article from saved comment like this: redirect_to comment.article
[08:58:34] iwmrby: I can do that?!
[08:58:45] iwmrby: Yes, I can because I have index defined for article.
[08:59:02] iwmrby: Ah, I kind of love Ruby.
[08:59:07] iwmrby: Thank you a lot!
[09:00:30] qiukun: has joined #ruby
[09:00:55] sarkis: has joined #ruby
[09:01:03] Mia: has joined #ruby
[09:01:04] Mia: has joined #ruby
[09:05:23] nettoweb: has joined #ruby
[09:06:02] lyoshajapan: has joined #ruby
[09:07:28] passerine: has left #ruby: ("Leaving")
[09:07:46] lyoshajapan: has joined #ruby
[09:09:49] drptbl: has joined #ruby
[09:10:46] Xentil: has joined #ruby
[09:11:06] symm-: has joined #ruby
[09:12:04] supermarin: has joined #ruby
[09:12:26] ibouvousaime: has joined #ruby
[09:12:43] hahuang65: has joined #ruby
[09:12:55] sarkis: has joined #ruby
[09:13:36] tomphp: has joined #ruby
[09:13:37] B1n4r10: has joined #ruby
[09:15:15] snowy: has joined #ruby
[09:15:57] christiandsg: has joined #ruby
[09:16:48] huyderman: has joined #ruby
[09:20:13] jhass: ?rails iwmrby
[09:20:14] ruboto: iwmrby, Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
[09:20:18] jhass: for the future ;)
[09:22:08] circ-user-mgcmJ: has joined #ruby
[09:22:59] bnizzle: has left #ruby: ()
[09:23:16] sarkis: has joined #ruby
[09:25:12] lyoshajapan: has joined #ruby
[09:26:06] armyriad: has joined #ruby
[09:26:07] NeverDie: has joined #ruby
[09:27:19] araujo: has joined #ruby
[09:27:20] araujo: has joined #ruby
[09:28:47] Zackio: has joined #ruby
[09:30:25] marr: has joined #ruby
[09:32:32] rdark: has joined #ruby
[09:33:01] fouriek: has joined #ruby
[09:33:11] sarkis: has joined #ruby
[09:35:31] iwmrby: did not know that. Thanks and apologies!
[09:35:37] lyoshajapan: has joined #ruby
[09:37:07] wmdrossard: has joined #ruby
[09:40:12] fouriek: has joined #ruby
[09:40:41] lurch_: has joined #ruby
[09:41:11] DeXterbed: has joined #ruby
[09:42:12] lubarch: has joined #ruby
[09:45:08] sarkis: has joined #ruby
[09:45:34] mahk: has joined #ruby
[09:48:51] Gamer-Pro: has joined #ruby
[09:49:32] bronson: has joined #ruby
[09:49:40] Gamer-Pro: Download this game from here
[09:49:40] Gamer-Pro: http://www.indiedb.com/games/spaceshooter-x1/downloads/spaceshooter-x1-update-for-windows
[09:49:41] Gamer-Pro: This game is the best game of the world
[09:50:47] jhass: !ban Gamer-Pro !T 1w spam
[09:50:49] ruboto: jhass, could not find a matching user for "Gamer-Pro"
[09:50:53] jhass: ah well, freenode was waster
[09:55:17] sarkis: has joined #ruby
[09:56:38] Bloomer: has joined #ruby
[09:58:37] howdoi: has joined #ruby
[09:59:21] favadi: has joined #ruby
[10:02:19] jackcom: has left #ruby: ()
[10:02:23] ghormoon: has joined #ruby
[10:04:28] blackmesa: has joined #ruby
[10:04:46] djbkd: has joined #ruby
[10:04:48] mahk: has joined #ruby
[10:05:25] sarkis: has joined #ruby
[10:06:01] vdamewood: has joined #ruby
[10:06:39] c0m0: has joined #ruby
[10:08:17] Bloomer: has joined #ruby
[10:08:41] BSaboia: has joined #ruby
[10:09:45] FooMunki: has joined #ruby
[10:10:07] colegatron: has joined #ruby
[10:12:20] shredding: has joined #ruby
[10:12:20] last_staff: has joined #ruby
[10:14:37] rodfersou: has joined #ruby
[10:14:56] blackms: can you point me in the right direction to learn ruby?
[10:15:25] blackms: I've a strong background in programming (c/c++ c# java python)
[10:15:29] devoldmx: has joined #ruby
[10:15:35] sarkis: has joined #ruby
[10:15:42] benhuda: has joined #ruby
[10:15:51] blackms: So I need something specifically for ruby
[10:16:03] blackms: I don't need to know what is a list or an array or an object
[10:16:28] blackms: I have to write a project in ruby to integrate it in fog cloud
[10:16:43] blackms: is there some book for non-beginners in programming but beginners in ruby?
[10:17:22] jds: has joined #ruby
[10:18:36] j2k: blackms Can not vouch - http://learnrubythehardway.org/book/
[10:18:42] christiandsg: has joined #ruby
[10:20:16] blackms: I already checked that, I need something more oriented to the advanced usage of classes/modules and I need to understand rake/bundle etc.
[10:20:36] shanemcd: has joined #ruby
[10:21:23] jhass: ?quickref blackms
[10:21:24] ruboto: blackms, http://www.zenspider.com/Languages/Ruby/QuickRef.html
[10:21:37] jhass: blackms: and then do the ruby koans
[10:21:53] blackms: jhass, tank you :)
[10:22:39] blackms: jhass, that seems to be perfect, thank you very much :)
[10:23:15] jhass: blackms: rake = build tool/task runner, bundler = dependency manager/enforcer, rubygems = library/package manager (used by bundler)
[10:23:42] jhass: the help/--help of all those tools should get you started
[10:23:48] blackms: thank you again
[10:23:56] blackms: you helped me a lot
[10:24:04] jhass: (rubygems executable is gem)
[10:24:21] blackms: gem it's the same as python pip
[10:24:33] jhass: pretty much yes
[10:24:54] fullofcaffeine: has joined #ruby
[10:25:07] dmolina: has joined #ruby
[10:25:11] blackms: ok, I can start really fast now
[10:25:41] arup_r: has joined #ruby
[10:27:05] Peg-leg: has joined #ruby
[10:27:30] sarkis: has joined #ruby
[10:28:04] darix: banister: do you know if there is something like pry for python. especially with a binding.pry alike?
[10:28:19] banister: darix ipython i think
[10:28:31] toretore: has joined #ruby
[10:30:21] solars: has joined #ruby
[10:34:39] azgil: has joined #ruby
[10:35:13] qiukun: has joined #ruby
[10:35:43] cwong_on_irc: has joined #ruby
[10:36:02] vayan: has left #ruby: ()
[10:36:07] skade: has joined #ruby
[10:38:12] qiukun: has joined #ruby
[10:39:20] cwong_on_irc1: has joined #ruby
[10:39:30] sarkis: has joined #ruby
[10:39:38] qiukun: has joined #ruby
[10:39:59] qiukun: has joined #ruby
[10:40:33] tomaz_b: has joined #ruby
[10:41:15] jhass: blackms: ^ reminds me, replace irb (REPL) with pry right away, install pry-doc too
[10:43:10] qiukun: has joined #ruby
[10:44:47] qiukun: has joined #ruby
[10:44:52] blackms: jhass, I'm using an IDE to develop, I don't need an interactive shell for now
[10:45:08] elton: has joined #ruby
[10:45:28] blackms: well... could be usefull anyway, ok I'm going to install it
[10:45:36] qiukun: has joined #ruby
[10:45:55] jhass: blackms: pry is also a good debugger and still good for quick experiments. It has tab completion, show docs, show source and all that stuff
[10:47:03] blackmesa: has joined #ruby
[10:47:44] qiukun: has joined #ruby
[10:48:44] cwong_on_irc: has joined #ruby
[10:49:07] lyoshajapan: has joined #ruby
[10:51:26] sarkis: has joined #ruby
[10:53:06] azgil: jhass, is possible create debugger for crystal, simialr to visual studio or idea ide
[10:53:22] jhass: azgil: wrong channel?
[10:53:58] qiukun: has joined #ruby
[10:54:01] azgil: jahss, why& i only asl one question
[10:54:23] jhass: but it's not a Ruby question and Crystal has its own channel
[10:54:31] azgil: and crystal similar to ruby
[10:54:32] ldnunes: has joined #ruby
[10:54:43] ddv: asl jhass
[10:54:46] jhass: only on the surface
[10:54:54] ddv: ??, male, germany
[10:54:59] nfk|laptop: has joined #ruby
[11:00:44] circ-user-mgcmJ: has joined #ruby
[11:01:36] sarkis: has joined #ruby
[11:02:05] platzhirsch: has joined #ruby
[11:02:24] B1n4r10: has joined #ruby
[11:03:10] benhuda: has joined #ruby
[11:04:05] afisher: has joined #ruby
[11:05:04] zotherstupidguy: has joined #ruby
[11:06:32] iwmrby: has joined #ruby
[11:07:46] darix: blackms: you have no idea how much it rocks to do "binding.pry" in your script and get a REPL right in that spot. with all data present so you can tinker with it
[11:08:38] InvGhost: has joined #ruby
[11:08:42] Spami: has joined #ruby
[11:08:47] blackmesa: has joined #ruby
[11:08:51] Pathfinder: has joined #ruby
[11:10:23] casadei: has joined #ruby
[11:10:56] industrial: has joined #ruby
[11:11:26] [k-: i nvr used a debugger for ruby in my entire lyfe
[11:11:33] industrial: Hi. I remember there being a gem that gives you a git command that does a stash (if any), pull and rebase and cancels the whole thing and puts it back in unconflicted state if it messes up anywhere along the line
[11:11:36] industrial: Anyone know the name?
[11:11:44] sarkis: has joined #ruby
[11:12:53] colli5ion: has joined #ruby
[11:14:25] dlitvak: has joined #ruby
[11:14:56] supermarin: has joined #ruby
[11:17:46] qiukun: has joined #ruby
[11:17:55] lubarch: has joined #ruby
[11:18:27] blackms: darix, I achieve the same thing with rubymine in debug mode
[11:18:42] blackms: and yes, it's essential for me
[11:18:59] cwong_on_irc: has joined #ruby
[11:19:03] blackms: fundamental it's a better word to describe it
[11:19:24] cwong_on_irc: has joined #ruby
[11:20:16] tAn: has joined #ruby
[11:21:06] bigmac: has joined #ruby
[11:21:49] sarkis: has joined #ruby
[11:25:19] christiandsg: has joined #ruby
[11:26:19] chridal: has joined #ruby
[11:28:57] _joes__: has joined #ruby
[11:30:08] c-c: has joined #ruby
[11:31:33] c-c: Quadtree - would using NArray with arrays of arrays like [[[],[],[],[]],[...],[],[]] be a good or bad idea for this?
[11:32:04] sarkis: has joined #ruby
[11:34:11] kam270: has joined #ruby
[11:36:06] wmdrossard: has joined #ruby
[11:36:52] evlute: has joined #ruby
[11:37:11] shredding: has joined #ruby
[11:38:05] wasane: has joined #ruby
[11:38:31] Mon_Ouie: has joined #ruby
[11:39:46] TTilus: blackms: believe me, it is not the same thing, just check shell mode, show-method, edit-method, state navigation, gist integration, et.al. ;)
[11:40:42] ponga: has joined #ruby
[11:41:06] blackms: TTilus, ok, I'll give it a try :)
[11:42:40] sameerynho: has joined #ruby
[11:43:39] zarubin: has joined #ruby
[11:43:46] durstburger: has joined #ruby
[11:43:57] sarkis: has joined #ruby
[11:43:58] TTilus: rubymine debugging works nicely and you sure will use it if you continue using rubymine, but still, pry is way worthy addition to your toolbox
[11:44:18] Azure: has joined #ruby
[11:45:03] emilkarl: has joined #ruby
[11:45:44] nazar: has joined #ruby
[11:46:20] Azure: has joined #ruby
[11:46:27] elton: has joined #ruby
[11:48:16] skade: has joined #ruby
[11:49:54] bronson: has joined #ruby
[11:53:30] lyoshajapan: has joined #ruby
[11:54:19] bmalum_: has joined #ruby
[11:54:35] yfeldblum: has joined #ruby
[11:55:29] wireshark: has joined #ruby
[11:56:30] jgt3: has joined #ruby
[12:00:18] Ishido: has joined #ruby
[12:00:36] monthy: has joined #ruby
[12:01:15] Macaveli: has joined #ruby
[12:01:46] dlitvak: has joined #ruby
[12:02:07] Macaveli: has joined #ruby
[12:03:46] maloik: has joined #ruby
[12:04:11] sarkis: has joined #ruby
[12:05:15] HakN96: has joined #ruby
[12:05:33] mostlybadfly: has joined #ruby
[12:06:43] emilkarl: has left #ruby: ()
[12:06:50] jgpawletko: has joined #ruby
[12:06:50] djbkd: has joined #ruby
[12:08:23] CloCkWeRX: has joined #ruby
[12:08:31] casadei: has joined #ruby
[12:09:59] benhuda: has joined #ruby
[12:11:24] Pathfinder: has joined #ruby
[12:11:31] HakN96: has joined #ruby
[12:12:54] krzkrzkrz: has joined #ruby
[12:14:02] legohead: has joined #ruby
[12:14:31] legohead: Hey, is there anyway in a rake task to run tests and get if they all passed or not?
[12:15:04] robert_: has joined #ruby
[12:15:25] jhass: ?xy legohead
[12:15:26] ruboto: legohead, it seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
[12:16:33] wmdrossard: has joined #ruby
[12:17:10] brunto: has joined #ruby
[12:19:13] edwinvdg_: has joined #ruby
[12:21:07] jschmid: has joined #ruby
[12:22:59] afisher: Hi. I'm a ruby newbie and have recently configured rubocop on my project.
[12:23:45] afisher: I've a couple of methods that fail the ABC metric. Instead of turning off the check, I was wondering if anyone would like to offer refactoring suggestions?
[12:25:12] ruboto: We can't help you without your code, please post it to https://gist.github.com
[12:25:14] afisher: https://github.com/alexjfisher/puppet-fme/blob/registered_services/lib/puppet/provider/fme_repository_item/rest_client.rb#L67
[12:25:26] favadi: has joined #ruby
[12:25:32] afisher: and https://github.com/alexjfisher/puppet-fme/blob/registered_services/lib/puppet/provider/fme_repository_item/rest_client.rb#L114
[12:25:40] afisher: both fail after my latest commit.
[12:26:12] afisher: They don't look too bad to me, but I'm not really a programmer and am new to Ruby.
[12:26:19] christiandsg: has joined #ruby
[12:26:40] xet7: has joined #ruby
[12:27:37] radgeRayden: has joined #ruby
[12:27:46] afisher: I am interested in improving though, so thought I'd see what experienced rubyists might suggest.
[12:30:08] vivekananda: has joined #ruby
[12:30:10] [k-: your code really looks alright to me
[12:31:18] [k-: http://c2.com/cgi/wiki?AbcMetric
[12:31:28] aryaching: has joined #ruby
[12:32:02] [k-: On line 116, you could remove the {} though
[12:33:22] [k-: i don't see how this ABC metric is useful at all though...
[12:34:37] sankaber: has joined #ruby
[12:36:06] dlitvak: has joined #ruby
[12:36:11] CloCkWeRX: has left #ruby: ()
[12:37:01] crdpink2: has joined #ruby
[12:37:15] mcanevet: has joined #ruby
[12:38:39] A124: has joined #ruby
[12:39:33] user1138: has joined #ruby
[12:39:55] Xentil: has joined #ruby
[12:40:24] afisher: k-: Thanks. ABC better than 'lines per method' though.
[12:41:40] mcanevet: Hello, I have one strange issue with IO.reopen here : https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util.rb#L260, it fails but I can't catch any exception (I tried putting begin .. rescue around the failing instruction)
[12:41:48] Xentil: has joined #ruby
[12:41:49] nettoweb: has joined #ruby
[12:42:03] jhass: "it fails"
[12:42:04] mcanevet: I'm using ruby 2.1.7
[12:42:46] mcanevet: If I puts some debug just after the instruction it does not print
[12:42:48] B1n4r10: has joined #ruby
[12:43:21] jhass: that's your only assertion for "it fails"?
[12:44:27] mcanevet: jhass, well "I don't know what happens" if you prefers :-)
[12:44:48] jhass: then how do you know that is wrong at all?
[12:45:11] kam270: has joined #ruby
[12:45:18] afisher: ACTION thinks mcanevet might be stalking him :)
[12:45:29] yfeldblum: has joined #ruby
[12:45:30] duckpuppy: has joined #ruby
[12:46:34] mcanevet: jhass, If I add "puts 'foo'" just after "begin $stdout.reopen(stdout) rescue puts "failure" end" it does not print either 'foo' nor 'failure'
[12:46:59] jhass: mcanevet: that's pretty expected, Kernel#puts is essentially $stdout.puts
[12:47:33] mcanevet: jhass, how can I add some debugging stuffs ?
[12:48:03] jhass: get a copy of the inherited stdout before reopening it
[12:48:10] jhass: &ri IO::dup
[12:48:11] `derpy: class `IO`: The IO class is the basis for all input and output in Ruby. An I/O stream may be??? ??? http://rubydoc.info/stdlib/core/IO
[12:48:35] jhass: nvm that one
[12:50:19] devbug: has joined #ruby
[12:50:41] minimalism: has joined #ruby
[12:51:06] lyoshajapan: has joined #ruby
[12:51:25] bronson: has joined #ruby
[12:51:27] [k-: i think you use . for class methods
[12:51:43] apeiros: not in documentation
[12:51:43] jhass: meh, guess you have to open a random file or make a pipe and reopen it to the original stdout prior reopen stdout to whatever you reopen it to
[12:51:55] apeiros: ri uses . for "either instance- or class-method"
[12:52:04] apeiros: and ::/# when you want to be specific
[12:52:25] banister: has joined #ruby
[12:52:56] mcanevet: jhass, OK thanks, now I understand at least why my puts does not print... I'll try to debug a bit more
[12:54:21] SOLDIERz: has joined #ruby
[12:55:43] DeXterbed: has joined #ruby
[12:56:19] lkba: has joined #ruby
[12:56:33] InvGhost: has joined #ruby
[12:57:33] sdothum: has joined #ruby
[12:58:25] aryaching: has joined #ruby
[12:59:39] lubarch: has joined #ruby
[13:00:16] krzkrzkrz: Is there a better way to write this: `"foo-profile,bar-profile".split(',').map(&:underscore).map(&:classify)` which should return `['FooProfile', 'BarProfile']`
[13:00:18] krzkrzkrz: Im more concerned about declaring `map` twice. Too bad you can't do `map(&:underscore.classify)`
[13:01:06] blackmesa: has joined #ruby
[13:01:42] skade: has joined #ruby
[13:02:23] joonty: has joined #ruby
[13:03:15] c-c: krzkrzkrz: find real problems to solve ;)
[13:03:44] c-c: you've reached the pinnacle of string handling in the world of computer science
[13:05:47] mcanevet: jhass, OK I outputed the debug to a file and noticed that the problem does not come from IO.reopen. Thanks for pointing me out that when reopening $stdout I couldn't output to stdout anymore
[13:06:45] InvGhost: has joined #ruby
[13:06:55] tulak: has joined #ruby
[13:07:14] krzkrzkrz: c-c: Hehe ok, will stick with the double map
[13:08:10] c-c: technically, you could just substitute '-p' with 'P' but that solution will work for much smaller subset
[13:14:41] synthroid: has joined #ruby
[13:16:46] codecop: has joined #ruby
[13:16:59] supermarin: has joined #ruby
[13:18:55] d0nn1e: has joined #ruby
[13:24:53] dorei: has joined #ruby
[13:25:17] blackmesa: has joined #ruby
[13:25:36] saddad: has joined #ruby
[13:27:17] GinoManWorks: has joined #ruby
[13:27:41] jgt3: has joined #ruby
[13:28:26] Bellthoven: has joined #ruby
[13:29:06] christiandsg: has joined #ruby
[13:30:08] Rutix: has joined #ruby
[13:30:08] Rutix: has joined #ruby
[13:31:30] arup_r: has joined #ruby
[13:35:12] Macaveli_: has joined #ruby
[13:35:17] vivekananda: has joined #ruby
[13:36:27] Macaveli_: has joined #ruby
[13:37:34] joonty: has joined #ruby
[13:39:42] InvGhost: has joined #ruby
[13:40:49] B1n4r10: has joined #ruby
[13:40:52] c355E3B: has joined #ruby
[13:41:41] sgambino: has joined #ruby
[13:41:56] goodcodeguy: has joined #ruby
[13:42:39] faisal: has joined #ruby
[13:43:11] brendan-: has joined #ruby
[13:45:36] lyoshajapan: has joined #ruby
[13:46:09] kobain: has joined #ruby
[13:46:19] shanemcd: has joined #ruby
[13:47:46] elton: has joined #ruby
[13:48:01] nopolitica: has joined #ruby
[13:51:42] joonty: has joined #ruby
[13:51:45] aryaching: has joined #ruby
[13:51:46] atomical: has joined #ruby
[13:52:06] CrazyEddy: has joined #ruby
[13:53:41] favadi: has joined #ruby
[13:54:25] Jardayn: has joined #ruby
[13:54:59] sarkis: has joined #ruby
[13:55:00] kam270: has joined #ruby
[13:55:11] zotherstupidguy: has joined #ruby
[13:56:46] zotherstupidguy: is there a gem for html_safe?
[13:56:55] shevy: hmm what is html safe doing
[13:57:05] zotherstupidguy: it escapes dangerous stuff :)
[13:57:31] shevy: well there is CGI.escape_html() or so, not sure if that is the safeness you want though
[13:57:33] zotherstupidguy: its a method in rails's active support gem,
[13:57:44] shevy: aha, then it probably does more than what CGI offers
[13:57:53] jhass: zotherstupidguy: that's not actually how it works
[13:58:15] shevy: can't you actually factor out that code zotherstupidguy? the methods should be in pure ruby, there usually is a "view source" link
[13:58:19] jhass: zotherstupidguy: it rather is marking a string for exemption from escaping by the template engine
[13:59:01] shevy: jackcom asks me in PM how to get unbanned... which channel was it again where he could ask?
[13:59:02] jackcom: has joined #ruby
[13:59:03] jhass: zotherstupidguy: http://devdocs.io/ruby/cgi/util#method-i-escape_html might be good enough for you
[13:59:10] jhass: shevy: #ruby-banned
[13:59:23] zotherstupidguy: lol ruby-banned :)
[13:59:39] shevy: I think it's the second time he managed to get banned now :D
[14:00:21] CloCkWeRX: has joined #ruby
[14:00:43] zotherstupidguy: so all the banned from ruby and ruby-offtopic end up there? :D
[14:01:10] [k-: only if they want to appeal their bans
[14:01:16] zotherstupidguy: they should organize a party
[14:05:58] vdamewood: has joined #ruby
[14:06:12] shevy: #ruby-offtopic is different, they play unicode hangman there
[14:07:36] Zarthus: I wonder how much of it my client will choke on
[14:07:39] JDiPierro: has joined #ruby
[14:08:47] banister: has joined #ruby
[14:09:06] shevy: your ruby IRC client?
[14:09:49] Zarthus: my windows mIRC IRC client that finds it funny to replace non-ascii to [?] symbols at ranodm
[14:09:57] Zarthus: it seems like it's encoding is ensured 50% of the time.
[14:10:43] shanemcd: has joined #ruby
[14:10:59] shevy: ohhh... good old mIRC... people love doing this
[14:11:02] c-c: Perhaps it is your ssh client that has incorrect encoding.
[14:12:01] shanemcd: has joined #ruby
[14:13:04] skweek: has joined #ruby
[14:15:36] jackcom: has left #ruby: ()
[14:16:15] skweek: has joined #ruby
[14:16:28] ramortegui: has joined #ruby
[14:17:39] yaewa: has joined #ruby
[14:17:40] skweek: has joined #ruby
[14:18:23] GinoManWorks: How well do you have to know ruby to write a script that will look for #include "*" 's and expand them and write the resultant file to the hard drive?
[14:19:04] skweek: has joined #ruby
[14:19:10] sankaber: has joined #ruby
[14:19:26] TomPeed: has joined #ruby
[14:19:26] c-c: GinoManWorks: you mean, read files, look for string, and whats "expand them", substitute with path? and write?
[14:19:36] GinoManWorks: substitute with file contents
[14:19:48] canton7: so basically 'gcc -E'?
[14:19:57] GinoManWorks: I'm on windows though
[14:20:08] moei: has joined #ruby
[14:20:25] Jardayn: has joined #ruby
[14:20:30] canton7: gcc exists on windows
[14:20:49] GinoManWorks: as cygwin/mingw
[14:20:50] c-c: From inside the directory in question:
[14:20:51] c-c: $ ruby -pi -e 'gsub("target", "practice")' *
[14:20:51] c-c: James Edward Gray II
[14:21:26] mariusz_eu: has joined #ruby
[14:21:26] c-c: oh, substitute file contents, never mind
[14:21:37] canton7: I'm just saying that using gcc is probably going to be easier. You haven't mentioned it, but presumably you'll need to do this recursively? And pay attention to include guards?
[14:21:46] GinoManWorks: canton7: other problem, gcc -E preprocesses defines and ifdefs
[14:21:47] c-c: is this like rewriting make in ruby?
[14:22:03] c-c: GinoManWorks: perhaps you actually wanted Rake
[14:22:07] GinoManWorks: canton7: actually not paying attention to include guards
[14:22:23] canton7: so if one file's included twice, it's substituted twice?
[14:22:40] GinoManWorks: canton7: I don't mind that, the include guards are part of the file contents
[14:23:04] canton7: right. how about recursive #includes?
[14:23:17] mariusz_eu: has left #ruby: ()
[14:23:29] GinoManWorks: essentially the point is to take a header which is a composite header (just contains a whole bunch of #include "..." lines) and form it into a single header file without needing all it's extras
[14:23:36] c-c: do you ever get the feeling that you are doing it wrong?
[14:23:50] c-c: I get that all the time, phew
[14:24:26] GinoManWorks: c-c: you're right, the "right way" would be to copy the entire directory structure .h, .mm, and .cpp files and all into my include path
[14:24:47] GinoManWorks: Doesn't seem quite right to me though to have all that extra stuff (.mm and .cpp files) in my include dir
[14:25:08] GinoManWorks: or for the includes to be split among a messy directory tree that increases typing
[14:25:38] CloCkWeRX: has left #ruby: ()
[14:26:45] lukeasrodgers: has joined #ruby
[14:27:05] c-c: Perhaps you should start with asking the right question. What is it that you actually wanted to do
[14:27:15] GinoManWorks: and yes, recursive including will need to be done. I think the most efficient way to do that is to then process the subbed file contents after subbing them
[14:27:35] chandlerbing: has joined #ruby
[14:27:40] legohead: has joined #ruby
[14:28:10] bnizzle: has joined #ruby
[14:28:15] ItSANgo: has joined #ruby
[14:28:45] mary5030: has joined #ruby
[14:28:47] blackmesa: has joined #ruby
[14:29:19] bnizzle: has left #ruby: ()
[14:29:38] GinoManWorks: I have an open source library that I downloaded which is compatable with windows and provides a lot of functionality I want in C++ (my lingua franca for most things) but they have a directory with seperate modules, then each module is it's own directory, then each module dir has a single "module_name.h" and a lithany of sub-modules that the "module_name.h" includes. additionally there's a "module_name.cpp" file which conditionally includes the
[14:29:38] GinoManWorks: submodule's .cpp/.mm files depending on platform and contains all the implimentation when preprocessed.
[14:30:00] trajing: has joined #ruby
[14:30:04] c-c: GinoManWorks: I get the feeling you should learn how to use rubygems, and then use the cmake gem(s) to use ruby to use cmake to play with your project build/templates.
[14:30:43] c-c: yeah, implies: learn cmake
[14:30:58] dlitvak: has joined #ruby
[14:31:37] ljarvis: how do you work
[14:31:50] Didac: has joined #ruby
[14:31:52] christiandsg: has joined #ruby
[14:32:50] fullofcaffeine: has joined #ruby
[14:33:27] GinoManWorks: c-c: Ultimately the goal is to have .dlls and .lib files that you can either statically or dynamically link that library
[14:34:00] c-c: often so when using C++
[14:34:14] colli5ion: has joined #ruby
[14:34:15] Macaveli: has joined #ruby
[14:34:33] weckl: has joined #ruby
[14:35:38] c-c: GinoManWorks: maybe you really wanted this https://github.com/joeyates/rake-builder
[14:36:01] GinoManWorks: rake-builder?
[14:36:15] c-c: "Builds C, C++ and Objective-C projects using GCC."
[14:36:40] babblebre: has joined #ruby
[14:36:41] c-c: written in ruby
[14:37:27] c-c: GinoManWorks: try typing in console: gem search rake-builder
[14:39:11] symm-: has joined #ruby
[14:39:24] daivyk: has joined #ruby
[14:40:39] c-c: GinoManWorks: oops, that may not work on Windows, has xutils-dev as dependency - at the least would need Cygnus on Win, maybe not enough
[14:41:04] GinoManWorks: Cygwin you mean?
[14:41:21] c-c: whatsitcalled yeah
[14:42:21] GinoManWorks: But ultimately I would need to know strings, file io, regexs,
[14:42:57] c-c: not regexes necessarily
[14:43:00] scepticulous: has joined #ruby
[14:43:15] chadmandoo: has joined #ruby
[14:43:16] c-c: compared to C++, ruby is something of a cakewalk
[14:44:14] chadmandoo: hey all. I have an issue installing rvm because on my mac I have a lower version of BASH but when i use homebrew to update bash i then too high of a version
[14:44:36] lyoshajapan: has joined #ruby
[14:45:11] scepticulous: compared to c++ most languages shine
[14:45:18] c-c: chadmandoo: thats not really a ruby problem
[14:45:35] c-c: chadmandoo: but I believe you should be able to set the target bash version to install with your package manager
[14:47:39] aibot: has joined #ruby
[14:47:48] GinoManWorks: well, I was thinking regexes because [ #include "..."] and [# include "..."] and [ # include "..."] are all legal
[14:48:03] chadmandoo: i have ruby installed by default its version 2.0 something. is that high enough to do most things in ruby for learning?
[14:48:11] evlute: Papierkorb: hello, are you here? :)
[14:48:13] chadmandoo: ruby 2.0.0p481
[14:48:25] chadmandoo: for learning purposes that version of ruby ok?
[14:48:40] elton: has joined #ruby
[14:48:43] Papierkorb: chadmandoo: meh. uses 2.2 if at all possible
[14:49:08] chadmandoo: i may need a vagrant box then
[14:49:14] malconis: has joined #ruby
[14:49:18] Papierkorb: chadmandoo: esp "for learning purposes". there doesn't have been *that* many changes since that version, still, learning the old junk while there's something newer is strange to me
[14:49:34] Papierkorb: chadmandoo: use chruby or rvm
[14:49:43] chandlerbing_: has joined #ruby
[14:50:16] steffkes: has joined #ruby
[14:50:17] steffkes: has joined #ruby
[14:50:18] chadmandoo: Papierkorb: the problem i am running into is trying to install rvm mac OSX version of bash is lower and if i upgrade via homebrew it raises to a too high of version of bash. so im struggling with trying to get the correct version of bash just to install
[14:50:46] chadmandoo: maybe ill try chruby
[14:51:04] Papierkorb: there's a third tool to get you a recent ruby, but I forgot its name
[14:51:18] govg: has joined #ruby
[14:51:28] evlute: Papierkorb: yesterday you showed me about the composite pattern. now i tried so create a pseudo filesystem objecttree on this pattern - http://nopaste.linux-dev.org/?878901 - it's the composite principle, right?
[14:52:40] evlute: your example was better Papierkorb - but this uses the right principle - doesn't it?
[14:52:51] Papierkorb: evlute: the code isn't really ruby-ish, but apart from that, looks like one, yes.
[14:53:34] evlute: because i'm not using attr_reader/writer?
[14:53:35] uris: has joined #ruby
[14:53:46] thejoecarroll: has joined #ruby
[14:54:04] bronson: has joined #ruby
[14:54:13] whippythellama: has joined #ruby
[14:54:30] scepticulous: evlute: for example because of the explicit "return"
[14:54:33] chadmandoo: found something called ruby-install
[14:54:36] Papierkorb: evlute: for one, yes (That's actually a sign of bad code if you don't use them). second, ruby uses_this_scheme andNotThis for methods. the 'get', 'set' prefix for variable getters/setters is discouraged (see attr_*)
[14:54:48] Papierkorb: Explicit return is another thing. if not needed, leave it out
[14:55:10] evlute: the return is a "bad" habit from another langs...
[14:55:25] Papierkorb: yeah it takes some getting used to at first
[14:55:53] scepticulous: big_boobs_xxx.avi ... I see
[14:56:14] Papierkorb: mixing german and english code is also interesting
[14:56:24] evlute: this was just a joke...
[14:56:51] Papierkorb: ACTION afk
[14:59:01] aibot: has joined #ruby
[14:59:39] arup_r: has joined #ruby
[14:59:51] chadmandoo: has left #ruby: ()
[15:00:15] B1n4r10: has joined #ruby
[15:01:13] stannard: has joined #ruby
[15:01:58] aryaching_: has joined #ruby
[15:02:22] thelastinuit: has joined #ruby
[15:03:12] iwmrby: has joined #ruby
[15:03:46] decoponio: has joined #ruby
[15:04:16] JDiPierro: has joined #ruby
[15:04:34] ledestin: has joined #ruby
[15:04:48] [k-: has joined #ruby
[15:05:02] benhuda: has joined #ruby
[15:05:16] DeXterbed: has joined #ruby
[15:05:41] evlute: http://nopaste.linux-dev.org/?878903 - scepticulous better ruby style?
[15:05:53] freerobby: has joined #ruby
[15:06:39] malconis: has joined #ruby
[15:08:32] B1n4r10: has joined #ruby
[15:09:43] Pumukel: has joined #ruby
[15:10:26] kao: has joined #ruby
[15:10:48] voodo: has joined #ruby
[15:11:08] mary5030: has joined #ruby
[15:11:10] akem: has joined #ruby
[15:11:22] futilegames: has joined #ruby
[15:11:25] rawrwx: has joined #ruby
[15:12:23] seitensei: has joined #ruby
[15:12:23] seitensei: has joined #ruby
[15:13:15] p0wn3d: has joined #ruby
[15:15:02] [k-: has joined #ruby
[15:15:29] ethe: has joined #ruby
[15:16:16] axl_: has joined #ruby
[15:18:18] devbug: has joined #ruby
[15:18:56] supermarin: has joined #ruby
[15:21:39] kgirthofer: has joined #ruby
[15:22:03] pdoherty: has joined #ruby
[15:23:46] shevy: it looks a bit C++ inspired, I assume you are a C++ programmer? :)
[15:24:59] whippythellama: has joined #ruby
[15:25:26] kgirthofer: how do you rspec the changing of a variable within an if statement? i.e. https://gist.github.com/Kgirthofer/b1b35c8cb3ae86fb410c
[15:25:38] _stu_: has joined #ruby
[15:26:42] RegulationD: has joined #ruby
[15:27:09] [k-: puts returns nil
[15:27:25] [k-: afterwards, you might get a scolding from jhass too
[15:28:15] jhass: kgirthofer: what's wrong with your current specs?
[15:28:17] banister: has joined #ruby
[15:28:27] [k-: to clarify, what i meant was, since puts is the last statement executed in the method, it would return nil
[15:28:59] tulak: has joined #ruby
[15:29:20] kgirthofer: it fails - it says expected 'policy' received nil
[15:29:26] jhass: code could be simplified to @status = @type || "error" or probably even getting rid of either and @status ||= "error"
[15:29:32] pontiki: maybe i'm missing something, but how does @type in set_type get set?
[15:29:38] shevy: by magic!
[15:29:43] jhass: kgirthofer: then you probably never call it
[15:29:46] Rubie: has joined #ruby
[15:29:47] Sou|cutter: I don't see set_type called at all
[15:29:48] radgeRayden_: has joined #ruby
[15:29:48] pontiki: thanks! i forget magic!
[15:29:53] jhass: this hard to judge without seeing all of the code
[15:31:20] Sou|cutter: also I'm curious - does this object actually DO something with the type? It might be more worth testing the behavior of what it does with that variable than the value of the variable itself. Hard to tell from this snippet though
[15:31:31] [k-: hm, seems like i completely failed to read the code
[15:31:39] colegatron: has joined #ruby
[15:31:49] kgirthofer: not yet - it just sets status depending on the type passed in
[15:31:56] kgirthofer: i'm going to do things with it later
[15:32:57] kgirthofer: and @type is set with let(:type) { 'policy' }
[15:33:07] Sou|cutter: that does not call set_type
[15:33:38] pontiki: that's not something i've ever seen rspec do...
[15:33:47] colli5ion: has joined #ruby
[15:33:48] Sou|cutter: it just creates a memoized variable 'type'
[15:34:11] Sou|cutter: expect(type).to eq 'policy' <-- that's all you're getting from that statement
[15:34:14] dionysus69: has joined #ruby
[15:34:28] [k-: has left #ruby: ()
[15:34:35] christiandsg: has joined #ruby
[15:34:47] kgirthofer: subject.set_type
[15:34:59] InvGhostt: has joined #ruby
[15:35:01] kgirthofer: I see so I have to call each method in the code to action - makes sense now
[15:35:10] jhass: probably something your initialize should do
[15:36:02] The_Phoenix: has joined #ruby
[15:36:29] kgirthofer: is it best to call each block in initialize? or in each definition
[15:36:42] Sou|cutter: line 23-24 the description of that block does not match the actual setup
[15:37:31] dlitvak: has joined #ruby
[15:38:06] kgirthofer: 2nd half of line 2?
[15:38:20] Sou|cutter: also set_type appears to set a status variable, which means the method name is not descriptive
[15:38:38] rippa: has joined #ruby
[15:38:40] pontiki: unless "set" is an adjective, not a verb
[15:38:41] The_Phoenix: has joined #ruby
[15:39:06] pontiki: but then i'd expect it to return the set type
[15:39:07] lyoshajapan: has joined #ruby
[15:40:23] kgirthofer: setting status var is just temporary so I can get used to writing the spec tests
[15:40:32] Sou|cutter: kgirthofer: nil and '' are not the same
[15:40:38] Sou|cutter: that's what I was saying there
[15:40:45] futilegames: has joined #ruby
[15:40:45] kgirthofer: ah ok I understand
[15:40:52] kgirthofer: empty is a better word choice - you're right
[15:41:29] PaulCapestany: has joined #ruby
[15:41:37] Sou|cutter: It might help to write the test without looking at the implementation so that you can make the test describe what you actually want the code to do instead of nailing down this exact implementation
[15:42:15] casadei: has joined #ruby
[15:42:35] Bloomer: has joined #ruby
[15:43:33] puria: has joined #ruby
[15:43:56] grill: has joined #ruby
[15:44:54] dlitvak: has joined #ruby
[15:46:21] jds: has joined #ruby
[15:46:35] dmcp: has joined #ruby
[15:46:38] Sou|cutter: e.g. context "#status" { it "defaults to 'policy' when no --type is supplied" { expect(Foo.new('').status).to eq 'policy' } }
[15:46:43] jessemcgilallen: has joined #ruby
[15:46:54] Sou|cutter: Now #set_type is an implementation detail that the test doesn't care about
[15:47:05] Sou|cutter: assuming it gets called in the constructor or something
[15:47:35] steffkes: has joined #ruby
[15:47:36] steffkes: has joined #ruby
[15:47:45] Sou|cutter: I'm making a lot of assumptions here because I have no idea what the code is really doing
[15:47:56] kgirthofer: no - I think you're right on point
[15:47:56] skade: has joined #ruby
[15:48:24] podman: has joined #ruby
[15:48:43] lacuna: has joined #ruby
[15:51:41] banister: has joined #ruby
[15:51:44] faisal_: has joined #ruby
[15:52:08] _joes__: has joined #ruby
[15:53:01] Coral: has joined #ruby
[15:55:27] trautwein: has joined #ruby
[15:56:26] akem: has joined #ruby
[15:57:37] davedev24: has joined #ruby
[15:58:37] pwnd_nsfw: has joined #ruby
[15:59:06] troulouliou_div2: has joined #ruby
[15:59:43] renderful: has joined #ruby
[15:59:44] arup_r: has joined #ruby
[16:01:05] DiCablo: has joined #ruby
[16:01:14] dhollinger: has joined #ruby
[16:02:18] joonty: has joined #ruby
[16:02:28] vasilakisFiL: has joined #ruby
[16:03:11] vasilakisFiL: is it a good idea to use memoization pattern in a self class (a class that is defined using class << self)?
[16:03:40] vasilakisFiL: like here, http://pastie.org/private/zn2uisenopq5rkgomhxipg memoize connection
[16:04:15] touchstone: has joined #ruby
[16:05:43] tjad: has joined #ruby
[16:06:23] loechel: has joined #ruby
[16:07:40] NeverDie: has joined #ruby
[16:08:07] sucks: has joined #ruby
[16:09:03] saddad: has joined #ruby
[16:10:20] Pumukel: has joined #ruby
[16:12:18] wottam: has joined #ruby
[16:12:23] dopie: has joined #ruby
[16:12:43] slackbotgz: has joined #ruby
[16:13:58] dmcp: has joined #ruby
[16:14:26] droptone: Question: I'm leveraging ActiveRecord in my Ruby script, and so far it's working great. I seem to have a situation though, where a function, on the second or third time, will not be able to access the updated info from the DB,
[16:14:31] droptone: so I'm worried I have a race condition
[16:14:38] lxsameer: has joined #ruby
[16:14:38] lxsameer: has joined #ruby
[16:15:07] droptone: Is there a known-method for forcing ActiveRecord instructions to wait until execution is complete?
[16:15:34] CrazyEddy: has joined #ruby
[16:15:37] psye: has joined #ruby
[16:15:57] benhuda: has joined #ruby
[16:16:47] psye: has joined #ruby
[16:16:48] banister: has joined #ruby
[16:17:06] blackmesa: has joined #ruby
[16:17:26] mary5030: has joined #ruby
[16:17:30] aibot: has joined #ruby
[16:18:55] nettoweb: has joined #ruby
[16:19:58] rflot: has joined #ruby
[16:20:11] supermarin: has joined #ruby
[16:20:38] wsewolod: has joined #ruby
[16:25:27] Caius: has left #ruby: ()
[16:25:49] touchstone: has left #ruby: ("WeeChat 1.3")
[16:25:57] tjad: has joined #ruby
[16:27:08] troulouliou_div2: has joined #ruby
[16:27:58] dmcp: has joined #ruby
[16:28:18] duckpupp1: has joined #ruby
[16:28:58] heidar: has joined #ruby
[16:30:29] nettoweb: has joined #ruby
[16:30:58] lacuna: has joined #ruby
[16:31:31] cwong_on_irc: has joined #ruby
[16:32:01] RobertBirnie: has joined #ruby
[16:32:18] Spami: has joined #ruby
[16:32:36] renderful: has joined #ruby
[16:33:02] troulouliou_div2: has joined #ruby
[16:33:02] heidar: has joined #ruby
[16:33:12] dmcp: has joined #ruby
[16:33:34] system64: has joined #ruby
[16:33:38] casadei: has joined #ruby
[16:33:55] heidar: has joined #ruby
[16:35:17] lyoshajapan: has joined #ruby
[16:35:33] hobodave: has joined #ruby
[16:36:53] supermarin: has joined #ruby
[16:36:54] hobodave: has joined #ruby
[16:37:27] christiandsg: has joined #ruby
[16:38:08] mwlang: has joined #ruby
[16:38:39] hectortrope: has joined #ruby
[16:38:47] blaxter: has joined #ruby
[16:40:17] mwlang: how do I match on all all ???&??? that are not also ???&amp;???? For example , I???m trying to turn ???This & that, but not here &amp; there??? into ??????This &amp; that, but not here &amp; there???
[16:40:55] [Butch]: has joined #ruby
[16:41:28] jbrhbr: has joined #ruby
[16:41:54] Sou|cutter: mwlang: /&(?!\w+;)/ possibly something like that
[16:42:36] Sou|cutter: or /&(?!amp;)/ to be more-specific
[16:43:10] nateberkopec: has joined #ruby
[16:43:54] mwlang: Sou|cutter: nice. that did the trick.
[16:44:30] Sou|cutter: for future reference, (?! is a negative look-ahead
[16:45:19] workatnight: has joined #ruby
[16:46:59] pontiki: i always forget about that
[16:47:53] duckpupp1: has joined #ruby
[16:49:42] skade: has joined #ruby
[16:50:01] elton: has joined #ruby
[16:50:50] griffindy: has joined #ruby
[16:51:15] kies: has joined #ruby
[16:52:06] shevy: you are a big old forgetter!
[16:52:12] shevy: one day you will forget #ruby
[16:53:12] pdoherty: has joined #ruby
[16:53:14] rcvalle: has joined #ruby
[16:53:51] stannard: has joined #ruby
[16:54:39] pontiki: i forget more and more every day
[16:55:11] Sou|cutter: gotta make room for the kardashians
[16:56:34] bronson: has joined #ruby
[16:57:19] hakunin: has joined #ruby
[16:59:28] tildes: has joined #ruby
[17:01:05] B1n4r10: has joined #ruby
[17:02:06] synthroid: has joined #ruby
[17:02:07] maloik: has joined #ruby
[17:04:07] lukeasrodgers: mwlang i think you could also have used http://www.rexegg.com/regex-best-trick.html there
[17:05:10] agit0: has joined #ruby
[17:06:34] Coldblackice: has joined #ruby
[17:06:52] duckpupp1: has joined #ruby
[17:07:41] sh4d0wD: has joined #ruby
[17:08:51] senayar: has joined #ruby
[17:08:51] senayar: has joined #ruby
[17:08:57] SCHAAP137: has joined #ruby
[17:09:16] agit0: has joined #ruby
[17:11:41] djbkd: has joined #ruby
[17:12:35] ytti: i would havenot epxected this to be super expensive
[17:12:37] ytti: def resolve_path src, dst, paths
[17:12:37] ytti: #return []
[17:12:37] ytti: node = dst
[17:12:39] ytti: path = []
[17:12:42] ytti: while paths[node].first != src
[17:12:44] ytti: path = paths[node] + path
[17:12:46] ytti: node = paths[node].first
[17:12:52] ytti: paths[node] + path
[17:12:57] ytti: but i have code, which runs in about 1s with the return unquoted
[17:13:01] ytti: and takes longer than i've wanted to waiat without it
[17:13:08] pdoherty: has joined #ruby
[17:13:11] ytti: srd, dst are String
[17:13:13] ytti: paths is Hash
[17:13:43] ytti: i think i must have a bug there
[17:14:00] Rodya_: has joined #ruby
[17:14:10] joonty: has joined #ruby
[17:16:37] rippa: has joined #ruby
[17:16:46] adaedra: ytti: please use gist to paste code.
[17:17:27] centrx: has joined #ruby
[17:18:46] ytti: adaedra, sorr
[17:19:02] adaedra: What is this code supposed to do?
[17:20:02] ytti: it'll point vertexes between src, dst for djikstra shortest path
[17:20:11] mfqr: ACTION groans.
[17:20:31] ytti: but i think i found my error, my code assumes all nodes are connected
[17:20:40] ytti: and that there are no holes
[17:20:50] ytti: if there is hole, the while is never satisfied
[17:21:05] mfqr: That's all lovely news without a testcase example.
[17:21:20] hxegon: has joined #ruby
[17:21:28] ytti: yeah, i would have provided one, but i just realised major brainfart
[17:22:14] mfqr: Drugs tend to do that.
[17:22:50] ytti: if only i could blame this on drugs
[17:23:00] ytti: but it's just clinical stupidness
[17:23:03] RobertBirnie: has joined #ruby
[17:23:14] mfqr: Well, whatever.
[17:28:31] gatman: has joined #ruby
[17:30:55] casadei: has joined #ruby
[17:31:09] calderonroberto: has joined #ruby
[17:31:54] Xentil: has joined #ruby
[17:32:00] colegatron: has joined #ruby
[17:32:28] wmdrossard: has joined #ruby
[17:33:18] tomphp: has joined #ruby
[17:33:44] lyoshajapan: has joined #ruby
[17:35:35] devbug: has joined #ruby
[17:36:18] baroquebobcat: has joined #ruby
[17:36:36] Mon_Ouie: has joined #ruby
[17:38:30] tomphp: has joined #ruby
[17:39:04] goodcodeguy: has joined #ruby
[17:40:17] christiandsg: has joined #ruby
[17:41:30] djbkd: has joined #ruby
[17:42:17] unreal: has joined #ruby
[17:42:24] duckpupp1: has joined #ruby
[17:45:00] lacuna: has joined #ruby
[17:45:34] zast: has joined #ruby
[17:46:24] NeverDie: has joined #ruby
[17:46:51] govg: has joined #ruby
[17:47:04] cdg: has joined #ruby
[17:47:06] brunto: has joined #ruby
[17:47:20] snockerton: has joined #ruby
[17:47:55] cdg: has joined #ruby
[17:48:09] thejamespinto: has joined #ruby
[17:50:19] drptbl: has joined #ruby
[17:50:35] amclain: has joined #ruby
[17:51:00] elton: has joined #ruby
[17:52:55] mrtomme: has joined #ruby
[17:52:57] KensoDev: has joined #ruby
[17:54:24] misz_: has joined #ruby
[17:54:30] Zamerick: has joined #ruby
[17:54:42] dlitvak: has joined #ruby
[17:55:53] dmolina: has joined #ruby
[17:56:05] blackmesa: has joined #ruby
[17:57:32] govg: has joined #ruby
[17:58:27] jessemcgilallen: has joined #ruby
[17:59:00] agit0: has joined #ruby
[17:59:03] codecop: has joined #ruby
[17:59:41] moeabdol: has joined #ruby
[18:00:36] howdoicomputer: has joined #ruby
[18:01:24] jbrhbr: has joined #ruby
[18:01:37] bmalum: has joined #ruby
[18:01:51] chrisseaton: does anyone know where the algorithm for resolving which version of gems to use, based on declared dependency version constraints, is implemented?
[18:02:34] c-c: there must be one in bundler
[18:02:52] chrisseaton: ah of course it's a bundler thing isn't it? RubyGems doesn't have this part of it
[18:03:13] c-c: rubygems must have one too
[18:03:37] sh4d0wD: has joined #ruby
[18:04:48] FLeiXiuS: has joined #ruby
[18:05:02] FLeiXiuS: Why doesnt this net ssh channel close when data is given to the channel? http://pastie.org/10621232
[18:05:23] evlute: has joined #ruby
[18:05:40] c-c: chrisseaton: something like this? https://github.com/rubygems/rubygems/blob/master/lib/rubygems/dependency.rb
[18:05:44] wireshark: has joined #ruby
[18:05:51] misz_: has joined #ruby
[18:06:11] colleenmcguckin: has joined #ruby
[18:06:15] dlitvak: has joined #ruby
[18:06:17] chrisseaton: c-c: not quite - I'm looking for the part of the system that takes the version constraints and solves them
[18:06:24] c-c: match?, satisfied_by? etc
[18:06:41] FLeiXiuS: I'm using .close() but the session doesnt end
[18:06:51] lemur: has joined #ruby
[18:07:02] c-c: chrisseaton: you read the 330 lines in less than 60 seconds, huh
[18:07:13] fantazo: has joined #ruby
[18:07:13] chrisseaton: c-c: it looks like those check a single dependency - I'm looking for the part that does the global solve
[18:08:19] c-c: looking or asking for? *chuckle*
[18:08:48] chrisseaton: c-c: not sure what you mean?
[18:08:55] c-c: chrisseaton: can't be far from that file I linked...
[18:09:48] troulouliou_div2: has joined #ruby
[18:09:53] chrisseaton: c-c: ah found it - it's just called 'resolver' and i was looking for 'solver' silly mistake
[18:10:17] agit0: has joined #ruby
[18:10:38] c-c: I like to use the word 'resolver' when theres bunch of stuff to evaluate, too
[18:10:39] radgeRayden: has joined #ruby
[18:13:23] kobain: has joined #ruby
[18:14:46] FLeiXiuS: any ideas on this net ssh problem?
[18:14:50] FLeiXiuS: I'm going crazy.
[18:14:56] lubarch: has joined #ruby
[18:15:12] steffkes: has joined #ruby
[18:15:13] steffkes: has joined #ruby
[18:15:17] staykov: has joined #ruby
[18:16:14] c-c: FLeiXiuS: let me guess.
[18:16:27] c-c: Its an IO type object, that has been passed into a block.
[18:16:43] centrx: has joined #ruby
[18:16:44] FLeiXiuS: http://pastie.org/10621232
[18:16:50] pwnd_nsfw: has joined #ruby
[18:16:51] FLeiXiuS: 13 lines of hatred.
[18:16:58] c-c: The block tries to 'close' but the IO object has been told to 'hold the line', ie prevent mutations
[18:18:04] jgpawletko: has joined #ruby
[18:19:10] jpfuentes2: has joined #ruby
[18:19:40] christiandsg: has joined #ruby
[18:20:41] Jackneill: has joined #ruby
[18:22:41] dlitvak_: has joined #ruby
[18:23:48] RegulationD: has joined #ruby
[18:24:36] FLeiXiuS: The session closes when data is passed into it after it was first told to close.
[18:25:42] c-c: FLeiXiuS: you seem confused
[18:25:50] duckson: has joined #ruby
[18:25:51] c-c: isn't that an event handler
[18:26:15] fantazo: has joined #ruby
[18:26:33] c-c: also, I believe open_channel gives you an session, which by default does ".wait" right before being given to you
[18:26:53] FLeiXiuS: c-c, Im extremely confused.
[18:27:05] c-c: ok, whats an event handler?
[18:27:37] FLeiXiuS: ^ thats self explanatory ;-)
[18:27:54] c-c: so, what kind of event does '.on_data' wait for?
[18:27:55] FLeiXiuS: a mechanism for handling events, callbacks, etc.
[18:28:13] FLeiXiuS: on_data is waiting for data packets from the exec.
[18:28:19] berserk_ren: has joined #ruby
[18:28:22] lyoshajapan: has joined #ruby
[18:28:26] FLeiXiuS: When received, its processed within the block
[18:28:57] davedev24: has joined #ruby
[18:29:13] Spami: has joined #ruby
[18:29:47] hfp: has joined #ruby
[18:30:07] agit0: has joined #ruby
[18:30:13] shadoi: has joined #ruby
[18:30:22] c-c: FLeiXiuS: so, logically, why doesn't the channel close right away?
[18:30:39] OS-18137: has joined #ruby
[18:31:59] FLeiXiuS: I know what you want me to say, but that doesnt make any sense ;-)
[18:32:20] Xentil: has joined #ruby
[18:32:40] centrx: has joined #ruby
[18:32:47] FLeiXiuS: The data has already been received by on_data, so why cant that tear down the SSH session?
[18:32:53] c-c: "because it is busy receiving data and writing it to stdout of the process"?
[18:32:54] freerobby: has joined #ruby
[18:32:57] nettoweb: has joined #ruby
[18:33:09] djbkd_: has joined #ruby
[18:33:13] kadoppe: has joined #ruby
[18:33:35] OS-18137: reading from a socket hangs indefinatly. http://pastie.org/private/huuajkqpylv2c3qdvqkja
[18:33:38] c-c: Or perhaps the problem is closing the channel, but not the session, FLeiXiuS
[18:34:12] OS-18137: s/difinatly/definitely/
[18:34:32] ruby-lang734: has joined #ruby
[18:34:51] FLeiXiuS: c-c, channel.close should start the tear down. Regardless of the execs data.
[18:34:58] FLeiXiuS: At least from what Im reading.
[18:35:00] hfp: Hi, I'm trying to write an algorithm that checks if a sequence of words matches the following rule: the next word in the sequence must be composed of all the letters from the previous word + 1 letter. This is what I have: https://gist.github.com/anonymous/b0cef050eaaefd747410. It works well except when there is a word that contains the same letter twice because Array#uniq discards the double letter. Any pointers
[18:35:06] hfp: how I could make the code work with the third case too?
[18:35:12] duckpupp1: has joined #ruby
[18:35:34] c-c: FLeiXiuS: how about some #close (Net::SSH::Connection::Session)
[18:36:18] ruby-lang734: has left #ruby: ()
[18:36:25] norc: has joined #ruby
[18:36:30] Xentil: has joined #ruby
[18:36:43] FLeiXiuS: I had ssh.close, and still natta
[18:36:56] ht__: has joined #ruby
[18:37:05] RegulationD: has joined #ruby
[18:37:11] FLeiXiuS: net.ssh.connection.session[e9ae30]: closing remaining channels (1 open)
[18:37:13] tulak: has joined #ruby
[18:37:23] c-c: you had it, where...
[18:37:37] FLeiXiuS: Within the on_data
[18:38:02] FLeiXiuS: I expect, when on_data receives anything, it terminates.
[18:38:08] c-c: hm, sounds like the wrong place
[18:38:13] skade: has joined #ruby
[18:38:13] norc: So, assume I am in the middle of a method call. How can I fiddle to the CFP?
[18:38:41] c-c: FLeiXiuS: perhaps there is intelligence, but it might also be that the block is dumped when you close the channel
[18:39:14] FLeiXiuS: I added an on_close callback but thats not even being called.
[18:39:18] c-c: I'd keep channel event handlers, and session handlers separate
[18:39:44] c-c: FLeiXiuS: code paste, or it didn't happen
[18:41:30] tulak: has joined #ruby
[18:41:40] norc: Or no.. this still does not help me.
[18:42:22] FLeiXiuS: c-c, http://pastie.org/10621303
[18:42:53] c-c: and the output?
[18:43:04] ht__: has joined #ruby
[18:43:49] FLeiXiuS: There is no output
[18:43:56] norc: Okay, rb_thread_current has what I want. :o)
[18:43:58] FLeiXiuS: Unless, I sent data into the channel twice
[18:45:07] jbrhbr: has joined #ruby
[18:45:38] c-c: FLeiXiuS: maybe the events that happen are not as you think
[18:46:02] c-c: FLeiXiuS: maybe add output puts for each event
[18:46:33] lubarch: has joined #ruby
[18:47:18] ESpiney: has joined #ruby
[18:47:20] Renich: has joined #ruby
[18:47:53] dlitvak: has joined #ruby
[18:48:08] codecop: has joined #ruby
[18:49:03] rdark: has joined #ruby
[18:51:14] FLeiXiuS: c-c, http://pastie.org/10621318
[18:51:21] FLeiXiuS: c-c, Cant get much clearer than that lol
[18:51:29] elton: has joined #ruby
[18:51:54] dlitvak_: has joined #ruby
[18:52:39] c-c: FLeiXiuS: are you sure the log has finished writing. And where is it writing?
[18:52:52] skade: has joined #ruby
[18:53:04] ht__: has joined #ruby
[18:53:17] FLeiXiuS: c-c, Yes. its finished.
[18:53:24] FLeiXiuS: I cant put the channel.close any where but within the on_data
[18:53:24] c-c: send eof?
[18:53:54] tomphp: has joined #ruby
[18:56:03] B1n4r10: has joined #ruby
[18:56:27] c-c: perhaps you could also poke at it with an .on_eof handler, to see if thats what you should handle
[18:56:35] Xentil: has joined #ruby
[18:56:54] FLeiXiuS: It just doesnt make sense that I cant force the session to shut down immediately
[18:57:07] FLeiXiuS: I should be able to do ssh.close
[18:57:12] c-c: you probably can, probably the session, not channel
[18:57:26] RobertBirnie: has joined #ruby
[18:57:56] tomphp_: has joined #ruby
[18:58:21] shutto: is ruby 1.9.3 EOL'ed?
[18:58:32] bronson: has joined #ruby
[18:58:33] shutto: oh yeah it totally is
[18:58:57] kgirthofer: has joined #ruby
[18:59:00] ht__: has joined #ruby
[18:59:12] centrx: it's totally over
[18:59:26] platzhirsch: has left #ruby: ()
[18:59:52] kgirthofer: how can I do a case with two conditions? i.e. case a, b when a ==z and b == x when a == f b==c etc
[19:00:27] ohsnap_: has joined #ruby
[19:00:50] TheNet: has joined #ruby
[19:01:25] nertzy: has joined #ruby
[19:02:02] rismoney1: has joined #ruby
[19:02:39] yorickpeterse: has joined #ruby
[19:02:52] madhatter: has joined #ruby
[19:02:52] norc: ?xy kgirthofer
[19:02:52] ruboto: kgirthofer, it seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
[19:03:30] duckpupp1: has joined #ruby
[19:03:37] hobodave: has joined #ruby
[19:03:56] nettoweb: has joined #ruby
[19:04:48] FLeiXiuS: kgirthofer, use a ,
[19:04:58] cyb3rspy: has joined #ruby
[19:05:04] ht__: has joined #ruby
[19:05:26] B1n4r10: has joined #ruby
[19:05:32] kirun: has joined #ruby
[19:05:34] FLeiXiuS: kgirthofer, "when foo, bar" will cover the condition when either foo or bar is met
[19:05:59] FLeiXiuS: kgirthofer, though, it sounds like you can probably just use an if, elsif statement.
[19:07:45] dlitvak: has joined #ruby
[19:08:12] bronson: has joined #ruby
[19:08:45] stannard: has joined #ruby
[19:09:20] norc: kgirthofer: Since you asked a XY question I shall endulge you though. It is not possible if you look: https://github.com/ruby/ruby/blob/trunk/parse.y#L2884-L2902
[19:10:56] FLeiXiuS: c-c, So session.close doesnt work - still waits for data; however, session.shutdown! closes though it throws an exception.
[19:12:22] symbol: has joined #ruby
[19:13:03] c-c: FLeiXiuS: so perhaps its "extended data"?
[19:13:11] c-c: perhaps your server needs to send some kind of eof
[19:13:36] howdoicomputer: has joined #ruby
[19:13:51] FLeiXiuS: The command will never send an EOF.
[19:13:57] akkmaxon: has joined #ruby
[19:13:59] FLeiXiuS: It's tailf.
[19:14:22] mg^: bah, Rubymine flags logger.log { message } as missing an argument, when it is perfectly valid
[19:14:31] c-c: strange, I remember seeing an echo
[19:16:15] dfockler: has joined #ruby
[19:17:10] c-c: FLeiXiuS: https://github.com/udryan10/scripts/blob/61bdc6cf7e32fe1541815d181dd87d0b4fb78a94/batch-ssh.rb
[19:17:12] norc: mg^: Feel to give an accurate pastie?
[19:17:36] norc: With a stacktrace
[19:18:06] FLeiXiuS: c-c, Son of a.
[19:18:11] FLeiXiuS: c-c, request_pty.
[19:18:25] FLeiXiuS: With a PTY it closes wondefuly.
[19:18:30] FLeiXiuS: wonderfully *
[19:18:31] wldcordeiro: has joined #ruby
[19:18:39] FLeiXiuS: Why does it need a pty
[19:19:32] mg^: you want me to give a pastie of a warning from a Java-based IDE GUI and a stacktrace that doesn't exist?
[19:19:46] FLeiXiuS: mg^, Ewww java based IDE
[19:20:00] mg^: My company bought it for me, figured I'd try it out.
[19:20:12] hobodave: has joined #ruby
[19:20:14] FLeiXiuS: mg^, java IDE and drinking the koolaid. Ewww
[19:20:25] FLeiXiuS: mg^, go sublime or go home ;-)
[19:20:25] freerobby: has joined #ruby
[19:20:30] jbrhbr: i just noticed that you can use @instance variables within functions and those variables will be within the scope of any nested function definition. is this by design or just an accidental convenience? like what is this an instance variable *on*? the current function object? and how does that work for the subfunction in OO terms? is the sub function dynamically interpreted as a subclass?
[19:20:40] c-c: FLeiXiuS: if you ask SSH to provide a pty you are effectively telling SSH that "I'll connect this session to a user terminal", thus programs on the receiving end expect that they can prompt for input, and provide coloured output, etc. In short they think they're talking to you over an interactive session, because by assigning a pty, Bash has been started in non-login, interactive mode.
[19:20:40] norc: mg^: Either way, syntactically that will parse { message } as a block
[19:20:53] mg^: norc: yes, it's valid
[19:20:55] norc: mg^: Which means if logger.log expects an argument it will not get any (aside from the block given)
[19:21:00] ht__: has joined #ruby
[19:21:10] mg^: norc: my complaint is that the linting functionality of this tool thinks it is not
[19:21:11] jhass: jbrhbr: there are no functions and "nested function definitions" most likely don't do what you think they do
[19:21:28] FLeiXiuS: c-c, yeah, but channels should exit regardless of the PTY when i tell it to close. ;-P
[19:22:05] norc: mg^: Ah.
[19:22:07] jbrhbr: jhass: so does 'def foo ..' without scope actually define Object#foo? or what
[19:22:19] mg^: FLeiXiuS: I'm usually a plain text editor guy, so as far as IDEs go, I'm not sure what to expect, but Rubymine doesn't seem that terrible
[19:22:21] jbrhbr: by "without scope" i should have just said "at the top level"
[19:22:21] jhass: jbrhbr: yup
[19:22:31] norc: On another node, are there actually people around knowledged in the internals of cruby?
[19:22:42] jhass: jbrhbr: and the toplevel has Object as definee and Object.new as self
[19:22:44] jbrhbr: jhass: and then when i call foo, is it actually Object.new.foo?
[19:23:10] jhass: not a new instance for each call though
[19:23:11] norc: Well. Its not like an Object is created every time.
[19:23:13] jbrhbr: it seems like maybe the instance is persistent
[19:23:17] dlitvak_: has joined #ruby
[19:23:20] jbrhbr: right, ok
[19:23:25] jhass: >> [self, self.class]
[19:23:27] ruboto: jhass # => [main, Object] (https://eval.in/482922)
[19:23:27] norc: jbrhbr: Indeed. The self object is created during initialization of Ruby. :)
[19:23:32] norc: *main object.
[19:23:40] jhass: actually a new one for each file, no?
[19:23:49] jbrhbr: just stumbled across this since i'm trying to undersatnd how the hell rspec works
[19:23:57] FLeiXiuS: c-c, Either way, thank you for your patience and your help.
[19:24:12] c-c: FLeiXiuS: maybe the command doesn't get passed correctly without pty
[19:24:16] norc: jhass: Damn it I actually peeked into that part last week.... :/
[19:24:30] lacuna: has joined #ruby
[19:24:32] colleenmcguckin: has joined #ruby
[19:24:43] lyoshajapan: has joined #ruby
[19:24:51] c-c: naw, that doesn't make sense
[19:24:52] norc: jhass: It is per VM.
[19:24:59] jhass: mh, k, thanks
[19:25:05] c-c: FLeiXiuS: gl
[19:25:11] jbrhbr: so how does a nested method fit into this framework then? which object gets the method definition?
[19:25:31] jhass: jbrhbr: think of def as syntax for Object#define_method
[19:25:47] norc: jhass: Wait I lied.
[19:25:51] thejamespinto: has joined #ruby
[19:25:57] jhass: jbrhbr: def doesn't change the definee
[19:26:01] jbrhbr: jhass: so regardless of nesting depth, it just defines another top level Object#method?
[19:26:11] jbrhbr: (in my example case at least)
[19:26:12] ur5us: has joined #ruby
[19:26:24] juddey: has joined #ruby
[19:26:25] jhass: jbrhbr: so you only delay execution of the method definition
[19:26:45] jbrhbr: jhass: well you were certainly correct when you said that it probably wasn't doing what i expected :)
[19:26:57] jbrhbr: thanks a lot for clarifying
[19:27:10] baroquebobcat: has joined #ruby
[19:27:18] jhass: >> def foo; def bar; end; end; b = Object.private_instance_methods.include?(:bar); foo; [b, Object.private_instance_methods.include?(:bar)]
[19:27:20] ruboto: jhass # => [false, false] (https://eval.in/482923)
[19:27:25] jhass: mmh, that went wrong
[19:27:29] brunto: has joined #ruby
[19:27:39] jbrhbr: they aren't private
[19:28:38] jbrhbr: it's `true` if i just check `Object.instance_methods.include?(:foo)`
[19:28:49] jbrhbr: in top level pry at least
[19:28:50] jhass: or are they?
[19:29:02] jhass: mmh, weird, I was confident they're private
[19:30:34] symm-: has joined #ruby
[19:30:44] sandstrom: What's the easiest way to turn a hexadecimal string (base 16) to a decimal (base 10)?
[19:31:06] slash_mode: sandstrom: to_s(10)
[19:31:14] RegulationD: has joined #ruby
[19:31:32] sandstrom: slash_mode like this? `'ff'.to_s(10)`
[19:31:53] jhass: >> 'ff'.to_i(16)
[19:31:54] ruboto: jhass # => 255 (https://eval.in/482930)
[19:32:22] slash_mode: sandstrom: jhass nailed it
[19:32:28] sandstrom: thanks jhass slash_mode
[19:32:41] norc: jhass: They are private.
[19:33:06] jhass: but why doesn't private_instance_methods include them?
[19:33:08] norc: >> def foo; end; Object.private_instance_methods(false).include?(:foo)
[19:33:09] colleenmcguckin: has joined #ruby
[19:33:09] ruboto: norc # => true (https://eval.in/482934)
[19:33:19] lacuna: has joined #ruby
[19:33:19] lacuna: has joined #ruby
[19:33:33] jbrhbr: ruby version dependent perhaps?
[19:33:43] norc: jhass: You tested for :bar not :foo
[19:33:53] norc: bar was the nested one
[19:33:56] jhass: I tested locally for foo
[19:34:00] jhass: so where is bar defined then?
[19:34:02] jbrhbr: my test contradicts yours unless i'm woefully foolish here
[19:34:12] jbrhbr: https://gist.github.com/jerryhebert/a8a2fa4ef97c6d57b2bb
[19:34:20] Bloomer: has joined #ruby
[19:34:20] daivyk: has joined #ruby
[19:34:33] norc: jhass: Should be on the singleton class of main
[19:34:46] jhass: mh, so def does change the definee?
[19:35:14] jbrhbr: self.class is `Object` in pry
[19:35:17] norc: Let me think.
[19:35:55] shevy: don't think!
[19:35:59] norc: jhass: First the method needs to be called for the nested method to be defined.
[19:36:07] jhass: that's clear
[19:36:16] RobertBirnie: has joined #ruby
[19:37:03] norc: >> def foo; def bar; end; end; b = Object.private_instance_methods.include?(:bar); foo; [b, Object.private_instance_methods.include?(:bar)]
[19:37:05] ruboto: norc # => [false, false] (https://eval.in/482939)
[19:37:14] norc: >> def foo; def bar; end; end; b = Object.private_instance_methods.include?(:bar); foo; [b, Object.singleton_class.instance_methods(true).include?(:bar)]
[19:37:16] ruboto: norc # => [false, true] (https://eval.in/482940)
[19:37:20] supermarin: has joined #ruby
[19:37:27] norc: That is interesting too.
[19:37:30] dlitvak: has joined #ruby
[19:37:53] norc: Oh wait that was silly.
[19:38:20] lacuna: has joined #ruby
[19:38:20] lacuna: has joined #ruby
[19:38:36] norc: No it actually gets added as a public method.
[19:38:43] ziggy: has joined #ruby
[19:39:07] jbrhbr: all public for me https://gist.github.com/jerryhebert/23201a779f52f0a61aee
[19:39:10] norc: jhass: And that makes sense, since that is the default visibility. Using def on top level scope is the actual exception here.
[19:40:09] norc: >> def foo; end; Object.instance_methods(false).include?(:foo) # jbrhbr
[19:40:10] ruboto: norc # => false (https://eval.in/482942)
[19:40:12] Xentil: has joined #ruby
[19:40:22] imperator: has joined #ruby
[19:40:41] colleenmcguckin: has joined #ruby
[19:40:41] ziggy: dumb question. I'm trying to clean up a deployment image (it's quite large). is there any reason that I can't remove APP_ROOT/vendor/bundle/ruby/2.2.0/cache/*.gem after I bundle install?
[19:40:45] imperator: wut: ActiveSupport::Gzip.compress(nil) # => "\x1F\x8B\b\x00\x99\x83hV\x00\x03\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00"
[19:41:04] ht__: has joined #ruby
[19:41:27] norc: jhass: So defining a method does not change the default assignee. Guess its good to know. :)
[19:41:33] jhass: imperator: haha, it calls to_s?
[19:41:38] havenwood: ActiveSupport::Gzip.decompress("\x1F\x8B\b\x00\xD3\x83hV\x00\x03\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00") #=> ""
[19:41:49] casadei: has joined #ruby
[19:41:56] imperator: jhass, i guess so :(
[19:42:12] norc: imperator: Because DHH wants it that way. Period.
[19:42:17] jhass: imperator: duck typing!
[19:42:33] Cohedrin: has joined #ruby
[19:42:49] freerobby: has joined #ruby
[19:42:56] Asher: has joined #ruby
[19:43:22] shanemcd: has joined #ruby
[19:43:38] jbrhbr: norc: how do you explain the discrepancy? am i missing something here? i just literally pasted your code and got true
[19:43:51] norc: jbrhbr: Ruby Version?
[19:44:26] norc: 21>> def foo; end; Object.private_instance_methods(false).include?(:foo)
[19:44:27] ruboto: norc # => true (https://eval.in/482944)
[19:44:48] jbrhbr: did you read my gist? it shows it there too
[19:45:14] lacuna: has joined #ruby
[19:45:29] colleenmcguckin: has joined #ruby
[19:45:35] tomchapin: has joined #ruby
[19:45:37] norc: jbrhbr: I don't know the previous code. If you don't pass "false" it will check up the ancestors chain of Object
[19:45:52] arthurix: has joined #ruby
[19:45:54] jbrhbr: yes but when i pasted your code, that also included your false :)
[19:46:03] norc: jbrhbr: It is supposed to return true.
[19:46:24] norc: jbrhbr: Just end your pry session, start a fresh one, and paste that code.
[19:46:24] jbrhbr: i'm confused
[19:46:32] jbrhbr: rubuto returned false
[19:47:04] timonv: has joined #ruby
[19:47:22] jbrhbr: mine's true as it has been
[19:47:24] jbrhbr: rubuto's was false though
[19:47:48] jbrhbr: for this line: def foo; end; Object.instance_methods(false).include?(:foo) irc://irc.freenode.org:6667/#??jbrhbr
[19:47:57] jbrhbr: that expanded weird
[19:49:58] jbrhbr: in case there is ambiguity, i'm referring to your 11:40 comment (pst)
[19:50:49] kies: has joined #ruby
[19:51:29] DoubleMalt: has joined #ruby
[19:52:27] elton: has joined #ruby
[19:53:01] dlitvak_: has joined #ruby
[19:55:37] ap4y: has joined #ruby
[19:56:26] nettoweb: has joined #ruby
[19:57:12] RobertBirnie: has joined #ruby
[19:57:39] NeverDie: has joined #ruby
[19:58:39] lkba: has joined #ruby
[19:58:48] apeiros: Object.instance_methods(false).include?(:foo) is bad form
[19:58:55] apeiros: use Object.method_defined?(:foo)
[19:59:29] jbrhbr: @ channel really, but thanks
[19:59:38] apeiros: ah you wanted to specifically check against private methods?
[19:59:57] apeiros: there's also private_method_defined?
[19:59:58] jbrhbr: yes, that's what we were testing
[20:00:56] jbrhbr: i was just pasting what jhass and norc wrote but thanks
[20:01:39] imperator: has left #ruby: ("Leaving")
[20:01:56] goodcodeguy: has joined #ruby
[20:02:08] imperator: has joined #ruby
[20:02:16] shevy: 15 days to xmas
[20:02:22] norc: jhass: Okay, C macros made it really annoying to figure out how. https://github.com/ruby/ruby/blob/trunk/inits.c#L24 -- So top_self is created during the setup of Ruby itself before even the VM gets booted.
[20:04:07] norc: Though top_self resides in the VM.. so. :)
[20:05:14] zacts: what is a good learning / reading path for ruby?
[20:05:18] Zamerick: has joined #ruby
[20:05:20] zacts: I know a bit of Perl5
[20:05:46] ruboto: http://ruby-community.com/pages/links
[20:06:02] jbrhbr: the derek banas video is pretty nice if you know other languages
[20:06:23] jbrhbr: in an hour i felt at least somewhat oriented
[20:07:03] ibouvousaime: has joined #ruby
[20:07:31] dlitvak: has joined #ruby
[20:07:38] lemur: has joined #ruby
[20:08:01] Renich: has joined #ruby
[20:09:05] crankharder: has joined #ruby
[20:10:12] shevy: gimme the banana video
[20:10:18] emilkarl: has joined #ruby
[20:10:29] agit0: has joined #ruby
[20:11:01] spider-mario: has joined #ruby
[20:11:08] akkmaxon: has joined #ruby
[20:12:47] yqt: has joined #ruby
[20:13:54] NeverDie: has joined #ruby
[20:15:46] bmalum: has joined #ruby
[20:15:48] diegoviola: has joined #ruby
[20:17:33] DoubleMalt: has joined #ruby
[20:18:09] slash_mode: shevy: here ya go: https://www.youtube.com/watch?v=6hi7uZvcMJ0
[20:19:02] ht__: has joined #ruby
[20:19:04] bronson: has joined #ruby
[20:19:16] arooni: has joined #ruby
[20:20:46] BangPython: has joined #ruby
[20:21:10] BangPython: has left #ruby: ()
[20:22:08] RobertBirnie: has joined #ruby
[20:22:24] DoubleMalt: has joined #ruby
[20:22:44] lyoshajapan: has joined #ruby
[20:23:08] rawrwx: has joined #ruby
[20:24:06] norc: Jesus, how can anyone work with this nightmare of a source code of Ruby.
[20:24:25] centrx: Exorcism?
[20:24:29] Moosashi: has joined #ruby
[20:25:16] DoubleMalt: has joined #ruby
[20:25:19] norc: Ruby forces you to somehow preprocess every single source and header before you can actually look at it.
[20:26:47] centrx: The SOURCE code
[20:27:53] norc: I got this bizarre function with 14 years of commits, even recent documentation changes - someone ought to use this function, even the objects contain references to it - but of course there is no explicit calls to it.
[20:28:11] norc: Because Japanese folks seem to like C macros a lot.
[20:28:22] norc: Especially to construct function names with...
[20:28:24] DoubleMalt: has joined #ruby
[20:28:37] Coldblackice: has joined #ruby
[20:28:39] JDiPierro: has joined #ruby
[20:28:51] sandstrom: has joined #ruby
[20:30:06] haxrbyte: has joined #ruby
[20:30:09] bronson: has joined #ruby
[20:31:01] ht__: has joined #ruby
[20:31:50] imperator: i have a string, broken up into parts, e.g. "foo", "\r\n", "bar"
[20:32:38] imperator: and i need to compress each part, but decompress it as if it were a single string
[20:32:49] hobodave: has joined #ruby
[20:33:55] imperator: turns out just joining the results of compress("foo") + compress("\r\n") + compress("bar") is not the same as compress("foo\r\n\bar")
[20:33:57] shanemcd: has joined #ruby
[20:36:05] wsewolod: has joined #ruby
[20:36:58] adaedra: I don't think what you want is possible
[20:37:27] adaedra: or you'll have to make your decompression decompress the string bits and join them manually
[20:38:09] dlitvak_: has joined #ruby
[20:38:28] qpls: has joined #ruby
[20:38:37] rawrwx: has joined #ruby
[20:38:39] bmalum: has joined #ruby
[20:38:48] edwinvdgraaf: has joined #ruby
[20:39:07] c0ncealed: has joined #ruby
[20:39:43] cjbottaro: has joined #ruby
[20:43:57] Azure|dc: has joined #ruby
[20:44:08] fullofca_: has joined #ruby
[20:45:28] zacts: has joined #ruby
[20:45:28] zacts: has joined #ruby
[20:47:03] ht__: has joined #ruby
[20:49:17] rawrwx: has joined #ruby
[20:49:26] avdi: has joined #ruby
[20:50:44] christiandsg: has joined #ruby
[20:50:52] zacts: has joined #ruby
[20:51:45] saddad: has joined #ruby
[20:52:40] norc: jhass: Yeah, top_self is generally shared for everything. The only exception is when you use Kernel#load with wrap=true. Even threads share the same top_self (another reason to keep your fingers away from top_self).
[20:56:20] uris: has joined #ruby
[20:57:51] hfp: I'm learning how to count the big O for functions. Could someone tell me if I got it right on this one: https://gist.github.com/anonymous/bdf3a70f4dee578b2d23 ? I think it's an O(n).
[20:59:23] iateadonut: has joined #ruby
[21:00:21] eam: hfp: in terms of n where n is your word_chain list what you have looks correct
[21:00:29] rawrwx: has joined #ruby
[21:00:59] slash_mode: eam: my only doubt is whether that #split makes it n^2
[21:01:03] ht__: has joined #ruby
[21:01:11] skade: has joined #ruby
[21:01:14] Renich: has joined #ruby
[21:01:19] eam: often there can be multiple dimensions of n, so you could have O(n) where n is the number of elements in word_chain, but also O(m) where m is the length of the strings in the list
[21:01:20] Mon_Ouie: The complexity of split is in terms of the string
[21:01:32] hfp: eam: Yes, I meant it's O(n) and depends on how long word_chain is. Thanks
[21:01:34] Mon_Ouie: i.e. the size an element, instead of the amount of elements
[21:01:40] eam: which is why in real world functions you often say things like O(mn)
[21:01:51] slash_mode: that looks better
[21:02:15] norc: eam: Also arr1 - arr2 depends on the length of each array.
[21:02:42] hfp: How can I know what's the O of built-in methods?
[21:02:50] norc: sry, I meant hfp.
[21:02:54] norc: hfp: Look at the implementation.
[21:02:59] eam: you can guess, based on obvious algos, but often have to RTFS
[21:03:06] norc: And good luck with that.
[21:03:07] ramfjord: has joined #ruby
[21:03:31] norc: But once you get through all the missing documentation and macro hell, it's not so bad. :)
[21:03:38] hfp: hmm so O(mn) is bad, isn't it?
[21:03:43] eam: there was one notable one from a few months ago where someone found that Array#reject! was far slower than Array#reject, for example
[21:03:44] norc: hfp: That really depends.
[21:03:48] norc: Could be worse.
[21:04:32] tvw: has joined #ruby
[21:04:50] eam: >> [*1..1_000_000].reject {true}
[21:04:51] ruboto: eam # => [] (https://eval.in/482958)
[21:04:54] fullofcaffeine: has joined #ruby
[21:04:55] eam: >> [*1..1_000_000].reject! {true}
[21:04:58] ruboto: eam # => (https://eval.in/482959)
[21:05:29] eam: ah, ruboto doesn't pass that through, but the latter didn't finish, time budget
[21:05:40] Papierkorb: eam: Range is Enumerable, you can call #reject on it directly.
[21:05:43] hfp: Any comments on my implementation? I'm checking whether a given list of words follows the rule: the next word must be 1 char longer than the previous one and contain all chars from the previous word. Chars order doesn't matter/
[21:05:58] akem: has joined #ruby
[21:06:02] eam: Papierkorb: but not reject!
[21:06:05] norc: eam: There should not be a significant difference between the two.
[21:06:15] slash_mode: hfp: fun... sounds like an adventofcode puzzle
[21:06:21] norc: eam: In fact I would expect Array#reject! to be faster looking at the implementation
[21:06:23] Papierkorb: eam: and there's Range#to_a too :P No need for the expensive splat operator
[21:06:29] eam: norc: the reason for the difference is that reject! shifts every element of the array for each iteration that rejects!
[21:06:51] eam: Papierkorb: ruby is a language for my ease of use, not the computer's :)
[21:07:05] eam: I don't like writing (1..10).to_a
[21:07:32] lemur: has joined #ruby
[21:07:37] eam: anyway, it's O(n^2) for reject! and O(n) for reject
[21:07:54] hfp: slash_mode: is it? I'll go check
[21:08:01] norc: eam: Not from what I can see.
[21:08:05] slash_mode: >> 1.upto(10).reject {|x| x == 1 }
[21:08:07] ruboto: slash_mode # => [2, 3, 4, 5, 6, 7, 8, 9, 10] (https://eval.in/482960)
[21:08:14] eam: norc: if you're on a super new ruby they may have changed it
[21:08:14] slash_mode: eam: why do either?
[21:08:27] norc: eam: Oh. Looking at trunk >:)
[21:08:32] eam: try it on say 2.1.5
[21:08:50] speaking1ode: has joined #ruby
[21:08:54] dfinninger: has joined #ruby
[21:08:55] eam: norc: the reasoning is to maintain proper state in the array, in case you look at it inside your reject proc
[21:09:03] ht__: has joined #ruby
[21:09:09] eam: and I think what they did is do away with that
[21:09:25] Frem: has joined #ruby
[21:09:34] eam: so if you dump the array in the middle of the reject {} you'll see junk
[21:09:47] eam: (sorry, in the middle of the reject!)
[21:10:05] RobertBirnie: has joined #ruby
[21:10:28] eam: because reject makes a copy and doesn't modify the receiver
[21:10:29] cardoni: has joined #ruby
[21:10:46] eam: so it's O(2n) for memory
[21:10:51] eam: but O(n) for runtime
[21:10:54] slash_mode: >> (1..10).reject {|x| x > 1 } # Papierkorb you don't need to_a or splat
[21:10:55] ruboto: slash_mode # => [1] (https://eval.in/482964)
[21:11:05] eam: slash_mode: you do for reject! though
[21:11:10] Papierkorb: slash_mode: that's exactly what I told eam, yes
[21:11:12] slash_mode: i believe that
[21:11:14] eam: Range won't implement !
[21:11:19] eam: (obviously)
[21:11:19] slash_mode: Papierkorb: nuh uh
[21:11:42] Papierkorb: slash_mode: [22:05] <Papierkorb> eam: Range is Enumerable, you can call #reject on it directly.
[21:11:53] eam: gentlepersons
[21:11:57] slash_mode: ACTION +corrected
[21:12:01] norc: eam: #5ec029d1e
[21:12:05] norc: About a year ago
[21:12:07] eam: norc: ;)
[21:12:19] dlitvak: has joined #ruby
[21:12:38] durstburger: has joined #ruby
[21:12:50] haxrbyte: has joined #ruby
[21:13:34] eam: anyway, just one example of many -- it's easy to guess at runtime but also surprisingly easy to get it wrong
[21:13:43] circ-user-mgcmJ: has joined #ruby
[21:13:43] norc: eam: Yeah. Was delete_at btw not shift.
[21:13:44] norc: But still.
[21:14:38] eam: I had one just earlier this week that got me and someone here helped figure out: Guess why this code is O(n^2) where n is the size of buf https://gist.github.com/eam/db9b3e7cd3b42743455b
[21:14:53] eam: ostensibly it's only O(n), paging through buf in 4k chunks
[21:15:22] eam: (iirc credit to drbrain
[21:15:31] sandstrom: has joined #ruby
[21:16:05] rawrwx: has joined #ruby
[21:17:42] eam: answer is that String#slice() has O(n) cost because it reads the entire string up to pos in order to count characters instead of using byte offsets in the char array
[21:17:56] dlitvak: has joined #ruby
[21:18:18] hfp: Is it a safe way to check my big O result by feeding the script a list of say 4 elements, run it, see how long it takes. Then rerun it but with 8 elements and see how much longer it takes and use these two times to verify if it's linear or not?
[21:18:19] eam: so changing the character encoding changes the code from O(n^2) to O(n) -- and on a 50M input has a runtime difference of microseconds to like an hour
[21:18:21] norc: rb_str_subpos I see it.
[21:19:32] root_murdoc: has joined #ruby
[21:19:40] s00pcan: has joined #ruby
[21:19:42] norc: hfp: No.
[21:21:12] norc: hfp: From Ruby side the entire lexer/parser/compiler/execution construction alone would severely skew any such minimalistic test.
[21:21:50] norc: Or wait, that was dumb,
[21:21:54] hfp: norc: How do you make sure you calculated your big O properly then?
[21:21:56] norc: I somehow was picturing you with a stopwatch....
[21:21:59] slash_mode: hfp: two times will always be linear
[21:22:15] tomphp: has joined #ruby
[21:22:21] norc: hfp: To calculate you really have to look at the implementation
[21:22:34] SlaytanicOne: has joined #ruby
[21:22:35] hfp: slash_mode: Oh right, O(mn) is the same as O(n) as far as big O is concerned, isn't it?
[21:22:48] htmldrum: has joined #ruby
[21:22:49] radgeRayden_: has joined #ruby
[21:22:59] hfp: norc: haha no stopwatch, I wanted to use `time ruby script.rb`
[21:22:59] SlaytanicOne: has left #ruby: ()
[21:23:05] slash_mode: i just mean that... if you draw a line between two points, it'll always be a line... if you're looking for the shape of a curve, you'll need more than two points.
[21:23:12] norc: hfp: Actually that would be the same mistake.
[21:23:23] norc: So my point remains valid after all.
[21:23:58] hfp: norc: so if I wanted to do that, I should use Ruby's Benchmark
[21:24:04] slash_mode: it is interesting that the length of the words in the word chain grow by 1 with each additional word
[21:24:29] norc: That would be a better start. Then you need to create multiple datapoints enough to model a function through.
[21:24:43] norc: And they need to be large enough to not be influenced by caching or random things.
[21:25:21] hfp: This puzzle is a lot more complicated than I initially thought
[21:26:23] norc: hfp: And as eam has pointed out, looking at the implementation takes a while, and you will end up at a lot of archaic and badly documented functions, where it is really easy to miss some accidental O(n^2) function blowing an assumed O(1) function up
[21:26:37] InvGhosttt: has joined #ruby
[21:26:56] jpfuentes2: has joined #ruby
[21:27:15] hfp: I first thought I could solve it with a regex but the fact that letters can change order made this impractical. So then I decided to split every word in the array, call uniq on it and make sure the result was the same length as the last entry in the word_chain array. But no dice, because words with the same letter twice broke it. So then I came up with the current implementation which I think is linear depending
[21:27:21] hfp: on the word_chain size
[21:27:42] norc: hfp: Out of curiosity, is this just educational, or are you genuinely worried about performance?
[21:27:52] InvGhost: has joined #ruby
[21:27:54] IrishGringo: has joined #ruby
[21:28:30] hfp: It's a puzzle I was asked to solve and one of the parameters of the puzzle is that the input can be as long as 750k words long
[21:28:45] hfp: So I have to pay attention to performance
[21:29:11] norc: Unless performance is part of the task, I would focus on an elegant and correct solution.
[21:29:12] hfp: Although the input is composed of several word chains, so no word chain would be that long most of the time
[21:29:13] slash_mode: hfp: oh god... 750words... that n parameter is absolutely important
[21:29:15] norc: 750k words is nothing.
[21:29:35] slash_mode: word 1 has 1 character... word 750000 has 750000 characters
[21:29:40] norc: hfp: As a general guideline: Write code that works. Test it. Profile it. Optimize it.
[21:29:42] norc: In that order.
[21:30:09] anime4christ: has joined #ruby
[21:30:28] norc: hfp: Rather than thinking about O(x) about everything, its much better to write stuff first, and use a profiler to immediately see where most time is lost - IF you notice it is an issue.
[21:30:29] InvGhostt: has joined #ruby
[21:30:41] norc: Much better use of your time. ;-)
[21:30:55] zacts: am I voiced here? :-)
[21:31:12] zacts: I have ruby questions
[21:31:12] slash_mode: zacts: no, but you don't need it to talk
[21:31:13] hfp: norc: I see, thanks for the tip. Will I still get something out of using a profiler for a short list of 8 words or should I make it much longer for the profiler to be of any use?
[21:31:24] zacts: slash_mode: so everyone here can hear me?
[21:31:32] hfp: zacts: yup
[21:31:33] norc: hfp: The profiler is only for *when* you have performance issues.
[21:31:36] rawrwx: has joined #ruby
[21:31:48] norc: hfp: So no matter how large your dataset, if its large enough for you to notice, profiling will help.
[21:31:59] norc: Dont think about the size.
[21:32:04] zacts: I'm just wondering if the ruby black book (latest edition) is a good book to begin learning ruby with
[21:32:10] InvGhosttt: has joined #ruby
[21:32:20] zacts: I checked the filter logs but couldn't find responses to my previous questions
[21:32:36] norc: zacts: Sometimes questions go under. Feel free to reask. :)
[21:33:33] norc: hfp: So again, focus on writing clean code that works. Then if applicable write unit tests. If you have performance issues, profile and only optimize the parts that need optimizing. -- I emphasize again: In that order.
[21:34:01] norc: 95% of the time performance should not be your concern.
[21:34:19] zacts: I just know that for #perl they have many books they _do not_ recommend, thus why I'm asking if this one is ok for ruby
[21:35:02] zacts: my plan was: ruby black book (latest edition) --> Metaprogramming Ruby (pragmatic press) --> poodr
[21:35:07] sandstrom: has joined #ruby
[21:35:12] s00pcan: has joined #ruby
[21:35:21] zacts: (and throwing in Eloquent Ruby in there somewhere)
[21:35:32] zacts: if that sounds like an ok start, just say yes or no, and I'll be happy
[21:36:17] RobertBirnie: has joined #ruby
[21:36:40] dlitvak: has joined #ruby
[21:37:09] norc: zacts: from what I can tell everybody here has their own opinion.
[21:37:28] norc: zacts: The majority here seems to favor taking some online resource and just diving in, rather than reading a book.
[21:38:51] zacts: which is an online resource you like norc?
[21:38:59] norc: ?links zacts
[21:38:59] ruboto: zacts, http://ruby-community.com/pages/links
[21:39:13] norc: Simple and effective. :)
[21:39:16] zacts: ah ok thanks
[21:39:24] zacts: I did skim those, but wanted to make sure they were up-to-date
[21:39:36] zacts: http://perl.org recommends links that #perl no-no's
[21:39:42] howdoicomputer: has joined #ruby
[21:39:45] zacts: but cool, I'll check those out
[21:39:50] zacts: ruby koans looks really great to me
[21:39:51] ta: has joined #ruby
[21:39:56] norc: Well, ask apeiros if you must know.
[21:40:02] norc: He amongst other maintains that list.
[21:40:20] norc: c-c was around too a while ago
[21:40:38] jbrhbr: has joined #ruby
[21:42:01] norc: zacts: I mean the important bits are to learn the syntax to get the hang out of it - and then use the ruby-docs for everything else.
[21:42:11] norc: They are fairly decent to work with.
[21:42:42] zacts: ah ok, cool
[21:42:57] norc: Anything else is just experience.
[21:43:02] zacts: so the ruby-docs are well written, as opposed to what I've heard of php doc
[21:43:23] zacts: thus far ruby looks really awesome to me, and the community sounds really great
[21:43:38] norc: I would not go as far as calling it well written, but it's decent.
[21:43:40] Radar: It is and you should totally forget PHP ever happened
[21:43:48] zacts: hehe, yeah
[21:44:01] zacts: I've avoided php this entire time, and I still hope I never have to learn it
[21:44:01] Radar: It's what I did and A++ would recommend to others
[21:44:30] jpfuentes2: has joined #ruby
[21:44:36] lyoshajapan: has joined #ruby
[21:44:45] norc: zacts: http://ruby-doc.org/core-2.2.3/Array.html#method-i-slice
[21:44:55] norc: Feel free to be the judge yourself.
[21:45:12] trautwein: has joined #ruby
[21:46:33] slash_mode: Radar: i've only had one possible employer say "welllll... we really like what we've got going here with php, so you might not be a good fit"
[21:46:58] c0ncealed: has joined #ruby
[21:47:02] Radar: slash_mode: Was that at "Mediocre Inc"?
[21:47:09] rawrwx: has joined #ruby
[21:47:44] norc: slash_mode: Honestly Im glad PHP exists as a holding center for the real idiots out there.
[21:47:47] slash_mode: Radar: hmm let me check.. chronicle studios, their offices are at the Innovation Depot
[21:47:56] norc: It keeps serious languages clean. :-)
[21:48:04] slash_mode: "innovation"
[21:48:50] Papierkorb: I'm not sure what I like less. JS or PHP.
[21:48:55] Papierkorb: I find both to be horrific
[21:49:15] norc: Papierkorb: JS is actually pretty decent.
[21:49:22] shevy: just use both JS and PHP together Papierkorb
[21:49:22] Radar: QUICK: give me the argument order for both strstr and str_replace.
[21:49:30] norc: It's just decades of kids who have given the whole thing a bad reputation.
[21:49:36] Radar: (The fact that everything is a top-level function in PHP really grates on me now)
[21:49:44] ramfjord: has joined #ruby
[21:50:06] Radar: Anyway, it's offtopic :P
[21:50:40] norc: Radar: I would really like methods to be first class objects like functions in JS. :-P
[21:50:50] norc: Or blocks as objects
[21:51:04] Radar: norc: Well have I got a language for you: Elixir!
[21:52:11] Papierkorb: I'm waiting for crystal to become useful for production
[21:52:17] calderonroberto: has joined #ruby
[21:52:35] Radar: Elixir is already useful for production and imo everyone should be learning that after they learn Ruby.
[21:53:10] norc: Radar: Well its definitely on my todo list. Though I just got started with Ruby for real.
[21:53:34] Papierkorb: didn't like it when I took a look. I do like OOP. for me, crystal gets many many things right.
[21:53:45] elton: has joined #ruby
[21:54:43] yfeldblum: has joined #ruby
[21:55:10] norc: Im just so sad that it seems downright impossible to get hold of the pointer to the current thread with Fiddle.
[21:55:38] norc: Though wait..
[21:57:02] ta: has joined #ruby
[21:58:01] braincrash: has joined #ruby
[22:02:39] rawrwx: has joined #ruby
[22:03:41] djbkd: has joined #ruby
[22:05:09] DurstBur2er: has joined #ruby
[22:05:48] RobertBirnie: has joined #ruby
[22:05:53] stannard: has joined #ruby
[22:07:37] fullofcaffeine: has joined #ruby
[22:08:13] dmolina: has joined #ruby
[22:09:01] tenderlove: has joined #ruby
[22:09:28] sdothum: has joined #ruby
[22:10:42] rakm: has joined #ruby
[22:11:59] idakyne: has joined #ruby
[22:12:21] rawrwx: has joined #ruby
[22:13:37] jpfuentes2: has joined #ruby
[22:18:57] B1n4r10: has joined #ruby
[22:21:08] puria: has joined #ruby
[22:22:29] pdoherty: has joined #ruby
[22:25:58] momomomomo: has joined #ruby
[22:27:18] devbug: has joined #ruby
[22:28:04] ap4y: has joined #ruby
[22:29:06] sandstrom: has joined #ruby
[22:29:26] rdavila: has joined #ruby
[22:30:32] Yzguy: has joined #ruby
[22:31:55] zacts: Radar: elixir does look neat
[22:31:56] twistedpixels: has joined #ruby
[22:31:59] zacts: I think it's based on erlang right?
[22:32:06] zacts: it's erlang with ruby syntax
[22:33:22] djbkd: has joined #ruby
[22:34:06] shevy: I approve of languages with ruby-esque syntax
[22:34:54] pipework: shevy: try crystal
[22:35:14] shevy: I am an old man now, my tinker days are long gone
[22:35:46] pipework: shevy: You're shevy, no longer a tinker, now a stinker.
[22:35:51] zquad: has joined #ruby
[22:36:31] zquad: I want to execute this command: redis-cli EVAL "return redis.call('del', unpack(redis.call('keys', ARGV[1])))" 0 pattern:*
[22:36:43] zquad: I used system with the above command is is getting an error
[22:36:50] diegoviola: are we getting 2.3 for xmas?
[22:36:51] zquad: how do you execute that cli command?
[22:37:11] havenwood: diegoviola: if you're good
[22:37:17] havenwood: diegoviola: otherwise coal!
[22:37:25] pipework: havenwood: Do even gingers get rubies for christmas?
[22:37:37] havenwood: pipework: Unless they're naughty!
[22:37:57] eam: rubies could be a nickname for gingers
[22:38:01] pipework: ACTION is definitely getting coal
[22:38:16] diegoviola: what does being good means? being a good programmer and writing good code? :)
[22:39:49] newmanships: has joined #ruby
[22:40:25] maloik: has joined #ruby
[22:42:07] shevy: diegoviola our gift will be a new ruby release at xmas
[22:42:13] shevy: you can be good or naughty
[22:42:37] lyoshajapan: has joined #ruby
[22:42:53] diegoviola: naughty? no thanks, not interested
[22:43:51] luckyme: has joined #ruby
[22:45:49] lemur: has joined #ruby
[22:45:52] jpfuentes2: has joined #ruby
[22:47:08] davedev24: has joined #ruby
[22:49:59] SenpaiSilver_: has joined #ruby
[22:53:17] ruid: has joined #ruby
[22:53:18] ruid: has joined #ruby
[22:53:19] circ-user-mgcmJ: has joined #ruby
[22:54:43] elton: has joined #ruby
[22:54:47] brunto: has joined #ruby
[22:56:49] rickmasta: has joined #ruby
[22:59:25] grilled-cheese: Is there a way to check what versions a ruby script is backward compatible to?
[23:00:26] grilled-cheese: I want to assert a minimum ruby version needed, but I wrote it against 2.1
[23:00:37] adaedra: Running it with older versions
[23:01:04] grilled-cheese: so rvm is basically my best bet
[23:01:11] havenwood: grilled-cheese: An app or a gem?
[23:01:27] grilled-cheese: uses a gem or two though
[23:01:30] havenwood: grilled-cheese: Err, so a gem that hasn't been cut?
[23:01:34] aryaching: has joined #ruby
[23:01:47] adaedra: grilled-cheese: if you use a CI, you can set it up there for it to do it itself (assuming you have tests)
[23:02:18] havenwood: grilled-cheese: Yeah, I'd typically check to see what versions are tested in the .travis.yml file.
[23:02:25] wsewolod: has joined #ruby
[23:02:26] grilled-cheese: single file script, not a full rails app or anything
[23:02:50] RobertBirnie: has joined #ruby
[23:02:56] havenwood: grilled-cheese: If you cut it into a gem you could specify for example a: spec.required_ruby_version = ['>= 2.1.0', '< 2.2.3']
[23:02:58] dfinninger: has joined #ruby
[23:03:33] mroth: has joined #ruby
[23:03:59] grilled-cheese: I was going to put my version checking a level up in puppet code
[23:04:07] grilled-cheese: as part of the install module
[23:04:37] havenwood: grilled-cheese: Easy enough to cut a gem even if you've no intention of uploading it to RubyGems. You can install gems locally only.
[23:04:46] kith_: has joined #ruby
[23:04:56] havenwood: grilled-cheese: Using gem conventions might make your script more accessible to others or yourself in the future as well.
[23:05:32] hahuang65: has joined #ruby
[23:06:35] DukeDave: has joined #ruby
[23:08:26] ledestin: has joined #ruby
[23:08:33] hplar: has joined #ruby
[23:12:13] puria: has joined #ruby
[23:21:27] sucks: has joined #ruby
[23:21:55] Seich: has joined #ruby
[23:29:24] jhill: has joined #ruby
[23:29:37] exadeci: has joined #ruby
[23:30:46] CloCkWeRX: has joined #ruby
[23:34:29] aryaching_: has joined #ruby
[23:34:42] nertzy: has joined #ruby
[23:37:46] mroth: has joined #ruby
[23:38:37] howdoico1: has joined #ruby
[23:44:44] rawrwx: has joined #ruby
[23:45:35] kam270: has joined #ruby
[23:45:55] sneakerhax: has joined #ruby
[23:46:29] acadavid: has joined #ruby
[23:46:54] jpinnix______: has joined #ruby
[23:46:54] ckrailo: has joined #ruby
[23:46:54] zarubin: has joined #ruby
[23:47:22] ec: has joined #ruby
[23:48:07] jgt3: has joined #ruby
[23:48:55] BTRE: has joined #ruby
[23:48:58] kam270: has joined #ruby
[23:49:03] ramfjord_: has joined #ruby
[23:49:14] akahn: has joined #ruby
[23:50:37] ledestin_: has joined #ruby
[23:52:52] jmhmccr: has joined #ruby
[23:55:27] glowcoil: has joined #ruby
[23:55:47] sneakers: has joined #ruby
[23:56:12] knowtheory: has joined #ruby
[23:58:48] jgt4: has joined #ruby
[23:59:19] vcoinminer_: has joined #ruby