« Back to channel list

#ruby - 09 June 2016

« Back 1 day Forward 1 day »
[00:00:08] wrkrcoop: what would i do then …
[00:00:16] wrkrcoop: raise an exception?
[00:00:26] shevy: well depends on the error
[00:00:32] shevy: (1) cat on the keyboard
[00:00:35] shevy: (2) someone wants to beat you up
[00:00:39] shevy: (3) corrupted filesystem
[00:00:46] jhass: wrkrcoop: what'll make your exception different than the one you're replacing with it?
[00:01:06] wrkrcoop: jhass: idk i was just going to google dif between exceptions and rescue
[00:01:31] shevy: you can rescue an exception
[00:01:42] wrkrcoop: so if something breaks during the process that everything else depends on would i just log that?
[00:01:48] jhass: wrkrcoop: it's the same difference between methods and arguments
[00:01:49] wrkrcoop: or put it in a failed queue
[00:01:49] shevy: you can rescue and log
[00:01:57] jhass: related but entirely different things
[00:02:15] chopin: has joined #ruby
[00:02:19] jhass: wrkrcoop: there's no general always correct "solution" here
[00:02:32] jhass: it depends _heavily_ on context
[00:02:54] jhass: else why would make ruby make you deal with it in the first place instead of the one correct thing there would be to do?
[00:03:33] wrkrcoop: ok well im doing this thing where i grab data from 5 apis one after the other — all depend on each other … so if one breaks the rest cant continue so i should probably just log it or put it in a failed queue
[00:04:07] wrkrcoop: thats pretty logical thing it seems
[00:06:53] jhass: can't judge, way to vague about what you even mean with what you say, what your actual situation is and what your implementation looks like
[00:07:49] mikecmpbll: has joined #ruby
[00:09:00] araujo: has joined #ruby
[00:09:48] ekinmur: has joined #ruby
[00:10:22] ahuman: has joined #ruby
[00:10:42] lopin: has joined #ruby
[00:11:22] roamingdog: has joined #ruby
[00:12:01] araujo: has joined #ruby
[00:15:16] noobsu: has joined #ruby
[00:15:56] ellisTAA: has joined #ruby
[00:16:01] achamian: has joined #ruby
[00:17:51] d5sx43: has joined #ruby
[00:19:03] xall: has joined #ruby
[00:19:30] griffindy: has joined #ruby
[00:20:06] davedev24: has joined #ruby
[00:20:07] lopin: has joined #ruby
[00:22:29] RobertBirnie: has joined #ruby
[00:23:48] davedev24: has joined #ruby
[00:24:40] n_blownapart: has joined #ruby
[00:25:39] davedev24: has joined #ruby
[00:27:53] aupadhye: has joined #ruby
[00:27:58] whathappens: has joined #ruby
[00:28:12] certainty: has joined #ruby
[00:28:30] blur3d: has joined #ruby
[00:29:12] nankyokusei: has joined #ruby
[00:29:18] flashpoint9: has joined #ruby
[00:31:48] palms: has joined #ruby
[00:32:50] soLucien: has joined #ruby
[00:33:23] soLucien: what is the difference between the bin\ folder and the exec\ folder ?
[00:35:03] havenwood: soLucien: Say more about the context?
[00:35:23] soLucien: i executed bundle --binstubs exec
[00:35:47] soLucien: then i got some auto-generated files in the exec\ folder
[00:35:54] soLucien: they are the same as the ones in bin\
[00:36:13] lightt: has joined #ruby
[00:37:06] nando293921: has joined #ruby
[00:39:36] jhass: well you explicitly made that folder then
[00:40:14] terminal_: has joined #ruby
[00:40:43] diegoaguilar: has joined #ruby
[00:40:57] hahuang65: has joined #ruby
[00:41:03] flashpoint9: has joined #ruby
[00:41:27] Dios: has joined #ruby
[00:42:27] rkazak: has joined #ruby
[00:43:30] skweek: has joined #ruby
[00:43:56] ElFerna: has joined #ruby
[00:45:44] sartan: has left #ruby: ("Leaving")
[00:46:31] mistermocha: has joined #ruby
[00:49:04] aberen: has joined #ruby
[00:49:36] SilverKey: has joined #ruby
[00:57:24] kies: has joined #ruby
[00:57:27] Wolland: has joined #ruby
[00:57:54] terminal_: has joined #ruby
[00:58:20] xlegoman: has joined #ruby
[00:58:23] ekinmur: has joined #ruby
[00:58:46] sp4rrow: has joined #ruby
[01:01:20] xlegoman_: has joined #ruby
[01:03:47] xlegoman_: has joined #ruby
[01:04:56] jaguarmagenta: has joined #ruby
[01:05:44] MyMind: has joined #ruby
[01:06:04] postmodern: has joined #ruby
[01:08:30] johnDoe111: has joined #ruby
[01:10:57] textchimp: has joined #ruby
[01:11:43] Dios: has joined #ruby
[01:11:49] bmorrison: has joined #ruby
[01:18:58] al2o3-cr: has joined #ruby
[01:19:06] Ropeney: has joined #ruby
[01:20:27] textchimp: does anyone have any experience require'ing external gems into Sonic Pi?
[01:20:41] tmtwd: has joined #ruby
[01:20:52] CloCkWeRX: has joined #ruby
[01:22:04] dopamean_: has joined #ruby
[01:22:53] MrBusiness3: has joined #ruby
[01:23:50] nando293921: has joined #ruby
[01:23:52] pilne: would anyone know why the ruboto IRB is no longer on the play store (i found the apk, just curious).
[01:25:12] rueben: has joined #ruby
[01:25:51] Trynemjoel: has joined #ruby
[01:28:55] certainty: has joined #ruby
[01:29:16] roamingdog: has joined #ruby
[01:29:40] AcidCras_: has joined #ruby
[01:32:08] ensyde: has joined #ruby
[01:33:20] blackmesa: has joined #ruby
[01:33:51] harai54: has joined #ruby
[01:36:58] aufi: has joined #ruby
[01:48:34] kgrz: has joined #ruby
[01:49:32] snath: has joined #ruby
[01:49:47] aberen: has joined #ruby
[01:49:51] Coldblackice: has joined #ruby
[01:51:17] Guest38: has joined #ruby
[01:54:40] jenrzzz: has joined #ruby
[01:54:46] yfeldblum: has joined #ruby
[01:54:52] elifoster: has joined #ruby
[01:55:15] nocco: has joined #ruby
[01:55:58] xall_: has joined #ruby
[01:59:08] araujo_: has joined #ruby
[02:01:15] araujo_: has joined #ruby
[02:01:54] houhoulis: has joined #ruby
[02:04:16] whathappens: has joined #ruby
[02:07:34] tubuliferous_: has joined #ruby
[02:08:44] araujo_: has joined #ruby
[02:10:09] Wolland: has joined #ruby
[02:11:38] Darkman738: hey guys, I'm trying to sterilize input to prevent sql injection on a postgres db. Any suggestions on an easy way to do it? ActiveRecord::Base::sanitize is just quoting the string which is interfering with my query
[02:12:18] Wolland: has joined #ruby
[02:15:50] araujo: has joined #ruby
[02:17:14] noobsu: has joined #ruby
[02:18:04] blockchan: has joined #ruby
[02:19:52] skweek: has joined #ruby
[02:21:12] lopin: has joined #ruby
[02:27:04] tjbiddle: has joined #ruby
[02:29:16] kgrz: darkman738: Better to ask in the #RubyOnRails channel.
[02:29:42] dsea: darkman738, whitelist queries or put an IPS in front
[02:29:44] certainty: has joined #ruby
[02:30:04] nankyokusei: has joined #ruby
[02:30:29] cdg: has joined #ruby
[02:32:39] jackjackdripper: has joined #ruby
[02:33:00] LoneHerm_: has joined #ruby
[02:33:21] mistermocha: has joined #ruby
[02:33:59] ksinkar: has joined #ruby
[02:34:18] jancel: has joined #ruby
[02:37:09] nocco: has joined #ruby
[02:39:22] mistermocha: has joined #ruby
[02:40:02] Maletor: has joined #ruby
[02:41:18] roamingdog: has joined #ruby
[02:45:46] bmorrison: has joined #ruby
[02:46:22] MrBusiness: has joined #ruby
[02:46:45] ensyde__: has joined #ruby
[02:48:05] skweek: has joined #ruby
[02:49:30] arlek: has joined #ruby
[02:50:32] aberen: has joined #ruby
[02:50:47] p337rB: has joined #ruby
[02:51:10] araujo: has joined #ruby
[02:53:23] ElFerna: has joined #ruby
[02:56:12] nando293921: has joined #ruby
[03:00:12] sandstrom: has joined #ruby
[03:02:07] RobertBirnie: has joined #ruby
[03:02:41] roamingdog: has joined #ruby
[03:03:36] amclain: has joined #ruby
[03:04:11] chipotle: has joined #ruby
[03:05:42] jaguarmagenta: has joined #ruby
[03:05:43] Yiota: has joined #ruby
[03:15:45] kraken: has joined #ruby
[03:16:15] krakenr: if I have an array that contains this: #<Person:0x000000020e61e8 @name="bob", @gender="male">
[03:16:18] krakenr: What is that?
[03:16:31] krakenr: is it an object? What does #<foo> signifiy?
[03:17:10] krakenr: nvm I got it :{
[03:18:20] braincrash: has joined #ruby
[03:19:09] Trynemjoel: has joined #ruby
[03:20:55] k3rn31: has joined #ruby
[03:25:52] jancel: has joined #ruby
[03:26:18] MrSamuel: has joined #ruby
[03:26:33] |8|chan: has joined #ruby
[03:26:38] |8|chan: HELLO NIGGERS
[03:27:01] araujo: has joined #ruby
[03:30:29] certainty: has joined #ruby
[03:32:35] mistermocha: has joined #ruby
[03:33:22] Arcaire: Dear diary,
[03:33:30] Arcaire: Today I yelled racist things in a programming language channel.
[03:33:38] Arcaire: It made me feel really good, today was productive!
[03:33:47] Arcaire: /baphomet/
[03:34:13] soLucien: i think it is against freenode's policy
[03:34:27] LoneHermit: has joined #ruby
[03:34:34] mistermocha: has joined #ruby
[03:34:51] Arcaire: It generally appears that people with the disposition to scream such things don't have the comprehension ability to read something as long as Freenode's ToS.
[03:35:00] Arcaire: It is pretty long and convoluted, and it's more than >one greentext
[03:35:06] Arcaire: >meme arrow
[03:35:07] Arcaire: >pepe pointer
[03:35:12] johnDoe111: has joined #ruby
[03:35:26] blackmesa: has joined #ruby
[03:35:43] araujo: has joined #ruby
[03:38:26] baweaver: !troll |8|chan
[03:38:28] ruby[bot]: +bbb $a:|8|chan$#ruby-banned |8|chan!*@*$#ruby-banned *!*@gateway/web/cgi-irc/kiwiirc.com/ip.23.105.140.102$#ruby-banned
[03:38:28] ruby[bot]: ruby[bot] kicked |8|chan: is a bannable offense, see http://ruby-community.com/pages/user_rules
[03:38:34] Arcaire: Why even bother?
[03:38:40] Arcaire: Also, trolling is a bannable offence?
[03:39:11] kareeoleez: has joined #ruby
[03:39:42] kareeoleez: has joined #ruby
[03:39:48] nocco: has joined #ruby
[03:39:57] baweaver: ACTION shrugs
[03:40:20] Arcaire: Build the wall ten feet higher around #ruby.
[03:40:48] k3rn31: has joined #ruby
[03:41:01] RobertBirnie: has joined #ruby
[03:43:34] ramfjord: has joined #ruby
[03:43:35] duncannz: has joined #ruby
[03:45:00] achamian: has joined #ruby
[03:45:04] damncabbage: has joined #ruby
[03:48:06] damncabbage: has left #ruby: ()
[03:48:18] mistermocha: has joined #ruby
[03:48:30] gix: has joined #ruby
[03:49:36] tmtwd: has joined #ruby
[03:50:22] Yiota: has joined #ruby
[03:51:00] bumao: has joined #ruby
[03:51:08] fiifi: has joined #ruby
[03:51:16] aberen: has joined #ruby
[03:54:06] mistermocha: has joined #ruby
[03:54:50] dh64: has joined #ruby
[03:57:12] mistermo_: has joined #ruby
[03:58:09] tildes_: has joined #ruby
[03:58:42] Guest38: has joined #ruby
[04:00:01] mistermocha: has joined #ruby
[04:00:22] lightt: has joined #ruby
[04:02:22] jancel: has joined #ruby
[04:03:13] mistermo_: has joined #ruby
[04:04:43] johnDoe111: has joined #ruby
[04:05:34] hk238: has joined #ruby
[04:07:13] shakedown: has joined #ruby
[04:07:28] devbug: has joined #ruby
[04:15:28] guardianJ: has joined #ruby
[04:15:41] chouhoulis: has joined #ruby
[04:17:50] duncannz: has joined #ruby
[04:18:35] duncannz: has joined #ruby
[04:29:09] bmorrison: has joined #ruby
[04:30:16] kyrose: has joined #ruby
[04:30:56] nankyokusei: has joined #ruby
[04:31:12] certainty: has joined #ruby
[04:32:37] nadir: has joined #ruby
[04:35:40] Respek: has joined #ruby
[04:42:53] govg: has joined #ruby
[04:43:32] blockchan: has joined #ruby
[04:45:04] chipotle_: has joined #ruby
[04:46:54] chipotle: has joined #ruby
[04:48:51] ramfjord: has joined #ruby
[04:51:00] p337rB: has joined #ruby
[04:52:03] aberen: has joined #ruby
[04:53:42] der-landgraf: has joined #ruby
[04:53:58] der-landgraf: has joined #ruby
[04:54:48] arescorpio: has joined #ruby
[04:55:45] tmtwd: has joined #ruby
[04:57:27] truenito: has joined #ruby
[04:57:43] alfiemax: has joined #ruby
[04:58:44] lightt: has joined #ruby
[05:02:09] johnDoe111: has joined #ruby
[05:03:26] etehtsea: has joined #ruby
[05:03:33] SpikeMaster: has joined #ruby
[05:05:30] zapata: has joined #ruby
[05:05:55] SpikeMaster: has left #ruby: ()
[05:06:26] jaguarmagenta: has joined #ruby
[05:06:27] aagdbl: has joined #ruby
[05:07:03] tubuliferous_: has joined #ruby
[05:07:11] craigp: has joined #ruby
[05:07:54] mistermocha: has joined #ruby
[05:08:19] kraken: has joined #ruby
[05:08:54] chopin: has joined #ruby
[05:09:18] krakenr: If I'm loading from a YAML file that contains multiple store objects, and I store YAML::load(yaml_string) in a variable, then that variable is only containing the first object in the yaml file. What am I doing wrong here? Should it contains an array of the objects?
[05:09:58] mistermo_: has joined #ruby
[05:10:25] griffindy: has joined #ruby
[05:11:03] pawnbox: has joined #ruby
[05:12:16] chopin: has joined #ruby
[05:12:39] blackgoat: has joined #ruby
[05:12:53] mistermocha: has joined #ruby
[05:13:35] krakenr: Figured it out, I used YAML.load_stream instead of YAML.load
[05:14:23] Wolland: has joined #ruby
[05:14:52] jenrzzz: has joined #ruby
[05:17:53] harai54: has joined #ruby
[05:18:07] Macaveli: has joined #ruby
[05:18:42] Macaveli: has joined #ruby
[05:18:44] alfiemax: has joined #ruby
[05:19:45] mistermocha: has joined #ruby
[05:19:52] JesseH: has joined #ruby
[05:21:15] nocco: has joined #ruby
[05:21:45] mistermocha: has joined #ruby
[05:24:01] jmhmccr: has joined #ruby
[05:24:11] hayden__: has joined #ruby
[05:24:20] tax: has joined #ruby
[05:24:43] mistermocha: has joined #ruby
[05:24:55] pawnbox: has joined #ruby
[05:25:14] kapowaz: has joined #ruby
[05:26:05] djbkd: has joined #ruby
[05:26:40] mistermocha: has joined #ruby
[05:26:56] kireevco: has joined #ruby
[05:26:56] daxroc: has joined #ruby
[05:27:02] zzak___: has joined #ruby
[05:27:08] vikid: has joined #ruby
[05:27:08] daemonwrangler: has joined #ruby
[05:27:10] LinuxHippie: has joined #ruby
[05:27:16] mroth: has joined #ruby
[05:27:16] adamf: has joined #ruby
[05:27:18] bove: has joined #ruby
[05:27:26] knowtheory: has joined #ruby
[05:27:28] ijij_: has joined #ruby
[05:27:28] HashNuke__: has joined #ruby
[05:27:33] olivierjanss: has joined #ruby
[05:27:34] Lloyd: has joined #ruby
[05:27:35] twodayslate: has joined #ruby
[05:28:37] mistermocha: has joined #ruby
[05:28:44] frode15243: has joined #ruby
[05:28:57] tfitts: has joined #ruby
[05:29:08] Eleeleth: has joined #ruby
[05:29:10] alxndr: has joined #ruby
[05:29:12] bcavileer: has joined #ruby
[05:29:14] sauvin: has joined #ruby
[05:29:18] jxf: has joined #ruby
[05:29:24] rfv: has joined #ruby
[05:29:25] meinside: has joined #ruby
[05:29:29] boxrick1: has joined #ruby
[05:29:37] dmnd: has joined #ruby
[05:29:47] err_ok: has joined #ruby
[05:29:48] incomprehensibly: has joined #ruby
[05:30:05] mtkd: has joined #ruby
[05:30:05] flyinprogrammer: has joined #ruby
[05:30:06] braderhart: has joined #ruby
[05:30:13] Hates_: has joined #ruby
[05:30:13] angiebadillo: has joined #ruby
[05:30:18] im0b: has joined #ruby
[05:30:26] andersh: has joined #ruby
[05:30:54] bttf: has joined #ruby
[05:30:55] Travis-42: has joined #ruby
[05:31:01] imanc: has joined #ruby
[05:31:13] nyandoge: has joined #ruby
[05:31:23] podman: has joined #ruby
[05:31:24] jmcc___________: has joined #ruby
[05:31:25] deepak_: has joined #ruby
[05:31:34] mistermo_: has joined #ruby
[05:31:36] kdisneur: has joined #ruby
[05:31:37] ELCALOR: has joined #ruby
[05:31:38] mjc_: has joined #ruby
[05:31:40] jimeh: has joined #ruby
[05:31:40] tonini: has joined #ruby
[05:31:45] avdi: has joined #ruby
[05:31:45] adambeynon: has joined #ruby
[05:31:45] mrfooo: has joined #ruby
[05:32:09] zipkid: has joined #ruby
[05:32:11] jord: has joined #ruby
[05:32:17] vcoinminer: has joined #ruby
[05:32:19] caw: has joined #ruby
[05:32:20] sauvin: has joined #ruby
[05:32:21] rflot: has joined #ruby
[05:32:23] lancetw: has joined #ruby
[05:32:23] colstrom: has joined #ruby
[05:32:24] mitsuhiko: has joined #ruby
[05:32:24] deeprave: has joined #ruby
[05:32:25] grvgr: has joined #ruby
[05:32:29] digitalfiz: has joined #ruby
[05:32:32] chorgi: has joined #ruby
[05:32:32] swgillespie: has joined #ruby
[05:32:36] DukeDave: has joined #ruby
[05:32:48] gmci: has joined #ruby
[05:32:49] acerna: has joined #ruby
[05:32:50] the-eat-scout: has joined #ruby
[05:32:51] cbetta: has joined #ruby
[05:33:08] shadowshell: has joined #ruby
[05:33:29] siovene: has joined #ruby
[05:33:29] chrisseaton: has joined #ruby
[05:33:29] codepete: has joined #ruby
[05:33:43] deimos__: has joined #ruby
[05:33:54] skmp: has joined #ruby
[05:34:01] lipoqil: has joined #ruby
[05:34:01] acalewin: has joined #ruby
[05:34:03] davidmichaelkarr: has joined #ruby
[05:34:05] jpinnix_______: has joined #ruby
[05:34:09] troter__________: has joined #ruby
[05:34:10] shelling__: has joined #ruby
[05:34:12] cstrahan: has joined #ruby
[05:34:12] ckrailo: has joined #ruby
[05:34:15] jabreity__: has joined #ruby
[05:34:15] joaomdmoura__: has joined #ruby
[05:34:20] machty: has joined #ruby
[05:34:36] AdamMeghji__: has joined #ruby
[05:34:42] manveru: has joined #ruby
[05:34:42] halfdan: has joined #ruby
[05:34:42] Guest4184_______: has joined #ruby
[05:34:45] bedouin: has joined #ruby
[05:34:50] JackMc: has joined #ruby
[05:35:06] bestie: has joined #ruby
[05:35:06] cardoni: has joined #ruby
[05:35:10] spastorino: has joined #ruby
[05:35:19] ramblinpeck: has joined #ruby
[05:35:25] akitada: has joined #ruby
[05:35:54] zrl_: has joined #ruby
[05:37:02] jlyndon: has joined #ruby
[05:37:13] mistermocha: has joined #ruby
[05:37:15] andywojo: has joined #ruby
[05:37:26] pmarreck: has joined #ruby
[05:37:33] zero7: has joined #ruby
[05:37:37] Meow-J: has joined #ruby
[05:37:40] yo61: has joined #ruby
[05:37:40] jackjackdripper: has joined #ruby
[05:37:57] blackmesa: has joined #ruby
[05:39:01] ggherdov: has joined #ruby
[05:39:22] mistermo_: has joined #ruby
[05:39:23] etehtsea: has joined #ruby
[05:40:31] Maletor: has joined #ruby
[05:40:54] etehtsea: has joined #ruby
[05:41:19] Ishido: has joined #ruby
[05:42:15] bmorrison: has joined #ruby
[05:42:22] mistermocha: has joined #ruby
[05:43:02] nano-: has joined #ruby
[05:46:21] mistermocha: has joined #ruby
[05:48:18] mistermo_: has joined #ruby
[05:49:50] jaguarmagenta: has joined #ruby
[05:52:46] aberen: has joined #ruby
[05:53:29] johnDoe111^: has joined #ruby
[05:55:00] last_staff: has joined #ruby
[05:55:11] kareeoleez: has joined #ruby
[05:56:03] mistermo_: has joined #ruby
[05:57:03] blingrang: Why can I do this-> h = {'0'=>'test'}.to_json then print h
[05:57:21] blingrang: but not print {'0'=>'test'}.to_json directly
[05:57:24] jas02: has joined #ruby
[05:58:09] mistermocha: has joined #ruby
[05:59:33] al2o3-cr: blingrang: use perentheses
[05:59:58] nocco: Anyone that has knowledge working with ruby and automator service on mac? I have some problems with the require method. :/
[06:00:20] kareeoleez: has joined #ruby
[06:00:39] MrSamuel: has joined #ruby
[06:00:46] jackjackdripper1: has joined #ruby
[06:00:51] neanderslob: has joined #ruby
[06:02:05] emilkarl: has joined #ruby
[06:02:16] blingrang: al2o3-cr: got it, thanks.
[06:02:19] firstdayonthejob: has joined #ruby
[06:03:27] edwardly: has joined #ruby
[06:04:09] edwardly: has joined #ruby
[06:07:24] al2o3-cr: blingrang: You can also use Kernel#j for printing objects as json strings
[06:07:48] tubuliferous_: has joined #ruby
[06:09:11] n1x-nz: has joined #ruby
[06:09:18] fenre: has joined #ruby
[06:09:43] skade: has joined #ruby
[06:10:07] Wolland: has joined #ruby
[06:10:37] pmarreck: has joined #ruby
[06:10:43] Meow-J: has joined #ruby
[06:11:13] jlyndon: has joined #ruby
[06:12:13] andywojo: has joined #ruby
[06:12:22] ramblinpeck: has joined #ruby
[06:12:43] certainty: has joined #ruby
[06:12:52] blingrang: al2o3-cr: I can't seem to find any 'j' function in the docs under kernel
[06:14:11] al2o3-cr: It adds it to Kernel when you require 'json'
[06:14:33] johnDoe111^: has joined #ruby
[06:14:53] Wolland: has joined #ruby
[06:15:18] al2o3-cr: >> require 'json'; j('0' => "test")
[06:15:19] ruby[bot]: al2o3-cr: # => {"0":"test"} ...check link for more (https://eval.in/585814)
[06:15:52] nocco: has joined #ruby
[06:16:21] al2o3-cr: or jj for a beautiful output :)
[06:16:45] RobertBirnie: has joined #ruby
[06:17:47] bier: has joined #ruby
[06:18:19] blingrang: perfect thanks.
[06:21:42] etehtsea: has joined #ruby
[06:22:08] tAn: has joined #ruby
[06:24:15] tmtwd: has joined #ruby
[06:24:34] LoneHerm_: has joined #ruby
[06:24:59] djbkd: has joined #ruby
[06:26:23] eGGshke: has joined #ruby
[06:30:32] fenre: has joined #ruby
[06:30:51] lxsameer: has joined #ruby
[06:31:51] nankyokusei: has joined #ruby
[06:32:14] nano-: has joined #ruby
[06:32:28] codecop: has joined #ruby
[06:36:27] araujo_: has joined #ruby
[06:40:24] blaxter: has joined #ruby
[06:41:55] dionysus69: has joined #ruby
[06:43:15] sandstrom: has joined #ruby
[06:43:22] RazorX: has joined #ruby
[06:43:41] darkxploit: has joined #ruby
[06:44:44] giz|work: has joined #ruby
[06:45:24] nocco: has joined #ruby
[06:46:21] solars: has joined #ruby
[06:46:24] jennings: has joined #ruby
[06:46:30] johnDoe111: has joined #ruby
[06:46:30] kraken: has joined #ruby
[06:46:51] krakenr: What does :: mean? For instance in Net::HTTP.start
[06:47:13] tubuliferous_: has joined #ruby
[06:48:52] al2o3-cr: kraken_: it's the constant/namespace/scope resolution operator
[06:50:38] krakenr: al2o3-cr, so it's accessing the HTTP constant in the Net class?
[06:51:03] al2o3-cr: In the Net Module, yes
[06:51:08] p337rB: has joined #ruby
[06:51:40] sameerynho: has joined #ruby
[06:51:47] anisha: has joined #ruby
[06:53:15] LaT0rtue: has joined #ruby
[06:53:32] aberen: has joined #ruby
[06:54:45] kareeole_: has joined #ruby
[06:55:19] agit0: has joined #ruby
[06:57:06] andikr: has joined #ruby
[06:57:07] djbkd: has joined #ruby
[06:57:45] nadir: has joined #ruby
[06:58:21] chipotle_: has joined #ruby
[07:00:30] tubuliferous_: has joined #ruby
[07:02:47] emilkarl: has joined #ruby
[07:03:42] noobsu: has joined #ruby
[07:04:04] psmolen: has joined #ruby
[07:04:38] chipotle: has joined #ruby
[07:04:58] RazorX: has joined #ruby
[07:05:10] harai54: has joined #ruby
[07:05:20] Wolland: has joined #ruby
[07:06:07] RazorX: has joined #ruby
[07:06:37] raeoks: has joined #ruby
[07:07:50] RazorX: has joined #ruby
[07:08:51] edward__: has joined #ruby
[07:09:23] bmorrison: has joined #ruby
[07:10:25] ur5us: has joined #ruby
[07:10:26] yfeldblum: has joined #ruby
[07:11:12] TomyWork: has joined #ruby
[07:13:02] haxrbyte: has joined #ruby
[07:13:09] bnjf: has joined #ruby
[07:14:07] yfeldblum: has joined #ruby
[07:14:33] biberu: has joined #ruby
[07:14:59] RazorX: has joined #ruby
[07:15:19] moei: has joined #ruby
[07:16:13] RazorX: has joined #ruby
[07:18:04] aganov: has joined #ruby
[07:18:58] certainty: has joined #ruby
[07:21:31] hightower2: has joined #ruby
[07:21:45] c0mrad3: has joined #ruby
[07:21:55] jackjackdripper: has joined #ruby
[07:24:07] solocshaw: has joined #ruby
[07:26:07] LoneHerm_: has joined #ruby
[07:26:26] madgen: has joined #ruby
[07:27:57] PeteyT: has joined #ruby
[07:28:02] sandstrom: has joined #ruby
[07:28:28] pierrehoudyer: has joined #ruby
[07:29:44] pmyjavec: has joined #ruby
[07:30:05] ptierno: has joined #ruby
[07:31:06] chipotle: has joined #ruby
[07:32:29] certainty: has joined #ruby
[07:36:22] aberen: has joined #ruby
[07:36:42] al2o3-cr: has joined #ruby
[07:37:24] flughafen_: has joined #ruby
[07:37:37] mikecmpbll: has joined #ruby
[07:38:36] MrBusiness2: has joined #ruby
[07:38:43] blackmesa: has joined #ruby
[07:40:02] MrBusiness3: has joined #ruby
[07:45:13] ishe_ua: has joined #ruby
[07:45:15] jaruga___: has joined #ruby
[07:46:29] spyder55: has joined #ruby
[07:47:09] spyder55: has joined #ruby
[07:47:29] antgel: has joined #ruby
[07:48:17] araujo__: has joined #ruby
[07:52:01] alfiemax: has joined #ruby
[07:53:54] troulouliou_div2: has joined #ruby
[07:53:58] troulouliou_div2: has joined #ruby
[07:54:07] kareeoleez: has joined #ruby
[07:55:35] Polysics: has joined #ruby
[07:56:43] certainty: has joined #ruby
[07:56:48] Polysics: hello! weird thing going on here
[07:57:04] Polysics: I have installed nio4r with some cflags, with the correct version that is in my Gemfile
[07:57:24] Polysics: yet bundle install fails, because it fails at compiling the gem native extensions
[07:57:31] agent_white: has joined #ruby
[07:57:35] Polysics: it makes no sense that it is trying to reinstall it
[07:57:57] Polysics: oh nvm, vendored gems
[07:58:21] Polysics: brain fart :)
[07:58:56] phrozen77: has joined #ruby
[07:59:29] mikecmpbll: has joined #ruby
[08:02:32] tubuliferous_: has joined #ruby
[08:03:41] achamian: has joined #ruby
[08:04:44] joonty: has joined #ruby
[08:05:35] giz|work: has joined #ruby
[08:09:55] blockchan: has joined #ruby
[08:11:05] binaryplease1: has joined #ruby
[08:11:39] Couch: has joined #ruby
[08:15:31] chussenot: has joined #ruby
[08:17:03] marr: has joined #ruby
[08:20:20] kareeoleez: has joined #ruby
[08:20:44] aswen: has joined #ruby
[08:24:59] nocco: has joined #ruby
[08:25:05] mdw: has joined #ruby
[08:25:22] pandaant: has joined #ruby
[08:27:09] craigp: has joined #ruby
[08:29:41] yatish27: has joined #ruby
[08:30:07] ur5us: has joined #ruby
[08:31:09] blackmesa: has joined #ruby
[08:31:19] flughafen_: has joined #ruby
[08:32:39] nankyokusei: has joined #ruby
[08:35:54] diegoaguilar: has joined #ruby
[08:37:28] ksinkar`: has joined #ruby
[08:37:37] senayar: has joined #ruby
[08:37:38] senayar: has joined #ruby
[08:39:07] spyder55: has joined #ruby
[08:41:04] soc42: has joined #ruby
[08:43:08] edwinvdgraaf: has joined #ruby
[08:46:36] ksinkar``: has joined #ruby
[08:48:03] kareeoleez: has joined #ruby
[08:48:17] bnjf: has joined #ruby
[08:53:23] kareeole_: has joined #ruby
[08:53:26] tAn: has joined #ruby
[08:54:19] moeabdol: has joined #ruby
[08:55:07] ocbtec: has joined #ruby
[08:55:11] govg: has joined #ruby
[08:55:14] dumdedum: has joined #ruby
[08:56:32] govg: has joined #ruby
[08:57:45] RyanMcCoskrie: has joined #ruby
[08:58:07] edwinvdgraaf: has joined #ruby
[08:58:20] RyanMcCoskrie: has left #ruby: ()
[08:59:04] bruce_lee: has joined #ruby
[08:59:30] lightt: has joined #ruby
[09:02:34] dionysus69: has joined #ruby
[09:02:46] mark_66: has joined #ruby
[09:03:04] araujo: has joined #ruby
[09:03:31] skade: has joined #ruby
[09:03:33] tubuliferous_: has joined #ruby
[09:03:54] araujo: has joined #ruby
[09:04:12] Polysics_: has joined #ruby
[09:06:31] edwinvdgraaf: has joined #ruby
[09:07:06] howdoi: has joined #ruby
[09:07:18] johnDoe111: has joined #ruby
[09:07:34] salexa: has joined #ruby
[09:08:04] MrBusiness2: has joined #ruby
[09:11:18] mdw7: has joined #ruby
[09:13:19] LoneHermit: has joined #ruby
[09:13:20] vasilakisFiL: has joined #ruby
[09:13:40] vasilakisFiL: "When you buy Sidekiq Pro, a custom URL associated with your email address will be sent to you. You add this URL to your Gemfile and everything else is seamless"
[09:13:50] vasilakisFiL: how can I do the same with my gem?\
[09:13:53] vasilakisFiL: is there a service for that ?
[09:14:09] jackjackdripper: has joined #ruby
[09:15:14] nocco: has joined #ruby
[09:16:09] urtokk: has joined #ruby
[09:17:47] chipotle: has joined #ruby
[09:17:47] emilkarl_: has joined #ruby
[09:18:35] ocbtec: has joined #ruby
[09:21:06] yopp: has joined #ruby
[09:22:00] skade: has joined #ruby
[09:22:06] yopp: has left #ruby: ("woop-woop-woop")
[09:22:33] c355E3B: has joined #ruby
[09:22:53] edwinvdg_: has joined #ruby
[09:23:38] Polysics: has joined #ruby
[09:24:51] ruby773: has joined #ruby
[09:25:38] diegoaguilar: has joined #ruby
[09:28:34] workmad3: has joined #ruby
[09:29:32] cunctat0r: has joined #ruby
[09:31:35] jhass: vasilakisfil: mike recently wrote up how he does it
[09:31:47] jhass: http://www.mikeperham.com/2016/05/17/commercial-gems/
[09:31:49] triangles2: has joined #ruby
[09:31:59] bnjf: has joined #ruby
[09:32:50] tAn: has joined #ruby
[09:33:41] tubuliferous_: has joined #ruby
[09:36:02] Polysics: has joined #ruby
[09:37:13] snowy: has joined #ruby
[09:38:06] joonty: has joined #ruby
[09:38:12] haxrbyte: has joined #ruby
[09:40:15] qba73: has joined #ruby
[09:40:17] sepp2k: has joined #ruby
[09:41:52] haxrbyte: has joined #ruby
[09:42:16] johnDoe111: has joined #ruby
[09:43:23] araujo: has joined #ruby
[09:43:25] alfiemax: has joined #ruby
[09:43:54] toretore: has joined #ruby
[09:46:28] Mia: has joined #ruby
[09:46:28] Mia: has joined #ruby
[09:47:42] nirix: has left #ruby: ("Textual IRC Client: www.textualapp.com")
[09:49:01] Polysics: has joined #ruby
[09:51:27] tjbiddle: has joined #ruby
[09:56:27] lopezcryto_: has joined #ruby
[10:01:37] achamian_: has joined #ruby
[10:03:08] Macaveli: has joined #ruby
[10:04:21] tubuliferous_: has joined #ruby
[10:04:22] pawnbox_: has joined #ruby
[10:05:16] mistermocha: has joined #ruby
[10:05:30] tvw: has joined #ruby
[10:06:30] blockchan: has joined #ruby
[10:08:30] thorgi: has joined #ruby
[10:08:45] nocco: has joined #ruby
[10:12:00] ferr1: has joined #ruby
[10:12:06] RobertBirnie: has joined #ruby
[10:12:13] dionysus69: has joined #ruby
[10:15:38] edwinvdgraaf: has joined #ruby
[10:15:59] jaruga___: has joined #ruby
[10:16:04] axxyhtrx: has joined #ruby
[10:17:31] edwinvdg_: has joined #ruby
[10:18:39] achamian: has joined #ruby
[10:18:43] pawnbox: has joined #ruby
[10:19:11] ruby173: has joined #ruby
[10:19:40] agit0: has joined #ruby
[10:19:53] ruby480: has joined #ruby
[10:22:00] bruce_lee: no! it's 7!
[10:22:08] bruce_lee: btw. \(^_^)/ @all
[10:22:25] mdw: has joined #ruby
[10:22:41] rubyhatesme: has joined #ruby
[10:23:22] bruce_lee: sorry, I was wrong
[10:23:33] bruce_lee: now I think it's 13!
[10:23:38] rubyhatesme: hi, does anyone have any experience with mandrill?
[10:24:13] shevy: the monkeys?
[10:24:23] jrafanie: has joined #ruby
[10:27:32] Diverdude: has joined #ruby
[10:27:52] Diverdude: Hi there, if i want to install this gem: https://github.com/seamusabshere/mysql2xxxx what would be the easiest way to do it? I am on ubuntu
[10:28:43] hk238|2: has joined #ruby
[10:31:02] Kedare: has joined #ruby
[10:31:04] the_drow: has joined #ruby
[10:31:39] Hanmac: diverdude: if you installed the ruby devs already or build ruby yourself otherwise i would recommend you install "apt-get build-dep ruby2.3" first ... that does have other stuff you might need to build
[10:32:18] Diverdude: hanmac, i body installed ruby and ruby-dev from repo
[10:32:27] bruce_lee: diverdude: I'm relatively new to ruby, according to: http://stackoverflow.com/questions/2577346/how-to-install-gem-from-github-source
[10:32:31] mostlybadfly: has joined #ruby
[10:32:34] bruce_lee: gem 'redcarpet', :git => 'git://github.com/tanoku/redcarpet.git'
[10:32:58] Hanmac: diverdude: then you need the dev packages from mysql for the dependencies
[10:33:34] nankyokusei: has joined #ruby
[10:33:59] Diverdude: hanmac, mmm ok you write ruby v2.3.... the version from repo seems to be 1.9.3p484...i guess that version is ok as well?
[10:34:08] Diverdude: hanmac, mmm ok you write ruby v2.3.... the version from repo seems to be 1.9.3p484...i guess that version is ok as well?
[10:34:33] Hanmac: diverdude: hm yeah that should be okay too (i prefer newest ruby but you shouldnt have a problem)
[10:34:52] Diverdude: hanmac, allright...ill just go apt-get build-dep ruby then?
[10:35:41] jhass: diverdude: you shouldn't need to, tried a plain gem install mysql2xxxxx yet?
[10:35:55] Diverdude: jhass, no didnt try that..moment ill try it
[10:36:01] Hanmac: for mysql you need stuff like libmysqlclient-dev too
[10:36:36] Diverdude: jhass, hmm ERROR: Could not find a valid gem 'mysql2xxxxx' (>= 0) in any repository
[10:36:46] emilkarl: has joined #ruby
[10:37:10] jhass: https://rubygems.org/gems/mysql2xxxx wrong amount of x?
[10:38:06] Diverdude: jhass, ahhh hmmm that might actually work
[10:38:13] Diverdude: it did stuff :D
[10:39:18] hk238: has joined #ruby
[10:39:46] Diverdude: jhass, hmm according to https://github.com/seamusabshere/mysql2xxxx that should have eg. mysql2json binary. Shouldnt that then be available in the commandline now?
[10:40:48] moeabdol: has joined #ruby
[10:41:23] bruce_lee: is there something like "apt-cache search" or "yum list" for ruby-gems?
[10:41:28] Diverdude: jhass, any idea how i can verify if it was installed properly?
[10:41:58] workmad3: bruce_lee: you mean like `gem list -r <search string>`?
[10:42:19] jhass: diverdude: still have the full output of the install command? -> gist it
[10:42:33] Diverdude: jhass, sure do..moment
[10:42:40] bruce_lee: workmad3: does this list gems that are not yet installed too?
[10:42:55] jhass: ?try bruce_lee
[10:42:55] ruby[bot]: bruce_lee: Why don't you try it and see for yourself?
[10:43:40] Diverdude: jhass, here it is: http://paste.ubuntu.com/17140706/
[10:43:56] jhass: diverdude: well that's a failure output
[10:44:17] Diverdude: i need some dependencies?
[10:44:23] jhass: you're missing libmysqlclient-dev (or libmariadbclient-dev or whatever)
[10:45:30] Diverdude: now it works :D
[10:45:34] Diverdude: at least its installed hehe
[10:49:05] jnoob22: trying to learn oop in ruby, but I'm not doing something right -> http://paste.ofcode.org/4KpupLL8sPVVcZ5gECUiXb ... a downstream class that I'm not even using just yet is setting values to variables in other class... surely I'm missing the point.
[10:49:23] rany: has joined #ruby
[10:49:35] rany: pastie: hi!
[10:49:40] blackmesa: has joined #ruby
[10:50:02] jhass: jnoob22: don't. use. class. variables.
[10:50:12] rany: pastie: 123qweasdzxcvfrtgbnhyujm,kiool./;p[']
[10:50:18] jnoob22: then how do you access them jhass ?
[10:50:33] jnoob22: class. variables. :-)
[10:50:45] jhass: well that shouldn't be an issue if you don't use them ;)
[10:50:50] rany: has left #ruby: ("Leaving")
[10:50:50] jnoob22: why not use them?
[10:51:01] jhass: because of their terrible scoping rules you just discovered
[10:51:13] edwinvdgraaf: has joined #ruby
[10:51:15] jhass: you likely want instance variables here
[10:51:27] jhass: btw you don't need to "declare" anything
[10:51:32] jnoob22: ok... how do i do that in this case?
[10:51:45] spikeheadon: has joined #ruby
[10:51:50] spikey: has joined #ruby
[10:52:12] jnoob22: ive read about instance variables and class variables in ruby docs but im missing something it seems. This can be done easily in Python or Java
[10:53:40] toretore: jnoob22: don't. use. class. variables.
[10:53:42] jhass: jnoob22: class variables are more like static attributes in Java, only worse
[10:53:46] jnoob22: this makes ruby extremely limited.
[10:53:58] jnoob22: based on what you've told me.
[10:54:04] etehtsea: has joined #ruby
[10:54:06] toretore: no, you just don't know how to use it
[10:54:14] jnoob22: how do i use them in this case?
[10:54:34] jhass: jnoob22: give me a minute, it's quite some code to change
[10:54:47] jnoob22: i got this from ruby docs
[10:55:00] jhass: not like that, no
[10:55:01] toretore: jnoob22: you're thinking in terms of "fields" or "attributes", which ruby doesn't have
[10:55:33] jnoob22: ok, i have to believe there's more to it then
[10:56:12] johnDoe111: has joined #ruby
[10:56:22] jnoob22: ive been programming for close to 20 years and have never heard of that for any oop capable language. Now I'm intrigued :-)
[10:56:44] moeabdol: has joined #ruby
[10:57:04] pmyjavec: When making your own exception classes is it common place to define 'message'?
[10:57:05] jhass: jnoob22: https://p.jhass.eu/2q.rb
[10:57:46] shevy: pmyjavec I'd say it is less common
[10:57:51] gnufied: has joined #ruby
[10:58:00] jhass: pmyjavec: I wouldn't say there's a general rule, it depends whether a default message makes sense or the caller should always give it, or whether prepending something to a callers message makes sense
[10:58:01] shevy: about 90% of the definitions I see are like: class Foo < Exception; end and that's about it usually
[10:58:16] jnoob22: jhass, thanks... going over it ...
[10:58:27] toretore: not < Exception i hope ..
[10:58:30] pmyjavec: ok, I'll show you why I hate having to specify it ;)...
[10:58:35] jnoob22: I see attr_reader and super ... super I can figure out ... but attr_reader ?
[10:58:51] etehtsea: has joined #ruby
[10:59:00] jhass: jnoob22: just a method http://devdocs.io/ruby~2.3/module#method-i-attr_reader
[10:59:06] jhass: defines the getter for you
[10:59:08] yqt: has joined #ruby
[10:59:16] pmyjavec: Well I don't hate it, but yeah
[10:59:31] jnoob22: jhass, ok, cool .... thanks for pointing this out to me :-)
[11:00:15] jnoob22: jhass, I'm assuming super in this context means 'override' perhaps?
[11:00:19] pmyjavec: http://pastebin.com/xb1yUuDE, my code looks messy
[11:00:20] ruby[bot]: pmyjavec: we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/3e5c1b838cdf0feae14c6d673696ee88
[11:00:20] ruby[bot]: pmyjavec: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[11:00:35] Diverdude: is it possible to open an interactive ruby session?
[11:00:40] workmad3: jnoob22: btw, you've got a fact wrong - `@lays_eggs = false` is not true in general for Mammal ;)
[11:00:49] jhass: jnoob22: initialize is just a regular method called by new on the fresh object, super simply calls the parent method
[11:00:51] jnoob22: diverdude, irb you're looking for?
[11:00:55] jhass: ?pry diverdude
[11:00:55] ruby[bot]: diverdude: Pry, the better IRB, provides easy object inspection `ls`, `history`, viewing docs `?`, viewing source `$`, syntax highlighting and other features (see `help` for more). Put `binding.pry` in your source code for easy debugging. Install Pry (https://pryrepl.org/): gem install pry pry-doc
[11:00:58] jnoob22: jhass, ah got it
[11:01:01] pmyjavec: I think the way I'm doing validations is the problem to be honest
[11:01:03] jnoob22: workmad3, yep true :-)
[11:01:13] pmyjavec: what do people think ?
[11:01:14] workmad3: jnoob22: gotta love those annoying monotremes, right?
[11:01:19] mdw: has joined #ruby
[11:01:26] jnoob22: workmad3, true that.
[11:01:27] jhass: jnoob22: and super without arguments passes the exact arguments present in the current method to it
[11:01:54] jnoob22: jhass, ok, cool I'll read up on that. Thanks so much for pointing me in the right direction
[11:02:04] workmad3: jhass: `super` passes exact arguments, `super()` passes no arguments... (thanks for that, ruby :/ )
[11:02:21] adaedra: this one is a bit stupid, yeah
[11:02:22] jhass: jnoob22: another thing to realize is that classes are just instances/objects too (of class Class), so if you need "per class attributes/static attributes" simply use instance variables at the class level
[11:02:39] jhass: workmad3: I know, didn't want to complicated right now :/
[11:02:45] jhass: *to get too
[11:02:45] jnoob22: will do ... will stay away from @@ stuff
[11:03:01] toretore: yes, no use @@
[11:03:09] Diverdude: ahh nice...so inside irb when i write a = Mysql2xxxx::JSON.new :user => 'dbuser', :password => 'dbpassword', :database => 'dbname', :execute => "select * from automobile_makes" i get: "uninitialized constant Mysql2xxxx". Do i somehow need to import that first?
[11:03:33] etehtsea: has joined #ruby
[11:03:36] workmad3: jhass: I know... but saying `super without arguments` would lead very quickly to attempting `super()` if someone happened to like explicit parens (such as from a java background) and then their code breaks :)
[11:03:37] jhass: jnoob22: though IME 90% of all @@ or class level @ uses in Ruby would be just fine or better off using just a CONSTANT
[11:04:02] jnoob22: makes sense now that I see the light a little better ;-)
[11:04:28] moeabdol: has joined #ruby
[11:04:53] johnmilton: has joined #ruby
[11:05:09] joonty: has joined #ruby
[11:05:55] jnoob22: this still was a lot easier than putting the same thing together for Java.
[11:06:03] aries_liuxueyang: has joined #ruby
[11:06:13] etehtsea: has joined #ruby
[11:06:26] jnoob22: the only thing going for me is that I understand Java errors a lot better at this point and know how to make it behave.
[11:06:39] Xentil: has joined #ruby
[11:06:55] Vingador: has joined #ruby
[11:07:34] skade: has joined #ruby
[11:07:57] workmad3: jnoob22: I hate java errors... they're not quite as bad as C++ errors, but they're still pretty nasty (especially if they're generated inside a framework like spring)
[11:08:09] johnDoe111: has joined #ruby
[11:08:29] nocco: has joined #ruby
[11:08:37] jhass: ACTION goes with Crystal errors :P
[11:08:37] jnoob22: oh Lord, yes workmad3 ... I work with that everyday ... doing support for Alfresco
[11:08:44] workmad3: "Here's 2000 lines of stack trace caused by a NullPointerException that's wrapping 5 other exceptions up, and the error you're looking for is nothing to do with any of this"
[11:08:45] jancel: has joined #ruby
[11:09:02] jnoob22: and it's such a pain to hook up and debug.
[11:09:17] workmad3: I think I spent 2 days tracking one of those down... and it was because I had the same library loaded in both the jar and in the container :(
[11:10:12] jnoob22: heh heh dont you love non-obvious error messages? heh Java is full of them. At least with Python, Ruby and PHP I can narrow it down (assuming i know what it means)
[11:10:32] jnoob22: a NPE almost never leads to any useful info.
[11:10:49] ddv: for java you need to set your display in potrait mode
[11:12:01] jhass: pmyjavec: I guess the question is whether you actually need that many and specific exception classes, or if they don't get redundant to their message. The question to ask yourself is: which will be rescued by the caller _and_ handled differently?
[11:12:09] elomatreb: jnoob22: You're right, 'undefined method "something" for nil:NilClass' is so much more helpful :P
[11:12:13] jnoob22: well java's good for some things.... you have an obsessive disorder and love extreme organizing.... you cannot stand dynamic programming and like everything defined all the way down without allowances for anything outside the box...
[11:12:13] davedev24: has joined #ruby
[11:12:46] jnoob22: elomatreb, actually if i would have understood the instance vars better, that would have made sense. But nothing's perfect I guess ;-)
[11:13:09] pmyjavec: jhass, yes, now I've completed the task at hand and had time to look at it again, I think I could just change the way my methods return things
[11:13:13] jmignault: has joined #ruby
[11:13:19] jaguarma_: has joined #ruby
[11:13:24] jnoob22: ... on the java note .... you still think XML files are the best at describing a data structure.
[11:13:31] pmyjavec: Probably just raising too often and unnecessarily
[11:14:02] elomatreb: jnoob22: What are your alternatives if you need more complex structures than JSON offers? YAML isn't much better than XML
[11:14:10] moos3: has joined #ruby
[11:14:12] Vingador: has joined #ruby
[11:14:21] rodfersou: has joined #ruby
[11:14:25] jnoob22: elomatreb, you're messing up my rant. stop it.
[11:14:32] pmyjavec: I think i've been programming too much towards and implementation if I'm honest
[11:14:58] ddv: JSON = XML with curly braces
[11:15:02] pmyjavec: most methods are turning something useless and uninformative
[11:15:34] adaedra: ddv: far from it, actually
[11:15:35] jnoob22: ddv elomatreb at least with json/dicts you are not having to define/describe what those curly braces and brackets mean ;-)
[11:15:35] davedev24: has joined #ruby
[11:15:42] elomatreb: ddv: At least there are no external entities or references in JSON, making it much safer
[11:15:47] ddv: I was trolling :-)
[11:16:09] adaedra: ddv: if you dig that, you can do JSONx though.
[11:16:25] pawnbox: has joined #ruby
[11:16:27] jhass: ACTION actually likes JSON schema
[11:16:46] Vingador: has joined #ruby
[11:16:53] elomatreb: adaedra: That's one of those technologies that *had* to come from IBM
[11:17:10] evidex: has joined #ruby
[11:19:54] axxyhtrx: has joined #ruby
[11:20:35] phredus: has joined #ruby
[11:20:39] Diverdude: ahhh so the mysql2xxx library i am trying to user cannot log in..it keeps getting access denied even though i know for 100% certainty that i supply the correct credentials...but it also spits out a warning: "iconv will be deprecated in the future, use String#encode instead." Might it be because this library has not been updated in a while that it encodes characters wrong and thus cannot log in?
[11:21:11] jhass: I doubt it tbh
[11:21:23] k3rn31: has joined #ruby
[11:21:35] jhass: I mean your username and password is probably all ASCII anyway?
[11:22:37] elomatreb: You mean I shouldn't put emoji in my database passphrase?
[11:23:05] jhass: most of the time it's stuff like your user only being allowed to login via localhost and then your DB and your client disagree whether localhost is 127.0.0.1, ::1 or either of your local interface addresses
[11:23:16] jhass: elomatreb: I mean you absolutely should
[11:23:25] jhass: just that it's unlikely you did
[11:23:44] elomatreb: :key emoji: is going to be my password now :P
[11:23:58] Diverdude: jhass, yes it is
[11:24:05] jhass: elomatreb: that's still ascii :(
[11:24:28] Diverdude: jhass, but i log in via ssh and specify host to by localhost
[11:24:37] Diverdude: jhass, and still i get access denied
[11:24:45] jhass: mysql is picky about that stuff
[11:24:51] elomatreb: jhass: I really don't trust my hacked-together ZNC to make emoji work on IRC, that's why I typed that like that
[11:24:58] Diverdude: jhass, ok...any way around it?
[11:25:04] jhass: diverdude: regular mysql cli works?
[11:25:35] lightt: has joined #ruby
[11:26:19] jhass: tried an explicit -h localhost ?
[11:27:03] Diverdude: jhass, yes if i do that i get access denied and if i try 127.0.0.1 then i get cannot connect
[11:27:22] jhass: -h "::1" perhaps?
[11:27:56] Diverdude: jhass, then i also get: /var/lib/gems/1.9.1/gems/mysql2xxxx-0.2.1/lib/mysql2xxxx/writer.rb:41:in `real_connect': Can't connect to MySQL server on '::1' (111) (Mysql::Error)
[11:28:15] jhass: so interestingly your mysql server isn't even listening to localhost?
[11:28:26] Macaveli: has joined #ruby
[11:29:12] Diverdude: jhass, but when i just do mysql -uxxxx -p i can connect with no problem
[11:29:23] elomatreb: something else: Are you really using Ruby 1.9.1? (ruby -v) I don't think you still get security patches with that version
[11:29:41] jhass: ?abi elomatreb
[11:29:41] ruby[bot]: elomatreb: Each Ruby release has actually two versions, the interpreter version and the ABI version. The interpreter version is what commonly is referred to, like 2.1.5. The ABI version is for the binary interface used by compiled extensions and it is what you see in your paths. It's shared among on
[11:29:41] ruby[bot]: e release series, for example for the Ruby versions 2.1.0 to 2.1.5 the ABI version is 2.1.0.
[11:29:42] Diverdude: ruby 1.9.3p484 (2013-11-22 revision 43786) [x86_64-linux]
[11:30:10] duckpupp1: has joined #ruby
[11:30:18] elomatreb: mh, ok. Didn't even know that
[11:30:34] ldnunes: has joined #ruby
[11:31:15] Diverdude: jhass, so it seems normal client works fine...php also connects fine...i also manage to connect ruby via active_record gem...no problem....but this script which is exactly what i need cannot connect :(
[11:32:08] Spami: has joined #ruby
[11:32:31] jhass: "The value of host may be either a host name or an IP address. If host is NULL or the string "localhost", a connection to the local host is assumed. For Windows, the client connects using a shared-memory connection, if the server has shared-memory connections enabled. Otherwise, TCP/IP is used. For Unix, the client connects using a Unix socket file."
[11:32:44] jhass: so looks like it connects via unix socket by default these days
[11:33:17] Diverdude: jhass, you mean the mysql2xxx lib?
[11:33:37] sdothum: has joined #ruby
[11:34:11] jhass: mysql2xxxx passes nil to the mysql2 gem when no host is given, which passes NULL to mysql_real_connect(3) if host is nil
[11:34:37] Diverdude: jhass, ok....that should be ok then no?
[11:34:38] jhass: anyway, that finicky user/authentication stuff is one of the reasons I avoid mysql
[11:34:45] jhass: I would expect so
[11:35:20] Diverdude: jhass, yeah but i cannot really avoid mysql :( I need to export the entire database into json and found this to be an easy to gem to use..apparantly not :( :( :(
[11:35:29] jhass: since your DB is only running on a unix socket apparently anyway, perhaps get a user with @*
[11:36:41] Diverdude: jhass, what does that mean?
[11:37:06] Diverdude: i understand
[11:37:23] nocco: Anyone that use ruby with macs automator script? I have problems require gems. :(
[11:37:27] Diverdude: hmmm i actually think the user i have has wildcard on domain
[11:38:12] jhass: ?anyone nocco
[11:38:12] ruby[bot]: nocco: Just ask your question, if anyone has or can, they will respond.
[11:38:17] Yiota: has joined #ruby
[11:39:52] skade: has joined #ruby
[11:41:13] lsmola: has joined #ruby
[11:41:19] certainty: has joined #ruby
[11:43:30] nocco: When require other gems when running ruby script in automator, it tells me that there is no something called "gem-name". What I tried to do is run it in a shell, specific told which ruby version and exporting my PATH. What more to do?
[11:44:18] norc: has joined #ruby
[11:44:43] JoshL: has joined #ruby
[11:44:51] jhass: nocco: which ruby version does it run?
[11:46:47] nocco: jhass: 2.3.0
[11:47:54] rbr: has joined #ruby
[11:47:58] elomatreb: nocco: What is the specific gem it complains about?
[11:48:36] jhass: nocco: and ruby -rgemname -e "" doesn't complain? what's gem env where it doesn't complain? can you run gem env where it does complain and is it different?
[11:48:37] nocco: elomatreb: rest-client and nokogiri
[11:51:23] nocco: jhass: when I run the script in the terminal, it works fine.
[11:51:51] kapo: has joined #ruby
[11:52:56] jaguarmagenta: has joined #ruby
[11:53:30] elomatreb: Are you using rvm or something similar?
[11:53:57] nocco: elomatreb: Yes, I use rvm
[11:54:38] norc: nocco: Gist the full error message (including stack traces) please..
[11:55:03] Hanmac: has joined #ruby
[11:55:22] elomatreb: nocco: I am not a Mac user, but I would assume that what you're using to run the script does not use the rvm environment, so it can't see your gems
[11:55:30] AlexJakeGreen: has joined #ruby
[11:55:32] chussenot: has joined #ruby
[11:57:30] rodferso1: has joined #ruby
[11:58:17] nocco: elomatreb: https://gist.github.com/rickbrunstedt/559ba9458fdad502c787e2a4cf5bae6f
[11:58:39] joonty: has joined #ruby
[11:59:13] kalopsian: has joined #ruby
[11:59:13] norc: nocco: Have you tried setting GEM_PATH manually?
[11:59:23] LBRapid: has joined #ruby
[11:59:31] elomatreb: Doesn't rvm generate some kind of wrapper scripts for use-cases like this?
[11:59:43] jhass: nocco: ^ don't do that or what you're doing currently, investigate rvm wrappers or rvm do
[11:59:47] norc: elomatreb: RVM is a huge pile of intrusive hacks into shell commands.
[11:59:54] spikey: has joined #ruby
[12:01:05] nocco: norc: Yeah I tried that but then in the gem there is another require for another gem, and so on.. :(
[12:01:18] LaT0rtue: has joined #ruby
[12:01:20] nocco: Is rvm wrapper they way to go?
[12:01:31] norc: I would not call it "the way to go"
[12:01:36] SirCmpwn: has joined #ruby
[12:02:11] norc: But then again Im biased against RVM all the way.
[12:02:44] elomatreb: I've been using rvm since a few years now, are there good (read: easy) alternatives?
[12:02:51] Arcaire: ruby-install + chruby
[12:03:06] Arcaire: https://github.com/postmodern/chruby
[12:03:09] Arcaire: https://github.com/postmodern/ruby-installl
[12:03:12] Arcaire: https://github.com/postmodern/ruby-install
[12:03:53] emilkarl: has joined #ruby
[12:03:54] ElFerna: has joined #ruby
[12:04:31] elomatreb: Mh, I'll try those later today I think.
[12:04:40] Arcaire: far easier / cleaner than rvm
[12:04:42] ruby435: has joined #ruby
[12:05:41] triangles: has joined #ruby
[12:05:55] nocco: which one? ruby-install?
[12:06:33] ElFerna: has joined #ruby
[12:06:53] triangles: has joined #ruby
[12:06:54] dabonka: has joined #ruby
[12:07:01] jhass: nocco: won't magically get rid of your issue either. Try rvm wrappers
[12:08:07] nocco: jhass: Yeah I will probably try that first. But is neither of you using rvm? Haven't done ruby for a while..
[12:08:39] jhass: RVM's popularity certainly is not increasing anymore, more on the contrary
[12:09:14] d10n-work: has joined #ruby
[12:09:21] jmignault: has joined #ruby
[12:09:25] norc: nocco: To your question, they are usually used in tandom.
[12:09:27] norc: *tandem.
[12:14:13] blackmesa: has joined #ruby
[12:16:17] ffgghhj: has joined #ruby
[12:21:55] aeterne: has joined #ruby
[12:24:14] triangles2: has joined #ruby
[12:24:44] allcentury: has joined #ruby
[12:25:51] Yiota: has joined #ruby
[12:28:33] jaruga___: has joined #ruby
[12:29:06] rodfersou: has joined #ruby
[12:30:35] synthroid: has joined #ruby
[12:34:24] nankyokusei: has joined #ruby
[12:34:54] Wolland: has joined #ruby
[12:35:07] emilkarl: has joined #ruby
[12:35:10] antgel: has joined #ruby
[12:38:14] workmad3_: has joined #ruby
[12:38:19] emilkarl: has joined #ruby
[12:38:26] edwinvdgraaf: has joined #ruby
[12:40:01] freerobby: has joined #ruby
[12:41:38] edwinvdg_: has joined #ruby
[12:43:07] chouhoulis: has joined #ruby
[12:43:34] dstarh: has joined #ruby
[12:44:29] allcentury: has joined #ruby
[12:45:10] p337rB: has joined #ruby
[12:46:18] mikecmpbll: has joined #ruby
[12:47:13] shadeslayer: has joined #ruby
[12:47:17] kareeoleez: has joined #ruby
[12:47:47] pmyjavec: has joined #ruby
[12:47:59] myntcake: has joined #ruby
[12:49:18] Ropeney: has joined #ruby
[12:49:45] LoneHermit: has joined #ruby
[12:51:12] axxyhtrx: has joined #ruby
[12:51:25] Niham: has joined #ruby
[12:52:53] yqt: has joined #ruby
[12:53:52] aufi: has joined #ruby
[12:54:58] VeryBewitching: has joined #ruby
[12:55:58] flashpoint9: has joined #ruby
[12:56:20] edwinvdgraaf: has joined #ruby
[13:01:57] ramortegui: has joined #ruby
[13:03:49] tlaxkit: has joined #ruby
[13:05:50] ChiefAlexander: has joined #ruby
[13:06:07] triangles: has joined #ruby
[13:06:48] deadnull_: has joined #ruby
[13:07:22] tknz: has joined #ruby
[13:07:40] k3rn31: has joined #ruby
[13:09:27] troulouliou_div2: has joined #ruby
[13:09:43] Saloun: has joined #ruby
[13:10:15] edwinvdgraaf: has joined #ruby
[13:10:27] aries_liuxueyang: has joined #ruby
[13:10:48] CJKinni: has joined #ruby
[13:10:56] edwinvdg_: has joined #ruby
[13:11:04] Saloun: can anyone tell me why im getting these errors: http://pastebin.com/KQvkSirr
[13:11:07] ruby[bot]: Saloun: we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/846543e0def5b1a55deb37580c5320f1
[13:11:07] ruby[bot]: Saloun: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[13:11:09] prestorium: has joined #ruby
[13:12:39] jhass: Saloun: because you either didn't install the cinch gem, installed it for a different ruby than you run now or installed it via bundler and run outside the context of your bundle (no require "bundler/setup" and neither using bundle exec)
[13:12:56] Saloun: How to fix this then?
[13:12:57] lightt: has joined #ruby
[13:13:02] Saloun: gem install cinch?
[13:13:06] jhass: depends on which of the three options it is
[13:13:29] Saloun: ok i will try that
[13:13:52] Veejay: jhass: Is using a Gemfile and Bundler in the project directory the "best" practice?
[13:13:58] Veejay: It's what I usually do
[13:14:05] aegis3121: has joined #ruby
[13:14:14] Veejay: I feel like it's well compartmented that way
[13:14:18] jhass: I'm against dogma
[13:14:20] Veejay: If that's even a word
[13:14:33] Saloun: i installed cinch and still the same errors
[13:14:38] jhass: but I do too most of the time
[13:14:40] Veejay: Healthy way of living one's life
[13:14:41] lupine: best practice is avoiding that many dependencies ^^
[13:14:59] lupine: but without that, committing a Gemfile (and sometimes Gemfile.lock, depending on how bad it is) can help
[13:15:13] johnDoe111: has joined #ruby
[13:15:15] jhass: eh, always commit the lock
[13:15:54] lupine: it's arguably inappropriate in expected-to-be-library code
[13:16:53] jhass: I never got why
[13:17:02] Saloun: jhass: how to fix this then? i mean a command to run or something.
[13:17:05] adaedra: what's going to be library is determined by the gemspec, not the repo
[13:17:11] jhass: Saloun: we still don't know the cause
[13:17:16] lupine: because when someone requires your library, they're not likely to take your gemfile.lock
[13:17:31] tlaxkit: has joined #ruby
[13:17:40] adaedra: Gemfile != gemspec
[13:18:08] jhass: the Gemfile and Gemfile.lock in a library is so that I can reproduce the environment I have in for example CI
[13:18:11] giz|work: http://pastebin.com/privacy
[13:18:11] ruby[bot]: giz|work: 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
[13:18:19] jhass: not a library users environment
[13:18:45] adaedra: gemspec is for library users, while Gemfile is for developping the gem, I think.
[13:18:46] jhass: lupine: rubygems isn't using the libraries Gemfile either, so I shouldn't commit it too?
[13:18:48] lupine: it's a fairly abstract thing, but if you've got the deps specified there very precisely, it's easier to write code that is going to break
[13:19:11] lupine: jhass: a gemfile typically (but not always, of course) has much looser version dependencies, and can even be shared with the gemspec
[13:19:16] lupine: which *will* go into transitive dependencies
[13:19:45] avelldiroll: has joined #ruby
[13:19:57] jhass: I see the argument, it doesn't convince me at all
[13:20:31] lupine: I'm pretty on the fence about it
[13:20:40] lupine: in practice, everything is broken everywhere all the time
[13:20:56] lupine: the amount of difference this makes to that is likely to be mininal
[13:21:25] jhass: Saloun: so how did you install Ruby? did you install cinch before? if so how? what was the output of the gem install command? what's the output of the gem env command? Do you see a Gemfile?
[13:21:42] Saloun: no i did "apt-get install ruby-full"
[13:22:08] dcluna: has joined #ruby
[13:22:25] lightt: hello fine ppl
[13:23:26] swills: has joined #ruby
[13:23:27] diegoaguilar: has joined #ruby
[13:24:03] Saloun: jhass: so what else i need to install
[13:24:16] jhass: Saloun: sorry, 1/6, will you answer the remaining five questions?
[13:24:45] Saloun: 2/6: nope
[13:24:51] Saloun: i didnt install cinch before
[13:25:21] jhass: use a gist for 4 & 6
[13:25:21] Saloun: what's the output of the gem env command? Do you see a Gemfile?: Nope
[13:25:22] freerobby: has joined #ruby
[13:25:51] jhass: 4/6, nope is an invalid answer to 5
[13:26:40] Saloun: 5/6 i didnt do that lol
[13:26:47] malconis: has joined #ruby
[13:27:01] jhass: run it, gist the output
[13:27:25] blockchan: has joined #ruby
[13:28:01] Saloun: jhass; https://gist.github.com/saloun/94f74f42a16dedd40d4bdc575f81f74d
[13:28:37] adaedra: why are you working as root?
[13:29:07] maesitos: has joined #ruby
[13:29:11] maesitos: Hello I have a simple question
[13:29:19] Saloun: ignore that last line lol
[13:29:21] maesitos: @shipment_country ||= params[:shipment_country]
[13:29:22] maesitos: @shipment_country ||= cookies[:shipment_country]
[13:29:22] maesitos: @shipment_country ||= extract_country_from_ip
[13:29:28] Saloun: i had it copied like 10mins ago so..
[13:29:33] jhass: Saloun: this is very confusing, your first prompt is a user and the prompt after the command returned is root
[13:29:45] adaedra: but both have a #
[13:29:46] Saloun: no just ignore that last line
[13:30:03] Saloun: lol. read what i said ^^
[13:30:05] jhass: gem env also looks like it was ran as root
[13:30:09] maesitos: will that 3rd line execute extract_country_from_ip if @shipment_country is 1 ?
[13:30:17] Saloun: ok i will run it as root wait
[13:30:24] gomix: has joined #ruby
[13:30:37] lupine: maesitos: ||= will only replace false and nil
[13:30:51] jhass: Saloun: 4/6 is still open too btw
[13:31:19] Saloun: 5/6: https://gist.github.com/saloun/d13b329b4a506ec71550e39f9402c849
[13:31:22] maesitos: lupine: but I need extract_country_from_ip to be executed only if @shipment_country is false or nill
[13:31:29] lupine: then you're in luck
[13:31:40] Saloun: 4/6: i didn't install cinch
[13:32:07] jhass: 15:14 <Saloun> i installed cinch and still the same errors
[13:32:19] Saloun: oh thats after
[13:32:34] maesitos: lupine: I mean, extract_country_from_ip is looking up the country based on the IP and it's using a paid service. I want to call that function only if neccesary
[13:32:40] Saloun: gem install cinch
[13:32:56] lupine: as-is, it will only be called if @shipment_country is nil or false
[13:32:59] maesitos: so my question is will the function be evaluated?
[13:33:07] jhass: maesitos: no
[13:33:10] kareeoleez: has joined #ruby
[13:33:20] adaedra: >> a = 1; a ||= proc { puts "Oops" }.call
[13:33:21] ruby[bot]: adaedra: # => 1 (https://eval.in/586177)
[13:33:27] jhass: maesitos: the best approximation for a ||= b is a || a = b, || short circuits
[13:33:48] Saloun: 4/6: gem install cinch
[13:34:14] Xiti: has joined #ruby
[13:34:44] jhass: 4/6 asks for the full output of the command
[13:36:07] GinoManWorks: has joined #ruby
[13:36:13] Saloun: ok 1second
[13:36:15] edwardly: has joined #ruby
[13:36:16] edwardly: has joined #ruby
[13:37:00] Wolland: has joined #ruby
[13:37:58] fjfpvd: has joined #ruby
[13:38:02] Saloun: jhass: https://gist.github.com/saloun/73629589d6ed46155b42150a02b69c0b
[13:38:31] maesitos: jhass: thanks
[13:38:50] maesitos: jhass: a simple test in irb confirmed that!
[13:39:25] jhass: Saloun: so you just did that only now?
[13:39:29] jhass: did it fix the issue?
[13:39:55] Niham: has joined #ruby
[13:40:06] adaedra: Still working as root, I see
[13:40:11] Saloun: jhass: Nope it didnt fix the issue
[13:40:14] jhass: Saloun: since you ran that as root now and should run the bot as your regular user, I'll need a definitive and clear comparison of gem env run as root and as your regular user, your previous gist of it was unclear under what circumstances it was run
[13:40:46] Saloun: okay fine
[13:41:16] willemb: has joined #ruby
[13:41:22] Niham: has joined #ruby
[13:41:27] eljimbo: has joined #ruby
[13:42:08] willemb: Hi . I have a problem where gem install <whatever> frequently times out on some of my servers. We have used geminabox with unicorn to set up a proxy so that all our hosts don't hit rubygems.org at the same time, but the problem is only better, not solved
[13:42:48] Saloun: jhass: i run gem env under my user? right?
[13:42:58] willemb: research on the internet says I should have some luck if I upgrade from rubygems 2.2.2 to rubygems 2.3.0.
[13:43:30] sankarshanmudkav: has joined #ruby
[13:43:52] jhass: Saloun: run it twice, once under your user that you want to run the bot with and once as root, clearly mark which is which in your gist
[13:44:09] Saloun: okay fine.
[13:44:19] Saloun: jhass: under my user/ https://gist.github.com/saloun/90cdc62988b396b8f58f9a2770ad8611
[13:45:00] Saloun: jhass: under root/ https://gist.github.com/saloun/6f5f1ccdd3f33def694151a1988119b8
[13:45:00] malconis: has joined #ruby
[13:45:59] jhass: okay thank you. what's the output of gem which cinch, again under either user
[13:47:17] Saloun: jhass: this? https://gist.github.com/saloun/73629589d6ed46155b42150a02b69c0b
[13:47:42] jhass: that's the output of gem install cinch, I'm asking for gem which cinch under either user
[13:48:03] ChiefAlexander: has joined #ruby
[13:48:07] qba73: has joined #ruby
[13:48:17] Saloun: saloun@alpha:~$ gem which cinch
[13:48:37] Saloun: -> /var/lib/gems/2.1.0/gems/cinch-2.3.2/lib/cinch.rb
[13:48:50] freerobby: has joined #ruby
[13:49:49] palms: has joined #ruby
[13:50:01] jhass: are you sure you see no Gemfile? are you sure it's still giving the same error? what's the output of command -v ruby and which ruby under your regular user?
[13:51:14] shevy: might be a debian ruby
[13:51:31] Saloun: root@alpha:~# ruby -v
[13:51:31] Saloun: -> ruby 2.1.5p273 (2014-11-13) [x86_64-linux-gnu]
[13:51:31] edwinvdg_: has joined #ruby
[13:51:51] jhass: I didn't ask you to run it as root
[13:51:57] Saloun: saloun@alpha:~$ which ruby
[13:52:06] Saloun: -> /usr/bin/ruby
[13:52:19] Saloun: saloun@alpha:~$ ruby -v
[13:52:19] Saloun: ruby 2.1.5p273 (2014-11-13) [x86_64-linux-gnu]
[13:52:23] Saloun: there we are
[13:52:45] jhass: two questions still open ;)
[13:53:04] Macaveli: has joined #ruby
[13:53:04] Saloun: i dont see a gemfile and there is still the same error.
[13:53:06] Saloun: I'm sure.
[13:53:09] jhass: exact same?
[13:53:25] jhass: it's not stuck on another missing gem perhaps?
[13:53:31] jhass: still says can't find cinch?
[13:53:55] jhass: this is quite impossible tbh
[13:54:06] theunraveler: has joined #ruby
[13:54:08] Saloun: - /usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- cinch/plugins/identify (LoadError)
[13:54:10] bkxd: has joined #ruby
[13:54:19] jhass: so it did change after all!
[13:54:27] Yiota: has joined #ruby
[13:54:30] Saloun: i just showed u the 1st error of cinch
[13:54:32] tlaxkit: has joined #ruby
[13:54:32] adaedra: look closer.
[13:54:34] Saloun: others are still there
[13:54:36] get_drunk: has joined #ruby
[13:54:49] get_drunk: what is class << some_object?
[13:54:57] kobain: has joined #ruby
[13:55:05] adaedra: > cannot load such file -- cinch (LoadError)
[13:55:09] zacstewart: has joined #ruby
[13:55:13] adaedra: > cannot load such file -- cinch/plugins/identify (LoadError)
[13:55:15] Saloun: jhass / adaedra: https://gist.github.com/saloun/681a5db928446f8100d33894a0d53266
[13:55:29] adaedra: those are not the same
[13:55:30] Saloun: thats what i get now
[13:55:31] jhass: Saloun: adaedra was faster than me, see how it changed?
[13:55:46] shevy: get_drunk for class methods usually; like: class Foo; def self.bar; puts 'hi from Foo.bar'; end; end; Foo.bar
[13:55:48] Saloun: oh. yeah true. Sorry i must get glasses
[13:56:05] jhass: even the line number of the last line in backtrace changed
[13:56:25] jhass: get_drunk: it opens the singleton class of some_object
[13:56:32] antgel: has joined #ruby
[13:56:51] get_drunk: ok, so I can use that to define methods at the instance level of some object?
[13:57:03] jhass: Saloun: https://rubygems.org/gems/cinch-identify appears to be the missing gem
[13:57:03] Saloun: yeah it changed indeed. just compared the two gists
[13:57:35] jhass: get_drunk: yup
[13:57:38] kgrz: has joined #ruby
[13:57:48] jhass: get_drunk: but only consider it for long-lived objects, like classes
[13:58:18] Saloun: jhass: done.. but now i have more errors
[13:58:28] get_drunk: i am messing around with prototyped objects, is this a dead-end?
[13:58:41] jhass: get_drunk: not sure what that is
[13:58:54] Saloun: jhass: https://gist.github.com/saloun/d6b40d26e8d6099291b1c82f9e3293a8
[13:58:54] jhass: you try to do JS in ruby?
[13:58:59] get_drunk: instead of a class, there's an object whose behavior I can clone
[13:59:03] get_drunk: lua, but yeah
[13:59:06] get_drunk: js is the same way
[13:59:16] jhass: I think you're already drunk then, adjust you nick :P
[13:59:44] jaruga___: has joined #ruby
[13:59:46] jhass: Saloun: https://rubygems.org/gems/domainatrix you'll get the pattern
[14:00:00] shevy: get_drunk you can use struct and openstruct, like Weapon = Struct.new :weapon; Sword = Weapon.new
[14:00:07] johnDoe111: has joined #ruby
[14:00:16] shevy: and modify everything at runtime
[14:00:35] edwinvdgraaf: has joined #ruby
[14:00:42] jhass: got_drunk: is there an underlying design problem you try to solve, is it "because I'm used to it" or just for the lulz?
[14:01:02] shevy: I once thought of having a MUD just via ad-hoc structs or struct-like objects... but somehow I always end up specifying stuff via classes in ruby :(
[14:01:05] Kneecaps: has joined #ruby
[14:01:10] willemb: ok, from the changelog, it looks like 2.3.0 added more than one performance improvement for dependency resolution. I guess if I am still on Debian Wheezy with ruby 1.8, I am out of luck in streamlining gem installs
[14:01:23] ekinmur: has joined #ruby
[14:01:35] adaedra: willemb: get rid of 1.8 already
[14:01:38] Saloun: jhass: no way.. errors: https://gist.github.com/saloun/e7b25094a7d54108455f75bc85975981
[14:01:53] jhass: willemb: the correct sentence is "if I'm still on debian wheezy I'm out of luck", the specific don't matter really :P
[14:02:00] Ch4rAss: has joined #ruby
[14:02:06] mdw: has joined #ruby
[14:02:25] cdg: has joined #ruby
[14:02:31] willemb: all good and well. almost 2000 web hosting servers :(
[14:02:36] jhass: Saloun: https://rubygems.org/gems/uuid I urge you, try to recognize the pattern! that's what human brains are made for after all!
[14:02:55] kgrz: has joined #ruby
[14:03:10] willemb: and they don't play well with linux 3.16 because their disk partitions arent 1MiB aligned :(
[14:03:42] chipotle: has joined #ruby
[14:04:10] blackmesa: has joined #ruby
[14:04:15] jhass: willemb: well, perhaps time to get half a dozen additional boxes, designing a new deployment strategy (which you can automate) and starting to migrate
[14:04:32] jhass: migrate a box, use it as spare
[14:05:25] jhass: your goal should probably be that you can just reimage a box at any point
[14:05:40] mistermocha: has joined #ruby
[14:05:54] Saloun: jhass: new errors now, different from the others
[14:06:02] willemb: jhass: Don't worry, we are working on deployment strategies. biggest hurdle is 'slow network, so no shared storage'. data on local disks, so takes LONG to move customers to different servers
[14:06:07] platzhirsch: has joined #ruby
[14:06:17] jhass: Saloun: show?
[14:06:38] willemb: the joys of mass shared web hosting
[14:07:12] Saloun: jhass: when running the bot: boom: https://gist.github.com/saloun/27ba1a998ae8ec4a9e20f9224c933c95
[14:07:33] Saloun: well the 1st error is on my config file but not the rest
[14:07:38] jhass: Saloun: well, the error message says it all, fix your yaml config
[14:07:47] jhass: "the rest" is the same error
[14:08:03] jhass: just tracing back where it originates in the code
[14:08:16] jhass: aka "backtrace" or "stack trace"
[14:08:19] Saloun: line 7 is only the name of a chan lol
[14:09:20] adaedra: Read the error message.
[14:09:22] kies: has joined #ruby
[14:09:23] davedev24: has joined #ruby
[14:09:38] adaedra: It tells you what the problem is.
[14:09:50] Saloun: i think i found it
[14:10:00] spikeheadon: has joined #ruby
[14:10:24] theunrav_: has joined #ruby
[14:10:38] chipotle: has joined #ruby
[14:10:42] edwinvdg_: has joined #ruby
[14:11:06] JesseH: has joined #ruby
[14:11:55] spikeheadon: has joined #ruby
[14:12:41] chipotle: has joined #ruby
[14:13:23] spikeheadon: has joined #ruby
[14:13:41] Fernando-Basso: has joined #ruby
[14:14:24] snath: has joined #ruby
[14:15:09] spikeheadon: has joined #ruby
[14:15:16] moredhel: has joined #ruby
[14:15:44] Saloun: jhass: "bncim-bot.rb:55:in `initialize': Permission denied @ rb_sysopen - log/irc-ircnetwork.log (Errno::EACCES)"
[14:15:48] Saloun: what does this means?
[14:15:57] jaguarmagenta: has joined #ruby
[14:16:15] adaedra: Permission denied opening log/irc-network.log
[14:16:20] johnDoe111: has joined #ruby
[14:16:30] adaedra: log/irc-ircnetwork.log*
[14:16:33] spikeheadon: has joined #ruby
[14:16:35] Saloun: how to fix it?
[14:16:37] jhass: that you don't have write permissions to the directory you run the bot in with the user you run it with
[14:16:45] jhass: see man chown chgrp chmod
[14:16:53] adaedra: stop switching to root all the time :p
[14:17:09] Saloun: i think thats the best solution lol
[14:17:15] ruby[bot]: general advice in system administration: do not and that means never use sudo or root to "fix" things. Only use it if you exactly know why it would work and why it wouldn't work under any circumstances as normal user. Or if you're told to do it.
[14:17:53] hutch34: has joined #ruby
[14:18:21] myntcake: has joined #ruby
[14:18:24] mtkd: has joined #ruby
[14:18:29] spikeheadon: has joined #ruby
[14:18:47] Saloun: jhass: more errors.. omg this is annoying
[14:20:12] got_drunk: yeah i hate when things that I did are my own problems
[14:20:26] got_drunk: if only there was a way to only do exactly what I choose to do...
[14:22:53] Saloun: jhass: https://gist.github.com/saloun/06f4ea050c6f078e900fb679fdd3110b
[14:22:55] babblebre: has joined #ruby
[14:23:17] aljailaa: has joined #ruby
[14:23:38] jhass: Saloun: hard to say without code, my guess is that you have a number in your config where a string is expected
[14:24:24] Saloun: ill send u the code
[14:24:39] Jardayn: has joined #ruby
[14:25:04] Saloun: jhass: PM
[14:25:27] kalopsian: has joined #ruby
[14:26:15] jhass: Saloun: https://gist.github.com/saloun/06f4ea050c6f078e900fb679fdd3110b#file-ruby-L2 https://github.com/somasonic/bncim-bot/blob/master/bncim-bot.rb#L71
[14:26:47] jhass: likely your password is just numbers, make sure it's a string in your yaml
[14:27:08] got_drunk: this just keeps getting better
[14:27:12] got_drunk: is it 123456
[14:27:19] Saloun: yes its numbers
[14:27:21] Saloun: gonna fix
[14:27:41] got_drunk: just do .to_s, then
[14:29:09] adaedra: proper storing in the YML is a better solution imo.
[14:30:15] Saloun: what i get now https://gist.github.com/saloun/a07cd1b074a011c2154197b631410d8b
[14:31:41] chopin: has joined #ruby
[14:33:01] RobertBirnie: has joined #ruby
[14:33:43] jhass: are you sure you didn't change the code?
[14:34:04] Saloun: no i didnt.
[14:35:18] nankyokusei: has joined #ruby
[14:35:20] jhass: well line 74 is just an end in the code on github
[14:35:29] achamian: has joined #ruby
[14:35:40] jhass: quite impossible for that error to happen there
[14:36:36] pawnbox: has joined #ruby
[14:37:13] senayar: has joined #ruby
[14:37:19] ncthom91: has joined #ruby
[14:37:38] Yiota: has joined #ruby
[14:37:58] Maletor: has joined #ruby
[14:38:00] Wolland: has joined #ruby
[14:38:05] Saloun: jhass: no
[14:38:08] Saloun: same lines
[14:38:31] jhass: bncim-bot.rb:74:in `block (3 levels) in <main>': uninitialized constant MonitorPlugin (NameError)
[14:38:33] Saloun: same on git i gave u
[14:38:35] jhass: that one says 74
[14:38:58] Saloun: whats wrong?
[14:39:02] jhass: https://github.com/somasonic/bncim-bot/blob/master/bncim-bot.rb#L74
[14:39:04] jhass: it's an end
[14:39:10] jhass: that error can't happen there
[14:39:19] jhass: so your local code must look different
[14:39:30] Saloun: i will paste u my local code then
[14:39:58] polishdub: has joined #ruby
[14:40:20] malconis_: has joined #ruby
[14:40:46] Saloun: jhass: https://gist.github.com/saloun/6c4b8dbde7637f49d29b05850ff1fa77
[14:41:12] LoneHerm_: has joined #ruby
[14:41:45] LoneHerm_: has joined #ruby
[14:41:47] jhass: very weird
[14:42:12] spyder55: has joined #ruby
[14:42:47] SilverKey: has joined #ruby
[14:43:12] jrafanie: has joined #ruby
[14:43:50] chopin_: has joined #ruby
[14:44:58] hobodave: has joined #ruby
[14:45:36] Saloun: what do you think, jhass?
[14:45:57] jhass: I think that I have no clue and won't try to locally setup up this mess to investigate
[14:46:22] Saloun: i got it to work last year
[14:46:45] Saloun: i don't remember the friend who i asked and he got that shit working
[14:47:20] elomatreb: Whoever recommmended me to switch to ruby-install/chruby over rvm earlier today: thank you. Works quite well!
[14:47:46] ash_workz: has joined #ruby
[14:48:37] Yiota_: has joined #ruby
[14:49:24] blockchan: has joined #ruby
[14:49:47] pmyjavec: Broad question but how do people like to handy a something missing situation, for example, a method which tries to get something form a database, if it can't be found, what would most people expect it to do ?
[14:50:00] pmyjavec: return nil?
[14:51:14] elomatreb: Depends on the method. I would design it like rails: Where you expect one result (like Model::find) throw an exception, where there may be more return an empty set
[14:51:35] pmyjavec: elomatreb , may I show you what i'm doing and see what you think ?
[14:51:58] elomatreb: please do :)
[14:51:59] pmyjavec: would love some feedback, i've been doing a bit of go and erlang and there seems to be a more distinct way to deal with this issue
[14:52:22] pmyjavec: cheers, one second
[14:52:36] jhass: pmyjavec: both is a valid, a guidance may be that exceptions are for exceptional cases
[14:53:01] jhass: if the absence of the record is a configuration or data integrity error, I'd throw an exception
[14:53:11] jhass: if it simply may or may not be there nil seems more sensible
[14:53:31] skade: has joined #ruby
[14:53:44] dopamean_: has joined #ruby
[14:53:45] Saloun: has left #ruby: ()
[14:53:45] Saloun: has joined #ruby
[14:53:52] pmyjavec: there would be a pattern for this problem, I just don;t know what it is...
[14:54:21] pmyjavec: https://gist.github.com/pmyjavec/039999b52e8f199aeaae0dce1d22e480
[14:54:44] aufi: has joined #ruby
[14:54:52] freerobby: has joined #ruby
[14:55:11] pmyjavec: jhass , elomatreb, there is is, my actual problem is how do I respond to clients when something is either indexed, a query is made, or a removal happens, I would like to respond in a standard way
[14:55:29] jhass: well, take perspective
[14:55:46] jhass: if I query, my question can very well be "is this there?"
[14:55:57] elomatreb: One thing I notice is that I would create more exception classes. Just raising OperationError everywhere is probably not ideal
[14:56:10] jhass: if I ask you to remove it should have verified it's there and it's my mistake to ask you to remove something that's not there
[14:56:29] Yiota: has joined #ruby
[14:56:43] pmyjavec: elomatreb I did have multiple exception classes, it was just a bit too crazy
[14:56:46] pmyjavec: easy to restore it though
[14:57:12] pmyjavec: Having too many classes means if I have a client library that uses thise object, it has to check for a lot of cases
[14:57:22] gfvcastro: has joined #ruby
[14:57:26] pmyjavec: which what made me thing my design is a little floored
[14:57:35] Guest38: has joined #ruby
[14:57:51] elomatreb: If they're all specific to your library extend them from a common baseclass, allowing a user to catch all with one rescue statement
[14:57:57] sepp2k: has joined #ruby
[14:58:09] pmyjavec: elomatreb, yup that's not a bad idea
[14:58:55] duckpuppy: has joined #ruby
[14:59:02] pmyjavec: how about returning a struct or hash with the result?
[14:59:03] Yiota: has joined #ruby
[14:59:32] edwinvdg_: has joined #ruby
[15:00:00] pmyjavec: jhass, can you repeat what you said before?
[15:00:08] pmyjavec: might be a type
[15:00:29] pmyjavec: *typo, oh the irony...
[15:01:23] jhass: I was giving general guidance, not my opinion on the specific situation
[15:02:07] mdw: has joined #ruby
[15:02:54] pmyjavec: Sure, I'm interested in your view, I think you might've just miss typed it ?
[15:03:11] ruby[bot]: You can find a log of this channel at http://irclog.whitequark.org/ruby/
[15:03:19] jhass: I don't think I did
[15:03:22] pmyjavec: "If I ask you to remove it should have verified it's there and it's my mistake to ask you to remove something that's not there"
[15:03:29] kgrz: has joined #ruby
[15:03:45] mdw7: has joined #ruby
[15:03:46] Maletor: has joined #ruby
[15:03:52] jhass: okay well there's a missing I before should
[15:04:20] jhass: I thought you're still referring to the exception classes
[15:04:37] pmyjavec: The exception classes work well enough
[15:05:23] pmyjavec: But I'm definitely not sure if it's the right approach
[15:06:10] TomyWork: i want to display notification popups from within a vagrant plugin (i.e. from a command line application). what chances do i have?
[15:06:18] shevy: why are you not happy if things work well enough pmyjavec
[15:06:33] alfiemax: has joined #ruby
[15:06:44] TomyWork: on windows 7,8,8.1 and 10
[15:07:13] TomyWork: linux would be nice, too
[15:07:16] pmyjavec: shevy, fair point I guess :)
[15:07:18] eeinb: has joined #ruby
[15:07:46] tjohnson: has joined #ruby
[15:08:00] elomatreb: TomyWork: There's https://rubygems.org/gems/notify, I think I remember using it, but only on Linux
[15:08:15] pmyjavec: elomatreb , what did you think of the solution in general ?
[15:08:25] TomyWork: i'll play with it a bit, thanks
[15:08:37] pmyjavec: Using the exceptions in that way?
[15:09:17] pld: has joined #ruby
[15:09:31] elomatreb: That's pretty much how I would do it, my only problem is probably the name of the query/index method
[15:09:51] mdw: has joined #ruby
[15:10:01] sandelius: has joined #ruby
[15:10:04] elomatreb: They probably make sense when you know the exact usecase, but I think something like find/add would be more intuitive
[15:10:17] SilverKey: has joined #ruby
[15:10:30] ChiefAlexander: has joined #ruby
[15:10:37] pmyjavec: elomatreb , cool, I'll run with it and see how it goes longer term, cheers
[15:10:49] pmyjavec: thank you for the feedback all
[15:11:44] pld: hi, can someone me enlighten on what scope i should use for the variable model_changed if i want this to work? https://bpaste.net/show/48c538787b81
[15:11:48] TomyWork: elomatreb "Desctop" - sounds promising :)
[15:12:02] mdw7_: has joined #ruby
[15:12:03] pld: i need a scope that is valid only within a method but the whole method
[15:12:22] elomatreb: heh, that's what I though as well. It's also last updated in 2013, so it may be useless
[15:13:26] elomatreb: TomyWork: I just tested it, it works on Linux
[15:13:56] Eeinx: has joined #ruby
[15:14:05] karmatr0n: has joined #ruby
[15:14:52] frem_: has joined #ruby
[15:14:53] elomatreb: TomyWork: This seems to be a more popular version: https://rubygems.org/gems/notiffany
[15:15:12] kobain: has joined #ruby
[15:16:14] Eeinx: has joined #ruby
[15:16:54] johnDoe111: has joined #ruby
[15:18:09] griffindy: has joined #ruby
[15:18:16] mdw: has joined #ruby
[15:20:39] jhass: pld: from the code visible the current version seems correct
[15:20:41] sandelius: has joined #ruby
[15:21:31] pld: jhass: thanks, i relied on my IDE (rubymine) which told me the local variable wasn't being used in the .each_message block
[15:21:41] pld: jhass: turns out that information was wrong!
[15:22:06] pld: jhass: do you notice anything that could be more idiotic or improved about the code?
[15:22:12] duoi: has joined #ruby
[15:22:13] pld: idiomatic
[15:22:38] jhass: pld: Hash.new's default value is suspicious
[15:22:46] jhass: pld: note that the _same object_ is used on missing keys
[15:22:47] pld: i'm new with ruby and constantly find new gimmicks
[15:22:49] jhass: it's not copied
[15:22:52] shevy: you have suspicious code elements!
[15:24:04] pld: jhass: i'm not quite sure on how it works internally either but that is the default implementation that comes with the Dashboard "Dashing" for updating the data, or at least the model part is
[15:25:02] pld: it confused me at first that they don't send the keys, only the values
[15:25:12] jhass: doesn't make it any less suspicious
[15:26:53] pld: what exactly do you mean with the "same object"?
[15:27:05] malconis: i guess, didn't notice
[15:27:11] pld: it sends an array of hashes
[15:28:33] spyder55: has joined #ruby
[15:29:43] tubuliferous_: has joined #ruby
[15:30:25] johnDoe111: has joined #ruby
[15:30:35] jhass: pld: what the argument to Hash.new sets is Hash#default, Hash#default is the value that is returned when a key in the hash is fetched that does not exist
[15:30:51] jhass: that value is returned, not an object of it
[15:31:15] truenito: has joined #ruby
[15:31:17] jhass: >> a = []; h = Hash.new(a); h[:a] << 1; h[:b] << 2; a
[15:31:18] ruby[bot]: jhass: # => [1, 2] (https://eval.in/586269)
[15:31:29] jhass: er, *not a copy of it I meant to say
[15:31:32] TomyWork: elomatreb together with rb-notifu it works on windows as well :)
[15:32:42] Vingador: has joined #ruby
[15:33:37] TomyWork: so now my plan is to spawn a simple tcp or http server inside the where i receive status messages from a modified puppet agent in the vagrant box
[15:33:47] TomyWork: inside the vagrant process*
[15:34:19] davedev24: has joined #ruby
[15:36:26] etehtsea: has joined #ruby
[15:36:36] TomyWork: or maybe i'll monkey-patch something in order to intercept some of the puppet output as it flows through vagrant
[15:38:10] spikeheadon: has joined #ruby
[15:38:26] haraigo: has joined #ruby
[15:38:29] lightt: has joined #ruby
[15:39:01] lightt: has joined #ruby
[15:39:55] Yiota: has joined #ruby
[15:40:50] edwinvdgraaf: has joined #ruby
[15:41:43] nando293921: has joined #ruby
[15:44:45] gfvcastro: has joined #ruby
[15:45:38] bobina22: has joined #ruby
[15:45:40] xlegoman: has joined #ruby
[15:45:54] achamian: has joined #ruby
[15:47:15] LaT0rtue: has joined #ruby
[15:47:47] rippa: has joined #ruby
[15:48:23] Yiota: has joined #ruby
[15:49:26] TomyWork: that's the plan
[15:49:42] shevy: monkey-do, monkey-hack
[15:49:44] TomyWork: vagrant isnt very cooperative, so i have to hack
[15:50:32] pepee: has joined #ruby
[15:50:44] tubuliferous_: has joined #ruby
[15:50:45] ash_workz: s/Vagrant/Docker ftw.
[15:51:13] GinoManWorks: has joined #ruby
[15:51:19] jhass: use mongo yo, it's webscale. MySQL not webscale
[15:51:44] helpa: has joined #ruby
[15:51:47] ash_workz: also: https://youtu.be/5W_wd9Qf0IE
[15:51:53] TomyWork: ash_workz try running a different kernel in your container :)
[15:52:05] Vingador: has joined #ruby
[15:52:06] ash_workz: TomyWork: ?
[15:52:18] TomyWork: ash_workz that's exactly the video i was thinking about when shevy said that :D
[15:52:46] norc: has joined #ruby
[15:53:04] hxegon: mongo not web scale enough, use artifact
[15:53:10] TomyWork: ok maybe not that video, but the song i think is playing
[15:53:13] TomyWork: i dont have sound
[15:53:21] TomyWork: but the title suggests it's that one
[15:53:25] hxegon: https://github.com/zv/Artifact
[15:53:28] exadeci: has joined #ruby
[15:53:37] roamingdog: has joined #ruby
[15:53:40] ash_workz: TomyWork: "code monkey get up, get coffee; code monkey go to job. Code monkey have boring meeting, boring manager rob"
[15:53:52] hxegon: ha, I just read that
[15:54:04] amclain: has joined #ruby
[15:54:07] shevy: I did not know that video
[15:54:16] ash_workz: that_video++
[15:54:47] hxegon: https://github.com/zv/Artifact
[15:54:59] hxegon: whoops, I meant https://twitter.com/yminsky/status/739101919025766400
[15:55:04] TomyWork: so now i'll have to write my very first gem \o/
[15:55:07] ash_workz: TomyWork: anyway, please elaborate on your issue with Docker? I am not a *huge* Docker fan... I just appreciate it for my purposes; but I like to have different perspectives
[15:55:33] aufi: has joined #ruby
[15:56:01] ash_workz: s/have/hear
[15:56:15] TomyWork: ash_workz well for one 90% of my users use windows, which eliminates any overhead advantage docker has when setting up a single vm
[15:57:10] TomyWork: and then the software i deploy on the vm is large and monolithic and requires an oracle enterprise db in a vm
[15:57:52] TomyWork: and one requirement is to run this on the customers' OS
[15:57:55] shevy: beastly software stacks
[15:58:53] TomyWork: wrong kernel + correct userland isnt going to cut it :)
[15:59:20] noobsu: has joined #ruby
[15:59:47] ash_workz: TomyWork: so, a couple things to note
[16:00:14] tubuliferous_: has joined #ruby
[16:00:20] chopin: has joined #ruby
[16:00:59] symm-: has joined #ruby
[16:01:14] ash_workz: TomyWork: I don't know how strict your requirements are, but shimming huge code into a docker images is something I've seen people fail to try to do before and it's not the "docker way". The idea there would be to link volumes of data to whatever you're trying to use and have docker service containers to run said code...
[16:01:37] sauvin_: has joined #ruby
[16:02:10] sandelius: has joined #ruby
[16:02:12] ash_workz: TomyWork: secondly; docker native is apparently breaking the WIndows wall; I think it already has broken the Mac wall, so that shouldn't be a problem soon? Idk. But who can wait for that, right? But yeah, I have never used boot2docker before so I don't know of any such woes
[16:02:30] phredus: has joined #ruby
[16:03:00] TomyWork: it's definitely not the docker way
[16:03:13] TomyWork: but i dont see how i can make the docker way work with this application
[16:03:27] chussenot: has joined #ruby
[16:03:29] banister: has joined #ruby
[16:03:43] TomyWork: i need to use the OS-specific packages (rpm, deb), too
[16:03:46] TomyWork: i forgot to mention that
[16:04:29] TomyWork: so I pretty much need to set up the customer's OS as a docker container first and then install the packages into that
[16:04:38] TomyWork: and then i still havent solved the kernel problem
[16:05:08] ash_workz: TomyWork: lastly, if used correctly, there are some benefits that I would think people would like in a wide range of applications; the layering allows you to have multiple images share sources so you don't have to redownload a bunch of stuff; containers are intended to be ephemeral, so the destruction and creation of them are a breeze; docker-compose makes management of VERY complicated...
[16:05:10] ash_workz: ...environments easy
[16:05:12] TomyWork: i think that's an unsolvable problem, too, unless i run docker *on* the customer's OS
[16:05:17] xlegoman: has joined #ruby
[16:05:34] kgrz: has joined #ruby
[16:05:37] pontiki: has joined #ruby
[16:05:41] ash_workz: TomyWork: I'm not entirely sure what your workflow is like in my mind
[16:06:21] TomyWork: i'd focus on the unsolvable problems first
[16:06:22] ash_workz: TomyWork: But if you want, you can always log into your docker containers to add whatever package managers you want (rpm, deb, etc)... or (ideally) just build them into the image.
[16:06:26] TomyWork: i.e. the kernel
[16:06:37] noodle: has joined #ruby
[16:06:37] ash_workz: TomyWork: so, what is the issue with that exactly?
[16:06:56] TomyWork: with docker, host and guest share the same kernel
[16:07:18] ash_workz: TomyWork: feel free to break this discussion... at best we'll both gain some insight to the pros and cons of docker, but I don't think you're going to change anything.
[16:07:34] ash_workz: TomyWork: yes... so what's the conflict exactly?
[16:07:51] TomyWork: one of my requirements is to use the customer's os
[16:07:54] TomyWork: including the kernel
[16:08:24] tubuliferous_: has joined #ruby
[16:08:25] jrafanie: has joined #ruby
[16:08:41] ash_workz: yeah, you're right. I don't think that's solvable.
[16:10:33] synthroid: has joined #ruby
[16:10:48] ramfjord: has joined #ruby
[16:11:01] craigp: has joined #ruby
[16:11:42] idefine: has joined #ruby
[16:12:26] noobsu: has joined #ruby
[16:14:08] jhack: has joined #ruby
[16:15:11] finisherr: has joined #ruby
[16:15:12] rkazak: has joined #ruby
[16:15:40] Asher: has joined #ruby
[16:16:43] jaguarmagenta: has joined #ruby
[16:19:10] alfiemax: has joined #ruby
[16:21:02] allcentury: has joined #ruby
[16:21:48] snath: has joined #ruby
[16:21:49] mleung: has joined #ruby
[16:22:49] moeabdol: has joined #ruby
[16:24:06] mistermocha: has joined #ruby
[16:24:25] SCHAAP137: has joined #ruby
[16:24:52] Guest38: has joined #ruby
[16:25:11] sneakers: has joined #ruby
[16:25:34] jhack: has joined #ruby
[16:27:23] malconis: has joined #ruby
[16:28:25] blockchan: has joined #ruby
[16:30:43] certainty: has joined #ruby
[16:31:33] p337rB: has joined #ruby
[16:32:25] tubuliferous_: has joined #ruby
[16:32:45] RobertBirnie: has joined #ruby
[16:32:49] moeabdol1: has joined #ruby
[16:33:37] hiyosi: has joined #ruby
[16:34:42] tgeeky: hmm. I have a class named SourceQBCustomers with a file named /lib/source_qb_customers.rb; and I am autolaoding the /lib directory, yet it will not find it
[16:34:45] tgeeky: suggestions?
[16:35:13] diegoaguilar: has joined #ruby
[16:35:25] skade: has joined #ruby
[16:36:09] nankyokusei: has joined #ruby
[16:37:27] jhack: has joined #ruby
[16:37:57] giz|work: has joined #ruby
[16:38:26] jackjackdripper: has joined #ruby
[16:39:47] Wolland: has joined #ruby
[16:41:02] pondering_: has joined #ruby
[16:41:50] pondering_: I have a static class with a variable that I only want to set the first time it is accessed. Is there a recommended way to do that?
[16:41:51] skweek: has joined #ruby
[16:42:35] norc_: has joined #ruby
[16:43:09] jhass: pondering_: def foo; @foo ||= compute_foo; end;
[16:44:11] pondering_: @jhass that seems pretty straight forward. Thanks!
[16:44:16] amclain_: has joined #ruby
[16:45:03] dhollinger: has joined #ruby
[16:45:49] blockchan: has joined #ruby
[16:47:53] kareeoleez: has joined #ruby
[16:48:37] moredhel: has left #ruby: ()
[16:51:25] snowy: has joined #ruby
[16:52:16] p337rB: has joined #ruby
[16:52:16] tubuliferous_: has joined #ruby
[16:53:23] buddhabrot: has joined #ruby
[16:53:30] mikecmpbll: has joined #ruby
[16:53:45] spyder55: has joined #ruby
[16:53:59] kith: has joined #ruby
[16:54:05] sankarshanmudkav: has joined #ruby
[16:54:49] emptyflask: has joined #ruby
[16:55:26] hahuang61: has joined #ruby
[16:56:23] amclain: has joined #ruby
[16:57:01] Coldblackice: has joined #ruby
[16:57:02] johnDoe111: has joined #ruby
[16:57:05] jackjackdripper: has joined #ruby
[16:57:08] emptyflask: is there a gemspec syntax that lets me specify a version range that includes prereleases, such as 1.5.0 - 2.0.0.rc1, including a future 2.0.0 release?
[16:57:30] jhack: has joined #ruby
[16:58:32] emilkarl: has joined #ruby
[16:59:38] duckpuppy: has joined #ruby
[17:00:29] mistermocha: has joined #ruby
[17:00:34] flashpoint9: has joined #ruby
[17:00:44] Sou|cutter: emptyflask: maybe `< 2.1` ?
[17:01:06] Rasi: has joined #ruby
[17:01:35] Sou|cutter: nah, I don't think that works like you'd want
[17:02:24] danostrowski: has joined #ruby
[17:02:50] emptyflask: no, it ignores prereleases unless specified
[17:03:07] rbr: has joined #ruby
[17:03:21] AndyBotwin: has joined #ruby
[17:03:21] AndyBotwin: has joined #ruby
[17:03:22] Sou|cutter: including pre-releases seems like not a great idea
[17:04:03] emptyflask: it's not for public consumption :)
[17:04:47] Sou|cutter: most people just keep a separate branch for pre-releases
[17:05:28] emptyflask: i guess that's the best way to handle this
[17:05:43] PaulCapestany: has joined #ruby
[17:05:47] hackeron: has joined #ruby
[17:06:09] jenrzzz: has joined #ruby
[17:06:16] kgrz: has joined #ruby
[17:06:17] giz|work: has joined #ruby
[17:06:22] emptyflask: the main reason is a rails 5 requirement on mime-types that conflicts with rest-client < 2.0
[17:07:13] moredhel: has joined #ruby
[17:07:36] moeabdol2: has joined #ruby
[17:07:43] yqt: has joined #ruby
[17:07:44] emptyflask: once the new rails and rest-client are released, all will be ok
[17:08:11] whathappens: has joined #ruby
[17:09:53] hahuang61: has joined #ruby
[17:09:57] gfvcastro: has joined #ruby
[17:10:52] aegis3121: has joined #ruby
[17:12:08] pepee: has joined #ruby
[17:12:56] p337rB: has joined #ruby
[17:13:27] adgtl: has joined #ruby
[17:15:55] Further: has joined #ruby
[17:17:27] chris2: has joined #ruby
[17:18:00] ramfjord: has joined #ruby
[17:18:44] diegoviola: has joined #ruby
[17:18:56] spikeheadon: has joined #ruby
[17:19:15] lunarg: has joined #ruby
[17:19:21] ChiefAlexander: has joined #ruby
[17:19:27] hxegon: why does pry -r lib/whatever.rb not work, but pry -r ./lib/whatever.rb will?
[17:19:59] cschneid: has joined #ruby
[17:20:19] sp4rrow: has joined #ruby
[17:20:34] rcvalle: has joined #ruby
[17:20:39] jhass: because it's the same as Kernel#require
[17:20:40] workmad3_: hk238: `-r foobar` is the equivalent of writing `require "foobar"` as the first line of the session
[17:20:48] workmad3_: hk238: and `.` isn't on the default load path
[17:20:57] p337rB: has joined #ruby
[17:21:15] jhass: so one alternative is pry -Ilib -rwhatever
[17:22:05] hxegon: ah, ok. Thanks
[17:22:12] whathapp_: has joined #ruby
[17:23:02] whathapp_: has joined #ruby
[17:23:14] cdg: has joined #ruby
[17:23:27] allcentury: has joined #ruby
[17:25:05] GinoManWorks: has joined #ruby
[17:26:05] domgetter: has joined #ruby
[17:27:34] djbkd: has joined #ruby
[17:27:58] mtkd: has joined #ruby
[17:29:32] aufi: has joined #ruby
[17:29:32] jrafanie: has joined #ruby
[17:30:05] pmyjavec: How do people go about using Object.send to methods which take different number of arguments? Is there a nice pattern to deal with that ?
[17:30:12] jenrzzz: has joined #ruby
[17:30:13] jenrzzz: has joined #ruby
[17:30:26] pmyjavec: Are keyword args compatible with Object.send?
[17:31:01] asdf123: has joined #ruby
[17:31:11] jhass: I generally avoid #send, for the few legitimate usecases I use #public_send
[17:31:25] asdf123: can anyone recommend a free book to learn ruby
[17:31:31] jhass: both take regular arguments, keywords arguments, splats and double splats just well
[17:31:34] asdf123: preferably not too length, something i could read in a day or two
[17:31:36] certainty: has joined #ruby
[17:31:49] baweaver: what have you found so far?
[17:32:38] Guest4184_______: has joined #ruby
[17:33:01] beatdown: has joined #ruby
[17:33:44] pmyjavec: How do you send a keyword argument, I can't see it in the documentation?
[17:34:06] last_staff: has joined #ruby
[17:34:12] pondering_: has joined #ruby
[17:34:14] jhass: just like you would to a regular method
[17:34:26] SilverKey: has joined #ruby
[17:34:29] pondering_: @jhass one more question. I'm only accessing that variable within that class. Is that still how you would write it?
[17:34:44] jhass: pondering_: yes, perhaps make the method private
[17:35:04] jhass: pondering_: that is if it has to be lazy, else just assign it in initialize
[17:35:19] pondering_: @jhass no initialize, it is static
[17:35:30] jhass: there's no such thing in ruby
[17:35:37] TomyLobo: has joined #ruby
[17:35:50] pondering_: @jhass I mean I am not creating instances of my classes
[17:35:57] pondering_: everything is self.something
[17:36:03] jhass: then they should be modules btw
[17:36:13] jhass: or you use a singleton pattern
[17:36:14] pondering_: There were problems with that
[17:36:29] lysw123: has joined #ruby
[17:36:31] pondering_: all of my variables are constants except this one
[17:36:37] jhass: a class with only self. methods is in no way different from a module
[17:36:38] pondering_: So it hasn't been an issue
[17:36:49] pondering_: jhass I'm using a test framework that didn't like it
[17:36:51] jhass: >> Class.ancestors
[17:36:52] ruby[bot]: jhass: # => [Class, Module, Object, Kernel, BasicObject] (https://eval.in/586312)
[17:36:54] pondering_: I can't remember why not
[17:37:20] pondering_: But it refused to let me use modules for some reason
[17:37:38] jhass: sounds like a quite stupid framework
[17:37:39] sameerynho: has joined #ruby
[17:37:55] pondering_: Well, it's what I've got
[17:38:20] pondering_: So basically if I want to access @foo, I actually need to access "foo" not "@foo"
[17:39:07] toretore: pondering_: it would be much easier to give advice if you provided some code to demonstrate the actual use case
[17:39:18] SegFaultAX: >> ("abc" "def")
[17:39:19] ruby[bot]: SegFaultAX: # => "abcdef" (https://eval.in/586313)
[17:39:27] SegFaultAX: ^ is there a multiline form if that?
[17:39:55] toretore: SegFaultAX: heredocs
[17:40:01] SegFaultAX: toretore: Not quite
[17:40:05] SegFaultAX: I don't want the newlines
[17:40:18] toretore: that's the "multiline" part
[17:40:25] SegFaultAX: But I don't want the literal to have to be all on one line.
[17:40:32] Wolland: has joined #ruby
[17:40:48] SegFaultAX: toretore: You cannot have ("abc" <newline>"def")
[17:41:05] SegFaultAX: It doesn't concatenate all the strings together like it does in Python
[17:41:14] SegFaultAX: It ignore everything but the last line in the parens.
[17:41:18] toretore: escape the newline
[17:41:28] SegFaultAX: I literally just said I don't want to use line continuations
[17:41:45] toretore: i literally just didn't say that
[17:42:03] mikecmpbll: has joined #ruby
[17:42:11] baweaver: ACTION grabs popcorn
[17:42:12] toretore: escape the newline in your code, not inside the string
[17:42:37] SegFaultAX: And I literally said I don't want to do that
[17:43:04] SegFaultAX: Assuming you mean make this:
[17:43:04] SegFaultAX: 2.3.0 :001 > ("abc"
[17:43:04] SegFaultAX: 2.3.0 :002?> "def")
[17:43:13] sergey_makagon: has joined #ruby
[17:43:20] SegFaultAX: 2.3.0 :003 > ("abc" \
[17:43:20] SegFaultAX: 2.3.0 :004 > "def")
[17:43:38] SegFaultAX: Sorry for the six line paste, btw.
[17:43:40] toretore: so what's wrong with it? it does exactly what you want
[17:44:05] SegFaultAX: My original question was, is there a multiline form of that so I don't have to use a line continuation.
[17:44:12] baweaver: Use a +, relying on compiler weirdness is a good way to have later issues.
[17:44:40] toretore: it's not compiler weirdness, \ is the escape character, and in this case it escapes the newline
[17:44:41] SegFaultAX: baweaver: Yea that's what I was thinking I'd have to resort to
[17:44:59] baweaver: toretore no no, not that
[17:45:06] swills_: has joined #ruby
[17:45:06] baweaver: >> "this" "thing"
[17:45:07] ruby[bot]: baweaver: # => "thisthing" (https://eval.in/586319)
[17:45:11] SegFaultAX: It's string to be that a parenthesized list doesn't concat all the strings
[17:45:24] SegFaultAX: That seems like a reader bug to me.
[17:45:49] SegFaultAX: It's strange to me*
[17:45:54] SegFaultAX: I can't type, ugh.
[17:46:14] eam: seems like "this" <newline> "string" ought to concat both strings
[17:46:15] miqlas-H: has joined #ruby
[17:47:01] eam: ruby would be a better language if it had an explicit semicolon statement delimiter
[17:47:21] toretore: *expression
[17:47:21] mdw: has joined #ruby
[17:47:22] ytti: you take that back right meow
[17:47:42] SegFaultAX: eam: When inside parens, I agree. As for semicolons, no.
[17:48:04] eam: you know it's true in your heart of hearts
[17:48:21] SegFaultAX: I know it's idiotic in my heart of hearts. :)
[17:48:41] pondering_: @toretore @jhass here's some pseudocode http://pastebin.com/6hFaQpmY
[17:48:42] ruby[bot]: pondering_: we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/4396cac10346782ede8e9aa2bb279690
[17:48:42] ruby[bot]: pondering_: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[17:48:50] rueben_: has joined #ruby
[17:49:18] gfvcastro: has joined #ruby
[17:49:44] toretore: pondering_: first of all, why are you using classes like that?
[17:49:55] toretore: singletons are bad
[17:50:20] pondering_: It's going to take me a long time to explain that
[17:50:23] toretore: pondering_: secondly, it's still not an actual real-life use case
[17:50:37] pondering_: I'm not allowed to paste the real code
[17:51:09] toretore: good policy, i'd definitely steal it
[17:51:13] danostrowski: has joined #ruby
[17:51:29] pondering_: Heh, I know it's not worth stealing but it offers insight into how my company's application works
[17:51:35] toretore: the code you pasted wouldn't work because one is an instance method and one is a "class method"
[17:51:38] pondering_: So rather than get fired, I'm writing pseudocode
[17:51:59] eeinqt: has joined #ruby
[17:52:09] pondering_: @toretore yes, I know it doesn't work
[17:52:16] pondering_: That's why I'm talking in this channel
[17:52:28] toretore: and i still don't understand what it is you want to do
[17:52:32] craigp: has joined #ruby
[17:52:46] cdg: has joined #ruby
[17:52:50] pondering_: Our app runs on an iPad
[17:52:50] yfeldblum: has joined #ruby
[17:52:53] toretore: is there a reason why one is an instance and the other a class method?
[17:53:02] pondering_: iPad apps have developer settings which are toggled by a user
[17:53:20] pondering_: @toretore jhass suggested it
[17:53:22] dar123: has joined #ruby
[17:53:40] jhass: pondering_: back when that context wasn't clear at all
[17:53:47] pondering_: I'm afraid I don't know which question to answer now
[17:53:49] jhass: I should not existent
[17:53:52] jhass: *should say
[17:53:55] pondering_: Do you want the backstory or...?
[17:54:01] toretore: ok, continue..
[17:54:12] hahuang61: has joined #ruby
[17:54:29] toretore: i want to understand what it is you're trying to do
[17:54:50] pondering_: okay, so iPads have developer settings that toggle options based on user preference. Let's say this one user preference is called "preference1"
[17:54:52] toretore: the more data we get, the better advice we can give
[17:55:08] pondering_: I don't know until the app is running whether the user preference is true or false
[17:55:22] pondering_: So I can't just set it like we set our normal variables
[17:56:03] pondering_: I need to be able to set it one time (not more than one time) and only on run-time
[17:56:10] pondering_: Within the class it is in
[17:56:26] pondering_: Which happens to be a class and not a module
[17:56:33] pondering_: And everything in that class happens to use self
[17:56:35] dionysus70: has joined #ruby
[17:56:38] pondering_: And no that's not going to change today
[17:57:31] eeinqt: has joined #ruby
[17:57:34] flashpoint9: has joined #ruby
[17:57:44] pondering_: Does that make any more sense?
[17:57:49] jhass: pondering_: you should take the time to research and understand what def self. actually does
[17:57:54] toretore: ok, so you basically have a singleton instance (the "static" class), which is how the app runs, and inside its methods you access a preference which is also a method on this class?
[17:57:57] eeinqt: has joined #ruby
[17:58:26] eeinqt: has joined #ruby
[17:58:55] pondering_: The app is running on an iPad and contains a web service the ruby code talks to
[17:59:12] pondering_: User says "i want to tap on object a on the screen"
[17:59:23] cstrahan: has joined #ruby
[17:59:41] pmarreck: has joined #ruby
[17:59:56] pondering_: my code says "okay, first let me ask the app what Preference1 is
[18:00:13] toretore: where is "my code" when this happens?
[18:00:35] toretore: and what exactly does it mean to ask the app about pref1?
[18:00:41] jabreity__: has joined #ruby
[18:00:44] pondering_: There are a lot of layers of code
[18:01:05] pondering_: user test --> layer that parses user test --> helper class --> talk to app
[18:01:20] c355E3B: has joined #ruby
[18:01:22] pondering_: user doesn't care about helper classes
[18:01:28] zrl_: has joined #ruby
[18:01:45] pondering_: helper class needs to be able to appropriately set the string for the preference in the ruby code based on the app setting
[18:02:13] shinnya: has joined #ruby
[18:02:22] pondering_: if preference1 is true, @active_overlay = "A", if false, @active_overlay = "B"
[18:02:34] pondering_: But I don't want to keep sending queries to the app because it's expensive
[18:02:56] tAn: has joined #ruby
[18:02:58] exadeci: has joined #ruby
[18:03:12] colegatron: has joined #ruby
[18:03:32] pondering_: some_method_to_determine_value(...) --> represents the call to the app
[18:03:36] toretore: how and from where do you read @active_overlay ?
[18:03:49] pondering_: AnotherClass.foo(@active_overlay)
[18:03:49] Xiti: has joined #ruby
[18:03:58] Raboo: has joined #ruby
[18:04:18] toretore: where exactly is this run from?
[18:04:27] pondering_: In the example above it would be tap(@active_overlay) where tap is a method owned by the base test framework we built on
[18:04:39] kobain: has joined #ruby
[18:04:45] pondering_: A computer running OSX
[18:04:59] sanika: has joined #ruby
[18:05:23] giz|work: has joined #ruby
[18:05:44] postmodern: has joined #ruby
[18:06:21] hobodave_: has joined #ruby
[18:06:24] pondering_: All I really want to know is how to set a class instance variable only the first time it is used
[18:06:57] toretore: you don't, you use a method
[18:07:08] toretore: don't access @active_overlay directly
[18:07:20] cstrahan: has joined #ruby
[18:07:28] pondering_: OK that is the answer to the question I asked awhile back :)
[18:07:35] jhass: there's no difference between a "class instance variable" and an "instance variable", they just have different objects where they reside
[18:07:43] voodoofish4302: has joined #ruby
[18:07:43] jancel: has joined #ruby
[18:07:45] toretore: it might be that you're just looking to do def active_overlay; @active_overlay ||= SomethingElse.pref1; end
[18:07:49] jpinnix_______: has joined #ruby
[18:07:54] acalewin: has joined #ruby
[18:07:58] pondering_: That's what jhass said a long time ago
[18:08:05] c0mrad3: has joined #ruby
[18:08:17] pondering_: When you asked me for the code, I was asking a follow-up question about that
[18:08:19] toretore: ok, so does that not work?
[18:08:25] digitalfiz: has joined #ruby
[18:08:36] pondering_: It did not. But I will continue looking into it.
[18:09:15] nekomune: has joined #ruby
[18:09:49] xfbs: has joined #ruby
[18:10:01] hakunin: has joined #ruby
[18:10:14] Kneecaps: has joined #ruby
[18:10:52] alfiemax: has joined #ruby
[18:10:57] Lildirt: has joined #ruby
[18:10:59] jhass: understanding that classes and modules are just instances of Class and Module and that every Ruby object has an implicit singleton class is a very worthwhile effort for your career as a Ruby programmer
[18:11:04] SilverKey: has joined #ruby
[18:11:13] jhass: it'll also make the solution to your current problem immediately obvious
[18:11:40] Saloun: jhass: any idea about that problem yet?
[18:12:16] jhass: I didn't and don't plan to spend any time on it
[18:12:39] tAn: has joined #ruby
[18:15:15] eeinqt: has joined #ruby
[18:15:19] aberen: has joined #ruby
[18:16:37] jenrzzz: has joined #ruby
[18:16:38] humd1ng3r: has joined #ruby
[18:16:48] yo61: has joined #ruby
[18:17:07] sergey_makagon: has joined #ruby
[18:17:18] jpinnix_______: has joined #ruby
[18:17:30] jaguarmagenta: has joined #ruby
[18:17:52] sergey_makagon: has joined #ruby
[18:17:57] digitalfiz: has joined #ruby
[18:19:00] tAn: has joined #ruby
[18:21:39] tAn: has joined #ruby
[18:23:08] jrafanie: has joined #ruby
[18:23:44] norc_: has joined #ruby
[18:23:46] Synthead: is there a better way to do "not [ ... ].any?" ?
[18:24:10] tao_: has joined #ruby
[18:24:14] allcentury: has joined #ruby
[18:24:26] jhass: http://devdocs.io/ruby~2.3/enumerable#method-i-none-3F
[18:24:56] digitalfiz: has joined #ruby
[18:25:07] jrafanie: has joined #ruby
[18:25:18] shevy: I don't think I have ever used none? so far
[18:25:24] smathy: has joined #ruby
[18:25:31] shevy: these devdoc are really nicer to read than the official ruby docu
[18:25:55] kobain: has joined #ruby
[18:26:19] zrl_: has joined #ruby
[18:26:54] mensvaga: has joined #ruby
[18:27:39] der-landgraf: has joined #ruby
[18:28:14] TinkerTyper: has joined #ruby
[18:30:37] mensvaga: What's the best way to insert a # in front of every line in a string? I could gsub(/\n/,/\n#/) , but that wouldn't get the first line.
[18:31:07] jhass: mmh, I think gsub(/^/, "#") works
[18:31:08] mensvaga: I could split("\n") , then concatenate,
[18:31:24] swgillespie: has joined #ruby
[18:31:25] jhass: .lines.map.join is the other option, yeah
[18:31:58] alfiemax: has joined #ruby
[18:32:15] certainty: has joined #ruby
[18:32:35] dangerousdave: has joined #ruby
[18:32:41] jhass: >> "a\nb\nc".gsub(/^/, "#")
[18:32:42] ruby[bot]: jhass: # => "#a\n#b\n#c" (https://eval.in/586386)
[18:32:53] tAn: has joined #ruby
[18:33:08] mensvaga: Well, hey. THat's pretty cool. I wouldn't have thought of using ^ like that.
[18:33:13] karmatr0n: has joined #ruby
[18:34:37] Xiti: has joined #ruby
[18:35:42] tgeeky: mensvaga: that's how i comment out blocks in vim
[18:35:50] voodoofish430: has joined #ruby
[18:36:08] jabreity__: has joined #ruby
[18:36:21] mensvaga: It makes sense, but it's not how I would think about using ^ , especially in a multi-line-string.
[18:36:56] mensvaga: Two things; first, regex flags probably allow you to say that ^ only corresponds to the beginning of the string, not necessarily the beginning of a new line in the string
[18:36:58] nankyokusei: has joined #ruby
[18:37:07] mensvaga: second, that the concept of ^ is something to be replaced.
[18:37:14] voodoofish4302: has joined #ruby
[18:37:15] mensvaga: But, if it works, it works.
[18:37:21] jhass: Ruby's a bit different here
[18:37:28] jhass: \A is beginning of string
[18:37:31] jhass: ^ is beginning of line
[18:37:35] jhass: m only affects .
[18:37:37] dangerousdave: has joined #ruby
[18:37:47] mensvaga: Makes sense.
[18:37:59] iamdevnul: has joined #ruby
[18:38:10] Ishido: has joined #ruby
[18:38:28] mensvaga: I'm writing something that generates nagios configurations from a data structure. But, that data structure is automatically generated from something else.
[18:38:30] tgeeky: can someone help me guess how to specify this XML via the hash?
[18:38:31] tgeeky: https://gist.github.com/technogeeky/1c6abedbd453d273313eeb7f2bf071fb
[18:38:42] whathappens: has joined #ruby
[18:38:55] tgeeky: I have tried :active_status => :all, and lots of other options, none seem to work
[18:39:11] mensvaga: So, I'm using data_structre.pretty_inspect.gsub(/^/,"#") , which puts the data structure in the output file as well (for debugging)
[18:39:29] dangerousdave: has joined #ruby
[18:39:32] tAn: has joined #ruby
[18:40:17] lupine: has joined #ruby
[18:40:29] tgeeky: ^ re my reques; gem is qbwc, and the max_returned part works already
[18:40:30] dangerousdave: has joined #ruby
[18:41:17] Wolland: has joined #ruby
[18:42:24] agit0: has joined #ruby
[18:42:25] monod: has joined #ruby
[18:42:34] multi_io: has joined #ruby
[18:44:59] moeabdol: has joined #ruby
[18:45:23] cdg: has joined #ruby
[18:45:30] tAn: has joined #ruby
[18:45:31] dangerousdave: has joined #ruby
[18:45:39] smathy: tgeeky, the docs you linked to show qbXML as version 13.0, and your XML says it's 7.0
[18:45:56] smathy: ...maybe 7.0 had a different set of elements.
[18:46:01] tgeeky: smathy: I didn't think of that initially, but I checked it about 4 minutes ago
[18:46:03] tgeeky: they are the same
[18:46:14] tgeeky: good catch, but that's not it :)
[18:46:51] iamdevnul: has joined #ruby
[18:47:15] smathy: Seems fine then.
[18:48:27] Kneecaps_: has joined #ruby
[18:49:28] chouhoulis: has joined #ruby
[18:50:46] DukeDave: has joined #ruby
[18:51:11] kirun: has joined #ruby
[18:51:42] tAn: has joined #ruby
[18:52:03] whathappens: has joined #ruby
[18:52:15] davidmichaelkarr: has joined #ruby
[18:53:04] tAn: has joined #ruby
[18:53:45] chridal: has joined #ruby
[18:53:53] sphex: has joined #ruby
[18:53:59] chridal: has joined #ruby
[18:54:55] snath: has joined #ruby
[18:55:43] whiteline: has joined #ruby
[18:56:01] gmci: has joined #ruby
[18:56:35] caw: has joined #ruby
[18:57:29] bestie: has joined #ruby
[18:58:45] mrfooo: has joined #ruby
[18:59:17] Dimik: has joined #ruby
[18:59:46] tAn: has joined #ruby
[19:03:36] digitalfiz: has joined #ruby
[19:04:03] kallisti5: has joined #ruby
[19:04:27] DarkBushido: has joined #ruby
[19:04:27] DarkBushido: has joined #ruby
[19:05:09] gmci: has joined #ruby
[19:09:07] babblebre: has joined #ruby
[19:09:39] Kneecaps: has joined #ruby
[19:09:40] johnDoe111: has joined #ruby
[19:09:42] k3rn31: has joined #ruby
[19:09:44] hahuang61: has joined #ruby
[19:09:55] zeroDi: has joined #ruby
[19:11:11] postmodern: has joined #ruby
[19:11:22] diegoviola: has joined #ruby
[19:11:33] speakingcode: has joined #ruby
[19:11:46] yqt: has joined #ruby
[19:11:52] ocbtec: has joined #ruby
[19:12:14] flughafen_: has joined #ruby
[19:12:51] matp: has joined #ruby
[19:14:08] voodoofish430: has joined #ruby
[19:14:19] jenrzzz: has joined #ruby
[19:15:27] aberen: has joined #ruby
[19:16:24] peitur: has joined #ruby
[19:18:13] sameerynho: has joined #ruby
[19:19:17] pmyjavec: Hey all, on line 5 of this https://gist.github.com/pmyjavec/e7dcdac39914863fb6a0f024fdeb6b3b, the method does not exist, but for some reason the exception is being caught and my application jsut hangs?
[19:19:27] sp4rrow: has joined #ruby
[19:19:32] wrkrcoop: has joined #ruby
[19:19:34] pmyjavec: Can anyone see why it's not being picked up by the VM and the application should just crash ?
[19:20:22] wrkrcoop: can someone take a look @ this and tell me if i’m using rescue correctly? https://gist.github.com/ellismarte/bea2e991f292cf3c9a8710860f2c8a08
[19:21:10] adaedra: First, def ... end blocks act as begin .. end block, so you can put a rescue at method level too
[19:21:20] wrkrcoop: im trying to rescue if the key doesn’t exist and also rescue if the internal logic doesn’t work
[19:21:50] adaedra: I don't see where it can raise
[19:22:16] wrkrcoop: adaedra: is that what im supposed to do?
[19:22:28] adaedra: You should not be using exceptions for control flow
[19:22:37] adaedra: Better to check your data
[19:23:00] adaedra: Also, rescuing StandardError is a very large nest, you shall be aiming for more precise exceptions to catch
[19:23:01] tubuliferous_: has joined #ruby
[19:23:03] wrkrcoop: adaedra: i feel like exception isn’t the right word … if the key isn’t there i just want to log it and not crash the server
[19:23:04] spider-mario: has joined #ruby
[19:23:21] pmyjavec: adaedra, who are you talking too ? :)
[19:23:30] adaedra: pmyjavec: wrkrcoop
[19:23:32] havenwood: pmyjavec: wrkcoop
[19:23:40] adaedra: havenwood: tab key
[19:24:18] pmyjavec: Has anyone had problems when you `raise` then nothing happens? It's like i'm capturing my exception and then nothing is happening
[19:24:34] shevy: adaedra he just needs more coffee!
[19:24:41] havenwood: ACTION gulps
[19:24:45] adaedra: wrkrcoop: if your goal is just to manage the case where arg has no "data" key, you can do an early return, like `return [] unless arg.key?("data")`
[19:24:54] sandelius: has joined #ruby
[19:24:58] allcentury: has joined #ruby
[19:25:04] shevy: pmyjavec could be if you also read user input or wait otherwise on something to happen, or in a thread that is still running but silencing what it yields
[19:25:11] adaedra: if you can check for case that can raise and throw them away like that, all the better, wrkrcoop
[19:25:13] danostrowski: has joined #ruby
[19:25:17] pmyjavec: shevy , I am doing that
[19:25:18] havenwood: wrkrcoop: +1 for avoiding raising for flow control - treat exceptions as exceptional
[19:25:42] adaedra: pmyjavec: you can try to run Ruby in debug mode to see raised exceptions even if caught
[19:25:50] shevy: I had to use "Thread.abort_on_exception = true" for the first time in my life, about 3 months ago or so. a ruby gtk program had errors but it never exited
[19:25:57] kgrz: has joined #ruby
[19:26:36] pmyjavec: Yeah, it's pretty confusing to be honest
[19:26:39] wrkrcoop: am i right in assuming rescue raises an exception?
[19:26:48] adaedra: No, rescue catches it.
[19:27:08] adaedra: >> begin; raise 'Oops'; rescue; puts "Oh noes"; end
[19:27:08] ruby[bot]: adaedra: # => Oh noes ...check link for more (https://eval.in/586406)
[19:27:12] wrkrcoop: hmm i thought it caught errors
[19:27:19] wrkrcoop: or handled exceptions — is that the smae thing?
[19:27:22] adaedra: there's two steps
[19:27:36] pmyjavec: shevy, it must be catching some exception outside of the exceptions my application raises
[19:27:43] pmyjavec: something like that...
[19:27:44] adaedra: raising the exception is creating it, rescue catches the raised exception
[19:27:55] wrkrcoop: so confused
[19:28:07] arlek: has joined #ruby
[19:28:07] adaedra: let me write a little thing
[19:28:15] agent_white: has joined #ruby
[19:29:21] NorthernHorse: has joined #ruby
[19:29:34] adaedra: wrkrcoop: https://eval.in/586408
[19:29:39] pmyjavec: shevy, thanks that helped, it seems the exception is one I'm supposed to be handling
[19:29:51] pmyjavec: just locks up the whole thread
[19:30:10] wrkrcoop: adaedra: so the oh noes part is that like an error happens, and because an error happens raise an exception called Dragon?
[19:30:44] flughafen_: has joined #ruby
[19:30:50] adaedra: no, "Dragon" is the text associated to the exception: it's the exception I encounter
[19:31:14] wrkrcoop: so lets say i try to access some key
[19:31:17] wrkrcoop: and the key is not there
[19:31:18] eljimbo: has joined #ruby
[19:31:24] wrkrcoop: would i raise a ‘key not found’?
[19:31:35] adaedra: no, it does not in ruby, it returns nil.
[19:31:52] wrkrcoop: yeah it returns nil, so what is an example of something i’d raise?
[19:31:56] shevy: pmyjavec YAY!!! I have random superpowers!
[19:32:12] pontiki: what are they this round, shevy ?
[19:32:17] adaedra: But that's where you get in the "Don't use exceptions for control flow rule": You can pretty well check for existance of the key and handle the case directly
[19:32:27] shevy: pontiki I don't know yet! I have to discover them properly first I think
[19:32:39] wrkrcoop: hmmm ok, what is the point of exceptions?
[19:32:50] eljimmy: has joined #ruby
[19:32:54] adaedra: You can raise in your program because you call `#each` which does not exists on nil
[19:32:54] shevy: wrkrcoop to indicate different failure types
[19:32:58] certainty: has joined #ruby
[19:33:05] shevy: like you have in bash, the exit codes
[19:33:05] adaedra: Exceptions are for exceptional cases
[19:33:13] monod: has joined #ruby
[19:33:15] pontiki: man, if superpowers were like fluxx cards
[19:33:54] pontiki: you get your hand telling you what you superpowers are each day
[19:34:23] shevy: pontiki only one superpower per day?
[19:34:30] wrkrcoop: ok let me see if i understand, i use begin - raise - rescue - end in order to prevent my code from crashing. raise indicates the type of error i encounter, and rescue handles it?
[19:34:32] pontiki: you get dealt 5
[19:34:38] NorthernHorse: has left #ruby: ()
[19:34:46] adaedra: wrkrcoop: yes
[19:34:52] wrkrcoop: so i could have several raises right next to each other?
[19:35:09] pontiki: still not getting the concept, i fear
[19:35:15] mrmortondk: has joined #ruby
[19:35:15] wrkrcoop: raise syntax error, raise someOtherError, etc
[19:35:37] adaedra: wrkrcoop: you should read up online on exceptions; explaining like that on IRC is not the best way to teach I'm afraid
[19:35:52] wrkrcoop: thanks for the help
[19:36:10] pepee: has joined #ruby
[19:36:29] adaedra: Also, other calls can raise exceptions, and that's the point: Exceptions stop the current program flow and are going up in the stack until they are caught
[19:36:59] adaedra: But they should be reserved for rare cases that should not happen at all in normal usage
[19:37:27] adaedra: On these words, I have to leave for a bit
[19:37:45] polll: has joined #ruby
[19:39:10] sp4rrow: has joined #ruby
[19:40:03] pontiki: wrkrcoop: i recommend "Exceptional Ruby" by Avdi Grimm for a learning about what exceptions are and how to use them -- and as much how *not* to use them
[19:40:41] Eiam: has joined #ruby
[19:40:57] tgeeky: smathy: FYI, since you helped: it was the order of arguments. The elements of the request have to be ordered exactly as the specification.
[19:40:58] ledestin: has joined #ruby
[19:41:38] smathy: tgeeky, sigh, stupid APIs.
[19:41:44] smathy: Glad you got it sorted.
[19:41:51] tgeeky: aye. thanks.
[19:42:00] Wolland: has joined #ruby
[19:44:44] aegis3121: has joined #ruby
[19:46:11] aufi: has joined #ruby
[19:48:56] postmodern: has joined #ruby
[19:49:47] ule: Hey guys
[19:50:02] ule: anyone here using VIM + NERDTree + vim-bundle ?
[19:50:30] ule: Fernando-Basso: ping
[19:50:43] sandstrom: has joined #ruby
[19:51:55] symm-: has joined #ruby
[19:52:15] norc_: ule, I wanted to buy a Peugeot, so I went to a BMW shop.
[19:52:44] ule: norc_: yeah, maybe you could get a good deal getting an used car there
[19:52:51] swills: has joined #ruby
[19:53:11] hxegon: norc_: illusion of transparency?
[19:53:17] hxegon: ule: is this a ruby question?
[19:53:20] Madplatypus: has joined #ruby
[19:53:21] truenito: has left #ruby: ("Bye!")
[19:53:48] truenito: has joined #ruby
[19:54:17] ule: hxegon: it's a plugin to code ruby in vim
[19:54:35] tgeeky: ule: none of the three you listed are?
[19:54:42] tgeeky: vim-bundle is close, since it's a ruby bundler
[19:55:05] tgeeky: ule: what is the question/problem?
[19:55:46] Spami: has joined #ruby
[19:55:49] ule: tgeeky: nevermind
[19:56:02] ule: I noticed that here there is no ruby developers using VIM
[19:56:16] tgeeky: there are a bunch, probably.
[19:56:23] tgeeky: I don't use vim-bundle, though. Or NERDtree.
[19:56:30] ule: tgeeky: When I execute NERDtree, and then :Bopen in order to open a gem source
[19:56:39] hxegon: I use nerdtree, but that isn't specific to ruby at all
[19:56:53] ule: it opens the files on the LEFT window instead of opening the files on the right window
[19:57:26] tgeeky: ule: ah. that is probably a nerdtree configuration option
[19:57:31] ule: in NERDTree, when you select a file from left window (tree of files) it opens the files in right side
[19:57:44] ule: but only when I type :Bopen it craches
[19:58:04] ule: tgeeky: I'll open an issue on vim-bundle github
[19:58:11] ule: thanks anyways
[19:58:12] Pumukel: has joined #ruby
[19:58:36] DTZUBDUB: has joined #ruby
[19:59:26] duckpuppy: has joined #ruby
[19:59:27] tgeeky: ule: also, it seems that even vim-bundle is not "ruby specific". It's just a (not very highly used) vim "bundle" manager
[19:59:32] tgeeky: ie, it doesn't appear to have anything to do with bundler
[19:59:43] tgeeky: i would use vundle or one of the other big vim bundlers
[19:59:55] wrkrcoop: has joined #ruby
[20:00:05] cdg: has joined #ruby
[20:00:09] smathy: Bopen opening the gem in the current window seems to be the correct behavior, fwiw.
[20:00:28] wrkrcoop: adaedra: so this works: https://gist.github.com/ellismarte/bea2e991f292cf3c9a8710860f2c8a08 but i’m not raising anything … should i be raising something?
[20:00:31] solars: has joined #ruby
[20:00:34] ule: smathy: it opens the gem inside the three (left side)
[20:00:50] hxegon: have you tried #vim?
[20:01:04] ule: hxegon: I'll try.. thanks
[20:01:25] smathy: ule, right, that's what Bopen does. Just sounds like nerdtree doesn't integrate with vim-bundler.
[20:01:55] tgeeky: oh, vim-bundler is... a bundler vim thing.
[20:01:59] tgeeky: weird, there are three of those
[20:02:03] mdw: has joined #ruby
[20:02:36] tgeeky: ule: reading the manual
[20:02:37] tgeeky: https://github.com/tpope/vim-bundler/blob/master/doc/bundler.txt
[20:02:38] ule: https://github.com/tpope/vim-bundler
[20:02:58] tgeeky: it seems you went something like :Bsplit, or :btabedit
[20:03:13] tgeeky: perhaps you could remap one of those on top of :Bopen
[20:03:14] smathy: ACTION just CtrlPs
[20:03:18] ule: tgeeky: that makes sense
[20:03:33] tgeeky: ule: it's the first thing I've thought today that does make sense, so that's progress
[20:04:19] A124: has joined #ruby
[20:05:37] tildes_: has joined #ruby
[20:06:57] postmodern: has joined #ruby
[20:09:49] sepp2k: has joined #ruby
[20:10:56] solocshaw: has joined #ruby
[20:11:13] workmad3: has joined #ruby
[20:11:37] johnDoe111: has joined #ruby
[20:12:53] minimalism: has joined #ruby
[20:13:57] blackgoat: has joined #ruby
[20:14:31] al2o3-cr: has joined #ruby
[20:14:50] roamingdog: has joined #ruby
[20:15:32] mistermocha: has joined #ruby
[20:15:42] AnoHito_: has joined #ruby
[20:15:57] achamian: has joined #ruby
[20:16:25] mistermocha: has joined #ruby
[20:16:30] wrkrcoop: if i called a method like scrub_data(data)
[20:16:35] wrkrcoop: and wrapped it in a begin rescue end
[20:16:42] wrkrcoop: if theres an error inside the data will i rescue it ?
[20:17:04] toretore: if there is an exception
[20:17:13] toretore: error != exception
[20:17:15] wrkrcoop: toretore: is an exception just another name for error?
[20:17:46] wrkrcoop: but this works: https://gist.github.com/ellismarte/bea2e991f292cf3c9a8710860f2c8a08
[20:18:04] toretore: error can mean many things. in your case "error in data" could mean malformed data that does not cause an exception
[20:18:13] jaguarmagenta: has joined #ruby
[20:18:20] Yiota: has joined #ruby
[20:18:43] toretore: you have an end too many there
[20:18:52] wrkrcoop: toretore: but i have to begin rescue statements?
[20:19:14] toretore: or improper indentation, i can't tell
[20:19:24] wrkrcoop: improper indentation
[20:19:26] toretore: if it works, proably the latter
[20:19:34] wrkrcoop: so whats the dif between an error and exception?
[20:19:48] toretore: "error" doesn't mean anything in particular
[20:19:53] spikey: has joined #ruby
[20:20:21] toretore: forget about "error", focus only on exceptions
[20:20:31] hahuang61: has joined #ruby
[20:20:51] toretore: if an exception is raised, a rescue will rescue it (as long as it is-a whatever you told it to rescue)
[20:22:20] tgeeky: how does one normally place .rb files which modify base stuff (object, string, array, etc) in a git repo?
[20:22:27] tgeeky: lib/<name>/extending?
[20:22:34] toretore: one does not normally write those
[20:22:39] tgeeky: well one has no choice
[20:22:41] shevy: tgeeky I tend to have a directory called core/
[20:22:47] toretore: a boy has been naughty
[20:22:56] tgeeky: shevy: ok thanks
[20:23:00] workmad3: tgeeky: I'd normally go lib/ext/<thing>
[20:23:14] whathappens: has joined #ruby
[20:23:16] wrkrcoop: what is the dif between an exception and error
[20:23:28] pontiki: rails uses 'lib/core-ext/...'
[20:23:30] toretore: there is always a choice; you could choose the light or you could succumb to the darkness of monkey patching
[20:23:51] workmad3: toretore: monkey patching isn't always evil :P
[20:23:55] pontiki: there's no standard i'm aware of; because, yeah, you shouldn't
[20:23:57] shevy: wrkrcoop I guess an exception is easier to define than an "error". Is any bug an error for instance?
[20:23:59] tubuliferous_: has joined #ruby
[20:24:04] spikeheadon: has joined #ruby
[20:24:07] workmad3: but yeah, no standard, because you should always consider it carefully
[20:24:09] toretore: workmad3: when is it not?
[20:24:30] nobitanobi: has joined #ruby
[20:24:43] wrkrcoop: if the owners of the language change the language how is that different from monkey patching? it isn’t as far as i can tell
[20:25:00] yfeldblum: has joined #ruby
[20:25:06] pontiki: my rule of thumb for "what's an exception" is a failure of some part that your program does not expect to handle
[20:25:28] workmad3: toretore: I'd have to really dig around for a good concrete example, but in the abstract - it's not evil when it's simple, easy to grok and solves your problem in a much simpler fashion than the non-monkey-patched approach
[20:25:43] allcentury: has joined #ruby
[20:25:44] pontiki: an exception is raised at the point, for hopefully some higher-level part (or the system) to handle
[20:25:53] workmad3: toretore: such situations are uncommon, but not non-existant IME
[20:26:43] kgrz: has joined #ruby
[20:27:55] toretore: workmad3: i've seen cases where it *probably* doesn't cause harm and is the easy way out, but i guess the point is the "probably" - you never really know
[20:28:22] Yiota: has joined #ruby
[20:29:18] colegatron_origi: has joined #ruby
[20:30:19] workmad3: toretore: hmm... 'probably doesn't cause harm' - are you mostly classing monkey-patching as altering existing methods on core/stdlib objects?
[20:30:31] nando293921: has joined #ruby
[20:32:16] kraken: has joined #ruby
[20:32:43] roamingdog: has joined #ruby
[20:32:48] toretore: workmad3: not exclusively - also adding new methods - but as it is a global namespace there is always a chance of collision, where the "winner" does not necessarily do the same thing as the "loser"
[20:32:50] dionysus69: has joined #ruby
[20:33:24] workmad3: toretore: right... but that's true of pretty much the entirety of your codebase, if you want to get pedantic
[20:33:46] certainty: has joined #ruby
[20:33:52] Guest56458: Hey could somebody please help me understand this? https://gist.github.com/KrakenHH/acacaf6cd0ffaac70a4a9ffc6520bd32 ? I really don't get whats going on. I was thinking that the first line starts the web server, the second line gets the page, and then the third line displays the body on the page, but I don't get why the third lines isn't: puts http.req.body
[20:34:44] hxegon: (on monkey patching) This gets rid of most of the evil of monkey patching IMO http://devblog.avdi.org/2015/05/20/so-whats-the-deal-with-ruby-refinements-anyway/
[20:34:59] toretore: workmad3: i guess if you can confine it to only your own code the chance of collision is minimized
[20:35:32] toretore: i think refinements too are a solution to a problem that shouldn't exist
[20:35:35] whathappens: has joined #ruby
[20:36:08] wrkrcoop: i want to run a command, and then send all lines with error into error.txt, i tried “the_command_to_run | grep error | cat > error.txt” and it didn’t do anything
[20:36:11] workmad3: toretore: sure... I'm much more heavily against monkey-patching in libraries... I see monkey-patching as a tool for application developers to tweak under the hood a bit, not as something to happen much in distributed code
[20:36:21] wrkrcoop: says Errno::EPIPE: Broken pipe - <STDOUT>
[20:36:38] toretore: Guest56458: req is just an object containing the data for the request, it doesn't perform the request itself, http does
[20:36:41] pontiki: EEGREGIOUSCAT
[20:36:51] sesquipedalian: has joined #ruby
[20:37:05] workmad3: Guest56458: the first line creates an HTTP client and yields it to the block. The second line creates a request object. The third line passes the request to the client (which executes the request) and grabs the body from the response
[20:37:18] workmad3: Guest56458: at no point does that start an HTTP web server... it only talks to one
[20:37:24] toretore: workmad3: i just don't understand what's so difficult about putting it somewhere else i guess
[20:37:30] APhilp: has joined #ruby
[20:37:43] pontiki: wrkrcoop: when you say "didn't do anything" does that mean the error.txt file was empty?
[20:37:49] wrkrcoop: pontiki: yes
[20:37:57] wrkrcoop: if i remove the grep part it works
[20:37:59] toretore: instead of core_obj.something just do MyUtils.something(core_obj)
[20:37:59] wrkrcoop: logs to the file
[20:38:10] pontiki: wrkrcoop: do you know if the lines containing "error" are being written to STDOUT?
[20:38:12] nankyokusei: has joined #ruby
[20:38:12] workmad3: toretore: sometimes a well placed monkey-patch just makes things so much neater it's hard to justify a different approach
[20:38:33] toretore: workmad3: we have different definitions of neat i think :P
[20:38:55] wrkrcoop: pontiki: no
[20:39:04] workmad3: toretore: one 3 line monkey patch == dozens of lines of reduction and improved readability throughout large parts of a codebase
[20:39:10] Guest56458: Thank you toretore and workmad3 much more clear now
[20:39:12] workmad3: toretore: that's the sort of neatness I'm talking about
[20:39:26] qasaur: has joined #ruby
[20:39:27] elifoster: has joined #ruby
[20:39:37] Noxilex: has joined #ruby
[20:40:13] toretore: workmad3: i will still choose the (imo) "proper" way, but to each his own i guess, as long as you're not publishing these into the wild
[20:40:25] workmad3: toretore: and I've had that happen on occasion... but not usually on a core object, I have to admit (normally, I add a quick method like that to another gem's code because it's a really simple, obvious extension)
[20:41:14] machinewar: has joined #ruby
[20:41:38] machinewar: I get the whole ampersand to_proc stuff except the call part, does map send #call to procs?
[20:41:44] machinewar: [1,2,3].map(&:upcase)
[20:41:49] machinewar: what actaully sends call to the proc?
[20:42:03] workmad3: machinewar: the & calls `to_proc` and passes the result as the block parameter to the method
[20:42:11] toretore: machinewar: ruby does
[20:42:29] workmad3: machinewar: the method would then yield/call the block
[20:42:48] Wolland: has joined #ruby
[20:43:34] machinewar: so upcase is calling the block? I think I'm just confused because it seems implicit
[20:43:40] machinewar: I mean calling the Proc
[20:43:42] workmad3: machinewar: so `[1,2,3].map(&:upcase)` == `[1,2,3].map { |target, *args| target.send(:upcase, *args) }`
[20:44:22] machinewar: i..e why doesn't [1,2,3,4,].map(some_proc) return [Proc.new, Proc.new, Proc.new, etc.]
[20:44:46] machinewar: its realling returning [Proc.new.call(a), Proc.new.call(b)]
[20:45:12] workmad3: machinewar: map calls a provided block once for each item in the collection, passing in the item, and returns a new array consisting of the result of those calls
[20:45:22] workmad3: machinewar: that's literally the entire point of the map method...
[20:45:32] machinewar: so map is calling it
[20:45:45] machinewar: damn totally makes sense now
[20:45:49] hdawg: has joined #ruby
[20:46:30] workmad3: machinewar: correct... some_method(&:blah) passes the result of :blah.to_proc to `some_method` as a block argument... `some_method` still has to call the block
[20:47:36] workmad3: machinewar: also it would be `[some_proc.call(a), some_proc.call(b)]` not `[Proc.new.call(a), ...]` ;)
[20:49:04] sesquipedalian: has joined #ruby
[20:49:14] SCHAAP137: has joined #ruby
[20:50:19] guacamole: has joined #ruby
[20:50:27] colegatron: has joined #ruby
[20:50:37] ur5us: has joined #ruby
[20:51:39] Staticillmatic: has joined #ruby
[20:52:22] qasaur: has joined #ruby
[20:54:03] dmitrij_1003: has joined #ruby
[20:54:49] sandelius: has joined #ruby
[20:55:09] jrafanie: has joined #ruby
[20:56:14] polll: has joined #ruby
[20:59:03] johnmilton: has joined #ruby
[20:59:11] machinewar: workmad3: definitely just meant to show its an instance of Proc, which is was some_proc would be
[20:59:19] machinewar: but totally get what you're saying
[20:59:23] diegoviola: has joined #ruby
[21:02:31] tatsuo: has joined #ruby
[21:07:04] rueben_: has joined #ruby
[21:09:47] jackjackdripper: has joined #ruby
[21:12:39] johnDoe111: has joined #ruby
[21:13:38] Flush: has joined #ruby
[21:15:58] aberen: has joined #ruby
[21:16:02] Gasher: has joined #ruby
[21:16:03] roamingdog: has joined #ruby
[21:17:01] johnmilton: has joined #ruby
[21:19:47] gregf: has joined #ruby
[21:21:13] maloik: has joined #ruby
[21:21:21] firstdayonthejob: has joined #ruby
[21:23:09] al2o3-cr: has joined #ruby
[21:23:33] whathappens: has joined #ruby
[21:23:43] wrkrcoop: i’m making an api call, would it make sense to raise response.code, and have rescue blocks for each code type …
[21:24:44] jhass: not. at. all.
[21:24:45] tubuliferous_: has joined #ruby
[21:25:23] wrkrcoop: but dont i want to rescue when the code comes back and its not a 200?
[21:25:32] tAn: has joined #ruby
[21:25:49] jhass: [stuff that makes sense] <- over here your idea somewhere -> [over here]
[21:26:27] wrkrcoop: feeling a lil hurt
[21:26:31] allcentury: has joined #ruby
[21:26:41] kareeoleez: has joined #ruby
[21:27:33] shevy: wrkrcoop you can check for that control flow already by checking on response.code alone, like via if/else or case/when
[21:27:37] kgrz: has joined #ruby
[21:27:49] wrkrcoop: shevy: got it …
[21:28:05] wrkrcoop: but can’t you check everything then? why have exceptions
[21:28:23] dmitrij_2691: has joined #ruby
[21:28:33] shevy: you can do crazy things
[21:28:46] shevy: we also have catch/throw
[21:28:51] tAn: has joined #ruby
[21:29:13] shevy: I feel catch/throw to stare at me like an alien when I use it :(
[21:29:15] jhass: for exceptional cases from which you can't recover, at least not in the code you're currently in
[21:29:33] wrkrcoop: jhass: couldn’t you just check for that somehow?
[21:29:40] bruce_lee: has joined #ruby
[21:29:40] wrkrcoop: and not use exceptions
[21:29:48] nando293921: has joined #ruby
[21:29:58] shevy: well there are things that can be dangerous
[21:30:01] jhass: sure there are exception free API designs
[21:30:09] jhass: all C code is exception free
[21:30:13] jhass: doesn't make it easier to handle
[21:30:25] wrkrcoop: shevy: like whart
[21:31:04] shevy: for instance wrkrcoop - create a directory, foo/; enter it, start irb; remove the directory somehow, then try to do something, then you get errors such as: "Errno::ENOENT: No such file or directory @ rb_sysopen"
[21:31:14] danostrowski: has joined #ruby
[21:31:33] wrkrcoop: so why not just say if “Errno::ENOENT” do this
[21:31:54] wrkrcoop: wouldn’t not doing that break the ‘dont use exceptions for flow control’ rule
[21:32:25] shevy: would that syntax work?
[21:32:36] wrkrcoop: well u know get the syntax righ
[21:32:55] shevy: I don't know, I never saw it... I don't know how you get it there
[21:33:23] wrkrcoop: thanks for the tips
[21:34:31] certainty: has joined #ruby
[21:35:33] senayar: has joined #ruby
[21:36:01] skweek: has joined #ruby
[21:36:20] Polysics_: has joined #ruby
[21:42:44] p337rB_: has joined #ruby
[21:43:31] Wolland: has joined #ruby
[21:45:36] Azure|dc: has joined #ruby
[21:45:42] benzrf_: has joined #ruby
[21:47:17] benzrf_: is there a convention for splitting a large class or module over a few files, where only one of them is meant to be used with require?
[21:49:26] shevy: benzrf_ I don't think there is any convention
[21:49:52] shevy: for requires, as gems, the typical convention would be to require "name_of_gem_here"
[21:50:15] shevy: internally it should not matter how you arrange the other files. I sometimes tend to spit things up when they seem logical to me
[21:50:32] shevy: like, some utility scripts go into utility_scripts/
[21:50:58] shevy: run.rb may have code that is used to run/start the code, the workhorse
[21:51:50] halpmepls: has joined #ruby
[21:52:16] halpmepls: what's the difference between doing input = gets.chomp and input.upper! versus doing: input = gets.chomp.upper
[21:52:43] flashpoint9: has joined #ruby
[21:53:34] eam: the latter makes more copies of the string
[21:53:44] pilne: has joined #ruby
[21:55:29] benzrf_: i think the mutation is more important, eam
[21:55:51] benzrf_: halpmepls: upper! mutates the string; upper returns a new version
[21:56:20] halpmepls: so the new version is a second copy?
[21:56:39] benzrf_: >> foo = "hello world!'; foo.upper!; puts foo
[21:56:53] benzrf_: man, wheres an eval bot when you need it >.<
[21:57:41] halpmepls: got it, thanks
[21:58:44] jhass: benzrf_: you have to identify
[21:59:02] eam: benzrf_: well, the mutation and the extra copy stem from the same behavior
[21:59:20] eam: a change either must occur in a second copy, or in the original thing itself
[21:59:38] benzrf_: eam: yeah, but the fact that more copies are made is less directly relevant to the programmer's interests than the fact that it mutates
[21:59:49] benzrf_: even though they are tied to each other
[22:00:01] eam: I guess? The copy in his example is lost without reference
[22:00:15] halpmepls: ^ that's what i thought
[22:00:22] benzrf_: eam: oh, right
[22:00:37] benzrf_: mb, i wasn't paying sufficient attention to context
[22:00:40] halpmepls: so then the verdict?
[22:00:43] halpmepls: it doesn't matter
[22:00:46] eam: benzrf_: you're not wrong though!
[22:00:47] benzrf_: pretty much
[22:01:07] jancel: has joined #ruby
[22:02:55] yfeldblum: has joined #ruby
[22:04:10] skade: has joined #ruby
[22:07:52] sandstrom: has joined #ruby
[22:10:17] jenrzzz: has joined #ruby
[22:10:18] jenrzzz: has joined #ruby
[22:10:42] joelwallis: has joined #ruby
[22:11:01] shevy: what is .upper
[22:12:25] jackjackdripper: has joined #ruby
[22:13:29] johnDoe111: has joined #ruby
[22:15:31] jenrzzz: has joined #ruby
[22:17:15] sp4rrow: has joined #ruby
[22:17:54] kgrz: has joined #ruby
[22:18:03] achamian: has joined #ruby
[22:19:01] jaguarmagenta: has joined #ruby
[22:26:14] darkxploit: has joined #ruby
[22:26:32] snath: has joined #ruby
[22:27:14] allcentury: has joined #ruby
[22:30:52] mistermocha: has joined #ruby
[22:31:04] roamingdog: has joined #ruby
[22:31:21] darkxploit: has joined #ruby
[22:32:07] griffindy: has joined #ruby
[22:35:17] certainty: has joined #ruby
[22:37:00] SilverKey: has joined #ruby
[22:37:16] lightt: has joined #ruby
[22:38:31] Azure: has joined #ruby
[22:38:41] nankyokusei: has joined #ruby
[22:39:30] jancel: has joined #ruby
[22:44:16] Wolland: has joined #ruby
[22:44:53] blackmesa: has joined #ruby
[22:46:05] coffeecupp: has joined #ruby
[22:46:06] senayar: has joined #ruby
[22:49:38] SCHAAP137: has joined #ruby
[22:49:53] alfiemax: has joined #ruby
[22:50:26] moeabdol: has joined #ruby
[22:50:43] MrBusiness3: has joined #ruby
[22:53:13] iceden: has joined #ruby
[22:53:31] danostrowski: has joined #ruby
[22:53:36] whathappens: has joined #ruby
[22:58:31] araujo: has joined #ruby
[22:58:39] cbyrda: has joined #ruby
[22:58:59] bmorrison: has joined #ruby
[23:00:26] tildes_: has joined #ruby
[23:02:33] binaryplease: has joined #ruby
[23:02:39] araujo: has joined #ruby
[23:04:00] swills: has joined #ruby
[23:04:21] guacamole: has joined #ruby
[23:04:29] mleung: has joined #ruby
[23:06:06] yfeldblum: has joined #ruby
[23:06:57] duckpuppy: has joined #ruby
[23:08:12] replay: has joined #ruby
[23:08:18] jancel: has joined #ruby
[23:13:18] GreyKite: has joined #ruby
[23:16:46] aberen: has joined #ruby
[23:18:40] freerobby: has joined #ruby
[23:19:01] rueben_: has joined #ruby
[23:19:52] djbkd: has joined #ruby
[23:21:10] rueben_: has joined #ruby
[23:25:01] KINGSABRI: has joined #ruby
[23:25:40] nando293921: has joined #ruby
[23:27:42] sumobob: has joined #ruby
[23:27:59] allcentury: has joined #ruby
[23:28:18] griffindy: has joined #ruby
[23:28:28] sameerynho: has joined #ruby
[23:29:57] Channel6: has joined #ruby
[23:31:48] JesseH: has joined #ruby
[23:32:55] smathy: has joined #ruby
[23:33:31] ElFerna: has joined #ruby
[23:33:55] emptyflask: has joined #ruby
[23:34:40] symm-_: has joined #ruby
[23:35:58] certainty: has joined #ruby
[23:37:56] Respek: has joined #ruby
[23:39:13] rht: has joined #ruby
[23:39:56] nando293921: has joined #ruby
[23:43:05] ash_workz: has joined #ruby
[23:43:39] blur3d: has joined #ruby
[23:45:16] Wolland: has joined #ruby
[23:45:44] jancel: has joined #ruby
[23:48:19] koooge: has joined #ruby
[23:50:33] whathappens: has joined #ruby
[23:52:30] bougyman: saw some syntax I don't even know what it means today: !!endpoint ^ !!sigver
[23:54:34] bougyman: and another one: raise "Must specify both proxyPort and proxyHost (or neither)" if !!proxy_host ^ !!proxy_port
[23:54:51] bougyman: what is the purpose of using the xor operator against those negated values?
[23:54:55] bougyman: I can't wrap my head around it.
[23:55:57] banister: has joined #ruby
[23:57:31] k3rn31: has joined #ruby
[23:57:59] Ropeney: has joined #ruby
[23:58:45] bougyman: like... what does the XOR do for boolean values?
[23:59:11] kies: has joined #ruby