« Back to channel list

#ruby - 24 August 2015

« Back 1 day Forward 1 day »
[00:00:04] robbyoconnor: has joined #ruby
[00:00:15] houhoulis: has joined #ruby
[00:02:47] Ox0dea: >> 'jhaz'.tr 'h-za', 'a-z'
[00:02:48] ruboto: Ox0dea # => "cats" (https://eval.in/421034)
[00:02:52] Ox0dea: Coincidence? I think not.
[00:03:20] Rodya_: has joined #ruby
[00:03:29] mary5030: has joined #ruby
[00:04:15] bazbing80: has joined #ruby
[00:06:43] davedev24: has joined #ruby
[00:06:45] Ox0dea: >> 'laxor'.tr 't-za-s', 'a-z'
[00:06:46] ruboto: Ox0dea # => "shevy" (https://eval.in/421035)
[00:08:04] Ropeney: has joined #ruby
[00:11:30] siemprefresco: has joined #ruby
[00:12:54] Torrieri: has joined #ruby
[00:12:55] sixyod: has joined #ruby
[00:13:09] sixyod: <3 you guys!
[00:13:17] sixyod: has left #ruby: ()
[00:13:47] christiandsg: has joined #ruby
[00:16:48] Ox0dea: has joined #ruby
[00:19:22] EminenceHC: has joined #ruby
[00:19:49] Rubie: has joined #ruby
[00:19:56] davedev24: has joined #ruby
[00:23:50] christiandsg: has joined #ruby
[00:24:56] jancel: has joined #ruby
[00:25:20] seanmclaren: has joined #ruby
[00:27:49] shevy: today is so quiet
[00:29:36] jeadre: has joined #ruby
[00:31:10] Torrieri: has joined #ruby
[00:31:35] mistermocha: has joined #ruby
[00:33:04] hyy1: has joined #ruby
[00:34:24] dimasg: has joined #ruby
[00:35:00] beef-wellington: has joined #ruby
[00:36:46] sevenseacat: has joined #ruby
[00:36:49] Feyn: has joined #ruby
[00:37:36] raypulver: has joined #ruby
[00:38:20] pgatt: has joined #ruby
[00:40:08] Guest26811: has joined #ruby
[00:43:54] pocketprotector: has joined #ruby
[00:47:14] dopamean_: has joined #ruby
[00:47:53] bffff_: has joined #ruby
[00:48:01] Musashi007: has joined #ruby
[00:48:53] faces: has joined #ruby
[00:49:13] war_pigs: has joined #ruby
[00:50:04] christiandsg: has joined #ruby
[00:51:25] Oog: has joined #ruby
[00:58:31] dimasg: has joined #ruby
[00:58:38] Yzguy: has joined #ruby
[01:02:49] enroxorz: has joined #ruby
[01:03:20] enroxorz: hey everyone, how do i add the following into yaml so i can parse it late? Something like
[01:03:55] jeadre: has joined #ruby
[01:03:58] enroxorz: --- route: billing/#{params[:account_number]}/summary/#{params[:billing_number]}
[01:04:06] zenguy_pc: has joined #ruby
[01:09:00] toretore: yaml doesn't know anything about ruby string interpolation
[01:10:25] fullofcaffeine: has joined #ruby
[01:10:30] sdfgsdfg: has joined #ruby
[01:11:39] mistermocha: has joined #ruby
[01:11:48] ftj: has joined #ruby
[01:12:42] toretore: >>require 'yaml'; params={account_number: '12345', billing_number: '67890'}; YAML.load(YAML.dump(route: 'billing/%{account_number}/summary/%{billing_number}'))['route'] % params
[01:12:43] ruboto: toretore # => undefined method `%' for nil:NilClass (NoMethodError) ...check link for more (https://eval.in/421042)
[01:12:55] toretore: >>require 'yaml'; params={account_number: '12345', billing_number: '67890'}; YAML.load(YAML.dump(route: 'billing/%{account_number}/summary/%{billing_number}'))[:route] % params
[01:12:57] ruboto: toretore # => "billing/12345/summary/67890" (https://eval.in/421043)
[01:14:18] Axsuul: has joined #ruby
[01:17:46] shevy: Ox0dea why are you so quiet today
[01:18:03] above: has joined #ruby
[01:18:41] sdwrage: has joined #ruby
[01:19:25] phutchins: has joined #ruby
[01:21:08] tmtwd: has joined #ruby
[01:24:17] ybian: has joined #ruby
[01:27:19] christiandsg: has joined #ruby
[01:28:17] phutchins: has joined #ruby
[01:30:24] chipotle: has joined #ruby
[01:30:57] workmad3: has joined #ruby
[01:34:08] roolo: has joined #ruby
[01:36:08] mistermocha: has joined #ruby
[01:36:23] fullofcaffeine: has joined #ruby
[01:37:11] rbennacer: has joined #ruby
[01:40:25] closer: has joined #ruby
[01:40:30] dr3w: has joined #ruby
[01:40:49] devoldmx: has joined #ruby
[01:43:00] haraoka: has joined #ruby
[01:43:14] war_pigs: has joined #ruby
[01:45:48] dimasg: has joined #ruby
[01:46:57] Rodya_: has joined #ruby
[01:48:56] Ox0dea: has joined #ruby
[01:50:17] ledestin: has joined #ruby
[01:53:10] mistermocha: has joined #ruby
[01:54:02] tkuchiki: has joined #ruby
[01:58:38] shevy: tikihontas!
[01:58:46] tkuchiki: has joined #ruby
[02:00:30] chipotle: has joined #ruby
[02:01:38] mistermocha: has joined #ruby
[02:03:24] cluelesscoder: has left #ruby: ("undefined")
[02:04:25] mistermo_: has joined #ruby
[02:05:30] A124: has joined #ruby
[02:06:00] Coraline: I'm just back from Madison Ruby. So sad.
[02:07:43] Tuxero: has joined #ruby
[02:07:48] Ox0dea: "Don't cry because it's over, smile because it happened." -- Theodor Geisel
[02:08:07] mistermocha: has joined #ruby
[02:08:48] shevy: what is madison ruby?
[02:08:52] hydrozen: has joined #ruby
[02:09:10] Coraline: The best Ruby conference in the world. And this week was the last one ever.
[02:09:45] totimkopf: why does it have to be the last one?
[02:09:46] cscheib: anyone who could help me reverse engineer how the github_api gem (https://github.com/peter-murach/github) is resolving multiple levels of dots to multiple levels of classes, it would be much appreciated. i.e. github.users.followers.following is mapped to Github::Client::Users::Followers.following
[02:09:57] Coraline: totimkopf: the organizers are burnt out
[02:10:13] totimkopf: Coraline: :(
[02:10:14] cscheib: I'm like half way to understanding, I'm missing a couple leaps
[02:10:23] Ox0dea: cscheib: See #const_get?
[02:11:23] Tuxero: has joined #ruby
[02:13:27] charliesome: has joined #ruby
[02:13:33] jancel: has joined #ruby
[02:14:10] rickmasta: has joined #ruby
[02:17:07] cscheib: Ox0dea: is that what's doing it? I'm not just talking about constants, they're actually basically translating methods multiple layers deep to a dotted namespace... I'm probably missing something simple
[02:17:29] ght: Question: I was told previously that if you use a conditional statement with ||, where you're checking if one or the other statement is true, if the left statement is true Ruby will not evaluate the right statement.
[02:17:31] Ox0dea: cscheib: Those're probably actual methods, no?
[02:17:49] Ox0dea: ght: That's correct.
[02:18:00] Ox0dea: This is called "short-circuit" evaluation.
[02:19:24] michael_mbp: has joined #ruby
[02:19:36] cscheib: Ox0dea: yea, I can find where the methods are defined in their classes, and how they could be called with the :: notation as part of their class, just trying to figure out how they're making use of them through dotted notation
[02:19:53] Ox0dea: cscheib: What is "dotted notation", as you understand it?
[02:19:59] Ox0dea: They're just method calls, as best I can tell.
[02:20:25] cscheib: I'm just trying to figure out the methodology they're using to define how to call the methods via dots.
[02:20:46] cscheib: I don't speak super concise developer speak, so apologies.
[02:20:51] Guest26811: has joined #ruby
[02:20:52] christiandsg: has joined #ruby
[02:21:12] cscheib: I'm also kinda diving into the deep end here
[02:22:05] cscheib: I've seen the "simple" method on how to do this... basically define a method in yoru higher level class that maps to the deeper level class
[02:22:14] cscheib: but I can't really find where they're doing that
[02:22:37] Ox0dea: cscheib: http://git.io/vs6z6
[02:22:46] Ox0dea: That seems to be where most of the magic happens.
[02:23:23] cscheib: thanks! that looks like exactly what I've been looking for
[02:26:20] catoblepa: has joined #ruby
[02:26:23] mistermo_: has joined #ruby
[02:27:43] above: has joined #ruby
[02:28:50] mistermocha: has joined #ruby
[02:29:07] Rubie: has joined #ruby
[02:30:01] choke: has joined #ruby
[02:31:38] umgrosscol: has joined #ruby
[02:32:46] charliesome: has joined #ruby
[02:33:52] Yzguy: has joined #ruby
[02:35:31] face: has joined #ruby
[02:38:31] Maletor: has joined #ruby
[02:38:56] hydrozen: has joined #ruby
[02:39:36] catoblepa: has joined #ruby
[02:39:36] catoblepa: has joined #ruby
[02:42:32] jher: has joined #ruby
[02:42:58] phutchins: has joined #ruby
[02:48:47] pocketprotector: has joined #ruby
[02:51:31] psye: has joined #ruby
[02:52:09] arescorpio: has joined #ruby
[02:53:21] siemprefresco: has joined #ruby
[02:53:51] Rodya_: has joined #ruby
[02:55:03] minmax: has joined #ruby
[02:55:42] gareim: has joined #ruby
[02:55:44] christiandsg: has joined #ruby
[02:58:51] mistermocha: has joined #ruby
[03:02:36] jeadre: has joined #ruby
[03:03:04] Raymon_: has joined #ruby
[03:04:06] astrobunny: has joined #ruby
[03:04:50] zenguy_pc: has joined #ruby
[03:05:33] Raymon_: has left #ruby: ()
[03:11:40] braincrash: has joined #ruby
[03:13:50] darkf: has joined #ruby
[03:15:49] snath: has joined #ruby
[03:17:47] Oog: has joined #ruby
[03:18:01] phutchins: has joined #ruby
[03:19:54] mistermocha: has joined #ruby
[03:21:26] Oog: has joined #ruby
[03:21:28] zenspider: cscheib: yeah "::" really is just ".", but its use has fallen out of favor for method calls. stick to "."
[03:22:17] roolo: has joined #ruby
[03:22:31] yfeldblum: has joined #ruby
[03:30:54] baweaver: has joined #ruby
[03:31:18] djbkd: has joined #ruby
[03:32:39] yfeldblum: has joined #ruby
[03:34:59] dimasg: has joined #ruby
[03:35:07] Valeness: has joined #ruby
[03:35:45] Valeness_: has joined #ruby
[03:36:45] Tuxero: has joined #ruby
[03:40:07] christiandsg: has joined #ruby
[03:46:34] siemprefresco: has joined #ruby
[03:47:07] mary5030: has joined #ruby
[03:48:06] khebbie: has joined #ruby
[03:48:10] above: has joined #ruby
[03:48:54] mistermocha: has joined #ruby
[03:50:34] JoshGlzBrk: has joined #ruby
[03:51:41] Maletor: has joined #ruby
[03:54:19] renderful: has joined #ruby
[03:54:24] clarkenciel: has joined #ruby
[03:55:27] mary5030: has joined #ruby
[04:00:49] Oog: has joined #ruby
[04:01:13] Musashi007: has joined #ruby
[04:01:40] jancel: has joined #ruby
[04:01:56] Rubie: has joined #ruby
[04:08:38] jeadre: has joined #ruby
[04:08:58] Oog_: has joined #ruby
[04:11:15] snath: has left #ruby: ("Leaving")
[04:13:41] jeadre: has joined #ruby
[04:14:51] cornerma1: has joined #ruby
[04:15:01] mistermocha: has joined #ruby
[04:15:48] towski_: has joined #ruby
[04:15:57] iateadonut: has joined #ruby
[04:17:47] rushed: has joined #ruby
[04:17:57] bruno-: has joined #ruby
[04:23:51] banjara: has joined #ruby
[04:25:51] lore-: ugh what happened her
[04:27:59] c0ncealed: has joined #ruby
[04:29:26] astrobunny: has joined #ruby
[04:29:44] Aeyrix: zenspider: the
[04:29:46] Aeyrix: Paamayim Nekudotayim
[04:29:57] Aeyrix: name for :: of the year, all years
[04:30:11] shevy: hmm... when I try to check for an addon such as CodeRay, I seem to check via defined?(CodeRay) but sometimes also via Object.const_defined? :CodeRay - which variant would be better, in the event that both would do the same?
[04:31:52] dgutierrez1287: has joined #ruby
[04:35:21] iamninja: has joined #ruby
[04:35:37] jeadre: has joined #ruby
[04:35:40] fullofcaffeine: has joined #ruby
[04:35:58] charliesome: has joined #ruby
[04:38:55] christiandsg: has joined #ruby
[04:39:45] banjara: has joined #ruby
[04:40:01] pranny: has joined #ruby
[04:42:40] havenwood: has joined #ruby
[04:44:02] zenspider: shevy: define "better"
[04:44:14] banjara: has joined #ruby
[04:45:26] pranny: has joined #ruby
[04:55:46] dented42: has joined #ruby
[04:57:53] devbug_: has joined #ruby
[04:59:40] Oog: has joined #ruby
[05:02:39] arooni-mobile: has joined #ruby
[05:05:25] zenguy_pc: has joined #ruby
[05:06:05] mary5030: has joined #ruby
[05:08:46] lessless: has joined #ruby
[05:09:05] banjara: has joined #ruby
[05:10:06] JoshGlzBrk: has joined #ruby
[05:10:24] h4ckurate: has joined #ruby
[05:10:31] roolo: has joined #ruby
[05:11:23] lxsameer: has joined #ruby
[05:12:42] chrissonar: has joined #ruby
[05:13:03] towski_: has joined #ruby
[05:13:14] riotjones: has joined #ruby
[05:14:56] dseitz: has joined #ruby
[05:16:20] dhjondoh: has joined #ruby
[05:16:35] bluOxigen: has joined #ruby
[05:20:16] djbkd: has joined #ruby
[05:23:46] ryanpc: has joined #ruby
[05:24:21] jtdoncas: has joined #ruby
[05:25:19] devbug: has joined #ruby
[05:26:47] mrtomme: has joined #ruby
[05:29:53] tagrudev: has joined #ruby
[05:30:16] blueOxigen: has joined #ruby
[05:30:29] fullofcaffeine: has joined #ruby
[05:32:05] dc: has joined #ruby
[05:32:55] banjara: has joined #ruby
[05:32:55] keen___________2: has joined #ruby
[05:33:43] major_majors: has joined #ruby
[05:35:31] christiandsg: has joined #ruby
[05:35:49] amystephen: has joined #ruby
[05:36:52] Axsuul: has joined #ruby
[05:38:30] _blizzy_: has joined #ruby
[05:38:40] rehat: has joined #ruby
[05:40:10] major_majors: has left #ruby: ()
[05:40:20] AlexRussia_: has joined #ruby
[05:42:24] krz: has joined #ruby
[05:43:19] ferhaty: has joined #ruby
[05:46:31] tmtwd: has joined #ruby
[05:48:13] ollie314: has joined #ruby
[05:48:39] christiandsg: has joined #ruby
[05:49:43] jancel: has joined #ruby
[05:50:43] khebbie: has joined #ruby
[05:54:42] Oog: has joined #ruby
[05:58:24] roolo: has joined #ruby
[05:59:02] duncannz: has joined #ruby
[06:00:25] riotjones: has joined #ruby
[06:01:52] TomyLobo: has joined #ruby
[06:03:44] VanWeyden: has joined #ruby
[06:05:20] anisha: has joined #ruby
[06:07:36] dhjondoh: has joined #ruby
[06:07:57] clarkenciel: has joined #ruby
[06:11:10] choke: has joined #ruby
[06:11:11] lsmola: has joined #ruby
[06:12:13] mutuma: has joined #ruby
[06:12:32] jas02: has joined #ruby
[06:15:12] ICantCook: has joined #ruby
[06:16:09] yardenbar: has joined #ruby
[06:16:30] hs366: has joined #ruby
[06:22:14] howdoi: has joined #ruby
[06:22:47] jas02: has joined #ruby
[06:23:30] sdfgsdfg: has joined #ruby
[06:26:01] zenspider: ICantCook: you should learn to cook. it tastes better
[06:26:23] astrobunny: has joined #ruby
[06:26:53] ruurd: has joined #ruby
[06:27:28] dionysus69: has joined #ruby
[06:29:59] khebbie: has joined #ruby
[06:35:02] ICantCook: zenspider: It's on the list
[06:35:16] aganov: has joined #ruby
[06:35:24] tonios57: has joined #ruby
[06:35:57] iateadonut: has joined #ruby
[06:36:56] iamninja: has joined #ruby
[06:37:03] ruurd: has joined #ruby
[06:41:29] Axsuul: has joined #ruby
[06:46:13] skade: has joined #ruby
[06:49:16] christiandsg: has joined #ruby
[06:50:06] lxsameer: has joined #ruby
[06:50:19] djbkd_: has joined #ruby
[06:52:14] Coldblackice_: has joined #ruby
[06:52:20] rht: has joined #ruby
[06:52:37] jeadre: has joined #ruby
[06:53:07] dumdedum: has joined #ruby
[06:53:10] kwd: has joined #ruby
[06:54:27] rushed: has joined #ruby
[06:56:03] codecop: has joined #ruby
[06:56:03] craysiii: has joined #ruby
[07:01:13] jancel: has joined #ruby
[07:01:30] zimbabawe: has joined #ruby
[07:02:31] khebbie: has joined #ruby
[07:03:49] abuzze: has joined #ruby
[07:05:21] iateadonut: has joined #ruby
[07:06:45] Musashi007: has joined #ruby
[07:07:32] stanc: has joined #ruby
[07:09:11] vondruch: has joined #ruby
[07:19:45] pranny: has joined #ruby
[07:19:46] Kedare: has joined #ruby
[07:19:54] ruurd: has joined #ruby
[07:23:52] TvL2386: has joined #ruby
[07:26:08] m8: has joined #ruby
[07:26:37] Axsuul: has joined #ruby
[07:26:58] edwinvdgraaf: has joined #ruby
[07:27:39] jas02: has joined #ruby
[07:27:55] jtdoncas: has joined #ruby
[07:30:31] iateadonut: has joined #ruby
[07:30:48] faces: has joined #ruby
[07:32:02] dgutierrez1287: has joined #ruby
[07:32:09] UtkarshRay: has joined #ruby
[07:33:15] jas02: has joined #ruby
[07:34:23] Axsuul: has joined #ruby
[07:35:09] Axsuul: has joined #ruby
[07:37:59] vondruch: has joined #ruby
[07:38:41] Timba-as: has joined #ruby
[07:38:42] jgt: has joined #ruby
[07:40:07] chinmay_dd: has joined #ruby
[07:41:03] devoldmx: has joined #ruby
[07:43:42] sameerynho: has joined #ruby
[07:47:28] Thermatix: has joined #ruby
[07:47:51] dhjondoh: has joined #ruby
[07:48:00] leafybasil: has joined #ruby
[07:48:13] Iskarlar: has joined #ruby
[07:48:13] ruurd: has joined #ruby
[07:48:53] terlar: has joined #ruby
[07:48:59] nuttermb: has joined #ruby
[07:49:40] _blizzy_: has joined #ruby
[07:49:48] devbug_: has joined #ruby
[07:51:18] Hijiri: has joined #ruby
[07:52:01] christiandsg: has joined #ruby
[07:52:40] [k-: has joined #ruby
[07:53:25] roolo: has joined #ruby
[07:53:44] Macaveli: has joined #ruby
[07:53:56] bmalum: has joined #ruby
[07:56:56] [k-: defined? is a keyword
[07:57:04] [k-: so it cant be overriden!
[07:57:07] pawanspace: has joined #ruby
[07:57:26] _blizzy_: has joined #ruby
[08:00:35] timonv: has joined #ruby
[08:03:14] paradoja: has joined #ruby
[08:03:41] MatthewRock: has joined #ruby
[08:03:45] apeiros: [k-: yupp. can't do what defined? does without a keyword.
[08:05:17] krisquigley: has joined #ruby
[08:05:40] jgt: has joined #ruby
[08:07:32] xhosae: has joined #ruby
[08:08:45] gagrio: has joined #ruby
[08:09:01] Oog: has joined #ruby
[08:09:40] davedev24: has joined #ruby
[08:10:51] joonty: has joined #ruby
[08:11:48] bruno-: has joined #ruby
[08:11:49] tagrudev: has joined #ruby
[08:13:14] Oog: has joined #ruby
[08:13:42] krz: has joined #ruby
[08:15:36] workmad3: has joined #ruby
[08:18:16] ollie314: has joined #ruby
[08:19:24] ruurd: has joined #ruby
[08:20:47] ta: has joined #ruby
[08:21:16] vdamewood: has joined #ruby
[08:24:15] benlovell: has joined #ruby
[08:25:14] skade: has joined #ruby
[08:25:24] aspiers: has joined #ruby
[08:25:26] Hounddog: has joined #ruby
[08:26:00] mutuma: has joined #ruby
[08:26:12] ruurd: has joined #ruby
[08:26:56] kr3ssh: has joined #ruby
[08:27:17] matchaw: has joined #ruby
[08:28:46] axsuul_: has joined #ruby
[08:29:51] haxrbyte: has joined #ruby
[08:30:48] Hounddog: has joined #ruby
[08:31:13] astrobunny: has joined #ruby
[08:33:36] iateadonut: has joined #ruby
[08:35:08] khebbie: has joined #ruby
[08:35:11] bmalum: has joined #ruby
[08:37:29] stardiviner: has joined #ruby
[08:38:00] charliesome: has joined #ruby
[08:38:30] paradoja: has joined #ruby
[08:45:32] einarj: has joined #ruby
[08:45:38] charliesome: has joined #ruby
[08:48:01] bumbar_: has joined #ruby
[08:48:01] bumbar_: has joined #ruby
[08:48:51] jancel: has joined #ruby
[08:49:01] Iskarlar: has joined #ruby
[08:49:21] pranny: has joined #ruby
[08:51:29] marr: has joined #ruby
[08:52:40] c0m0: has joined #ruby
[08:54:56] araujo: has joined #ruby
[08:55:42] ferhaty: has joined #ruby
[08:59:05] j416: can anyone remember why I'd put Kernel monkeypatch methods as private?
[08:59:14] j416: I did it for a reason that I foergot
[08:59:15] j416: forgot* even
[08:59:43] yorickpeterse: why would we remember?
[09:01:28] demonlove: has joined #ruby
[09:01:51] j416: yorickpeterse: because you are awesome ruby dudes that know why one might want to put things under private
[09:02:20] pawnbox: has joined #ruby
[09:03:14] j416: aah, because I'm _in_ Kernel
[09:03:58] j416: and putting it private is a way to not pollute other classes (e.g. 5.foo)
[09:04:01] j416: thanks o/
[09:04:21] adaedra: Happy to help
[09:05:18] sevenseacat: good job, you awesome ruby dudes.
[09:05:45] dfockler: has joined #ruby
[09:06:02] ndrei: has joined #ruby
[09:06:19] apeiros: j416: because it makes method_missing work correctly
[09:06:31] apeiros: j416: also you wouldn't make them private, you'd make them module_function
[09:06:55] apeiros: that way you follow the common way Kernel methods are implemented.
[09:07:00] apeiros: >> Kernel.puts "hi"
[09:07:03] ruboto: apeiros # => hi ...check link for more (https://eval.in/421271)
[09:07:52] apeiros: >> class X; def method_missing(name, *); "you called #{name} on me"; end; end; X.new.puts "hi" # method missing works properly with private methods
[09:07:53] ruboto: apeiros # => "you called puts on me" (https://eval.in/421272)
[09:08:31] apeiros: >> module Kernel; def boo; "BAD!"; end; end; class X; def method_missing(name, *); "you called #{name} on me"; end; end; X.new.boo "hi" # method missing is not used if the method is not private
[09:08:32] ruboto: apeiros # => wrong number of arguments (1 for 0) (ArgumentError) ...check link for more (https://eval.in/421273)
[09:08:40] apeiros: >> module Kernel; def boo(*); "BAD!"; end; end; class X; def method_missing(name, *); "you called #{name} on me"; end; end; X.new.boo "hi" # method missing is not used if the method is not private
[09:08:41] ruboto: apeiros # => "BAD!" (https://eval.in/421274)
[09:09:06] apeiros: and since Kernel is *everywhere*, you break method missing *everywhere*. so it's kinda a big deal.
[09:09:19] adaedra: Stop breaking everywhere.
[09:10:13] romero: has joined #ruby
[09:10:20] pranny: has joined #ruby
[09:12:43] j416: adaedra: thanks
[09:12:48] j416: not adaedra, apeiros
[09:14:01] pranny: has joined #ruby
[09:16:17] DoubleMalt: has joined #ruby
[09:18:28] khebbie: has joined #ruby
[09:20:22] Antiarc: has joined #ruby
[09:20:25] pranny: has joined #ruby
[09:20:55] michael_mbp: has joined #ruby
[09:23:17] last_staff: has joined #ruby
[09:23:48] fella5s: has joined #ruby
[09:25:45] tesuji: has joined #ruby
[09:26:08] howdoicomputer: has joined #ruby
[09:27:37] khebbie: has joined #ruby
[09:28:26] Zai00: has joined #ruby
[09:29:51] livathinos: has joined #ruby
[09:33:53] last_staff: has joined #ruby
[09:34:52] leafybasil: has joined #ruby
[09:35:13] Karpah: has joined #ruby
[09:36:00] Macaveli: has joined #ruby
[09:36:55] Musashi007: has joined #ruby
[09:38:01] deg__: has joined #ruby
[09:38:37] yfeldblum: has joined #ruby
[09:39:01] arup_r: has joined #ruby
[09:39:19] ta: has joined #ruby
[09:39:25] iamninja: has joined #ruby
[09:39:30] Blaguvest: has joined #ruby
[09:40:25] pawnbox: I am working on a ruby cli app that will have data persistence using pg. The question is how do i structure the app? I have following directories: lib, spec, bin, config(for database connection setup datbase.rb)
[09:40:54] pawnbox: Where do i put database files?
[09:41:02] pawnbox: or classes?
[09:41:32] roolo: has joined #ruby
[09:41:48] devoldmx: has joined #ruby
[09:41:55] adaedra: you put your code in lib
[09:43:05] adaedra: spec is for rspec tests files
[09:43:16] adaedra: bin for your binary/ies files
[09:43:32] adaedra: I don't see what you mean by "database files", .sql to create the db?
[09:44:01] pawnbox: like class that will have sql queries
[09:44:27] adaedra: if those are ruby classes, in lib
[09:44:41] apeiros: it puts the code in the basket
[09:44:51] adaedra: althrough you could also use a rails-like structure with app directory
[09:45:04] yfeldblum: has joined #ruby
[09:45:54] pawnbox: how would i use database connection object from config directories database.rb file?
[09:46:17] pawnbox: for ececuting database queries?
[09:46:26] adaedra: I would not put .rb files in config personally, just serialized formats (i.e. YAML)
[09:46:43] pawnbox: that a nice suggesstion
[09:46:53] pawnbox: i'll try that.
[09:46:55] ljarvis: except like.. not YAML
[09:47:34] adaedra: problem with YAML?
[09:47:40] pawnbox: like database.yml?
[09:48:28] ljarvis: meh, it has its uses
[09:49:02] ljarvis: pawnbox: yes
[09:49:37] adaedra: Then you have some code somewhere that loads it and create your database connection
[09:50:05] adaedra: I suggest using Sequel for database, by the way, really good gem
[09:50:21] pawnbox: yeah i have decided to use pg
[09:50:51] adaedra: that's not incompatible
[09:51:27] adaedra: Sequel will provide a really nice layer over your database including models which could be usefull
[09:52:35] pawnbox: I have requirements to use pg, but i will definitely take a look at sequel
[09:53:20] gregf_: pawnbox: when you say pg? do you mean a database or an orm? sequel is an orm afaik
[09:53:49] gregf_: as in pg == postgresql?
[09:54:15] gambl0re: has joined #ruby
[09:54:35] gregf_: so the gem is very specific to posrgres? what if your db changes downthe line *which i suspect it would*
[09:55:18] gregf_: sequel is prolly a orm which used the DBI class under the hood?
[09:55:22] ljarvis: sequel wraps the pg gem, it's an abstraction. It should allow you to keep your code cleaner and may increase security/readability and decrease maintenance burden
[09:55:23] gregf_: s/used/uses/
[09:55:39] ljarvis: "would I suspect it would" wat
[09:55:54] senayar: has joined #ruby
[09:56:14] gregf_: s/suspect/believe/
[09:56:22] Stan: has joined #ruby
[09:56:39] gregf_: anyways, no point taking to a tree and ******* :/
[09:56:42] pawnbox: gregf_ Ok. I'll get back to you in a min. GOTTA TALK TO CUSTOMER. HAHA
[09:56:49] christiandsg: has joined #ruby
[09:59:00] dgutierrez1287: has joined #ruby
[10:00:10] etqqkoiflwhb: has joined #ruby
[10:00:38] pawnbox: has joined #ruby
[10:00:49] imanzarrabian: has joined #ruby
[10:02:43] etqqkoiflwhb: has joined #ruby
[10:02:45] pawnbox: gergf_ So I think I won't be migrating to any other sql db because the scope of project is not that big.
[10:04:00] AlexRussia_: has joined #ruby
[10:04:19] gregf_: pawnbox: the reason i'm saying is we're having nightmares in migrating a project to mongodb as all of the business logic is in mysql. wonders is orm's can deal with mongodb :/
[10:04:35] adaedra: ahahahahahahahahahahahah
[10:04:41] porfa: has joined #ruby
[10:05:10] WilfredTheGreat: has joined #ruby
[10:06:13] pawnbox: Let's just say I need not to switch the db.
[10:06:17] yorickpeterse: You're migrating _TO_ MongoDB?
[10:07:03] skade: has joined #ruby
[10:07:05] gregf_: yorickpeterse: yep; why? nothing new ;)
[10:07:12] Gribo: has joined #ruby
[10:07:35] davedev24: has joined #ruby
[10:07:46] yorickpeterse: oh sweet baby jesus
[10:07:50] yorickpeterse: I hope you're switching jobs soon
[10:07:53] Iskarlar: has joined #ruby
[10:08:05] yorickpeterse: If not, you might want to consider that
[10:08:13] allcentury: has joined #ruby
[10:08:36] gregf_: yorickpeterse: haha, well migration projects are like greenfield projects ;)
[10:08:37] matcouto: has joined #ruby
[10:08:55] yorickpeterse: No, this sounds like a death march
[10:11:22] gregf_: yorickpeterse: if you expect all honey and no bees, then good luck to you :)
[10:11:42] yorickpeterse: There's a big difference between that and outright suicide
[10:12:00] yorickpeterse: There's no other way to put it than "It's fucking dumb to migrate from a relational database to MongoDB"
[10:12:14] yorickpeterse: In doing so you ignore the past, what, 5 years of complains about MongoDB?
[10:12:18] yorickpeterse: And all the proof that it's outright shit?
[10:12:26] yorickpeterse: At least migrate to a sane setup like Postgres
[10:12:51] yorickpeterse: hell, even Oracle would probably be a better choice
[10:13:01] yorickpeterse: In fact, even SQLite3 would be better
[10:13:14] yorickpeterse: Soon that will have JSON support, making Mongo basically obselete for any use case
[10:14:01] workmad3: has joined #ruby
[10:14:30] gregf_: well, theres surely got to be a reason why we're switching and the top guys have decided. you dont take such decisions in a matter of days. and yeah, no point you getting so mad at mongodb.
[10:14:52] Karpah: ACTION gets popcorn
[10:15:01] sevenseacat: ACTION gets more popcorn
[10:15:18] yorickpeterse: gregf_: you expect people to know what they're talking about
[10:15:25] yorickpeterse: and I have every reason to be mad at Mongo
[10:15:31] yorickpeterse: I've had to deal with it for ~2,5 years
[10:15:36] yorickpeterse: so have plenty of others
[10:15:51] yorickpeterse: http://developer.olery.com/blog/goodbye-mongodb-hello-postgresql/ here
[10:16:10] gregf_: yorickpeterse: i've worked on 2 mongo projects with Perl :), so its not a new thing for me
[10:16:58] pawnbox: Guys lets not fight over db's.
[10:16:59] gregf_: not that i'm a big fan of relational db's. you may even go ahead and use a relational db to store hierarchical data.
[10:17:36] gregf_: pawnbox: indeed. no time to argue :/
[10:18:06] allcentury: has joined #ruby
[10:18:21] sevenseacat: sweet, I get to still argue. you guys have to stop.
[10:18:36] yorickpeterse: I eagerly await the day they realize "Fuck that was a bad choice"
[10:18:53] charliesome: has joined #ruby
[10:20:22] rickmasta: has joined #ruby
[10:20:31] Iskarlar: has joined #ruby
[10:22:48] ruurd: has joined #ruby
[10:23:15] leat: has joined #ruby
[10:24:51] sevenseacat: yorickpeterse: good article
[10:25:07] adaedra: And this day they will do the right choice, putting all data in .csv files.
[10:25:45] yorickpeterse: adaedra: are you sure it will be comma separated, and not tab separated?
[10:25:47] yorickpeterse: or something else
[10:25:57] yorickpeterse: e.g. we have a company that uses ^|^ as the field separator
[10:25:59] _blizzy_: has joined #ruby
[10:26:00] yorickpeterse: I'm not even kidding
[10:27:45] Iskarlar: has joined #ruby
[10:29:27] pranny: has joined #ruby
[10:31:45] adaedra: semi-column separated
[10:33:15] _blizzy_: has joined #ruby
[10:33:56] jokke: has joined #ruby
[10:34:06] jokke: following code: https://p.jreinert.com/7EHV9/ruby
[10:34:17] jokke: rubocop tells me there's a redundant begin
[10:34:23] jokke: i don't understand why
[10:34:27] sevenseacat: then there is
[10:34:28] jokke: following code: http://p.jreinert.com/7EHV9/ruby
[10:35:21] jokke: i gotta update my pastebin..
[10:35:39] adaedra: I see no code :x
[10:35:41] sevenseacat: you should really use the one we recommend, if you want people to click on your links
[10:35:43] jokke: adaedra: yeah
[10:35:57] ruboto: https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
[10:36:07] dionysus69: hey all can I use ternary operator with && statement ?
[10:36:15] jokke: dionysus69: sure
[10:36:22] sevenseacat: can you? yes. should you? probably not.
[10:36:28] dionysus69: jokke: params[:action] == action ? "active" : nil, how do I add it on this example for example?
[10:36:51] jokke: params[:action] == action && foo ? "active" : nil
[10:36:52] dionysus69: i mean I just have an interest on how to do it , I could use regular if format :D
[10:36:59] jokke: but it's the wrong approach ther
[10:37:16] dionysus69: hmm ok thats ok answer too i wont use it then :) thanks jokke sevenseacat
[10:37:50] jokke: dionysus69: you should think over the code when the else part is just nil
[10:37:55] khebbie: has joined #ruby
[10:38:42] dionysus69: jokke: ok thanks )
[10:41:36] jokke: adaedra: ok, updated the pastebin, you shoud see code now
[10:42:14] stamina: has joined #ruby
[10:42:18] Cust0sLim3n: has joined #ruby
[10:43:28] jokke: so why is this begin redundant?
[10:44:07] ferhaty: has joined #ruby
[10:44:15] apeiros: jokke: methods have an implicit begin/end
[10:44:35] Billias: has joined #ruby
[10:44:35] jokke: i didn't know that
[10:44:35] apeiros: def meth; code; rescue; ???; else; ???; ensure; ???; end # valid
[10:44:36] adaedra: you can remove lines 2 and 9
[10:45:11] ta: has joined #ruby
[10:46:09] Mon_Ouie: has joined #ruby
[10:46:24] sevenseacat: ACTION wonders why we bother directing people to gis
[10:47:00] Liam`: has joined #ruby
[10:47:12] apeiros: hm, I don't. only when they use crap like pastebin
[10:47:44] apeiros: I mean, I do - if they paste code here or ask whether pasting code here is ok. but else, not so much.
[10:47:59] Timba-as: has joined #ruby
[10:48:23] thantos: has joined #ruby
[10:49:11] sevenseacat: ACTION points at channel topic and also channel rules 4 and 5
[10:49:24] Gnomethr_: has joined #ruby
[10:49:42] Gnomethrower: has joined #ruby
[10:50:27] charliesome: has joined #ruby
[10:51:04] rodfersou: has joined #ruby
[10:51:06] _blizzy_: has joined #ruby
[10:52:39] Fraeon: has joined #ruby
[10:52:53] Iskarlar: has joined #ruby
[10:52:54] [k-: ACTION points out that we shouldn't just click any link
[10:52:57] unreal: has joined #ruby
[10:52:59] ljarvis: has joined #ruby
[10:53:02] DaniG2k: has joined #ruby
[10:53:08] sevenseacat: +1000 to that too
[10:53:09] alexcf: has joined #ruby
[10:53:17] ebarrett: has joined #ruby
[10:53:48] FastJack: has joined #ruby
[10:54:39] sarkyniin: has joined #ruby
[10:55:23] above: has joined #ruby
[10:56:02] rdark: has joined #ruby
[10:56:25] LBRapid: has joined #ruby
[10:56:27] universa1: has joined #ruby
[10:56:40] [k-: 1. people use their own pastebins to showoff
[10:56:47] canton7: has joined #ruby
[10:56:47] canton7: has joined #ruby
[10:57:07] [k-: 2. people like to have control over their pastes
[10:57:15] rvchangue: has joined #ruby
[10:57:33] [k-: even though github already provides these
[10:57:36] jeadre: has joined #ruby
[10:57:43] zzak: has joined #ruby
[10:57:47] [k-: github is also pretty
[10:57:50] asi_: has joined #ruby
[10:58:03] BackEndCoder: has joined #ruby
[10:58:03] Phoop: has joined #ruby
[10:58:08] cstrahan: has joined #ruby
[10:58:46] hoey: has joined #ruby
[10:59:03] djbender: has joined #ruby
[10:59:11] mlue: has joined #ruby
[10:59:13] _blizzy_: has joined #ruby
[10:59:21] hellschreiber: has joined #ruby
[10:59:43] kirun: has joined #ruby
[10:59:58] thesheff17: has joined #ruby
[11:00:07] ELCALOR: has joined #ruby
[11:00:37] Aeyrix: has joined #ruby
[11:00:37] shelling__: has joined #ruby
[11:00:38] danoo_: has joined #ruby
[11:00:38] AdamMeghji: has joined #ruby
[11:00:46] rflot: has joined #ruby
[11:00:46] lancetw: has joined #ruby
[11:00:47] jaxxstorm: has joined #ruby
[11:01:02] teotwaki: has joined #ruby
[11:01:06] george2: has joined #ruby
[11:01:13] bmalum: has joined #ruby
[11:01:37] Steve_Jobs: has joined #ruby
[11:01:48] znz_jp: has joined #ruby
[11:01:53] chridal: has joined #ruby
[11:01:54] drbrain: has joined #ruby
[11:01:56] iooner: has joined #ruby
[11:02:00] larissa: has joined #ruby
[11:02:02] DarkBushido: has joined #ruby
[11:02:04] epochwolf: has joined #ruby
[11:02:05] psye: has joined #ruby
[11:02:10] cschneid: has joined #ruby
[11:02:12] yfeldblum: has joined #ruby
[11:02:13] Stan: has joined #ruby
[11:02:17] mjmac: has joined #ruby
[11:02:18] sfr^: has joined #ruby
[11:02:23] Nightmare: has joined #ruby
[11:02:27] Liam`: has joined #ruby
[11:02:36] TvL: has joined #ruby
[11:02:38] lupine: has joined #ruby
[11:02:58] apeiros: sevenseacat: yeah, it's where we guide people to as a default.
[11:03:18] johnhamelink: has joined #ruby
[11:03:24] bffff_: has joined #ruby
[11:03:24] revoohc: has joined #ruby
[11:03:26] ponga: has joined #ruby
[11:03:42] apeiros: I prefer having an actually actionable text than an abstract. i.e. I prefer "please use http://some.paste.bin/" over "please use a pastebin service"
[11:03:54] sdothum: has joined #ruby
[11:03:54] codex: has joined #ruby
[11:04:11] Dwarf: has joined #ruby
[11:04:17] terrellt: has joined #ruby
[11:04:34] AckZ: has joined #ruby
[11:04:43] apeiros: gist is there because it's one of the better services. but if there's better suggestions, I don't mind changing it.
[11:05:36] revoohc: has joined #ruby
[11:06:33] manara314: has joined #ruby
[11:06:34] skarn: has joined #ruby
[11:06:35] efox: has joined #ruby
[11:07:28] catbusters: has joined #ruby
[11:07:51] [k-: why dont people listen to us for gist?
[11:08:43] preyalone: has joined #ruby
[11:08:52] [k-: these people are more likely not to listen to us when we ask them to provide more info
[11:09:21] sevenseacat: thats exactly why I don't bother
[11:10:03] anker: i havent found any command line tool for gist yet which is adequatte
[11:10:59] [k-: and some other person's solely maintained pastebin is better at that?
[11:11:33] [k-: if we plot a bar chart of pastebins over time, pastebin.com is the winner
[11:11:38] [k-: and then the rest
[11:11:58] ta: has joined #ruby
[11:12:25] [k-: (we should actually plot a graph of pastebin over time, that'll be fun)
[11:13:52] Mekkis: has joined #ruby
[11:17:59] ndrei: has joined #ruby
[11:19:06] ruurd: has joined #ruby
[11:22:22] Iskarlar: has joined #ruby
[11:23:21] pranny: has joined #ruby
[11:24:35] bruno-: has joined #ruby
[11:28:19] shevy: [k- they don't listen to monsters!
[11:28:48] [k-: like your face!
[11:28:52] [k-: ooooo buuuuuuuurn
[11:29:01] [k-: sorry shevy :3
[11:29:44] roolo: has joined #ruby
[11:29:52] porfa: hellos! whats wrong here???? i get a page in mecha??? ( urltemp = agent.page ) and then i (parser = Nokogiri::HTML(open(urltemp)) )
[11:30:06] shevy: so many ()
[11:30:20] [k-: for your convenience, shevy
[11:30:27] shevy: this not lisp!
[11:30:37] shevy: like your face!!!!
[11:30:41] arup_r: What this #SOreadytohelp means? People are using http://stackoverflow.com/users/1553787/vamsi-krishna
[11:30:42] vondruch: has joined #ruby
[11:30:54] Zarthus: arup_r: see the 2.5 billion questions answered thing
[11:30:56] shevy: arup_r are you still trying to go for 1 million karma
[11:31:10] arup_r: Zarthus: I saw
[11:31:16] Zarthus: that's where it's from
[11:31:22] arup_r: not able to connect what this hashtag for ?
[11:31:31] Zarthus: it's a hashtag, they're always useless.
[11:31:42] arup_r: Zarthus: Well, should I use it in my profile? that is my question
[11:31:46] shevy: Porfa you should put up the code, in a reproducible manner, including the way how you invoke that code and what the specific error is, all in that pastie/gist
[11:31:51] [k-: its promotional media for stackoverflow
[11:31:55] Zarthus: arup_r: do you want to?
[11:31:59] Zarthus: It's just to show your support to SO
[11:32:14] [k-: it's like wearing a badge, "i support this event"
[11:32:21] shevy: ^^^ this is how arup_r makes 1 million reputation
[11:32:40] arup_r: I thought if I use it,,, I can get a t-shirt from them
[11:32:49] arup_r: shevy: :)
[11:33:30] shevy: a t-shirt hmm a muscle shirt
[11:33:53] fgo: has joined #ruby
[11:33:59] arup_r: shevy: I am thin,, :)
[11:35:23] yqt: has joined #ruby
[11:35:23] shevy: yeah, programmer
[11:35:48] [k-: like your face!
[11:36:43] yqt: has joined #ruby
[11:38:23] porfa: I'm kind of ashamed of posting the code on gist??? :(
[11:38:29] phutchins1: has joined #ruby
[11:38:33] porfa: because ??? f*** it i will explain...
[11:38:39] pandaant: has joined #ruby
[11:39:11] porfa: it's fetlife site.. they have no search for members age/sex so I want to parse all the locals and put them on a nice data table for better browsing experience??? it's a sex/meeting site *ASHAMED*
[11:39:25] shevy: Porfa you just have to post code that can reproduce an error, ideally in a minimal variant
[11:39:34] ldnunes: has joined #ruby
[11:39:50] ruurd: has joined #ruby
[11:40:10] ruboto: shevy # => divided by 0 (ZeroDivisionError) ...check link for more (https://eval.in/421339)
[11:40:13] shevy: see? that is a good error ^^^
[11:40:16] iamninja: has joined #ruby
[11:40:30] shevy: then we can say... it's not good to divide by 0
[11:40:30] [k-: >> shevy
[11:40:31] ruboto: [k- # => undefined local variable or method `shevy' for main:Object (NameError) ...check link for more (https://eval.in/421340)
[11:40:43] [k-: hue hue hue
[11:40:48] shevy: then arup_r can go and ask on stackoverflow for confirmation of that and gain +1000 points
[11:40:48] dc: has joined #ruby
[11:42:34] devoldmx: has joined #ruby
[11:42:59] znz_jp: has joined #ruby
[11:43:40] sebyx07: has joined #ruby
[11:43:57] _axx: has joined #ruby
[11:44:07] arup_r: shevy: :( I have some good answers too
[11:44:22] sebyx07: dependency injection gem for ruby: https://github.com/sebyx07/rubybeans
[11:44:35] arup_r: pawnbox: ys
[11:44:45] pawnbox: care to elaborate
[11:45:07] arup_r: pawnbox: Ask shevy:
[11:45:34] [k-: trailing :!
[11:45:34] arup_r: he knows what I meant and I knows what he meant :D
[11:45:39] [k-: the world is ruined!
[11:45:40] _axx: What is the best way to run long-running tcp connections in ruby? I open a few connections that should stay open (listen) until i close them by hand)
[11:46:16] _axx: Just the standard thread mechanism, or spawn processes?
[11:46:31] [k-: too vague
[11:47:14] porfa: i just need to know how to pass a page mechanize got, into nokogiri :( but ill post the gist, i should make a temporary username/pass for the site though, because if you want to test the code you'll need one
[11:47:26] Feyn: has joined #ruby
[11:47:38] _axx: [k-: what do you need to know? To be more precise: i open multiple IRC connections (each thread is one connection).
[11:48:11] [k-: a bouncer?
[11:48:18] _axx: yeah and no. similar
[11:48:19] porfa: https://gist.github.com/anonymous/b2ad66641cbc9f467b10
[11:48:32] porfa: there it is.. how do i pass the links I'm getting to nokogiri???? eh
[11:48:43] _axx: [k-: i log everything from one channel to a database and show that via websockets to multiple clients
[11:49:15] [k-: so it's a reallyyyyyy long running thing
[11:49:31] _axx: [k-: the thing is, all those connections are user-provided, so i don't know which server/channel they connect to. I need a reliable, long-running connections.
[11:49:36] _axx: [k-: yeah, basically
[11:49:54] [k-: a process would ensure that the whole thing doesn't crash and burn
[11:50:01] _axx: sure, it *could* reconnect. But those threads/processes should better un without termination
[11:50:16] _axx: [k-: yeah, i guessed so. since threads are not so "stable". :D
[11:50:35] _axx: I just wasn't sure, if there is a "better" or "standard" gem/way/tool
[11:51:51] ndrei: has joined #ruby
[11:52:05] skade: has joined #ruby
[11:53:13] paradoja: has joined #ruby
[11:54:09] symm-: has joined #ruby
[11:56:41] but3k4: has joined #ruby
[11:57:46] christiandsg: has joined #ruby
[11:58:40] Kallis: has joined #ruby
[12:01:12] [k-_: has joined #ruby
[12:05:27] Iskarlar: has joined #ruby
[12:06:10] lxsameer_: has joined #ruby
[12:07:23] imanzarrabian: has joined #ruby
[12:07:46] ferhaty: has joined #ruby
[12:08:42] tkuchiki: has joined #ruby
[12:09:19] dgutierrez1287: has joined #ruby
[12:09:33] lele|w: has joined #ruby
[12:10:22] voker57: has joined #ruby
[12:11:02] lessless: has joined #ruby
[12:11:50] Kallis: has joined #ruby
[12:11:58] rfmind: has joined #ruby
[12:12:18] pawnbox_: has joined #ruby
[12:12:50] newbie1: has joined #ruby
[12:13:00] bruno-: has joined #ruby
[12:13:02] Kallis: has joined #ruby
[12:14:10] futilegames: has joined #ruby
[12:16:11] diegoaguilar: has joined #ruby
[12:17:35] krz: has joined #ruby
[12:17:37] leat: has joined #ruby
[12:20:44] khebbie: has joined #ruby
[12:22:11] DiscoM: has joined #ruby
[12:23:36] gagrio: has joined #ruby
[12:24:24] phutchins2: has joined #ruby
[12:24:58] rbennacer: has joined #ruby
[12:25:10] jancel_: has joined #ruby
[12:25:23] dEPy: has joined #ruby
[12:25:24] Zai00: has joined #ruby
[12:27:35] dorei: has joined #ruby
[12:29:11] leat: has joined #ruby
[12:29:15] Iskarlar: has joined #ruby
[12:29:45] northfurr: has joined #ruby
[12:31:55] northfurr_: has joined #ruby
[12:32:03] IrishGringo: has joined #ruby
[12:32:13] iamninja: has joined #ruby
[12:33:45] nw: has joined #ruby
[12:36:14] leat: has joined #ruby
[12:38:22] livathinos: has joined #ruby
[12:38:44] UtkarshRay: has joined #ruby
[12:39:41] leat: has joined #ruby
[12:41:13] acke: has joined #ruby
[12:46:33] d10n-work: has joined #ruby
[12:49:36] pranny: has joined #ruby
[12:49:39] leat: has joined #ruby
[12:50:06] paradoja: has joined #ruby
[12:50:56] hinbody: has joined #ruby
[12:53:19] tmtwd: has joined #ruby
[12:54:36] _joes__: has joined #ruby
[12:55:11] northfurr_: has joined #ruby
[12:55:15] Cust0sLim3n: has joined #ruby
[12:56:42] victortyau: has joined #ruby
[12:56:57] mary5030: has joined #ruby
[12:58:50] Encapsulation: has joined #ruby
[13:00:00] rideh: has joined #ruby
[13:00:25] M-mistake: has joined #ruby
[13:00:26] M-prosodyContext: has joined #ruby
[13:00:58] mary5030: has joined #ruby
[13:01:27] dhjondoh: has joined #ruby
[13:02:32] sgambino: has joined #ruby
[13:02:43] rideh: has joined #ruby
[13:03:53] haylon: has joined #ruby
[13:04:08] renderful: has joined #ruby
[13:05:29] KC9YDN: has joined #ruby
[13:05:29] KC9YDN: has joined #ruby
[13:06:19] bmalum: has joined #ruby
[13:06:50] joonty: has joined #ruby
[13:09:38] dblessing: has joined #ruby
[13:09:41] tomaz_b: has joined #ruby
[13:12:47] IrishGringo: has joined #ruby
[13:15:22] dimasg: has joined #ruby
[13:15:59] paradoja: has joined #ruby
[13:15:59] havenwood: has joined #ruby
[13:16:40] ta: has joined #ruby
[13:17:13] droidburgundy: has joined #ruby
[13:17:45] dstarh: has joined #ruby
[13:17:50] roolo: has joined #ruby
[13:18:52] bestbrents: has joined #ruby
[13:19:03] AnoHito: has joined #ruby
[13:19:45] sankaber: has joined #ruby
[13:21:41] atomical: has joined #ruby
[13:22:09] crdpink2: has joined #ruby
[13:22:16] allcentury: has joined #ruby
[13:23:18] djcp: has joined #ruby
[13:23:31] IrishGringo: has joined #ruby
[13:25:14] Iskarlar: has joined #ruby
[13:25:21] JoshL: has joined #ruby
[13:26:23] jerius: has joined #ruby
[13:26:42] duggiefresh: has joined #ruby
[13:28:40] Cust0sLim3n: has joined #ruby
[13:29:39] wookiehangover: has joined #ruby
[13:30:06] radgeRayden: has joined #ruby
[13:30:11] iooner: has joined #ruby
[13:31:48] bmalum: has joined #ruby
[13:32:17] jhack: has joined #ruby
[13:32:19] george2_: has joined #ruby
[13:32:30] failshell: has joined #ruby
[13:33:04] zenguy_pc: has joined #ruby
[13:33:08] gamename: has joined #ruby
[13:33:14] Shidash: has joined #ruby
[13:33:25] benlovell: has joined #ruby
[13:34:31] segmond: has joined #ruby
[13:34:48] gamename: has joined #ruby
[13:35:03] Polysics: has joined #ruby
[13:35:34] ckinniburgh: has joined #ruby
[13:37:11] aspiers: has joined #ruby
[13:37:20] lupine: has joined #ruby
[13:38:07] Stan: has joined #ruby
[13:38:42] andikr: has joined #ruby
[13:38:57] Rutix: has joined #ruby
[13:38:57] Rutix: has joined #ruby
[13:40:44] gamename: has joined #ruby
[13:42:42] catbusters: has joined #ruby
[13:43:13] freerobby: has joined #ruby
[13:43:18] devoldmx: has joined #ruby
[13:43:19] rbennacer: has joined #ruby
[13:43:24] arup_r: has joined #ruby
[13:43:28] ferhaty: has joined #ruby
[13:43:47] tmtwd: has joined #ruby
[13:44:39] arup_r1: has joined #ruby
[13:44:45] jordanm: has joined #ruby
[13:45:37] rdark: has joined #ruby
[13:46:08] gagrio_: has joined #ruby
[13:46:39] bmalum: has joined #ruby
[13:46:57] rdark: has joined #ruby
[13:47:02] bruno-: has joined #ruby
[13:47:12] malconis: has joined #ruby
[13:52:12] Oog: has joined #ruby
[13:52:43] fmcgeough: has joined #ruby
[13:52:53] Iskarlar: has joined #ruby
[13:54:37] Zort0n: has joined #ruby
[13:57:04] davedev24: has joined #ruby
[13:57:37] devdazed: has joined #ruby
[13:59:10] above: has joined #ruby
[14:00:32] christiandsg: has joined #ruby
[14:01:00] whippythellama: has joined #ruby
[14:01:05] decoponio: has joined #ruby
[14:01:55] jgpawletko: has joined #ruby
[14:02:11] zly: has joined #ruby
[14:02:34] gagrio: has joined #ruby
[14:02:36] jhack: has joined #ruby
[14:02:59] abbe: has joined #ruby
[14:03:18] msnyon: has joined #ruby
[14:04:10] new2rails: has joined #ruby
[14:04:36] new2rails: join #rubyonrails
[14:05:02] gagrio_: has joined #ruby
[14:06:07] Olipro: has joined #ruby
[14:06:28] Soda: has joined #ruby
[14:07:34] khebbie: has joined #ruby
[14:08:02] shevy: test failed!
[14:09:55] [k-_: one rabbit blew up
[14:10:07] cajone: has left #ruby: ()
[14:11:12] banjara: has joined #ruby
[14:11:13] catbusters: has joined #ruby
[14:11:49] dopamean_: has joined #ruby
[14:13:24] jokke: anyone know if a version change in yaml has made YAML.load('[foo,:bar,baz]') throw an error?
[14:13:25] rbennacer: has joined #ruby
[14:14:03] porfa: has joined #ruby
[14:14:34] jokke: iirc this would have returned ["foo", ":bar", "baz"]
[14:17:10] mhib: has joined #ruby
[14:17:29] [k-_: you are supposed to give the array a name
[14:17:38] jokke: no that's not it
[14:17:46] [k-_: hello_this_is_an_array: [foo, :bar, baz]
[14:17:52] jokke: not working
[14:17:59] jokke: it's the colon in front of :bar
[14:18:00] aibo: > YAML.load('[foo,:bar,baz]')
[14:18:01] aibo: => ["foo,:bar,baz"]
[14:18:05] aibo: in ruby 1.8
[14:18:23] jokke: so it _is_ a regression
[14:18:23] ofdtrinity: has joined #ruby
[14:18:31] [k-_: so horrible you people
[14:18:35] i: has joined #ruby
[14:18:51] above: has joined #ruby
[14:18:57] aibo: jokke: the output is differnt fom your expected output
[14:19:14] jokke: oh you meant that with the quotes
[14:19:20] jokke: thought that was a typo
[14:19:34] aibo: i copied it
[14:19:34] Iskarlar: has joined #ruby
[14:19:38] aibo: so, no typo
[14:20:35] momomomomo: has joined #ruby
[14:20:43] aspiers: has joined #ruby
[14:20:44] jokke: 1.9.3 throws the same error
[14:20:55] cajone: has joined #ruby
[14:21:08] jokke: this works though: YAML.load("[foo,':bar',baz]")
[14:21:11] fibbel: has joined #ruby
[14:21:13] Iskarlar: has joined #ruby
[14:21:14] [k-_: >> require 'yaml'; YAML.load("foo:\n- bar\n- baz\n- :b\n")
[14:21:15] ruboto: [k-_ # => {"foo"=>["bar", "baz", :b]} (https://eval.in/421415)
[14:21:18] phutchins: has joined #ruby
[14:21:21] [k-_: tadaaaaaaa
[14:21:30] jokke: yeah that works
[14:22:13] dojobo: has joined #ruby
[14:23:20] [k-_: which is why you should follow the format!
[14:23:21] j_mcnally: has joined #ruby
[14:23:24] [k-_: shevy: FOLLOW!
[14:24:24] umgrosscol: has joined #ruby
[14:25:11] adaedra: says the one who writes obfuscation software
[14:25:27] [k-_: nuh uh, i still follow ruby syntax
[14:25:27] khebbie: has joined #ruby
[14:26:50] pranny: has joined #ruby
[14:26:56] [k-_: >> require 'yaml'; YAML.load("- bar\n- baz\n- :b\n")
[14:26:57] ruboto: [k-_ # => ["bar", "baz", :b] (https://eval.in/421421)
[14:27:04] [k-_: wow it still works
[14:27:08] [k-_: stupid yaml
[14:27:37] sarkyniin: has joined #ruby
[14:27:59] grotewold: has joined #ruby
[14:28:25] amystephen: has joined #ruby
[14:28:52] shortythepimp: has joined #ruby
[14:29:03] shortythepimp: has left #ruby: ()
[14:29:37] beef-wellington: has joined #ruby
[14:30:25] hashrocket: has joined #ruby
[14:30:38] atomical: has joined #ruby
[14:30:54] bmalum: has joined #ruby
[14:31:14] shortythepimp: has joined #ruby
[14:31:21] ta: has joined #ruby
[14:32:06] tjohnson: has joined #ruby
[14:33:31] nertzy: has joined #ruby
[14:34:49] tonios57: has joined #ruby
[14:35:49] lampd1: has joined #ruby
[14:35:58] khebbie: has joined #ruby
[14:37:24] Macaveli: has joined #ruby
[14:38:08] varesa: has joined #ruby
[14:39:04] ducklobster: has joined #ruby
[14:40:13] Zai00: has joined #ruby
[14:40:49] njs126: has joined #ruby
[14:41:25] ducklobster: is there any way to impose the same input argument limitations that a regular method has to a block?
[14:41:43] ducklobster: i.e. if i say def mymethod(input), ruby will throw an exception if i pass more or less than a single input
[14:42:07] kies^: has joined #ruby
[14:42:07] whippythellama: has joined #ruby
[14:42:08] rdark: has joined #ruby
[14:42:13] ducklobster: however with a block (in particular i am using define_singleton_method(:mymethod) do |input|
[14:42:28] ducklobster: i have to manually check the input length
[14:42:33] tmtwd: has joined #ruby
[14:42:50] jhass: uhm, no, after define_method you don't
[14:42:51] dagda1: has joined #ruby
[14:43:00] twistedpixels: has joined #ruby
[14:43:05] abuzze: has joined #ruby
[14:43:30] bweston92: has joined #ruby
[14:43:30] ducklobster: so checking the input length is the correct approach
[14:43:33] jhass: >> o = Object.new; o.define_singleton_method(:foo) {|a| }; o.foo;
[14:43:34] ruboto: jhass # => wrong number of arguments (0 for 1) (ArgumentError) ...check link for more (https://eval.in/421425)
[14:43:37] [k-_: yup, after that, the block is promoted to a method
[14:43:46] [k-_: no, ducklobster
[14:44:18] ngscheurich: has joined #ruby
[14:44:25] futilegames: has joined #ruby
[14:44:29] ducklobster: hmmm strange, i am able to pass multiple values and it doesn't seem to complain
[14:44:37] jhass: >> o = Object.new; o.define_singleton_method(:foo) {|a| }; o.foo(1, 2);
[14:44:38] ruboto: jhass # => wrong number of arguments (2 for 1) (ArgumentError) ...check link for more (https://eval.in/421430)
[14:44:42] farn: has joined #ruby
[14:44:47] jhass: then that's not the reduced version of your code
[14:44:59] ducklobster: yeah let me gist my code
[14:45:27] AlexAltea: has joined #ruby
[14:46:40] ducklobster: https://gist.github.com/anonymous/d662f612ca2230016e51
[14:47:07] Iskarlar: has joined #ruby
[14:47:47] bruno-: has joined #ruby
[14:48:26] [k-_: andddd, how are you using it
[14:48:56] jhass: mmh, ruby -v might be relevant too actually, never checked
[14:49:05] [k-_: you can also create a symbol like this :"#{field}="
[14:49:12] ducklobster: i use the register with some input field name, which should generate a a custom setter method
[14:49:13] [k-_: >> :"test="
[14:49:15] ruboto: [k-_ # => :test= (https://eval.in/421434)
[14:49:22] jhass: that to_sym is unnecessary btw
[14:49:29] ducklobster: so then i am using the custom setter and mygenerator.name2 = 5, 31
[14:49:35] ecnalyr: has joined #ruby
[14:49:41] ducklobster: thanks for the symbol tip!
[14:49:52] rippa: has joined #ruby
[14:50:00] jhass: I meant you can pass a string just fine
[14:50:22] ducklobster: oh, define_singleton_method will auto convert?
[14:50:22] jhass: I think in assignments the = binds stronger than ,
[14:50:27] ducklobster: i am guessing define_method will too?
[14:50:28] jhass: try .name2=(5, 21)
[14:51:02] bmalum: has joined #ruby
[14:51:24] ducklobster: .name3=(31, 5) => syntax error, unexpected ',', expecting ')'
[14:51:42] jhass: there you go the , just vanishes somewhere
[14:51:48] jhass: >> a = 1, 2
[14:51:49] ruboto: jhass # => [1, 2] (https://eval.in/421438)
[14:51:52] jhass: >> a = 1, 2; a
[14:51:53] ruboto: jhass # => [1, 2] (https://eval.in/421439)
[14:52:05] jhass: okay, actually maybe you get an array?
[14:52:22] apeiros: ducklobster: you can (re arg count with blocks), but it's ugly
[14:52:24] ducklobster: that seems like what is happening
[14:52:30] apeiros: >> def foo; yield; end; foo(&->(x) {})
[14:52:31] ruboto: apeiros # => wrong number of arguments (0 for 1) (ArgumentError) ...check link for more (https://eval.in/421440)
[14:52:53] momomomomo: has joined #ruby
[14:53:03] Draggor: has joined #ruby
[14:53:06] jhass: >> o = Object.new; o.define_singleton_method(:foo=) {|a| p a }; o.foo = 1, 2
[14:53:07] ruboto: jhass # => [1, 2] ...check link for more (https://eval.in/421441)
[14:53:14] dimasg: has joined #ruby
[14:53:20] jhass: you're assigning an array actually :P
[14:53:22] apeiros: explanation: blocks normally use proc semantics (no arg count validation), lambda's otoh do an arg count validation. ->(){} is a synonym for lambda.
[14:53:24] Draggor: Anyone know where I can look for help with the gollum/omniauth/omnigollum projects?
[14:53:44] jhass: Draggor: prolly #RubyOnRails has some folks
[14:54:12] Draggor: jhass: as far as I'm aware this is a sinatra project and not RoR?
[14:54:36] jhass: omniauth is popular in the rails community though
[14:54:38] ecnalyr: I've got a method that feels smelly due to the numerous conditionals, I feel I can clean it up by mapping but I'm not 'clicking' this morning - thoughts? https://gist.github.com/ecnalyr/8ff0a7cc8b18e16c3b2a
[14:54:44] havenwood: Draggor: Nonetheless the largest community here familiar with it is #RubyOnRails. There is a #Sinatra as well to try.
[14:54:46] Draggor: jhass: ahh, gotcha
[14:54:52] jhass: Draggor: there's a #sinatra too
[14:55:04] jhass: oh, too slow :P
[14:55:46] ducklobster: apeiros: thanks, interesting, i might just end up doing my own validation, easier to understand/read
[14:56:41] abuzze: has joined #ruby
[14:57:08] fullofcaffeine: has joined #ruby
[14:57:58] Draggor: of course after asking I at least get the basics of it down
[14:58:11] jhack: does .sort only sort strings? and not #'s?
[14:58:48] momomomomo: has joined #ruby
[14:58:50] jhass: ecnalyr: I feel like you can write a single query for this, something like PlacePreference.joins(:roles => :users).where(users: {id: current_user.id}, venue_uuid: current_place.id) or so, but the #RubyOnRails folk might have an actually working idea into that direction
[14:59:11] ecnalyr: jhass good point, thanks
[14:59:12] iamninja: has joined #ruby
[14:59:40] but3k4: has joined #ruby
[14:59:40] ckinniburgh_: has joined #ruby
[15:00:04] clarkenciel: has joined #ruby
[15:00:15] dopamean1: has joined #ruby
[15:00:43] jhass: ecnalyr: actually might not even need to join users and can just restrict the user_id in roles
[15:02:05] j_mcnally: has joined #ruby
[15:02:05] jhass: ecnalyr: PlacePreference.joins(:roles).where(role: {user_id: current_user.id}, venue_id: current_place.id) does that work?
[15:02:32] jhass: eh, venue_uuid
[15:03:03] sudiptamondal: has joined #ruby
[15:03:08] yashinbasement: has joined #ruby
[15:03:10] chouhoulis: has joined #ruby
[15:03:56] ecnalyr: jhass gets me going in the right direction, thanks!
[15:04:24] Gribo: has joined #ruby
[15:05:25] jtdoncas_: has joined #ruby
[15:05:54] pawnbox: has joined #ruby
[15:05:59] roolo: has joined #ruby
[15:06:36] skade: has joined #ruby
[15:08:18] nerdoncall: has joined #ruby
[15:08:20] joneshf-laptop: has joined #ruby
[15:08:52] IceyEC: has joined #ruby
[15:09:26] ta: has joined #ruby
[15:11:03] diegoaguilar: has joined #ruby
[15:11:47] bl4ckpajamas: has joined #ruby
[15:11:56] kies: has joined #ruby
[15:11:59] m3ow1504_x: has joined #ruby
[15:13:06] bootstrappm: has joined #ruby
[15:13:13] praveen__: has joined #ruby
[15:13:50] EminenceHC: has joined #ruby
[15:14:46] juanpaucar: has joined #ruby
[15:18:16] sarkyniin: has joined #ruby
[15:18:21] unver: has joined #ruby
[15:20:18] countryHick: has joined #ruby
[15:21:00] cschneid_: has joined #ruby
[15:21:07] sldkjfsldkjf: has joined #ruby
[15:21:21] Iskarlar: has joined #ruby
[15:21:41] lkba: has joined #ruby
[15:21:45] dopamean_: has joined #ruby
[15:22:35] bl4ckpajamas: has joined #ruby
[15:22:51] riotjones: has joined #ruby
[15:23:21] mkopriva: has joined #ruby
[15:25:10] pranny: has joined #ruby
[15:25:38] Exuma: has joined #ruby
[15:26:30] cschneid_: Does anybody know if unicorn exposes a "is this a worker or a preloaded master process" method?
[15:28:24] fullofcaffeine: has joined #ruby
[15:28:30] skade: has joined #ruby
[15:29:25] IceyEC: has joined #ruby
[15:29:31] jhass: cschneid_: there are pre and after fork hooks to do you reconnections and such
[15:30:04] startupality: has joined #ruby
[15:30:39] cschneid_: jhass: right, I'm aware of those. I was hoping for a simple Unicorn::GlobalStatus.running_worker? or running_master? method. A quick skim of the code doesn't turn up anything though
[15:30:54] andybernard: has joined #ruby
[15:31:19] jhass: I'm saying needing that sounds a bit silly
[15:32:00] snockerton: has joined #ruby
[15:32:33] andybernard: has joined #ruby
[15:33:21] chouhoulis: has joined #ruby
[15:33:48] ReK2: has joined #ruby
[15:33:48] ReK2: has joined #ruby
[15:33:55] rcvalle: has joined #ruby
[15:33:57] porfa: hello??? any suggestion to bypass a thingie I'm having problems with in mechanize???? this ---> .link_with(:text => 'view more ???').click
[15:34:17] porfa: can't i ??? ".link_with(:text => 'view more ***WHATEVER***').click ?
[15:34:30] porfa: because I'm having a problem passing the ??? in ruby
[15:34:38] porfa: (in rib, works fine, in ruby??? it fails)
[15:35:16] [k-: >> '???'
[15:35:17] ruboto: [k- # => "???" (https://eval.in/421460)
[15:35:31] dfockler: has joined #ruby
[15:35:38] [k-: are you sure it's not the library
[15:35:45] [k-: or your old Ruby
[15:35:46] porfa: #<Mechanize::Page::Link "view more ???" "/administrative_areas/2789/groups">
[15:36:02] porfa: in rib it works.. my ruby is indeed old, 1.9...
[15:36:23] porfa: what version should i use in your opinion?
[15:36:39] porfa: thank you jhass
[15:36:42] [k-: only the latest and greatest
[15:36:48] [k-: , 2.2.3
[15:36:51] dfockler: might as well
[15:37:01] but3k4: has joined #ruby
[15:37:47] paradoja: has joined #ruby
[15:38:02] rehat: has joined #ruby
[15:39:23] bffff_: has joined #ruby
[15:40:42] DiscoM: Hi. Ruby newbie here, can someone tell why in this code http://pastie.org/10372520 , if ??puts global_bla
[15:40:42] DiscoM: ?? , why using ??puts @global_local?? ?
[15:41:04] Alayde: has joined #ruby
[15:41:10] Cache_Money: has joined #ruby
[15:41:11] [Butch]: has joined #ruby
[15:41:13] The_Phoenix: has joined #ruby
[15:41:29] adaedra: who uses ????
[15:41:32] above: has joined #ruby
[15:41:43] yqt: has joined #ruby
[15:41:51] larissa: has joined #ruby
[15:41:56] DiscoM: me, with my b??po keyboard
[15:42:00] ljarvis: DiscoM: what do you mean why? you didn't write this?
[15:42:07] Torrieri: has joined #ruby
[15:42:20] NeverDie: has joined #ruby
[15:42:37] porfa: arm??? i now have 2.2.3 but my gems are gone.. can i use the gems i was using from the 1.9 ruby or it's better for me to change back to 1.9, gem list, get the names, go to 2.2.3 and install said gems again?
[15:42:49] The_Phoenix: has joined #ruby
[15:42:49] ljarvis: Porfa: the latter
[15:43:11] ytti: has joined #ruby
[15:44:03] devoldmx: has joined #ruby
[15:44:20] khebbie: has joined #ruby
[15:44:25] The_Phoenix: has joined #ruby
[15:44:34] araujo: has joined #ruby
[15:44:37] adaedra: DiscoM: 1) salut 2) what are you trying to achieve 3) you know the difference between variables and @variables?
[15:44:45] DiscoM: i mean, in ??def affiche?? , ??puts global_bla?? is working, but in every tutorial, they tell to use ??puts @global_local?? , i don't know why they ask to put the ??@??. Ok it's a local variable, but it's working without ??@?? so why wondering about it.
[15:45:08] ljarvis: @foo is not a local variable
[15:45:14] NeverDie: has joined #ruby
[15:45:25] ljarvis: I don't understand this "in every tutorial".. this code is quite odd, really
[15:45:33] benlovell: has joined #ruby
[15:45:37] adaedra: ???@foo??? is not the same as ???foo???
[15:45:48] adaedra: (I, too, can use fancy quotation marks)
[15:45:51] ljarvis: so I highly doubt it's "every tutorial". Might be worth sharing your resources
[15:46:14] bl4ckpajamas: has joined #ruby
[15:46:35] ta: has joined #ruby
[15:46:41] shevy: perhaps ruby the hard way
[15:47:06] DiscoM: ljarvis: like thiis one : http://ruby-doc.org/docs/beginner-fr/xhtml/ch04s02.html (Fra sorry)
[15:47:07] yorickpeterse: Zed might be grumpy, but he's not dumb
[15:47:25] dgutierrez1287: has joined #ruby
[15:47:38] [k-: fancy: ????????????????????????????
[15:47:47] ljarvis: DiscoM: ok, that's not really the same thing; and I think your variable naming is confusing yourself
[15:48:36] adaedra: ?? @rue est une variable de classe. ??
[15:49:31] shevy: adaedra beautiful french
[15:49:43] DiscoM: ljarvis: ok, l will read more to understand, thank you.
[15:50:07] adaedra: shevy: the language ok, the tutorial is full of errors
[15:50:15] shevy: adaedra GigiDAgostino - LAmourToujours
[15:50:15] [k-: classe rue de est variable une rue
[15:50:20] DiscoM: too bad for an offical tutorial
[15:50:22] shevy: the language is so beautiful that errors are ok!
[15:50:54] shevy: yeah ruby-doc.org
[15:51:03] adaedra: (well, full, I push it a bit far, but there's weird things)
[15:51:06] DiscoM: it's not official ?
[15:51:23] shevy: DiscoM dunno but I would tend to english tutorials, they are often better
[15:51:23] araujo_: has joined #ruby
[15:51:43] shevy: or a GERMAN TUTORIAL!
[15:51:43] [k-: ruby-docs.org isnt affiliated with ruby-lang.org
[15:51:44] havenwood: DiscoM: It's only officially official if Matz has direct control of it. :P
[15:51:47] big|bad|wolf: has joined #ruby
[15:51:58] DiscoM: shevy: ok i will, thanks for the tip
[15:52:01] Iskarlar: has joined #ruby
[15:52:06] shevy: http://ruby-doc.org/docs/Einfuhrung_in_Ruby/ oh my god... 2006
[15:52:17] havenwood: DiscoM: So ruby-docs.org, bundler, chruby, rvm etc aren't official.
[15:52:19] shevy: 10 years... most languages change a lot in 10 years...
[15:52:23] xhosae: has joined #ruby
[15:52:41] [k-: i will too
[15:52:48] shevy: [k- your face!!!
[15:52:59] shevy: the french tutorial is from 2003?
[15:53:07] adaedra: This guide is ?? 2003
[15:53:32] djbkd_: has joined #ruby
[15:53:36] [k-: shevy: your face will be too old to recognise in 10 years!!!
[15:53:47] [k-: hahahahahahha
[15:53:51] adaedra: [k-: do you have a face fetish or something?
[15:53:59] adaedra: DiscoM: this guide looks really old too
[15:54:12] [k-: i already explained this some time ago
[15:54:22] araujo_: has joined #ruby
[15:54:28] [k-: either you werent here or you have a memory loss
[15:54:39] DiscoM: adaedra: ok :( , i wil try to look for newers
[15:54:42] jtdoncas_: has joined #ruby
[15:55:19] adaedra: ?? A l'heure ou nous ??crivons ces lignes, la derni??re version disponible de Ruby pour Microsoft Windows est 1.6.8. ?? (???As we writes these lines, last available version of Ruby for Ms Windows is 1.6.8???
[15:55:37] DiscoM: adaedra: indeed
[15:56:04] [k-: sooooo ooooooooold
[15:56:14] bruno-: has joined #ruby
[15:56:22] bmalum: has joined #ruby
[15:56:26] adaedra: DiscoM: If you're fluent enough in English, look for documentation in English. You'll find way better resources than keeping to your native language, even if it would be easier.
[15:56:45] phutchins: has joined #ruby
[15:57:05] [k-: i think Ox0dea has 1.6.8 archived somewhere
[15:57:19] DiscoM: adaedra: ok, i will stick to english docs. thanks.
[15:57:23] dopie: has joined #ruby
[15:57:24] araujo_: has joined #ruby
[15:58:37] jeadre: has joined #ruby
[15:59:07] khebbie: has joined #ruby
[15:59:17] ytti: has joined #ruby
[15:59:24] araujo_: has joined #ruby
[16:00:05] shevy: la baguette
[16:00:24] luckyme: has joined #ruby
[16:00:43] shevy: adaedra why are there not more games written in ruby :(
[16:01:07] shevy: this guy used to use ruby https://github.com/godrin/antargis but he no longer does as far as I know
[16:01:28] NeverDie: has joined #ruby
[16:01:32] [k-: just like me
[16:01:35] shevy: or perhaps he still does
[16:01:39] shevy: but he wrote a javascript version lately
[16:01:48] dfockler: you could probably use crystal for a game, not sure if there are good bindings yet
[16:01:49] adaedra: shevy why do you ask me
[16:02:06] Oog: has joined #ruby
[16:02:29] shevy: oh yeah https://github.com/godrin/antargis https://godrin.github.io/antargis.js/
[16:02:36] ngscheurich: has joined #ruby
[16:02:40] shevy: adaedra you look wise
[16:02:42] shevy: and competent
[16:02:44] [k-: why adaedra why
[16:02:47] nerdoncall: Noobie here. First Ruby web scraping program and getting an error trying to write a hash to a csv file. Getting an error "undefined local variable or method `csv'" . Code is at https://gist.github.com/0aaffb6f0076b1d0c630.git
[16:03:13] shevy: page not found
[16:03:22] christiandsg: has joined #ruby
[16:03:43] nerdoncall: sorry https://gist.github.com/nerdoncall/0aaffb6f0076b1d0c630
[16:03:49] [k-: remove the .git
[16:03:52] atomical: has joined #ruby
[16:03:53] pragmatism: has joined #ruby
[16:04:09] adaedra: rm -rf .git
[16:04:26] banister: has joined #ruby
[16:04:28] [k-: he used gist and you dont know how to use it?!!?!?
[16:04:33] dr3w: has joined #ruby
[16:04:44] jhass: nerdoncall: is this the game where you guess the error output?
[16:04:50] jhass: nerdoncall: does it contain an e?
[16:05:24] adaedra: yeah, a complete error with line could be nice.
[16:05:31] nerdoncall: error caused by line 110.
[16:05:39] ngscheurich: has joined #ruby
[16:05:44] [k-: your code is not idiomatic
[16:05:49] [k-: and you abuse constants
[16:06:00] nerdoncall: search1.rb:110:in `block (2 levels) in find_att_value': undefined local variable or method `csv' for main:Object (NameError) from search1.rb:83:in `each' from search1.rb:83:in `block in find_att_value' from search1.rb:75:in `each' from search1.rb:75:in `find_att_value' from search1.rb:124:in `block in <main>' from /home/bob/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/csv.rb:1273:in `open' from search1.rb:17:in `<main>'
[16:06:13] jhass: [k-: so helpful
[16:06:17] adaedra: indent is weird
[16:06:30] [k-: line 49 ended csv scope
[16:06:33] jhass: nerdoncall: can you tell me what a local variable is?
[16:07:06] [k-: wait it didnt
[16:07:07] rodfersou: has joined #ruby
[16:07:17] mleung: has joined #ruby
[16:07:25] ljarvis: [k-: please take a minute to review/think about the code before blurting stuff out
[16:07:32] nerdoncall: a local variable is local to that method or class
[16:07:43] nerdoncall: sorry I am new at this
[16:08:11] JoshGlzBrk: has joined #ruby
[16:08:12] jhass: nerdoncall: exactly. So you define a bunch of methods. methods introduce a new scope and don't inherit the outer one
[16:08:38] SCHAAP137: has joined #ruby
[16:08:50] jhass: well, actually a local variable is only local to a method
[16:08:57] jhass: or the toplevel
[16:09:12] jhass: but the point that methods don't inherit any scope stands
[16:09:32] luksaur: has joined #ruby
[16:09:58] ruurd: has joined #ruby
[16:10:21] dc: has joined #ruby
[16:11:01] renderful: has joined #ruby
[16:11:28] [k-: but he abused constants!
[16:11:46] [k-: that should be corrected before it gets out of hand
[16:12:14] [k-: constants aren't supposed to be modified, nerdoncall
[16:12:27] nerdoncall: so I need to inherit from CSV. I will work on my constant abuse.
[16:13:54] unver: has left #ruby: ("ERC (IRC client for Emacs 24.5.1)")
[16:18:08] jhass: you should make a normal class
[16:18:15] above: has joined #ruby
[16:18:37] jhass: and use a instance variables for all your constants as well as the CSV writer instance
[16:18:49] shevy: nerdoncall you need to write clear and concise code; look at what you do, you define a method inside the do |csv| block
[16:19:04] fullofcaffeine: has joined #ruby
[16:19:09] finisherr: has joined #ruby
[16:19:37] khebbie: has joined #ruby
[16:19:42] rbennacer: has joined #ruby
[16:20:13] Novice201y: has joined #ruby
[16:20:39] Novice201y: Hello. Are there interesing open source projects in Ruby on Cloud9 IDE?
[16:20:59] Hanmac: has joined #ruby
[16:21:46] nerdoncall: thank you -jhass -shevy -k-
[16:23:38] riotjones: has joined #ruby
[16:23:58] phutchins: has joined #ruby
[16:26:46] bricker: has joined #ruby
[16:27:46] pietr0: has joined #ruby
[16:28:12] RobertBirnie: has joined #ruby
[16:28:49] shevy: the simplest way towards a cleanup is to use small methods that do only fairly little
[16:29:00] shevy: dunno about cloud
[16:29:10] Spami: has joined #ruby
[16:29:34] skade: has joined #ruby
[16:30:12] towski_: has joined #ruby
[16:30:16] jtdoncas_: has joined #ruby
[16:30:18] renderful: has joined #ruby
[16:31:10] lkba_: has joined #ruby
[16:31:49] banister: yorickpeterse i wsa in arnhem over the weekend
[16:32:05] banister: yorickpeterse it's the ONLY place i've been to in NL that has hills, are there any other places like that?
[16:32:14] banister: it was awesome, finally...a landscape!
[16:32:50] youngbaks: has joined #ruby
[16:33:15] adaedra: hills? in NL?
[16:34:04] anker: adaedra: they have 1/3 of a hill
[16:34:22] anker: near the border with belgium and germany
[16:34:24] adaedra: At the German border?
[16:34:24] rideh: has joined #ruby
[16:34:36] anker: the highest spot of the netherlands
[16:34:59] adaedra: "The highest spot of the netherlands ??? Germany."
[16:35:44] RobertBirnie: has joined #ruby
[16:38:47] skade: has joined #ruby
[16:38:58] fantazo: has joined #ruby
[16:40:15] araujo: has joined #ruby
[16:40:15] araujo: has joined #ruby
[16:40:59] yqt: has joined #ruby
[16:41:35] porfa: ok, now that i have change to ruby 2.2 i can't install most of the gems i was using??? lots of compiling errors, rvm requirements was done of course :'/ goddamit.. can't i really stay on 1.9 ?;'(
[16:42:12] sudiptamondal: has joined #ruby
[16:42:22] shevy: come to 2.2.3
[16:42:32] shevy: wget ftp://ftp.ruby-lang.org/pub/ruby/ruby-2.2.3.tar.xz
[16:42:53] shevy: if you stay on 1.9 you will have to do more and more work on your own, like fixing incompatibilities
[16:43:08] sudiptamondal: has joined #ruby
[16:43:58] Spami: has joined #ruby
[16:44:02] Eiam: has joined #ruby
[16:44:36] shevy: less heroic than if you were on 1.8.x though
[16:46:23] socialjackie: has joined #ruby
[16:47:31] Spami_: has joined #ruby
[16:48:12] Rubie: has joined #ruby
[16:48:15] tkuchiki: has joined #ruby
[16:48:23] sevvie: has joined #ruby
[16:48:40] Bish: i want to start a thread with an exchangeable block, is that possible?
[16:48:45] zenguy_pc: has joined #ruby
[16:48:52] Maletor: has joined #ruby
[16:49:23] DoubleMalt: has joined #ruby
[16:49:57] araujo: has joined #ruby
[16:50:04] Bish: meaning i want a block in a variable, sort-of
[16:50:13] troyready: has joined #ruby
[16:51:15] dagda1: has joined #ruby
[16:51:34] bricker: Bish: yes, that's what Procs are for
[16:51:51] sankaber: has joined #ruby
[16:51:54] porfa: shevy: i want 2.2.3 but I'm using RVM??? should i drop it? it's already installed.. but every time i try to install nokogiri or mechanize it starts complaining about lstdc++ and I'm pretty sure its installed..i mean, it installed nokogiri and mechanize in 1.9...
[16:52:06] Bish: bricker, that's what i thought, but how do i start a proc in a thread?
[16:52:20] sanguisdex: has left #ruby: ()
[16:52:29] shevy: Porfa dunno, I can't give advice on rvm as I don't use it; it may help to show the specific error you get
[16:52:43] wprice: has joined #ruby
[16:52:49] Bish: ACTION loves rvm
[16:52:49] porfa: ruby -v = ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-linux]
[16:53:03] bricker: Bish: yourProc = proc { "hello" }; yourProc.call()
[16:53:06] porfa: ok, i will paste the error in gist and post it, maybe i can get some help, thanks for the hint shevy
[16:53:28] Bish: bricker, Procs aren't threads, or am i wrong?
[16:53:43] bricker: Bish: Procs and Threads are different things
[16:53:49] porfa: https://gist.github.com/anonymous/7cceadf97e900e1fca47
[16:53:51] Bish: their execution blocks when called, that's what i mean
[16:54:02] Bish: yeah so.. how does this help me
[16:54:09] roolo: has joined #ruby
[16:54:24] bricker: Bish: I guess I misunderstood your question
[16:54:54] saddad: has joined #ruby
[16:54:59] Iskarlar: has joined #ruby
[16:55:01] Bish: well, i want to do stuff like "Thread.new block1 if cond1 else Thread.new block2"
[16:55:08] cornerma1: has joined #ruby
[16:55:35] bricker: Bish: Thread.new(&yourProc)
[16:55:40] bricker: like that?
[16:55:56] Bish: oehh, i don't know exactly, but might be
[16:56:02] araujo: has joined #ruby
[16:56:02] araujo: has joined #ruby
[16:57:07] einarj: has joined #ruby
[16:57:29] rbennacer: has joined #ruby
[16:58:45] Bish: bricker, thank you, looks good, but i don't know how to make sure the threads will not get the same variables
[16:59:20] bricker: Bish: I'm not sure what you're concerned about
[16:59:41] jpfuentes2: has joined #ruby
[16:59:51] codecop: has joined #ruby
[17:00:12] livcd: what non rails project are you working on guys ?
[17:00:12] Bish: http://pastebin.com/TpaEGfpE
[17:00:13] ruboto: Bish, we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/4b037e733eab09cef016
[17:00:13] ruboto: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[17:00:45] yatish27: has joined #ruby
[17:01:03] duggiefresh: has joined #ruby
[17:01:27] clarkenciel: anyone familiar with the Selenium bindings for Ruby?
[17:01:28] gizmore: has joined #ruby
[17:01:41] bap1313: has joined #ruby
[17:01:48] fuzzyhorns: has joined #ruby
[17:01:59] Bish: #1) why does Proc have "job", if there comes another thread along, will "job" get overwritten? it might be not the case, because i would create a new proc everytime handle_job is called, but what if i store the proc outside of the method
[17:01:59] bricker: Bish: has keys are unique so you don't need that check. Is that what you're talking about?
[17:02:24] alphaatom: has joined #ruby
[17:02:25] Bish: pretty hard to put into words, sorry
[17:02:26] shevy: Porfa that is also the ruby version I use; perhaps your gcc is too old or lstdc++ is missing some -dev package or something like that
[17:03:42] Bish: bricker, most importantly can i give multiple threads the very same proc, or will they end up using the same references?
[17:03:54] alphaatom: has joined #ruby
[17:04:22] bricker: Bish: you can define the proc anywhere, you can pass the proc into any number of threads (just be sure the proc isn't changing any state)
[17:05:08] efox: has left #ruby: ("WeeChat 1.2")
[17:05:13] araujo: has joined #ruby
[17:05:13] araujo: has joined #ruby
[17:05:20] havenwood: Porfa: Is that OS X or another BSD?
[17:06:14] Bish: bricker, i will try ;) last question: when doing Thread.new &proc, can i also pass variables to proc?
[17:07:05] jaycee: has joined #ruby
[17:07:25] pawnbox: has joined #ruby
[17:07:42] roolo: has joined #ruby
[17:09:18] lagweezle: Erm, anyone know how to set pty true for a single Capistrano task? I'm failing to figure that out, currently. :/
[17:09:42] Bish: bricker, yep i can, found it, thank you
[17:10:00] Bish: let's see if those threads fuck each other up ;)
[17:10:21] havenwood: Porfa: gcc -v
[17:11:17] greymeister: has joined #ruby
[17:11:22] kies^: has joined #ruby
[17:13:10] IrishGringo: has joined #ruby
[17:13:21] TomyLobo: has joined #ruby
[17:14:56] symm-: has joined #ruby
[17:15:21] shevy: hmm I have a XP -> level table, in hash form right now ... {400=>1, 900=>2 }
[17:15:48] shevy: now I need to query "if I have 555 xp, what level would I be?" - would a range be better to have?
[17:15:58] renanoronfle: has joined #ruby
[17:16:52] benlovell: has joined #ruby
[17:17:12] krz: has joined #ruby
[17:17:35] m3ow1504_x: has joined #ruby
[17:17:40] shevy: I guess I'll just iterate through until I find the exact elements that are smaller, and the next one that is bigger
[17:19:17] diegoviola: has joined #ruby
[17:20:02] banjara: has joined #ruby
[17:20:09] pawnbox: has joined #ruby
[17:20:50] casadei: has joined #ruby
[17:20:51] leat: has joined #ruby
[17:21:16] _djbkd: has joined #ruby
[17:21:52] _djbkd: has joined #ruby
[17:21:59] einarj: has joined #ruby
[17:22:32] rickmasta: has joined #ruby
[17:23:30] big|bad|wolf: has joined #ruby
[17:24:05] Mon_Ouie: You could just have an Array and use #bsearch to find the right index
[17:24:22] riotjones: has joined #ruby
[17:24:35] Mon_Ouie: (or even linear search since it's probably not a very large array anyway)
[17:25:19] Musashi007: has joined #ruby
[17:26:12] NeverDie: has joined #ruby
[17:26:26] freezevee: has joined #ruby
[17:26:35] freezevee: how do I write an array into a file ?
[17:26:56] freezevee: I am trying with File.open("todo.items", "w") { |f| f.write(@items)} and I see an Array object
[17:27:05] shevy: freezevee File.open; apply .join on it
[17:27:06] freezevee: I am trying with File.open("todo.items", "w") { |f| f.write(@items.to_json)} and I don't see a JSON
[17:27:16] baweaver: has joined #ruby
[17:27:22] shevy: I assume .to_json turns it into a string?
[17:27:23] freezevee: shevy: just join with "," ?
[17:27:36] shevy: yes if it is an Array, not if it is a String
[17:27:45] freezevee: shevy: json turns into that ["#<Item:0x007f93d39149e8>"]
[17:27:57] Jackneill: has joined #ruby
[17:28:06] spider-mario: has joined #ruby
[17:28:09] shevy: hash.to_json.class
[17:28:14] shevy: # => String
[17:28:15] j_mcnally: has joined #ruby
[17:28:20] livcd: what do you think about ruby codewars taksks ?
[17:28:22] shevy: I don't believe you freezevee :)
[17:28:43] shevy: freezevee what is @items? perhaps it has a to_json method
[17:28:53] freezevee: shevy: it's an array
[17:29:12] shevy: array.to_json # => "["1","2","3","4","5","6","7","8","9","0","a","b","c","d","e","abc","cat","dog","a","a","b",null,null]"
[17:29:22] freezevee: shevy: I initialize it with @items = []
[17:29:24] shevy: I also get a String, sorry freezevee, what you say is not correct
[17:29:31] shevy: I just tested in irb
[17:29:32] freezevee: shevy: you are right
[17:29:36] freezevee: shevy: you are so right
[17:29:43] juanpaucar: has joined #ruby
[17:29:45] shevy: anyway, once you have the string you can store via File.open
[17:29:51] shevy: it may be best to store in a variable, before sending to f.write()
[17:29:55] freezevee: I entered an "Item" object into the array
[17:30:09] bluOxigen: has joined #ruby
[17:30:12] freezevee: shevy: I did @items << Item.new(item)
[17:30:19] freezevee: shevy: thank you
[17:31:05] j_mcnally: has joined #ruby
[17:32:22] failshell: has joined #ruby
[17:32:32] jschmid: has joined #ruby
[17:32:39] arup_r: has joined #ruby
[17:32:58] snockerton1: has joined #ruby
[17:34:43] shizus: has joined #ruby
[17:35:24] Motoservo: has joined #ruby
[17:35:51] davedev24: has joined #ruby
[17:36:32] hooper1: has joined #ruby
[17:38:13] shizus: Hello! I have file with the following structure "001000150001" where the first 3 chars have a meaning, the following 5 chars have another... I have to read each line by char position. Is there a way to define the structure and match it with the string in one step?
[17:38:19] dagda1: has joined #ruby
[17:39:16] whiteline: has joined #ruby
[17:39:31] djbkd_: has joined #ruby
[17:40:47] dimasg: has joined #ruby
[17:40:49] havenwood: >> /(?<three>.{3})(?<five>.{5})/ =~ "001000150001"; [first_three: three, next_five: five]
[17:40:50] ruboto: havenwood # => [{:first_three=>"001", :next_five=>"00015"}] (https://eval.in/421527)
[17:41:16] havenwood: Shizus: Say more about what you're doing?
[17:41:30] havenwood: Shizus: Have an example of the expected output and what you're doing with it? What are you using now?
[17:41:58] powersurge: has joined #ruby
[17:42:06] powersurge: when using savon, is there any way to see the outgoing headers?
[17:44:15] porfa: hmmm can anyone help me out? (already on ruby 2.2 !! :D :D ) on IRB ir plays fine???. --> error -- kinsters.rb:18:in `<main>': undefined method `click' for nil:NilClass (NoMethodError) -- Gist -- https://gist.github.com/anonymous/123137386b9fce2a64cd
[17:44:31] weemsledeux: has joined #ruby
[17:44:48] devoldmx: has joined #ruby
[17:45:11] shevy: 'view more ?' must return nil in your example
[17:45:14] akkad: has joined #ruby
[17:45:15] shevy: what is the -> anyway
[17:45:15] shizus: havenwood: The file lines are too long to paste them. I have file describing by position each line of the file, for example "Char 0 to 3: ID of the element, char 4 to 10: description, char 10 to 15: cost of the element". The idea is to generate a json given an input line
[17:46:29] porfa: shevy: it's the name of the link on the page I'm trying to get into
[17:46:36] kies^: has joined #ruby
[17:47:26] dimasg: has joined #ruby
[17:47:59] shevy: never seen something like that before
[17:48:19] einarj: has joined #ruby
[17:48:29] shevy: are you absolutely sure that the '?' is part of the name?
[17:49:12] shizus: havenwood: I just read about the "unpack" methods used in String, I think that's exactly what I need
[17:49:49] choke: has joined #ruby
[17:49:54] catoblepa: has joined #ruby
[17:52:00] iamninja: has joined #ruby
[17:52:00] yardenbar: has joined #ruby
[17:53:33] dchait-lt: has joined #ruby
[17:54:45] dchait-lt: Hello all, does Ruby have an internal timeout of sorts? I'm only getting partial results from an OOP query, though it works fine if I remove some secondary processing requirements from the process.
[17:55:43] towski__: has joined #ruby
[17:55:56] eam: dchait-lt: "ruby" doesn't, but whatever gems and frameworks you're using might
[17:56:03] dchait-lt: essentially I am running amatch to do contextual matching (source/destination) via a function, then adding the result to an object
[17:56:24] dchait-lt: good point, amatch might be the problem
[17:56:28] mary5030: has joined #ruby
[17:56:31] C1V0: has joined #ruby
[17:56:36] eam: dchait-lt: what is the query that's timing out? What protocol? what gem powering the query? etc
[17:56:51] stef204: has joined #ruby
[17:57:05] eam: if you're doing a query, processing, then querying again -- sometimes the server may time you out too
[17:57:05] dchait-lt: I am iterating over a directory, loading a number of YAML files
[17:57:17] dchait-lt: then from each I generate objects (hosts, subnets, etc)
[17:57:23] mary5030: has joined #ruby
[17:57:28] dchait-lt: and then for each host I run them through amatch to determine role
[17:57:48] dchait-lt: and finally apply that role to the host object
[17:57:51] eam: what's the query you're performing?
[17:58:02] porfa: shevy: #<Mechanize::Page::Link "view more ???" "/administrative_areas/2789/kinksters">
[17:58:16] dchait-lt: def findrole(hostname)
[17:58:17] dchait-lt: m = LongestSubstring.new(hostname)
[17:58:17] dchait-lt: role = 'none'
[17:58:17] dchait-lt: $rolematch.keys.each do |x|
[17:58:18] dchait-lt: match = m.match(x)
[17:58:18] dchait-lt: if match > count
[17:58:19] dchait-lt: count = match
[17:58:19] dchait-lt: role = $rolematch[x]
[17:58:21] dchait-lt: return role
[17:58:32] dchait-lt: Where rolematch is a hash array with valid roles/patterns
[17:58:33] spleeze: has left #ruby: ()
[17:58:37] stef204: has joined #ruby
[17:59:22] dchait-lt: It looks like I get about 74 results when I pipe the hosts through that function, and all of the results when I don't
[17:59:27] freerobby: has joined #ruby
[17:59:40] catoblepa: has joined #ruby
[17:59:40] catoblepa: has joined #ruby
[17:59:44] einarj: has joined #ruby
[18:00:01] malconis_: has joined #ruby
[18:00:29] michaeldeol: has joined #ruby
[18:00:33] paulcsmith: has joined #ruby
[18:00:56] phutchins: has joined #ruby
[18:01:12] malconis_: has joined #ruby
[18:01:58] porfa: can i pass it as an HTML code? &#8594;
[18:02:21] shevy: not sure... all I know is that this is the first time I saw '?' used as part of a method call in ruby
[18:02:35] shevy: I guess I could not even use it because I store in an ISO encoding format :)
[18:02:42] ych_: has joined #ruby
[18:02:56] _djbkd: has joined #ruby
[18:03:04] porfa: can't i escape it using HEX notation?
[18:03:06] d5sx43: has joined #ruby
[18:04:13] Spami_: has joined #ruby
[18:04:41] porfa: (where can i host a screenshot where YOU would feel safe opening it?)
[18:05:30] shevy: I don't know how mechanize internally finds a match
[18:06:14] christiandsg: has joined #ruby
[18:06:27] darix: Porfa: given it says /administrative_area/ you might have control over the app and just add an api instead of using html parsing
[18:06:30] darix: just a though
[18:07:48] Cust0sLim3n: has joined #ruby
[18:08:06] porfa: thanks for the tip, but unfortunately it's not as it seems??? that administrative area is just the standard user logen in URL
[18:08:10] porfa: logged in*
[18:09:51] bruno-: has joined #ruby
[18:10:00] whiteline: has joined #ruby
[18:10:15] porfa: this is what i need to escape https://codepoints.net/U+21C4
[18:10:50] ChanServ: -b Porcpdio!*@*
[18:11:19] apeiros: Porfa: your question is how to escape characters in urls?
[18:11:55] porfa: no, i need to tell mechanize to click 'that link' and that link name contains a rightwards arrow
[18:12:13] apeiros: Porfa: then look at the source and see how it's written
[18:12:27] porfa: it's just there, an arrow icon.
[18:12:38] IceyEC: has joined #ruby
[18:12:44] apeiros: then write it just like that
[18:12:45] chinmay_dd: has joined #ruby
[18:12:50] bin7me: has joined #ruby
[18:12:56] porfa: ruby fails, but rib doesn't.. that's what i am missing...
[18:13:00] porfa: agent.page.link_with(:text => 'view more ???').click
[18:13:10] shevy: yeah he applies a .click on nil there
[18:13:19] porfa: that on IRB goes into the page "view more ->" but the .rb won't get in
[18:13:40] porfa: but how come it's not nil for IRB but is for ruby?
[18:14:25] JoshL: has joined #ruby
[18:14:26] doug_f1: has joined #ruby
[18:14:27] shevy: you pasted the -> differently now
[18:14:28] DLSteve: has joined #ruby
[18:14:31] shevy: <Porfa> agent.page.link_with(:text => 'view more ???').click
[18:14:33] shevy: <Porfa> that on IRB goes into the page "view more ->"
[18:14:44] shevy: my client tells me that... so whatever you do, you don't use the same arrow
[18:14:44] m3ow1504_x_io: has joined #ruby
[18:14:52] doug_f1: Is there a way to make http://ruby-doc.org/core-1.9.3/File.html#method-c-fnmatch-3F ignore symlinks?
[18:14:52] ellisTAA: has joined #ruby
[18:14:55] porfa: shevy: sorry, i just can't write it on my keyboard, so i did a minus + plus math sign, srry about that
[18:15:00] nux443: has joined #ruby
[18:15:11] Zai00: has joined #ruby
[18:15:13] shevy: I can't write it either, I just copy paste your one above
[18:15:18] porfa: this is getting so confusing, I'm so sorry
[18:15:23] porfa: yes you're right
[18:15:30] shevy: can you not avoid it?
[18:15:34] shevy: by using a regex to the earlier part
[18:15:42] shevy: like /view more/
[18:15:51] shevy: I don't know enough about mechanize to know whether it allows that
[18:16:48] juanpaucar: has joined #ruby
[18:17:01] skade: has joined #ruby
[18:18:01] momomomomo: has joined #ruby
[18:19:51] skade: has joined #ruby
[18:19:54] pranny: has joined #ruby
[18:20:08] amclain: has joined #ruby
[18:20:16] _djbkd: has joined #ruby
[18:20:40] weemsledeux: has joined #ruby
[18:20:47] _djbkd: has joined #ruby
[18:22:14] ex0ns: has joined #ruby
[18:22:21] rakm: has joined #ruby
[18:22:33] snockerton: has joined #ruby
[18:23:03] Soda: has joined #ruby
[18:23:12] m3ow1504_xx: has joined #ruby
[18:23:25] barhum2013: has joined #ruby
[18:23:54] nofxx: has joined #ruby
[18:23:54] nofxx: has joined #ruby
[18:24:14] grotewold: has joined #ruby
[18:25:14] riotjones: has joined #ruby
[18:27:15] Timba-as: has joined #ruby
[18:27:41] einarj: has joined #ruby
[18:29:03] porfa: shevy: thank you SO much for the hint??? if i do.. irb(main):032:0> agent.page.link_with(:text => /(view more).+/)
[18:29:09] porfa: it will fetch me the goddamed arrow ;)
[18:30:16] dan123b: has joined #ruby
[18:30:22] pawnbox: has joined #ruby
[18:30:55] porfa: but now the rest of my ruby 1.9 code is not working??? arghwghj
[18:32:10] dagda1: has joined #ruby
[18:32:15] porfa: why doesn't this work on ruby 2.2 ? .at_css('.clearfix .user_in_list')
[18:33:01] porfa: unless they changed the site since this morning??? O_o
[18:33:40] alejo: has joined #ruby
[18:34:01] Spami_: has joined #ruby
[18:34:06] barhum2013: has joined #ruby
[18:34:18] freezevee: Can someone explain to me what am I doing wrong ? https://gist.github.com/chrisvel/6a9d79fa0a8cb345445d
[18:34:39] BraddPitt: what is the issue, freezevee ?
[18:34:48] freezevee: I am adding a new task e.g. ruby todo.rb add Clean house
[18:35:18] BraddPitt: what is the error you are getting
[18:35:24] porfa: *going back to ruby 1.9*
[18:35:26] freezevee: when creating a new object, the file data get loaded, then an item is added to the array and then saved
[18:35:28] apeiros: freezevee: you don't properly indent. do I win?
[18:35:35] freezevee: apeiros: sure
[18:35:46] freezevee: it's pretty simple, I am trying to see how things work
[18:36:01] apeiros: you don't deserialize the json when reading. do I win again?
[18:36:11] BraddPitt: you still haven't described an issue
[18:36:31] eam: freezevee: what BraddPitt is looking for is "when I run the program I see X but I expect Y"
[18:36:35] freezevee: apeiros: the data inside the file saved is a bit of mixed things
[18:36:37] apeiros: oh, and you don't use the easier File.write instead of File.open + #write
[18:36:52] apeiros: freezevee: your save method says otherwise
[18:36:56] eam: freezevee: it'll save a lot of text/time if you explain the issue as well as sharing code
[18:37:09] apeiros: freezevee: and if you used fake code, then: you used fake code to illustrate your problem. do I win again?
[18:37:18] freezevee: apeiros: what ??
[18:37:22] freezevee: eam: https://gist.github.com/chrisvel/6a9d79fa0a8cb345445d
[18:37:44] apeiros: freezevee: your save method says your todo.items is only @items.to_json. not a mix.
[18:37:48] jackjackdripper: has joined #ruby
[18:38:12] apeiros: so if you now claim it's a mix, either you or your code is wrong. what is it?
[18:38:17] freezevee: apeiros: the first add is "Clean windows"
[18:38:33] freezevee: apeiros: the second add is "\"Clean windows\"Wash car"
[18:38:47] powersurge: has left #ruby: ("WeeChat 0.4.3")
[18:38:55] dagda1: has joined #ruby
[18:38:56] freezevee: apeiros: third "\"\\\"Clean windows\\\"Wash car\"Buy a tv cable"
[18:39:02] yqt: has joined #ruby
[18:39:29] freezevee: apeiros: I knew that json format is like that { data: "blabla" }
[18:39:39] tmtwd: has joined #ruby
[18:40:17] apeiros: when you say `the second add is "\"Clean windows\"Wash car"`, do you mean you do `item.add "\"Clean windows\"Wash car"` ?
[18:40:17] freezevee: apeiros: you didn't win yet
[18:40:23] jackjackdripper: has joined #ruby
[18:40:25] dfockler: has joined #ruby
[18:40:29] freezevee: apeiros: sorry
[18:40:31] apeiros: oh, I won 4 times. all I said is spot on :-p
[18:40:38] freezevee: apeiros: I do add "Clean windows"
[18:40:39] araujo: has joined #ruby
[18:40:41] freezevee: add "Wash car"
[18:40:45] freezevee: one add at a time
[18:40:51] BraddPitt: freezevee: post your code, post example input, post expected output, post actual output
[18:40:52] craysiii: he wants to add the values only?
[18:40:57] BraddPitt: this is such a roundabout way to describe a problem
[18:41:17] BraddPitt: its driving me crazy, im sorry
[18:41:20] apeiros: freezevee: and why do you say `"\"Clean windows\"Wash car"` then?
[18:41:30] freezevee: BraddPitt: code is already posted
[18:41:46] apeiros: I concur with BraddPitt. you have not posted all code.
[18:41:49] freezevee: BraddPitt: example input is Item.add "Clean windows"
[18:41:51] craysiii: post example into and expected output vs actual output
[18:41:53] apeiros: you only posted your Item class.
[18:41:57] patrick_star: has joined #ruby
[18:42:27] freezevee: apeiros: https://gist.github.com/chrisvel/6a9d79fa0a8cb345445d updated
[18:42:58] apeiros: your main issue still is probably the missing deserialization in initialize
[18:42:59] freezevee: I am tryiing to use it as "ruby main.rb add Clean Windows" and then "ruby main.rb add Wash floor"
[18:43:11] kadoppe: has joined #ruby
[18:43:16] apeiros: your @items will be a String after new. not an array.
[18:43:31] apeiros: neither a Hash
[18:43:42] _djbkd: has joined #ruby
[18:43:53] apeiros: File.read returns a string.
[18:43:54] freezevee: I was trying to create an array
[18:44:12] jenrzzz: has joined #ruby
[18:44:13] baweaver: has joined #ruby
[18:44:21] craysiii: why dont you use a database :)
[18:44:31] freezevee: craysiii: just experimenting with text files
[18:45:03] _blizzy_: has joined #ruby
[18:45:06] freezevee: apeiros: the array will give me the chance to sort items later
[18:45:18] freezevee: apeiros: isn't array <=> json possible ?
[18:45:39] nofxx: freezevee, require 'json' array.to_json
[18:45:44] freezevee: read from json file => save to array => add item => save to file in json
[18:45:59] freezevee: apeiros: this is what I am trying to do
[18:46:21] apeiros: freezevee: again, if you read json, you have to deserialize it
[18:46:32] freezevee: apeiros: like @items = JSON.parse(File.read("todo.items")) ?
[18:46:34] apeiros: JSON.load(json_string) # => object structure in the json
[18:46:45] apeiros: oh, right, parse, not load
[18:46:59] apeiros: actually, both exist :D
[18:47:05] apeiros: freezevee: yes
[18:47:07] Cache_Money: has left #ruby: ()
[18:47:18] apeiros: freezevee: you want to make sure you start with a correct value when the todo.items does not exist yet.
[18:47:20] freezevee: ....`initialize': A JSON text must at least contain two octets! (JSON::ParserError)
[18:47:33] apeiros: ^ because that :-p
[18:47:49] apeiros: so: when todo.items does not exist yet +or is empty
[18:48:02] freezevee: should I open it in "a" mode ?
[18:48:23] Iskarlar: has joined #ruby
[18:48:27] apeiros: only if you want to end up with broken json.
[18:48:31] rbennacer: has joined #ruby
[18:48:42] freezevee: apeiros: what do you suggest ?
[18:48:56] apeiros: I think I just said what I suggest?
[18:49:03] Iskarlar: has joined #ruby
[18:49:15] howdoicomputer: has joined #ruby
[18:49:28] apeiros: add code to initialize to deal with non-existing/empty todo.items
[18:49:56] hinbody: has joined #ruby
[18:49:59] CorySimmons: has joined #ruby
[18:51:19] banghouse2: has joined #ruby
[18:52:12] freezevee: apeiros: https://gist.github.com/chrisvel/6a9d79fa0a8cb345445d
[18:52:50] apeiros: freezevee: File.read will never return nil
[18:53:13] freezevee: apeiros: I believe it worked, I am getting ["Wash car","Buy a tv cable"]
[18:53:14] apeiros: .empty?, ? is part of the name
[18:53:28] freezevee: yes I missed that
[18:53:35] freezevee: but is this JSON format ?
[18:53:48] apeiros: now move the require to the top and use File.write, and then you have almost decent code ;-p
[18:54:12] freezevee: you mean outside the class ?
[18:54:14] apeiros: "I am getting" = "my file contains"?
[18:54:22] apeiros: yes. top of the file. (the require)
[18:54:57] freezevee: yeah it's a way to say that my file contains :P
[18:55:07] lkba: has joined #ruby
[18:55:18] davedev24: has joined #ruby
[18:55:23] apeiros: not really. it can mean a plethora of things.
[18:55:28] _aeris_: has joined #ruby
[18:55:29] freezevee: apeiros: why use File.write?
[18:55:43] apeiros: because File.write(path, data.to_json) is 2 lines shorter?
[18:55:45] apeiros: easier to read?
[18:55:52] freezevee: makes sense
[18:56:13] victortyau: has joined #ruby
[18:57:10] freezevee: do you think I can correct something else ? https://gist.github.com/chrisvel/6a9d79fa0a8cb345445d
[18:57:41] greencoder: has joined #ruby
[18:57:55] apeiros: you could deal with todo.items not existing.
[18:58:09] apeiros: also if your todo is json, I'd use the proper file extension (.json)
[18:58:36] shevy: apeirosn wouldn't like .jsn!!!
[18:58:41] shevy: damn, I mistyped :(
[18:58:54] freezevee: valueable chat (for me)
[18:59:44] Zai00: has joined #ruby
[18:59:44] roadpanda_: has joined #ruby
[19:00:25] apeiros: freezevee: note that require_relative 'lib/item/item' is bad style which may/can/will break once you make this thing a gem
[19:00:53] apeiros: (rubygems is not required to put the lib dir relative to the bin dir the same way it is in your gem)
[19:00:59] dtzitz: has joined #ruby
[19:01:19] greencoder: Is this the right place to ask questions for ruby help or is there a different channel for beginners?
[19:01:43] freezevee: thank you but require didn't work
[19:01:49] freezevee: that's why I used relative
[19:02:07] khebbie: has joined #ruby
[19:02:16] nofxx: greencoder, just shoot to thrill
[19:02:40] apeiros: freezevee: require works. but you have to use it properly.
[19:02:57] greencoder: I'm basically trying to write a script that creates a bunch of different folders and files based a name it gets from user input
[19:03:04] greencoder: based on a name*
[19:03:17] apeiros: the way you do it: `require 'item/item'` in your code, and `ruby -I path/to/lib main.rb`
[19:03:51] apeiros: the -I is not necessary once you made it a gem and installed it. rubygems then handles that. what it does is add "path/to/lib" to $LOAD_PATH (which is what require searches for your file)
[19:04:12] clarkenciel: has joined #ruby
[19:04:15] apeiros: greencoder: this channel is fine. there's also ##new2ruby if you prefer a smaller channel.
[19:04:30] millerti: has joined #ruby
[19:04:54] dtzitz: you could also try ##webdevvit if you're looking for people to be activly hostile toward you
[19:04:56] greencoder: cool thanks apeiros
[19:04:57] shevy: greencoder you require 'fileutils', and then you can do so - create a file FileUtils.touch() (or perhaps File.touch, not sure); a directory FileUtils.mkdir_p() etc..
[19:05:13] shevy: and user input is: user_input = gets.chomp
[19:05:35] greencoder: shevy: I'm not too concerned about making the actual directory or file, the problem I'm having is figuring out what to do after I create the file
[19:05:47] shevy: delete it again
[19:05:48] greencoder: I want to insert a bunch of XML code inside it, and only change a certain value in every place
[19:06:25] shevy: yah you can write anything into your string; http://stackoverflow.com/questions/2777802/how-to-write-to-file-in-ruby
[19:06:27] sarkyniin: has joined #ruby
[19:06:40] greencoder: cool, I'll look into it thanks shevy
[19:06:46] apeiros: dtzitz: hm, raytheon, where do I know them from?
[19:07:00] shevy: perhaps your dirty php past
[19:07:14] shevy: with your 100.000 lines of code php webframework
[19:07:20] jtdoncas_: has joined #ruby
[19:07:30] nertzy: has joined #ruby
[19:08:01] dfockler: 1000 lines of php, copied 10 times
[19:08:19] dfockler: then those copies copied 10 times
[19:08:32] shevy: I can see you do know how php works
[19:08:46] nofxx: I remember my first rails project, 100k php files were rewritten to 5k. With lots of extr features.
[19:08:53] JoshL: has joined #ruby
[19:09:02] christiandsg: has joined #ruby
[19:09:02] dtzitz: apeiros: never heard of em
[19:09:13] dfockler: rails just hides the 100k of files in the background
[19:09:16] shevy: nofxx hmm
[19:09:18] nofxx: greencoder, if you're changing a lot this xml you might give ERB a try
[19:09:39] nofxx: heheh... what the current rails LOC?
[19:09:51] nofxx: w/o activerecord pls =D
[19:09:53] greencoder: nofxx: It's basically a Sublime Text color scheme file. I basically want to change every instance of a certain hexadecimal color value based on whatever the user inputs
[19:10:12] pocketprotector: has joined #ruby
[19:10:32] nofxx: greencoder, and the file already exists or are you creating it?
[19:10:48] nofxx: and if you're creating it's cool to overwrite it later?
[19:11:13] peterhu: has joined #ruby
[19:11:15] greencoder: nofxx: I'm creating it
[19:11:46] greencoder: and what exactly do you mean? Once the color value has been switched, I wouldn't really need to make any other changes to it
[19:12:09] choke: has joined #ruby
[19:13:07] dagda1: has joined #ruby
[19:13:07] tmtwd: has joined #ruby
[19:14:44] nofxx: greencoder, the simplest way I can think: inside a def get_the_xml(value) do a <<EOC paste the xml here and interpolate #{value}
[19:15:04] bruno-: has joined #ruby
[19:15:18] nofxx: the good way: put the xml a part in a file.xml.erb use the erb <% interpolation that I forgot, and do ERB.render or something that I forgot too
[19:15:20] Diabolik: has joined #ruby
[19:15:33] apt-get_: has joined #ruby
[19:15:35] Darkwater: anyone here got experience with ZeroC ICE?
[19:15:39] Darkwater: trying to use callbacks with murmur
[19:15:52] Darkwater: but I can find like zero documentation on how to do that in ruby
[19:15:55] greencoder: nofxx: that seems like a cleaner way to do it, I may try that
[19:16:03] Motoservo: has joined #ruby
[19:16:18] nofxx: greencoder, it's very easy actually. erb is also stdlib, so just require and have fun
[19:16:25] Cust0sLim3n: has joined #ruby
[19:17:38] nofxx: greencoder, last tip: There;s -p for mkdir too, so you can create nested folders
[19:17:54] nofxx: FileUtils.mkdir_p iirc
[19:18:37] greencoder: so like FileUtils.mkdir_p 'folder/nested_folder' ?
[19:18:41] Musashi007: has joined #ruby
[19:18:51] nofxx: greencoder, let me know ;)
[19:19:08] greencoder: lol thanks a lot
[19:19:13] michael_mbp: has joined #ruby
[19:19:23] greencoder: ill start making it
[19:19:51] jalljo: has joined #ruby
[19:21:36] djbkd_: has joined #ruby
[19:21:45] dc: has joined #ruby
[19:23:56] michael_mbp: has joined #ruby
[19:24:33] rbennacer: has joined #ruby
[19:25:06] SCHAAP137: has joined #ruby
[19:25:58] riotjones: has joined #ruby
[19:26:05] skade: has joined #ruby
[19:26:13] einarj: has joined #ruby
[19:26:56] greymeister: has joined #ruby
[19:27:04] shevy: semi off topic - I am looking at ruby-gnome bindings in github right now. Is there a simple way to propose an updated version of a .rb file, in the browser ideally?
[19:27:15] shevy: I'd like to update https://github.com/ruby-gnome2/ruby-gnome2/blob/master/rsvg2/sample/svg-viewer.rb
[19:27:39] RazorX: has joined #ruby
[19:27:43] jgt: has joined #ruby
[19:27:45] Darkwater: should be an edit button somewhere near the top
[19:28:16] shevy: oh you are right, now I see it, thanks!
[19:28:24] pranny: has joined #ruby
[19:28:40] Blaguvest: has joined #ruby
[19:28:45] Timba-as: has joined #ruby
[19:29:27] shevy: "The Travis CI build is in progress"
[19:29:30] shevy: excitement
[19:31:26] shevy: well this would be pretty cool if this could be a browser in the editor, perhaps one day I can ditch bluefish altogether
[19:31:32] shevy: erm... *editor in the browser
[19:31:53] havenwood: has joined #ruby
[19:33:04] IrishGringo: has joined #ruby
[19:34:15] m3ow1504_x: has joined #ruby
[19:35:03] dagda1: has joined #ruby
[19:35:20] kr3ssh: has joined #ruby
[19:36:07] dgutierrez1287: has joined #ruby
[19:37:20] barhum2013: has joined #ruby
[19:37:27] Nahra: has joined #ruby
[19:38:32] ChanServ: -b sreggin!*@*
[19:40:18] baweaver: has joined #ruby
[19:41:25] Nahra: has joined #ruby
[19:42:01] cmckee: has joined #ruby
[19:44:22] sarkyniin: I have a little ruby script and I want to cache a small file
[19:44:41] nahtnam: > "2015"[-3..-1]
[19:44:43] sarkyniin: what's the preferred folder for that? XDG_CACHE or XDG_CONFIG_HOME? how do I save to those folders?
[19:44:47] nahtnam: >> "2015"[-3..-1]
[19:44:48] ruboto: nahtnam # => "015" (https://eval.in/421613)
[19:44:54] shinnya: has joined #ruby
[19:45:33] devoldmx: has joined #ruby
[19:46:07] greencoder: has joined #ruby
[19:46:50] toretore: has joined #ruby
[19:47:09] decaff: has joined #ruby
[19:47:59] havenwood: nahtnam: Hem?
[19:48:13] nahtnam: havenwood: ?
[19:48:14] greencoder: is there a good way to check if a hex string is valid?
[19:48:31] havenwood: nahtnam: Oh, you showed example code without context.
[19:48:31] greencoder: like if I wanted to make ` def valid_hex?(hex)`
[19:48:38] dagda1: has joined #ruby
[19:48:54] nahtnam: havenwood: Sorry was just running something from #RubyOnRails
[19:49:11] jtdoncas_: greencoder: google: http://stackoverflow.com/questions/9075515/ruby-check-if-string-is-all-valid-hex-characters
[19:49:14] jgpawletko: has joined #ruby
[19:50:51] Axsuul: has joined #ruby
[19:51:59] porfa: has joined #ruby
[19:52:06] momomomomo: has joined #ruby
[19:52:29] nonnatus: has joined #ruby
[19:52:44] havenwood: greencoder: Make sense how to take it from `\h` to your goal?
[19:52:52] iamninja: has joined #ruby
[19:53:11] Bish: how do i escape #{} correctly?
[19:53:35] havenwood: Bish: That'd do it.
[19:53:39] jgpawletko: has joined #ruby
[19:53:46] Bish: will it do it, or is it correct?
[19:53:56] Bish: i mean #{ is a two-letter thing, isn't it?
[19:54:12] dc: has joined #ruby
[19:54:14] havenwood: Bish: If the first is escaped the second is irrelevant.
[19:54:22] greencoder: havenwood: I tried doing something like this: https://gist.github.com/anonymous/f6a38245a82342b5f25c
[19:54:30] Bish: but why is \# == #
[19:54:51] greencoder: but that doesn't seem right
[19:55:08] havenwood: Bish: Without magic that needs escaping there's no need for an escape.
[19:55:36] havenwood: greencoder: You want it to be all valid hex xdigits and also size of 7?
[19:55:51] greencoder: does '#' count as a valid hex digit?
[19:55:55] greencoder: i guess not lol
[19:55:57] nonnatus: has left #ruby: ("WeeChat 0.4.2")
[19:56:00] machinewar: has joined #ruby
[19:56:08] dtzitz: has left #ruby: ()
[19:56:11] havenwood: greencoder: Is it between 0-9, a-f or A-F?
[19:56:32] baweaver: >> "#\{}" # Keep your eye on the birdie
[19:56:33] ruboto: baweaver # => "\#{}" (https://eval.in/421617)
[19:56:37] greencoder: yeah got it lol
[19:56:55] baweaver: You so silly Ruby
[19:57:01] havenwood: >> 'nope' =~ /\h{7}/
[19:57:02] ruboto: havenwood # => nil (https://eval.in/421618)
[19:57:04] havenwood: greencoder: ^
[19:57:21] havenwood: greencoder: That would be any 7 xdigits in a row.
[19:57:23] skade: has joined #ruby
[19:57:27] havenwood: greencoder: Say more about what you want?
[19:57:38] havenwood: greencoder: Or better yet, show examples of real input and desired output.
[19:57:40] baweaver: http://rubular.com/ # greencoder
[19:57:46] m3ow1504_x_io: has joined #ruby
[19:57:56] greencoder: thanks baweaver that looks cool
[19:58:03] baweaver: should help to experiment
[19:58:05] havenwood: greencoder: On Rubular try: /\A\h{7}\z/
[19:58:09] greencoder: havenwood: I basically am just verifying that a hexadecimal color should work
[19:58:13] baweaver: allows you to put in psuedo-input to test for matches.
[19:58:19] greencoder: So `#123456` should return true
[19:58:25] barhum2013: has joined #ruby
[19:58:25] ekleog: has joined #ruby
[19:58:26] greencoder: `#h12345` should return false
[19:58:32] havenwood: greencoder /\A#\h{6}\z/
[19:58:37] baweaver: How about FFF?
[19:58:53] Bish: bleh when using .gsub with blocks, can i get the groups somehow?
[19:59:13] greencoder: baweaver: I'm telling the user to input it in `#XXXXXX` format, but maybe I should account for that too lol
[19:59:33] tens0r: has joined #ruby
[19:59:45] baweaver: /\A#\h{3,6}\z/
[20:00:05] greencoder: Thanks a lot havenwood and baweaver
[20:00:06] Frem: has joined #ruby
[20:00:14] baweaver: Bish: http://ruby-doc.org/core-2.0.0/String.html#method-i-gsub
[20:00:15] shevy: the beaver!
[20:00:21] baweaver: it says bits on that
[20:00:29] shevy: that dam bits
[20:01:27] baweaver: >> 'foobar'.gsub(/oo/) { |match| "oo#{match}" }
[20:01:28] ruboto: baweaver # => "foooobar" (https://eval.in/421619)
[20:02:00] Norrin: has left #ruby: ("Dueces")
[20:02:16] Bish: 'whoop #{test}'.gsub(/\#{[^}]}/)
[20:02:18] Bish: arghs, sorry
[20:02:23] Bish: 'whoop #{test}'.gsub(/\#{[^}]}/)
[20:03:19] Bish: >> 'whoop #{test}'.gsub(/\#{([^}]+)}/) { |m| p m }
[20:03:20] ruboto: Bish # => "\#{test}" ...check link for more (https://eval.in/421620)
[20:03:36] freerobby: has joined #ruby
[20:03:40] Bish: i just want "test"
[20:04:00] nonnatus: has joined #ruby
[20:04:25] decaff: has left #ruby: ("Leaving...")
[20:04:45] zxvcd: has joined #ruby
[20:06:16] z1haze: has joined #ruby
[20:06:23] Bish: >> 'whoop #{test}'.gsub(/\#{([^}]+)}/) { |m| m = "that's what i want, just generic" + m[2...-1] }
[20:06:23] ruboto: Bish # => "whoop that's what i want, just generictest" (https://eval.in/421621)
[20:06:35] baweaver: >> 'whoop #{test}'.gsub(/\#\{([^}]+)\}/) { |m| Regexp.last_match[1] }
[20:06:36] ruboto: baweaver # => "whoop test" (https://eval.in/421622)
[20:07:05] Bish: kinda dirty, is regexp thread safe?
[20:07:05] z1haze: Hi I know nothing about ruby or anything like that, it is just a requirement for a application I'm using.. But it required me to install mysql2 which I attempted to do.. but its been sitting at Building native extensions. This could take a while... for close for 45 minutes or more now
[20:07:10] z1haze: Is this a problem?
[20:07:32] Bish: z1haze, is it mechanize, yeah leave it hanging for 3 days
[20:07:34] baweaver: Run just the gsub: 'whoop #{test}'.gsub(/\#\{([^}]+)\}/) - then inspect Regexp.last_match
[20:07:58] Bish: baweaver, yeah i understand, but is Regexp unique per thread?
[20:08:07] baweaver: Bish: If you're using threads in ruby you're going to have a bad time.
[20:08:11] z1haze: I dont have 3 days..
[20:08:15] Bish: z1haze, im just fucking with yeah, no that's not normal, atleast if your machine is not from 1998
[20:08:19] nonnatus: has left #ruby: ()
[20:08:27] z1haze: no its a decent machine
[20:08:29] Bish: baweaver, until know i love threads in ruby
[20:08:32] z1haze: its a dedicated server
[20:08:36] z1haze: what should I do?
[20:08:45] barhum2013: has joined #ruby
[20:08:46] Bish: z1haze, have you tried turning it off and on again?
[20:08:48] baweaver: install just that gem
[20:08:59] z1haze: turning it off?
[20:09:01] nonnatus: has joined #ruby
[20:09:06] baweaver: ignore them
[20:09:13] Bish: baweaver, what's so bad about threads in ruby?
[20:09:14] z1haze: turning what off?
[20:09:26] Bish: z1haze, another joke.. but i was serious, have you tried restarting the installation of the gem?
[20:09:37] z1haze: I didnt cancel it i didnt wantto mess anything up
[20:09:42] rocx: has joined #ruby
[20:09:51] Bish: z1haze, you cannot mess up, in the worst case it doesn't get installed
[20:10:27] dagda1: has joined #ruby
[20:10:28] z1haze: well in that case.. i dont think restarting is going to magically fix it. what could I check ?
[20:10:29] baweaver: "These global variables are thread-local and method-local variables."
[20:10:30] ngscheur1: has joined #ruby
[20:10:31] baweaver: looks like it
[20:10:36] rocx: Is it true that Ruby contains a JavaScript engine embedded in it?
[20:10:40] z1haze: what ports does it need to connect out on?
[20:10:55] Coldblackice_: has joined #ruby
[20:11:12] Bish: z1haze, are you using ubuntu? i had problems with it to, it took some time, installed some dev libs, let me check my browser history
[20:11:25] z1haze: I dont have ubuntu, this machine runs centos
[20:11:31] baweaver: There's therubyracer which can do parts of it, but that's a technicality.
[20:11:36] rocx: baweaver: Then the execjs page confused me when it said that there's "V8 embedded in Ruby".
[20:11:38] yorickpeterse: rocx: No, we do have an embedded COBOL engine though
[20:12:01] baweaver: z1haze: yum install mysql
[20:12:06] baweaver: or equivalent
[20:12:10] rocx: Or am I just reading something wrong on the GitHub page for execjs?
[20:12:24] Bish: baweaver, why do you think rubythreads are a bad idea?
[20:12:27] baweaver: rocx: probably, never heard of that myself.
[20:12:33] baweaver: green threads, they block.
[20:12:52] Bish: yeah ofcourse i know about that, but i don't care, i don't have performance issues, also i am using rubinius
[20:13:21] Bish: im just using them, so i don't have to write complicated algorhitms to do the same fu* thing
[20:13:26] baweaver: The more potential global state in a language, the more annoyance they can yield.
[20:13:31] havenwood: rocx: Any reason not to install node if you need it? Or just curious?
[20:13:36] yorickpeterse: suggesting the use of threads is a bad idea is flat out dumb
[20:13:44] yorickpeterse: Anybody telling you that has no idea what they're talking about
[20:13:51] rocx: I'd really really like to not use Node or anything JS-related on my system. That's why I was asking.
[20:13:54] Bish: let the war begin
[20:14:06] yorickpeterse: rocx: No, Ruby has no embbed JS anything
[20:14:15] yorickpeterse: rocx: there are libraries that let you communicate with JS from within Ruby though
[20:14:28] yorickpeterse: but Ruby itself, as in the language and the implementions, is completely unrelated to JS
[20:14:32] baweaver: yorickpeterse: have fun with mutex
[20:14:33] rocx: Alright. Thanks. Guess I read it wrong since I think I see CPP sources for V8 in the execjs repo.
[20:14:52] yorickpeterse: baweaver: I suggest learning about multi-threading before spewing nonsense
[20:15:00] yorickpeterse: Also, you can do lock free operations just fine in Ruby
[20:15:00] dstarh: has joined #ruby
[20:15:09] yorickpeterse: That is, you don't always need a mutex
[20:15:29] baweaver: You're making an awful lot of assumptions here.
[20:15:49] einarj_: has joined #ruby
[20:15:55] yorickpeterse: The only assumption that can be possibly false is my suggestion of you learning about multi-threading
[20:15:57] jpfuentes2: has joined #ruby
[20:16:02] dstarh: I need to SHA256 about 6 million email addresses, is there any reason that I should do a Digest::SHA2.new vs passing an instnace of digest and doing a reset before using it?
[20:16:06] symm-: has joined #ruby
[20:16:08] yorickpeterse: Ruby does not provide decent primitives out of the box, correct
[20:16:14] yorickpeterse: MRI doesn't do multi-threading properly, correct
[20:16:21] yorickpeterse: But claiming threads are bad is plain dumb
[20:16:36] havenwood: rocx: An understandable position. ;)
[20:16:41] yorickpeterse: dstarh: Digest::SHA2.hexdigest basically does the latter under the hoods
[20:16:45] yorickpeterse: dstarh: it just saves you code
[20:16:52] baweaver: You're entitled to your opinion, but being an ass about it is another matter entirely.
[20:16:55] greencoder: well now I realize what my problem has been. I was assuming that str.slice(1) would give me the substring from index 1 all the way to the end
[20:17:02] yorickpeterse: baweaver: boo fucking hoo
[20:17:04] havenwood: Do please be nice all!
[20:17:05] bricker: :( why the name calling, we're all on the same team
[20:17:28] dstarh: yorickpeterse so you don't pay the initialzation cost?
[20:17:30] yorickpeterse: baweaver: if you suggest something as silly as you did you should be prepared to be told you're wrong
[20:17:33] yorickpeterse: dstarh: it's there always
[20:17:40] yorickpeterse: dstarh: but it's unlikely to be your bottleneck
[20:17:44] baweaver: Welcome to the mute list then
[20:17:56] dstarh: roger thanks
[20:18:18] z1haze: i have mysql.
[20:18:38] yorickpeterse: Bish: re regexp, what did you mean about it being thread-safe?
[20:18:55] yorickpeterse: Bish: the magic variables such as $1, $2, etc are supposed to be frame local IIRC
[20:18:57] choke: has joined #ruby
[20:19:03] yorickpeterse: err, thread local frame local
[20:19:13] yorickpeterse: * you'd call it
[20:19:27] z1haze: i am trying to import a xenforo database into discourse.. when i ran the script and i get load error cannot load such file -- mysql2
[20:19:49] z1haze: so i do gem install mysql2 ... it fetched 100% then building native extensions blah blah.. and just sits there.. 2 times in a row now
[20:20:10] yorickpeterse: z1haze: gem install mysql2 --verbose
[20:20:12] yorickpeterse: might give more insight
[20:20:28] z1haze: oh alright
[20:20:59] z1haze: its just spamming something over and over
[20:21:08] z1haze: checking for mysql_query() in -lmysqlclient... no
[20:21:20] yorickpeterse: make sure you have development headers for mysql installed
[20:21:28] yorickpeterse: usually the package is called something like "mysql-dev" or "mysql-devel"
[20:21:54] baweaver: Now then, to clarify without commentary... Most people abuse threads and metaprogramming earlier on, most of the time not even really needing them.
[20:22:21] z1haze: with yum or gem?
[20:22:23] yorickpeterse: baweaver: that's a massive difference from saying "Ruby threads are bad"
[20:22:26] baweaver: Now when you happened to mention Rubinius and other such things, you probably have knowledge to avoid those issues.
[20:22:28] rikkipitt: has joined #ruby
[20:22:33] havenwood: Bish: JRuby has some reasonable guildlines to follow: https://github.com/jruby/jruby/wiki/Concurrency-in-jruby#concurrency-basics
[20:22:35] Bish: yorickpeterse, well, i was thinking about 2 threads using regexp at the "same time" and overwriting each other
[20:22:36] havenwood: guidelines*
[20:22:39] z1haze: i have mysql installed though, well mariadb..
[20:22:45] z1haze: i use mysql all the time..
[20:22:46] yorickpeterse: Bish: are you specifically referring to the magic variables?
[20:22:51] Bish: yorickpeterse, yes
[20:22:54] yorickpeterse: Bish: those are fine
[20:23:00] Bish: or Regexp.last_match
[20:23:06] m3ow1504_x_io: has joined #ruby
[20:23:09] yorickpeterse: That's fine too
[20:23:14] baweaver: MariaDB probably won't work with that gem, but not sure.
[20:23:16] z1haze: Package 1:mariadb-5.5.41-2.el7_0.x86_64 already installed and latest version
[20:23:21] z1haze: thats what mysql installs..
[20:23:23] baweaver: even if they're forks technically.
[20:23:29] yorickpeterse: z1haze: make sure you also have mariadb-dev or w/e it is
[20:23:31] z1haze: yum install mysql installs mariadb by default
[20:23:40] baweaver: huh, interesting
[20:23:44] yorickpeterse: z1haze: yum search mariadb | grep '\-dev'
[20:23:45] baweaver: I'll have to read into that later.
[20:23:47] Bish: first_body = template[:content].gsub(/\#{([^}]+)}/) { |s| s = data_fields[$1] } <= but this seems to work just fine :3
[20:23:53] z1haze: yea theres a devel
[20:23:55] z1haze: you think thats it?
[20:24:13] baweaver: might be, but not entirely sure
[20:24:17] opensource_ninja: has joined #ruby
[20:24:19] baweaver: I just know adapters can be touchy.
[20:24:33] z1haze: that did it
[20:24:34] z1haze: thank you
[20:25:11] baweaver: not a problem
[20:25:15] banister: yorickpeterse arnhem is the only place i've been to in NL that has hills, are there any other places like that?
[20:25:16] ex0ns: has joined #ruby
[20:25:26] yorickpeterse: banister: haha, this country has no proper hills
[20:25:28] baweaver: I'll have to read up on the MariaDB split later though, I only know it by name honestly.
[20:25:29] yorickpeterse: There are bumps, that's it
[20:25:31] zendrix: has joined #ruby
[20:25:40] catoblepa: has joined #ruby
[20:25:41] banister: yorickpeterse arnhem was relatively impressive though
[20:25:42] yorickpeterse: There are some in Limburg, and around the Veluwe
[20:25:49] banister: you been there? it felt like a real city
[20:25:59] banister: (cos of the hills, i'm used to hills back in nz)
[20:26:26] yorickpeterse: Not that I can remember
[20:26:37] blue_deref: has joined #ruby
[20:26:47] riotjones: has joined #ruby
[20:26:48] banister: ah ok, cool zoo there btw
[20:27:51] Iskarlar: has joined #ruby
[20:28:15] sacarlson: has joined #ruby
[20:28:22] rocx: has left #ruby: ()
[20:28:50] yorickpeterse: baweaver: MariaDB supposedly has an ABI compatible with MySQL
[20:28:56] sacarlson: any idea why I get these https://gist.github.com/sacarlson/bae9ce656325acc99b31 /home/sacarlson/.bundle/gems/json-1.8.3/lib/json/common.rb:67: [BUG] Segmentation fault at 0x00000000000018
[20:28:56] yorickpeterse: Though I don't know if they intend to keep that around forever
[20:29:04] senayar: has joined #ruby
[20:29:05] senayar: has joined #ruby
[20:29:18] yorickpeterse: sacarlson: not without any code and a full stack trace
[20:29:24] ruboto: https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
[20:29:46] sacarlson: just by runing rake -v
[20:30:25] sacarlson: /home/sacarlson/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/rake-10.4.2
[20:31:08] sacarlson: yorickpeterse: I think the stack trace is in the included gist above
[20:31:30] bruno-: has joined #ruby
[20:31:44] _djbkd: has joined #ruby
[20:32:07] yorickpeterse: There's no Gist link anywhere to be found
[20:32:57] yorickpeterse: Hm, maybe the Gem is botched?
[20:33:31] pdoherty: has joined #ruby
[20:33:50] sacarlson: I've had this error in serveral other gems not sure what it comes from. how do you reinstall the gem? just delete and reinstall it?
[20:34:16] juanpaucar: has joined #ruby
[20:34:20] yorickpeterse: Just gem install json
[20:34:22] yorickpeterse: it overwrites it
[20:34:46] sacarlson: ok but it's with bundler and I'm new to this bunder thing
[20:35:08] yorickpeterse: That should be fine, bundler doesn't matter in this case
[20:35:26] greencoder: Is there a way to join strings with a comma seperator? They are not in an array, so I don't think I can use join(',')
[20:35:43] greencoder: basically 3 different string values
[20:36:18] Ox0dea: has joined #ruby
[20:36:27] Ox0dea: greencoder: Just put them in a temporary array?
[20:36:34] Iskarlar: has joined #ruby
[20:37:15] sacarlson: looks to be the same error after gem install json
[20:37:31] sacarlson: maybe gem install rake?
[20:37:55] yorickpeterse: maybe there's some invalid input being passed to the JSON gem?
[20:38:12] sacarlson: this is just from rake -v
[20:38:25] Limix: has joined #ruby
[20:38:52] sacarlson: so with bundler I can still try gem install rake than?
[20:39:03] greencoder: Ox0dea: I basically went with something like this, does that look alright to you? https://gist.github.com/anonymous/7ff0074175d48cb6acd7
[20:39:10] Ox0dea: sacarlson's error is occurring here: http://git.io/vsDC6
[20:39:17] Ox0dea: It looks a little scary, but it should work just fine. :/
[20:39:47] sacarlson: I'll take a look Ox0dea
[20:39:51] Ox0dea: greencoder: That's fine, I suppose, but there are better ways.
[20:40:04] greencoder: would you mind telling me some? :p
[20:40:45] Ox0dea: >> ['ddeeaa'].pack('H*').bytes * ', ' # greencoder
[20:40:46] ruboto: Ox0dea # => "221, 238, 170" (https://eval.in/421628)
[20:41:32] Ox0dea: It'll fail with a leading '#', though. :/
[20:42:36] jeadre: has joined #ruby
[20:42:47] dagda1: has joined #ruby
[20:43:14] yatish27: has joined #ruby
[20:44:15] sacarlson: Ox0dea: I'm not sure what to read into that something to do with # Set the module _generator_ to be used by JSON. ?
[20:45:08] renderful: has joined #ruby
[20:46:00] einarj: has joined #ruby
[20:47:08] Ox0dea: sacarlson: JSON's state generator is written in C; that you're getting a segfault is indicative of something having gone wrong at that level.
[20:47:25] sargas: has joined #ruby
[20:47:52] radgeRayden: has joined #ruby
[20:48:09] sacarlson: Ox0dea: what might I reinstall or change version to correct it?
[20:48:26] Ox0dea: Try nuking the entire thing from orbit?
[20:49:05] sacarlson: the entire thing being all the gems? I've already tried that a few times in the past
[20:49:26] sacarlson: but I'm willing to give it another try
[20:50:51] Ox0dea: sacarlson: No, I was only ribbing.
[20:51:05] porfa: so I'm really excited because I'm ding my first project where i use mechanize and nokogiri and omg.. it's so beautiful how it works ;_;
[20:51:21] Ox0dea: sacarlson: Have you ensured that the JSON standard library works in isolation?
[20:51:30] sacarlson: Ox0dea: dam and I just reformated my hard disk ha ha
[20:51:36] Ox0dea: Problem solved.
[20:51:42] sacarlson: just kiding
[20:52:13] Nahra: has joined #ruby
[20:52:17] Rubie: has joined #ruby
[20:52:21] sacarlson: how would I verify json standard lib?
[20:52:38] jeadre: has joined #ruby
[20:53:07] sacarlson: some irb test I can do?
[20:53:32] porfa: I'm just running into a problem, a programmers logic problem :X so.. i get mechanize no login and do it's stuff, then i jump to the user list, but the user list only contains 40 users on each page??? after my parsing loop to get the users names and sex, then after this "for each" is done how do i make it jump to the next page and repeat the previous loop? do i need to put a loop inside a loop?
[20:53:47] Ox0dea: sacarlson: Well, `ruby -rjson -e ""` would let you know that the library is being loaded properly.
[20:54:02] Ox0dea: But you'll probably need to "exercise" it a bit to hit the bug.
[20:54:22] renderful: has joined #ruby
[20:54:41] Maletor: is there a shorter form of foo.inject(0) { |a, e| a + e }
[20:54:43] sacarlson: ruby: no code specified for -e (RuntimeError)
[20:54:52] Ox0dea: >> [1, 2, 3].reduce(:+) # maletor
[20:54:53] ruboto: Ox0dea # => 6 (https://eval.in/421631)
[20:55:03] Maletor: Ox0dea: you are fast
[20:55:08] Ox0dea: sacarlson: You need the empty string at the end.
[20:55:42] Ox0dea: maletor: Note well that you can still supply an initial value with this form.
[20:55:54] sacarlson: I get no return so I assume that's good?
[20:56:12] Maletor: Ox0dea: but otherwise it's 0?
[20:56:12] Ox0dea: It's good in that the library loads fine, bad in that it doesn't get us any closer to finding the bug.
[20:56:31] Ox0dea: maletor: Sort of. It just uses the collection's first element as the initial value.
[20:56:48] kfpratt: has joined #ruby
[20:57:17] shevy: Porfa show the code?
[20:57:45] Ox0dea: In any case, Porfa does in fact need an inner loop.
[20:57:49] shevy: Porfa in general, if you can split up tasks into smaller chunks, it will usually be the best approach; a loop in a loop sounds odd in ruby, normally you could do a .select
[20:58:32] porfa: whats a .select? whoaaa thats to much for me, never heard of that drug mate. ( send hub for you to github)
[20:58:59] Ox0dea: shevy: Well, I suppose it's dependent upon what Porfa is doing in their "parsing loop", but if it really does need to be a loop, and they want to do it multiple times, well...
[20:59:09] michaeldeol: has joined #ruby
[20:59:15] shevy: >> %w( 2 3 4 ).select { |i| i.to_i % 2 == 0 }
[20:59:16] ruboto: shevy # => ["2", "4"] (https://eval.in/421633)
[20:59:33] shevy: Porfa you formulate your query condition within the select {} block and it'll yield you the matches
[20:59:50] porfa: here, https://gist.github.com/anonymous/f7dc4be782a96f6f4ce7
[21:00:33] porfa: ignore line 14 plz
[21:00:37] jeadre: has joined #ruby
[21:00:38] vF3hNGxc47h8: has joined #ruby
[21:01:09] shevy: lots of dependencies
[21:01:13] shevy: are all of these needed for that snippet?
[21:01:21] shevy: I don't have mysql installed here right now for instance
[21:01:33] porfa: ok, remaking the gist, sorry shevy
[21:01:43] shevy: Porfa cheap man's debug tool is: require 'pp' on top, then do a: pp parsu
[21:01:54] shevy: I don't know what parsu holds for instance
[21:02:51] troyready: has joined #ruby
[21:03:25] einarj: has joined #ruby
[21:03:43] porfa: https://gist.github.com/anonymous/fd662dc854f8f6447b4e
[21:03:54] cmckee: has joined #ruby
[21:04:02] baweaver: has joined #ruby
[21:04:12] Ox0dea: shevy: "%w( 2 3 4 )"; what is this silliness?
[21:04:15] porfa: what i really need is that, when the loop ends, i need it to click "next" and do the loop again
[21:04:34] dagda1: has joined #ruby
[21:04:37] Ox0dea: Porfa: Do you know how to loop indefinitely?
[21:04:38] shevy: Ox0dea this is called an Array
[21:04:48] Ox0dea: shevy: But it's an array of "words" that contains only numbers.
[21:04:51] porfa: Ox0dea: nope
[21:05:01] Ox0dea: It looks GitHub.
[21:05:04] howdoicomputer: has joined #ruby
[21:05:31] shevy: Porfa I can't seem to use your code, I get lots of .click on nil objects
[21:05:47] Ox0dea: Porfa: You can say `loop do ... end` to just keep running the loop over and over.
[21:06:03] Ox0dea: Of course, you'll want to use `break` to exit the loop when you meet some termination condition.
[21:06:09] porfa: because the user/pass is not real, sorry shevy . i will create a user name / pass for testing purposes, sorry about that, i'll be creating an account now on the site
[21:06:16] zenguy_pc: has joined #ruby
[21:06:21] porfa: Ox0dea: the terminal condition would be a nil on the "click next"
[21:06:28] rbowlby: has joined #ruby
[21:06:48] northfurr: has joined #ruby
[21:06:59] Ox0dea: Probably better to check for its existence, but I suppose that would do.
[21:07:21] malconis: has joined #ruby
[21:07:22] yeticry: has joined #ruby
[21:07:59] shevy: Porfa hmm it may be best if you change your code to check for nil objects prior to call a method, there may be other failures like a connection that is down
[21:08:43] shevy: these were the old school usage examples I used to use http://mechanize.rubyforge.org/EXAMPLES_rdoc.html
[21:09:05] shevy: well except for the "end.something" stuff
[21:11:22] porfa: shevy: https://gist.github.com/anonymous/304c264127ec9185d02c
[21:11:35] porfa: :) there, that one works as it as correct user/pass
[21:11:35] sacarlson: is there a command that will just recompile all extensions? assuming those are all the C code that is compiled for each gem?
[21:11:36] jeadre: has joined #ruby
[21:11:56] christiandsg: has joined #ruby
[21:12:08] shevy: ok I get result this time
[21:12:29] porfa: *happy because he made something work*
[21:12:50] shevy: what was the information you wanted to extract from that Porfa?
[21:12:58] porfa: wife's calling me for dinner, srry i better go.. (lol "i better go???" )
[21:13:11] porfa: the user/name/sex/pref/link/pic profile
[21:13:20] porfa: and then, jump into the next page, and do it all over again
[21:13:22] shevy: well go to dinner then
[21:13:23] einarj: has joined #ruby
[21:13:28] porfa: brb so sorry!!
[21:13:43] cek: has joined #ruby
[21:13:44] porfa: but ur helping me arghhh shiat,, here's comes the dough roller
[21:13:50] cek: Unfortunately MRI does not have good profile tooling.
[21:14:38] sacarlson: maybe this command will recompile all? gem pristine --all
[21:14:39] shevy: sacarlson I think this may not be available... you could try to ask on #rubygems to make sure, or file an issue request for that
[21:15:06] sacarlson: ok good idea shevy
[21:15:20] shevy: gem pristine: "restores installed gems to pristine condition from files located in the gem cache"
[21:15:24] allcentury: has joined #ruby
[21:15:25] shevy: don't think it will recompile
[21:15:47] shevy: perhaps it may copy back an old compilation
[21:16:20] shevy: -?-[no-]extensions - Restore gems with extensions in addition to regular gems
[21:16:22] sacarlson: well it won't break anything so might be worth a try then
[21:16:30] Ox0dea: cek: How do you mean?
[21:16:51] cek: jruby has it, mri doesn't.
[21:17:11] Ox0dea: cek: There's ruby-prof, the TracePoint API, and a few others.
[21:17:46] cek: > Sidekiq stays fast by using the JProfiler java profiler to find and fix performance problems on JRuby. Unfortunately MRI does not have good profile tooling.
[21:18:28] sacarlson: well gem pristine --all did nothing
[21:18:32] sacarlson: still fails
[21:18:50] gamename: has joined #ruby
[21:18:53] Wolland: has joined #ruby
[21:19:06] sacarlson: I'll check in at #rubygems
[21:19:35] momomomomo_: has joined #ruby
[21:19:43] Iskarlar: has joined #ruby
[21:20:38] shevy: `gsub': incompatible encoding regexp match (ISO-8859-1 regexp with ASCII-8BIT string) (Encoding::CompatibilityError)
[21:20:40] nofxx: has joined #ruby
[21:20:40] nofxx: has joined #ruby
[21:20:42] shevy: cool... never had this error before
[21:22:05] leafybasil: has joined #ruby
[21:22:12] sarkyniin: has joined #ruby
[21:24:38] mary5030: has joined #ruby
[21:24:56] cek: has left #ruby: ()
[21:25:17] sarkyniin: is File.write(filename, content) an acceptable way of writing to a file?
[21:25:20] sarkyniin: what are its limitations?
[21:25:51] drbrain: sarkyniin: it doesn't work on ruby 1.8
[21:26:28] drbrain: if you have lots of data (> 100MB) you probably want to use the instance method unless it is already all in memory
[21:26:37] sarkyniin: drbrain: it's just at short json file
[21:26:56] drbrain: I would use File.write then
[21:26:59] rideh: has joined #ruby
[21:27:35] riotjones: has joined #ruby
[21:27:45] porfa: I'm back!
[21:27:56] greencoder: I'm trying to create a file and fill it with contents from a template file
[21:28:01] greencoder: Is this a bad way of doing it? File.new('newfile.txt', 'w+').write(File.read('template.txt'))
[21:28:13] zendrix: has left #ruby: ()
[21:28:25] porfa: ( i said i'd wash the dishes and clean the kitchen if i could be excused???)
[21:28:48] chouhoul_: has joined #ruby
[21:28:52] Ox0dea: greencoder: Yes.
[21:29:02] greencoder: I figured :/
[21:29:17] lagweezle: greencoder: You are just copying the file, it looks like, without modifying it...?
[21:29:29] Ox0dea: greencoder: require 'fileutils'; FileUtils.cp 'foo', 'bar'
[21:29:40] greencoder: Yeah I plan on modifying it after I've copied that stuff first
[21:30:00] Ox0dea: You should almost certainly do your modifications before writing.
[21:30:15] adaedra: greencoder: never do that (.new.write), as you have no close and let a resource be wasted.
[21:31:17] baweaver: has joined #ruby
[21:31:30] `derpy: No results
[21:31:33] Ox0dea: adaedra: :(
[21:31:59] yfeldblum: has joined #ruby
[21:32:26] adaedra: Ox0dea: I don't know about this
[21:32:44] Ox0dea: It's okay for the machines to be better than us at some things.
[21:33:11] lagweezle: 0x0dea: ri FileUtils.cp
[21:33:59] adaedra: lagweezle: 1) it's a O (letter), not 0, at first place 2) Ox0dea uses `derpy like ri, which find something for `cp`, but `derpy doesn't
[21:34:33] einarj: has joined #ruby
[21:34:52] FernandoBasso: has joined #ruby
[21:34:59] barhum2013: has joined #ruby
[21:35:47] Ox0dea: `derpy should show us his guts so we can make him behave more like `ri`.
[21:36:03] banjara: has joined #ruby
[21:36:14] dagda1: has joined #ruby
[21:36:49] adaedra: Again, the code for the rubydoc plugin is available at GitHub
[21:38:30] lagweezle: That'd explain why it didn't autocomplete for me, when I typed it, adaedra.
[21:38:30] einarj_: has joined #ruby
[21:38:32] Ox0dea: Oh, right. I see now that it essentially just formats a URL.
[21:39:07] adaedra: What would you want it to do else? :)
[21:39:23] Ox0dea: Well, it could be made cleverer by giving it a list of all the standard library methods.
[21:39:51] Ox0dea: I don't think disambiguation would be too much of a problem.
[21:40:02] adaedra: It has them, through yard
[21:40:48] adaedra: but yard lookup is different from ri's one
[21:41:06] adaedra: I tried to use rdoc directly, but didn't do well with their library :s
[21:42:01] skade: has joined #ruby
[21:43:47] sacarlson: my method to fix my seg fault problem was to rm -r ~/.bundle ; bundle install ; seems to have fixed the seg fault
[21:44:11] rideh: has joined #ruby
[21:44:42] nofxx: sacarlson, rm -r , solving bugs since 1971. What it doesn't solve -f does.
[21:44:52] sacarlson: I think the problem comes from when I bundle install ; the first time it hit a problem with some missing system dep that needed apt-get install some-dev
[21:45:04] adaedra: and if nothing works, just `reboot`
[21:45:33] shevy: then he won't be able to bring his computer up anymore!
[21:45:40] northfurr: has joined #ruby
[21:46:01] nofxx: sacarlson, might be... file a bug if the gem is kinda false installing
[21:46:12] nofxx: but just reinstalling it, with the depedencies, should fix it sacarlson
[21:46:14] Ox0dea: $ while :; eject -T; done
[21:46:21] devoldmx: has joined #ruby
[21:46:36] sacarlson: well the developer of the app didn't say it was required so
[21:46:42] Ox0dea: I missed a `do` in there.
[21:47:00] sacarlson: but I'm happy thanks guys
[21:47:10] Ox0dea: sacarlson: Perhaps you ended up with some sort of "partial compile".
[21:47:10] porfa: dammit ;_; i lost my help, damn wife and the dinner
[21:47:20] porfa: (i love her tho :3 )
[21:47:33] sacarlson: Ox0dea: yes seems so
[21:47:56] sacarlson: if ever I have this problem again first try will be rm -r
[21:48:01] leafybasil: has joined #ruby
[21:48:26] phutchins: has joined #ruby
[21:48:41] zendrix: has joined #ruby
[21:49:29] Ox0dea: >> 'landline'.tr 'denial', '-/ fmr'
[21:49:30] ruboto: Ox0dea # => "rm -rf /" (https://eval.in/421639)
[21:49:35] arescorpio: has joined #ruby
[21:50:04] shevy: now you only need to hide a system() call there
[21:50:29] Ox0dea: Backticks are particularly inconspicuous in some fonts.
[21:51:27] matcouto: has joined #ruby
[21:51:47] lele: has joined #ruby
[21:52:24] Ox0dea: In any case, --preserve-root has been the default on modern systems for, like, a decade.
[21:53:45] iamninja: has joined #ruby
[21:54:00] ellisTAA: has joined #ruby
[21:54:49] porfa: shevy: hello?
[21:54:52] jhass: easy to workaround, just rm -rf .*
[21:56:15] porfa: i guess shevy's gone.. hmm well, can anyone help me accomplishing the fine task of making a loop inside a loop? it's my first time.. *wink wink*
[21:57:00] jhass: loop do; loop do; puts "loop in a loop, forever"; end; end; # solved! next!
[21:57:03] porfa: https://gist.github.com/anonymous/304c264127ec9185d02c here's the git, i just need to repeat the loop after it clicks "next" (last line)
[21:57:14] sarkyniin: uhh apparently the optionparser module
[21:57:20] sarkyniin: allows me to use autocompletion in shells like zsh
[21:57:26] sarkyniin: however, when pressing tab, nothing happens
[21:57:32] porfa: yeah, but I'm missing the programers logic, so i think the problem is actually between the monitor and the chair :(
[21:57:32] sarkyniin: do I need to restart my shell first or something
[21:58:29] Ox0dea: sarkyniin: Erm, how do you mean?
[21:58:40] jhass: Porfa: what's your loop condition? when do you want to stop?
[21:58:50] workmad3: has joined #ruby
[21:58:56] choke: has joined #ruby
[21:58:58] sarkyniin: Ox0dea: in the optionparser doc, they mention this: "For modern shells (e.g. bash, zsh, etc.), you can use shell completion for command line options."
[21:59:07] sarkyniin: However, I can't actually use shell completion with my ruby script
[21:59:46] porfa: jhass: if "click next" is nil, abort?
[22:00:04] porfa: (the last page has no "next ->" to click on
[22:00:16] Ox0dea: sarkyniin: I think that must be some sort of mistake.
[22:00:35] Ox0dea: OptionParser doesn't make any mention or use of readline.
[22:00:35] sarkyniin: Ox0dea: http://hastebin.com/raw/inumezijox
[22:00:48] sarkyniin: error on optionparser's side
[22:00:51] jhass: Porfa: loop do; parse_page; next_link = ...; break unless next_link; next_link.click; end;
[22:01:02] Ox0dea: sarkyniin: Well, whoever slipped that into the documentation anyhow.
[22:01:15] sacarlson: has left #ruby: ()
[22:01:17] decoponio: has joined #ruby
[22:01:19] Ox0dea: It's true that many shells support Tab completion for arguments, but that's nothing to do with OptionParser.
[22:02:05] Ox0dea: Perhaps they meant to hint at the fact that you can get your script registered for completions through the appropriate channels.
[22:02:29] Ox0dea: I don't see why that advice should go in OptionParser's documentation, though.
[22:02:31] valeri_uF0: has joined #ruby
[22:02:54] Iskarlar: has joined #ruby
[22:04:37] JoshGlzBrk: has joined #ruby
[22:05:37] dan4352: has joined #ruby
[22:06:22] ckinniburgh__: has joined #ruby
[22:06:25] Xiti`: has joined #ruby
[22:06:37] tubulife|: has joined #ruby
[22:06:42] zxvcd_: has joined #ruby
[22:07:21] ujjain: has joined #ruby
[22:07:21] ujjain: has joined #ruby
[22:07:53] oiwjda: has joined #ruby
[22:08:27] MikeKuntz: has joined #ruby
[22:08:33] anon: has joined #ruby
[22:08:42] oiwjda: has left #ruby: ()
[22:09:16] MikeKuntz: what are good free resources to build Ruby projects with?
[22:09:22] senayar: has joined #ruby
[22:09:30] MikeKuntz: I'd like to learn for free while building a portfolio
[22:10:28] jhass: ugh, never saw anything just Ruby that would build a project
[22:10:39] jhass: little OT if you don't mind, what client are you using?
[22:11:06] MikeKuntz: I have no clue
[22:11:13] jhass: how did you connect here ;)
[22:11:30] tmtwd: has joined #ruby
[22:12:05] MikeKuntz: irc phone app
[22:12:35] adaedra: TurboIRC for iOS
[22:12:40] einarj: has joined #ruby
[22:12:40] jhass: interesting, thanks
[22:12:55] jhass: always wondered where those usernames would come from
[22:13:17] MikeKuntz: this is my real name
[22:13:24] MikeKuntz: should I change to a username?
[22:13:34] Ox0dea: jhass: http://git.io/vsD54
[22:13:35] jhass: nah, not the nickname ;)
[22:13:36] Ox0dea: For what it's worth.
[22:14:06] shevy: jhass I wonder about your username too!
[22:14:08] jhass: Ox0dea: yeah, they don't appear to be unique :/
[22:14:19] Ox0dea: jhass: I expect they're the same person.
[22:14:27] jhass: shevy: I'm sure you can figure it out if you spend any effort on it
[22:14:46] bradland: well, that pretty much counts shevy out
[22:14:56] jhass: Ox0dea: nah, I've run through tons of logs, pretty sure that client's RNG just sucks
[22:15:53] pen: has joined #ruby
[22:16:19] adaedra: jhass: little ot, do you prononce it (jhass) with a german j or an english one?
[22:16:48] jhass: adaedra: I think I never pronounced it actually :D
[22:17:19] jhass: my real name has the german one, even though being of scandinavian origin
[22:17:27] failshell: has joined #ruby
[22:17:55] adaedra: Well, scandinavian j should be the same I guess
[22:18:12] toretore: its pronounced jazz
[22:18:12] doug_f1: has left #ruby: ()
[22:20:52] freerobby: has joined #ruby
[22:22:21] baweaver: has joined #ruby
[22:22:38] rbirch_: has joined #ruby
[22:23:15] duggiefresh: has joined #ruby
[22:24:44] workmad3: has joined #ruby
[22:24:47] davedev24: has joined #ruby
[22:25:06] rbirch: has joined #ruby
[22:26:29] senayar: has joined #ruby
[22:27:06] sarkyniin: http://hastebin.com/raw/vimivabese
[22:27:09] sarkyniin: is this behaviour normal?
[22:27:28] jhass: sarkyniin: yes, String#delete has String#count semantics
[22:28:00] araujo_: has joined #ruby
[22:28:20] cmckee: has joined #ruby
[22:28:21] riotjones: has joined #ruby
[22:29:30] sarkyniin: jhass: how would I go about achieving what I want in a single command?
[22:29:33] sarkyniin: preferably without using regex
[22:29:46] jhass: you didn't specify what you want
[22:30:15] Limix: has joined #ruby
[22:30:47] sarkyniin: deleting two separate substrings from a string
[22:30:55] arooni-mobile: has joined #ruby
[22:30:59] jhass: use a regex
[22:31:05] ishahnaz: has joined #ruby
[22:31:06] whiteline: has joined #ruby
[22:31:33] jhass: >> "hello".gsub(Regexp.union("he", "lo"), "")
[22:31:34] ruboto: jhass # => "l" (https://eval.in/421642)
[22:31:48] Ox0dea: sarkyniin: Do you need to actually remove substrings, or just characters?
[22:32:03] sarkyniin: just characters, Ox0dea
[22:32:09] Ox0dea: >> 'hello'.delete 'el'
[22:32:09] sarkyniin: jhass: I guess I'll do that
[22:32:09] ruboto: Ox0dea # => "ho" (https://eval.in/421643)
[22:32:48] jhass: sarkyniin: nah, check Ox0dea's reply. I assumed you checked what String#count semantic actually means and know what you're talking about when saying substring
[22:33:07] sarkyniin: jhass: sorry
[22:33:10] sarkyniin: yeah Ox0dea that works
[22:34:01] Ox0dea: jhass: Precious few people actually use "substring" correctly.
[22:34:14] Ox0dea: Alas, it's easier to just pretend I don't know the technically correct definition. :/
[22:35:12] jhass: Ox0dea: well, I assumed in this context the difference between character and substring would be obvious
[22:35:18] jhass: but my bad, yeah
[22:35:35] j_mcnally: has joined #ruby
[22:36:00] veduardo: has joined #ruby
[22:36:17] shevy: bradland haha yeah
[22:36:30] _djbkd: has joined #ruby
[22:37:28] DifferentLambda: has joined #ruby
[22:37:31] havenwood: has joined #ruby
[22:37:44] duggiefresh: has joined #ruby
[22:37:55] dgutierrez1287: has joined #ruby
[22:38:59] phutchins: has joined #ruby
[22:42:07] Limix: has joined #ruby
[22:44:36] christiandsg: has joined #ruby
[22:46:43] Torrieri: has joined #ruby
[22:46:44] Torrieri: has joined #ruby
[22:47:45] ellisTAA: i don???t get how a server can handle thousands of users @ once ??? can someone explain how companies handle such large traffic? do they create multiple servers?
[22:48:06] finisherr: has joined #ruby
[22:49:28] Ox0dea: EllisTAA: https://en.wikipedia.org/wiki/C10k_problem
[22:49:34] eam: EllisTAA: generally yes
[22:49:50] ellisTAA: Ox0dea: thanks
[22:49:53] eam: a single server can serve between 1 and 100_000 clients at once depending on the kind of server
[22:50:09] eam: most scalable services run across many, many machines
[22:50:42] baweaver: and most of the time they're behind what's called a load balancer
[22:50:44] ellisTAA: eam: so if me and 99,999 other people update our status, we should get a response from the server in less than a second
[22:50:52] baweaver: that intelligently forwards traffic to servers based on load
[22:51:06] ellisTAA: baweaver: thanks
[22:51:19] baweaver: Typically some form of proxy combination of NginX, squid, or other such tools depending on stack,
[22:51:31] ellisTAA: what is this field or area of programming called?
[22:51:32] Dzejmskrokan: has joined #ruby
[22:51:37] eam: EllisTAA: sure. If you're talking about something like facebook, what you'll have is a large number of frontend systems doing the page rendering and some kind of sharded datastore on the backend
[22:51:47] havenwood: EllisTAA: There are many ways. Here's an Erlang example that might be fun to look at: http://www.erlang-factory.com/upload/presentations/558/efsf2012-whatsapp-scaling.pdf
[22:51:54] baweaver: or Infrastructure Engineering.
[22:52:12] havenwood: EllisTAA: Or do you mean Ruby specifically?
[22:52:16] baweaver: I happen to work in an odd intersection between DevOps, Infrastructure, and straight Web Dev
[22:52:18] eam: havenwood: is that the rick reed presentation?
[22:52:44] eam: he's fantastic
[22:53:01] ellisTAA: interesting. i guess i???m trying to get a job in web dev, but i???m interested in devops
[22:53:17] baweaver: I once got nailed in College for referring to Erlang and FP as a solution to mutex issues.
[22:53:36] baweaver: DevOps can be brutal
[22:53:39] eam: EllisTAA: many smaller companies can go for quite some time before they need to scale certain components
[22:53:50] eam: a single database is a very very common architecture
[22:53:55] dagda1: has joined #ruby
[22:53:59] havenwood: Hundreds of connections per hour! ;)
[22:54:02] baweaver: source: I've been in DevOps for 4 years, and am not exactly fond of it.
[22:54:05] ellisTAA: eam: gotcha. thanks
[22:54:13] ellisTAA: baweaver: why not
[22:54:22] baweaver: I'd be lucky to see 100 a second
[22:54:24] ellisTAA: baweaver: sounds bad ass
[22:54:32] baweaver: Chef, for one
[22:54:32] veduardo: has joined #ruby
[22:54:35] charliesome: has joined #ruby
[22:54:48] baweaver: ACTION chuckles at badass reference
[22:55:06] baweaver: fine fine, clarification
[22:55:24] baweaver: My team name is BaDASS -> Build and Deployment Automation Support System.
[22:55:44] baweaver: So I can legitimately say I'm a badass developer on my resume if I want to.
[22:55:52] bootstrappm: hahah thats great
[22:56:16] eam: speaking of load balancers - there's also a point where you have more traffic than can be pushed through one
[22:56:33] eam: this is a much, much higher bar; most companies probably don't reach this point
[22:56:39] baweaver: eam: shhh, you'll scare them
[22:56:47] baweaver: that stuff is the stuff of nightmares.
[22:56:55] havenwood: it's much easier without users
[22:56:55] ellisTAA: eam: so i dont need to start worrying about having multiple servers until i get a couple thousand users?
[22:57:09] eam: EllisTAA: it entirely depends on what kind of server you have and how expensive it is to serve a query
[22:57:16] shevy: the world would be easier without users!
[22:57:19] ellisTAA: eam: gotcha
[22:57:21] eam: working out capacity models and growth plans is all part of the game
[22:57:38] Aeyrix: baweaver: I didn't realise Sony ever named anything that edgy.
[22:57:39] eam: "we'll just put the database on a fusionio"
[22:57:46] baweaver: internal tools
[22:57:49] ellisTAA: eam: what do i search to learn more about this stuff
[22:58:08] eam: EllisTAA: honestly best way is to get a job and get paid to learn it :)
[22:58:28] bootstrappm: EllisTAA what kind of app are you talking about / building?
[22:58:46] eam: EllisTAA: ##infra-talk is a pretty good channel on freenode for this stuff
[22:58:48] charliesome: has joined #ruby
[22:58:49] bootstrappm: or you want to learn about the devops part of it?
[22:58:54] ellisTAA: eam: do you know anyone in sf that???s hiring?
[22:59:07] eam: EllisTAA: indeed - perhaps a better question is who isn't ;-)
[22:59:09] bootstrappm: hahahaha that's a good joke
[22:59:18] ellisTAA: eam: lol well who???s hiring jr devs!
[22:59:22] bootstrappm: skill level is high though
[22:59:25] bootstrappm: yes, better question
[22:59:33] eam: EllisTAA: intern programs are a great place to start
[22:59:42] eam: SF interns earn 70-90k so
[22:59:59] ellisTAA: eam: ahh yes i applied to 1. any suggestions on where to apply?
[23:00:25] BraddPitt: EllisTAA take a look at HN "Who's Hiring" threads, angel.co and various ruby job boards
[23:00:32] BraddPitt: i think rubyweekly has a pretty good job board for that
[23:00:45] BraddPitt: otherwise, just search indeed.com with 'ruby' and 'intern' or 'junior dev' keywords
[23:00:45] _djbkd: has joined #ruby
[23:00:51] eam: well, you could send me your resume if you want. I'd be happy to drop you in our system. try also hn "who's hiring" threads, craigslist
[23:00:52] BraddPitt: PLENTY of positions in the bay area
[23:01:02] BraddPitt: where are you located, EllisTAA ?
[23:01:10] ellisTAA: BraddPitt: san fran
[23:01:16] ellisTAA: thanks ill check out all of those
[23:01:28] BraddPitt: also, you can join the Ruby/RoR Hiring meetups
[23:01:47] ellisTAA: BraddPitt: i missed the last one, ill check em out on meetup.com
[23:01:54] nickjj: are any of you ops knowledge seekers interested in learning more about docker?
[23:02:22] ellisTAA: eam: how can i send you my resume?
[23:02:37] eam: messaged you my email
[23:02:47] bootstrappm: me nickjj! I use it in development
[23:03:28] nickjj: bootstrappm, <shameless plug> i recently published a book on using docker for development and production
[23:03:59] bootstrappm: I figured it would be ;) send the link anyways, never know who might find it useful
[23:04:12] _blizzy_: has joined #ruby
[23:04:13] nickjj: the cool thing to me is that it's very decoupled from whatever language your web app is written in. you can apply it to anything
[23:04:24] _djbkd: has joined #ruby
[23:04:24] dc: has joined #ruby
[23:04:32] System42: has joined #ruby
[23:05:48] kies: has joined #ruby
[23:06:09] zenguy_pc: has joined #ruby
[23:08:01] NeverDie: has joined #ruby
[23:08:32] _djbkd: has joined #ruby
[23:09:03] michaeldeol: has joined #ruby
[23:09:20] BTRE: has joined #ruby
[23:11:39] j_mcnally: has joined #ruby
[23:11:41] DLSteve: has joined #ruby
[23:12:10] sarkyniin: has joined #ruby
[23:12:39] sgambino: has joined #ruby
[23:12:59] _blizzy_: has joined #ruby
[23:13:37] BTRE: has joined #ruby
[23:14:34] JimmyNeutron: has joined #ruby
[23:14:36] blackmesa: has joined #ruby
[23:16:40] craysiii: nickjj what was it like publishing a book?
[23:17:12] nickjj: craysiii, a lot less tedious than screencasts. that's for sure
[23:17:21] fumihiro: has joined #ruby
[23:17:31] nickjj: overall not too bad, it's only in digital form at the moment
[23:17:51] craysiii: self published?
[23:18:43] tkuchiki: has joined #ruby
[23:18:44] craysiii: congratulations with that, seems like a good accomplishment to make
[23:18:52] whiteline: has joined #ruby
[23:18:53] Ropeney: has joined #ruby
[23:19:14] _djbkd: has joined #ruby
[23:19:36] nickjj: craysiii, thanks. were you interested in publishing one yourself?
[23:20:31] craysiii: i am nowhere near proficient enough in anything to write a book about it. When i was tutoring comsci / C++ I had thought about making a short pamphlet for my students, but never got really far.
[23:20:54] shevy: the laziness factor
[23:21:05] _djbkd: has joined #ruby
[23:21:06] craysiii: that more than anything.
[23:21:44] bricker: Can someone do me a favor and copy this into a gist? I want to share it with coworkers but pastebin is blacklisted http://pastebin.com/BjD84BQ3
[23:21:44] ruboto: bricker, we in #ruby do not like pastebin.com, it loads slowly for most, has ads which are distracting and has terrible formatting. Please use https://gist.github.com
[23:21:56] _djbkd: has joined #ruby
[23:22:03] chipotle: has joined #ruby
[23:22:18] nickjj: it does take a bit of effort, but if you keep it under 100 pages or so it doesn't have a chance to get really hand out of hand
[23:22:25] bricker: It's the "Amazon Programmer's Perspective" article
[23:22:31] shevy: ruboto for the auto-win
[23:22:44] shevy: why does it not turn it into a gist?
[23:23:13] bricker: shevy: dunno, maybe it's too big?
[23:23:20] bricker: it's not *that* big
[23:23:21] Aeyrix: https://gist.github.com/anonymous/9c97d475bba68e461308
[23:23:23] shevy: bricker this works? https://gist.github.com/shevegen/ecc5ad6115b63de567d6
[23:23:26] craysiii: thats what ruboto said /s
[23:23:34] tkuchiki: has joined #ruby
[23:23:41] shevy: well that was strange... ruboto normally auto-gists upon pastebin
[23:23:43] bricker: shevy: thanks!
[23:24:02] craysiii: ruboto no feel well today.
[23:24:42] shevy: >> [].all? {|number| number =~ /\d+/ }
[23:24:43] ruboto: shevy # => true (https://eval.in/421653)
[23:24:54] shevy: can someone explain this to me?
[23:26:40] gambl0re: has joined #ruby
[23:27:28] yfeldblum: has joined #ruby
[23:27:29] Radar: shevy: All the elements in the array match the block.
[23:27:33] [H]unt3r: has joined #ruby
[23:27:37] Radar: >> [].all? { }
[23:27:38] ruboto: Radar # => true (https://eval.in/421654)
[23:27:50] pipework: shevy: All the ^
[23:27:56] Aeyrix: >> [1,2,3,4,5].all? {|number| number =~ /\d+/ }
[23:27:56] craysiii: makes sense semantically
[23:27:57] ruboto: Aeyrix # => false (https://eval.in/421655)
[23:28:05] Aeyrix: >> ['1', '2', '3'].all? {|number| number =~ /\d+/ }
[23:28:06] ruboto: Aeyrix # => true (https://eval.in/421656)
[23:28:44] Aeyrix: >> ['1', '2', '3', 'tbh'].all? {|number| number =~ /\d+/ }
[23:28:45] ruboto: Aeyrix # => false (https://eval.in/421657)
[23:28:52] hooper1: has left #ruby: ()
[23:28:57] pipework: %w my friend
[23:29:06] riotjones: has joined #ruby
[23:29:08] Aeyrix: \d on fixnum tbh
[23:29:14] pipework: >> %w|1 2 3 woot|
[23:29:14] ruboto: pipework # => ["1", "2", "3", "woot"] (https://eval.in/421658)
[23:29:17] yashinbasement: has joined #ruby
[23:29:22] Ox0dea: shevy: #all? optimistically starts the search with the result set to `true` and only changes it to `false` if an element doesn't match.
[23:29:34] roolo: has joined #ruby
[23:30:37] Ox0dea: https://github.com/ruby/ruby/blob/trunk/enum.c#L1096
[23:31:37] petersaints: has joined #ruby
[23:31:49] Ox0dea: Aeyrix: %w[1 2 3].all?(/\d+/), amirite?
[23:32:09] pipework: Ox0dea: you certainly aint left!
[23:32:16] Ox0dea: Aeyrix: Really?
[23:32:51] Aeyrix: Ox0dea: My problem is more to do with the data type issue.
[23:32:57] Aeyrix: Not really an "issue" given regex's purpose
[23:33:00] Aeyrix: but I've run into it a few times.
[23:33:02] Ox0dea: I don't follow.
[23:33:11] Aeyrix: >> 5.class
[23:33:12] ruboto: Aeyrix # => Fixnum (https://eval.in/421659)
[23:33:16] Aeyrix: >> "5".class
[23:33:17] ruboto: Aeyrix # => String (https://eval.in/421660)
[23:33:25] Ox0dea: I meant that it would be nice if #all? and friends used case equality?
[23:33:28] Aeyrix: You can perform a regex substitution that will work correctly on only one of those.
[23:33:50] Swappticon: has joined #ruby
[23:34:19] Aeyrix: Now I think about it I forget what the hell I must've been doing to have encountered a Fixnum while performing a regex operation.
[23:34:25] Aeyrix: I must've been seriously breaking something.
[23:34:43] Ox0dea: >> '' =~ //
[23:34:44] ruboto: Ox0dea # => 0 (https://eval.in/421661)
[23:35:04] Aeyrix: >> "535353535" =~ /\d+/
[23:35:05] ruboto: Aeyrix # => 0 (https://eval.in/421662)
[23:35:09] Aeyrix: thanks fam
[23:35:41] Ox0dea: For real, though: https://bugs.ruby-lang.org/issues/11286
[23:35:53] jaycee: has joined #ruby
[23:36:23] loop3r: has joined #ruby
[23:36:31] eam: why does fixnum have a =~ method anyway, if it doesn't stringify self?
[23:36:38] Liam`: has joined #ruby
[23:36:42] eam: what the heck does it do
[23:36:47] ledestin: has joined #ruby
[23:36:51] drbrain: Object has #=~
[23:36:56] _aeris_: has joined #ruby
[23:37:00] eam: that's weird
[23:37:06] drbrain: generically, =~ is "match"
[23:37:12] eam: is it valid for anything other than String?
[23:37:18] Aeyrix: Not really.
[23:37:20] chipotle: has joined #ruby
[23:37:26] Aeyrix: Not anything that isn't stringified.
[23:37:30] drbrain: I've implemented it on objects before
[23:38:15] eam: >> class Fixnum; def =~(x); self.to_s =~ x; end; end; 1234 =~ /23/
[23:38:15] ruboto: eam # => 1 (https://eval.in/421663)
[23:38:24] drbrain: by default it returns nil
[23:38:30] bjmllr: has joined #ruby
[23:38:37] eam: seems like it oughta be defined on String since it's meaningless for other classes
[23:38:49] nahtnam: has joined #ruby
[23:38:54] kr3ssh: has joined #ruby
[23:38:58] nyandoge: has joined #ruby
[23:39:15] calleerlandsson: has joined #ruby
[23:39:27] ngscheurich: has joined #ruby
[23:39:29] drbrain: https://github.com/rubygems/rubygems/blob/master/lib/rubygems/requirement.rb#L246
[23:39:30] Ox0dea: It's also defined on Regexp.
[23:39:41] bove: has joined #ruby
[23:39:42] nux443: has joined #ruby
[23:39:58] ELCALOR: has joined #ruby
[23:40:14] eam: Ox0dea: yeaaaaah
[23:40:27] drbrain: you can use it any time you have pattern
[23:40:41] drbrain: pattern =~ object or object =~ pattern
[23:41:16] barajasfab: has joined #ruby
[23:42:01] eam: not a fan of that behavior :)
[23:42:33] drbrain: Regexp#=~ already works with everything implementing #to_str
[23:43:51] eam: drbrain: really? I get a TypeError
[23:44:08] craysiii: >> [false, false].all? { |f| f =~ /true/ }
[23:44:09] ruboto: craysiii # => false (https://eval.in/421668)
[23:44:39] Meow-J: has joined #ruby
[23:45:15] drbrain: >> o = Object.new; def o.to_str; "dog"; end; p /dog/ =~ o
[23:45:16] ruboto: drbrain # => 0 ...check link for more (https://eval.in/421669)
[23:45:35] eam: oh, to_str not to_s
[23:45:39] ggherdov: has joined #ruby
[23:45:59] eam: yeah ok :)
[23:46:01] drbrain: with #to_s would be a bizarro-world
[23:47:06] devoldmx: has joined #ruby
[23:47:16] eam: I see, if it's keyed off to_str that makes sense
[23:48:52] barajasfab: has left #ruby: ()
[23:48:55] workmad3: has joined #ruby
[23:52:23] gregf: has joined #ruby
[23:53:32] Feyn: has joined #ruby
[23:54:42] iamninja: has joined #ruby
[23:55:27] jiada: has joined #ruby
[23:57:56] chipotle: has joined #ruby
[23:58:48] cyberarm: has joined #ruby
[23:59:54] JoshuaPaling: has joined #ruby