« Back to channel list

#ruby - 21 November 2015

« Back 1 day Forward 1 day »
[00:00:21] ruboto: Why don't you try it and see for yourself?
[00:00:44] ellisTAA: got it. works
[00:00:52] ellisTAA: have a feeling i should use what jhass said
[00:02:18] cirenyc: has joined #ruby
[00:02:24] Oog: has joined #ruby
[00:03:54] rbowlby: has joined #ruby
[00:04:14] allcentury: has joined #ruby
[00:04:46] mistermo_: has joined #ruby
[00:06:09] gennaro: has joined #ruby
[00:06:51] skade: has joined #ruby
[00:07:02] ellisTAA: i???m getting this error message that says this file is not a file or a directory ???. what the heck? https://gist.github.com/ellismarte/dc4eb18967f85c53b25f#file-errors-txt-L1
[00:07:42] jhass: what's with the // in front?
[00:07:55] ellisTAA: jhass: idk that???s just part of the error message
[00:08:12] jhass: it's the real value you pass to File.file?
[00:08:38] jhass: or chdir rather
[00:08:54] jhass: whatever is on line 33
[00:08:59] bougyman: yes, folder must have that // on it
[00:09:18] ellisTAA: well i think that just is root ???
[00:09:33] ellisTAA: line 13 i???m starting at root https://gist.github.com/ellismarte/dc4eb18967f85c53b25f#file-neatfreak-rb-L13
[00:10:18] jhass: so you have "/" in folder
[00:10:50] jhass: then you concatenate "/" and what's in file, "Applications" in this case
[00:11:00] jhass: "/" + "/" + "Applications"
[00:11:06] ellisTAA: yeah for sure
[00:11:08] jhass: &ri File.join
[00:11:08] `derpy: http://www.rubydoc.info/stdlib/core/File#join-class_method
[00:11:36] gennaro: has joined #ruby
[00:12:15] djbkd: has joined #ruby
[00:12:43] ellisTAA: are you saying File.file?(File.join(folder, file)) is better than what i have?
[00:13:20] jhass: not just there, everywhere where you do + "/" +
[00:13:59] jhass: but you're also reimplementing Dir[] / Dir.glob thee
[00:14:33] ellisTAA: jhass: what about the error? how can something be neither a file or a directory?
[00:14:56] jhass: I don't know OSX, I'd make sure it doesn't freak out about the "//" first
[00:15:30] ellisTAA: well it runs for a while before it hits that error
[00:16:04] ellisTAA: oh shit, adding this ??? return if all_files_in_this_directory.empty???? to the file got rid of the //
[00:16:14] jhass: well, then it indeed is neither a file nor a directory
[00:16:23] jhass: perhaps a symlink, socket, fifo or whatever
[00:17:11] `derpy: http://www.rubydoc.info/stdlib/find/Find
[00:18:13] ljarvis: but yeah, don't chdir without knowing it's a directory..
[00:18:54] mg^: I still like my suggestion of Rake::FileList because you can give it a .exclude
[00:19:09] mg^: but of course there's more than one way to do it
[00:19:26] rakm: has joined #ruby
[00:19:30] ljarvis: I think that and glob are find for collecting stuff, but this doesn't seem to do that (yet?)
[00:19:35] jhass: EllisTAA seems determined to find the most cludgy one for now, let's just let them
[00:19:42] ljarvis: so it seems pointless to grow something
[00:19:53] jhass: at least glob takes a block
[00:20:41] blubjr: i think they're just learning..
[00:20:57] ellisTAA: blubjr: yep
[00:21:13] ellisTAA: i need to eventually accecss gzip ??? is that possible from inside ruby
[00:21:28] jetpackjoe: has joined #ruby
[00:21:49] ellisTAA: ljarvis: how?
[00:22:03] ljarvis: you said eventually, do you really want to start that now?
[00:22:08] gennaro: 22Avolio-Toly11
[00:22:23] mg^: this would be a fun one to golf, since there are so many ways to get it done
[00:22:37] shortdudey123: has joined #ruby
[00:22:38] aeontech: has joined #ruby
[00:22:59] ljarvis: i dont really understand what the goal is, it cant be inferred from the code
[00:23:04] gatman: has joined #ruby
[00:23:12] bkxd: has joined #ruby
[00:23:16] ellisTAA: ljarvis: i???m just doing it for fun and to learn how to work with files
[00:23:45] ljarvis: EllisTAA: yep sure I get that, but I'm saying you should get past the current hurdle before moving on to the mode advanced stuff. I think it would be helpful
[00:24:00] ellisTAA: ljarvis: for sure
[00:25:01] mg^: system('find /dir -mtime +60 -exec gzip {} \;') but that's cheating
[00:25:11] mg^: actually need a -type f in there
[00:25:53] solocshaw: has joined #ruby
[00:26:17] ellisTAA: cool this allows me to traverse through the entire file system https://gist.github.com/ellismarte/dc4eb18967f85c53b25f
[00:26:41] ellisTAA: oh nvm another error
[00:27:22] baweaver: has joined #ruby
[00:27:46] ljarvis: I would recommend against using chdir
[00:27:52] ljarvis: there's no reason to do it
[00:28:50] ellisTAA: ljarvis: hmm ok
[00:29:07] havenwood: EllisTAA: You just want the filenames or the path and filename?
[00:29:39] Gustavo: has joined #ruby
[00:29:43] ellisTAA: havenwood: i???d want the path i guess so i can go into the directory
[00:29:51] atomical: has joined #ruby
[00:29:53] havenwood: EllisTAA: Try: require 'find'; Find.find('/') { |path| puts path }
[00:30:02] ljarvis: ACTION points above
[00:30:43] ljarvis: but yeah you are just implementing Find.find
[00:30:52] ljarvis: which is fine if you want to learn obviously
[00:30:53] htmldrum: has joined #ruby
[00:31:11] gusrub: has joined #ruby
[00:31:50] ellisTAA: if i dont change directories how do i grab everything in the folder?
[00:32:03] stannard: has joined #ruby
[00:34:50] voodo: has joined #ruby
[00:35:52] malconis: has joined #ruby
[00:37:01] bougyman: has joined #ruby
[00:37:04] jhass: EllisTAA: by not ignoring the advice you've been given here. You have been pointed out three superiror options so far
[00:37:46] IrishGringo: has joined #ruby
[00:38:45] blubjr: lol what a dick
[00:39:00] rbowlby: has joined #ruby
[00:39:01] ellisTAA: blubjr: lol
[00:39:51] matp: has joined #ruby
[00:39:55] stannard: has joined #ruby
[00:40:02] ljarvis: blubjr: language like that isn't tolerated here, take that as your last warning
[00:40:20] angiebadillo: has joined #ruby
[00:43:32] blackmesa: has joined #ruby
[00:44:32] err_ok: has joined #ruby
[00:44:37] EminenceHC: has joined #ruby
[00:44:45] braderhart: has joined #ruby
[00:45:13] amirpro: has joined #ruby
[00:46:31] aphprentice: has joined #ruby
[00:46:45] cyberfawkes: has joined #ruby
[00:47:06] wldcordeiro: has joined #ruby
[00:47:25] maloik: has joined #ruby
[00:47:31] moeabdol: has joined #ruby
[00:47:46] ss_much: has joined #ruby
[00:48:23] duncannz: has joined #ruby
[00:48:41] gusrub: has joined #ruby
[00:51:16] benlieb: has joined #ruby
[00:51:48] Rollabunna: has joined #ruby
[00:53:09] rbowlby_: has joined #ruby
[00:53:15] PDI: has joined #ruby
[00:54:32] arcanez: havenwood: is that essentially the same as 'find . -type f' ?
[00:57:15] Rubie: has joined #ruby
[00:58:30] ellisTAA: woo!! got the traversal part to work https://gist.github.com/ellismarte/dc4eb18967f85c53b25f
[00:58:32] PDI: has joined #ruby
[00:59:01] exadeci: has joined #ruby
[01:02:41] cirenyc: has joined #ruby
[01:02:55] skweek: has joined #ruby
[01:03:56] PDI: has joined #ruby
[01:04:11] wldcordeiro: has joined #ruby
[01:06:17] shevy: we build the next skynet live on #ruby!
[01:06:43] mg^: literally lol
[01:06:52] diegoviola: has joined #ruby
[01:06:58] allcentury: has joined #ruby
[01:07:00] mg^: meaning that I laughed, co-worker is confused
[01:09:41] mistermocha: has joined #ruby
[01:14:21] mistermocha: has joined #ruby
[01:16:17] ellisTAA: i???ve been running this program for like 10 mins ???.
[01:17:01] ellisTAA: starting to think it???s in a loop ???. https://gist.github.com/ellismarte/dc4eb18967f85c53b25f
[01:17:15] ellisTAA: which seems like that wouldn???t be true since it???s like a tree ???
[01:18:04] maloik: has joined #ruby
[01:20:07] dlitvak: has joined #ruby
[01:20:16] rakm: has joined #ruby
[01:22:01] nateberkopec: has joined #ruby
[01:24:04] bruce_lee2: has joined #ruby
[01:25:12] willardg: has joined #ruby
[01:25:25] chipotle: has joined #ruby
[01:27:18] hahuang65: has joined #ruby
[01:29:41] CloCkWeRX: has joined #ruby
[01:30:49] Scripore: has joined #ruby
[01:31:35] NeverTired: has joined #ruby
[01:35:14] maloik: has joined #ruby
[01:35:17] aibot: has joined #ruby
[01:36:32] kobain: has joined #ruby
[01:37:40] htmldrum: has joined #ruby
[01:38:22] havenwood: arcanez: I think `require 'find'; puts Find.find('.').first 20` would be more along the lines of `find -s . | head -n 20`.
[01:44:28] arooni: has joined #ruby
[01:45:21] havenwood: diff -s <(find -s . | head -n 20) <(ruby -rfind -e "puts Find.find('.').first 20") #=> Files /dev/fd/x and /dev/fd/y are identical
[01:46:12] baweaver: has joined #ruby
[01:46:37] ur5us: has joined #ruby
[01:48:12] Melpaws: has joined #ruby
[01:48:27] NeverDie: has joined #ruby
[01:49:43] yoongkang: has joined #ruby
[01:50:43] dmcp_: has joined #ruby
[01:50:59] pawnbox: has joined #ruby
[01:53:35] havenwood: (^ BSD userland flags.)
[01:55:07] bruce_lee2: has joined #ruby
[01:55:07] ellisTAA: has left #ruby: ()
[01:56:58] cirenyc: has joined #ruby
[01:57:59] Axsuul: has joined #ruby
[02:00:56] EminenceHC: has joined #ruby
[02:01:41] iateadonut: has joined #ruby
[02:05:43] jetpackjoe: has joined #ruby
[02:14:30] moeabdol: has joined #ruby
[02:16:15] hahuang65: has joined #ruby
[02:16:26] paradisaeidae: has joined #ruby
[02:16:47] kp666: has joined #ruby
[02:17:02] ellisTAA: has joined #ruby
[02:17:17] borkdude_: has joined #ruby
[02:18:48] Sp4rKy_: has joined #ruby
[02:18:49] raddazong: has joined #ruby
[02:18:49] mduca: has joined #ruby
[02:18:50] Drakevr_: has joined #ruby
[02:18:50] saltsa_: has joined #ruby
[02:18:51] sgrdrnk: has joined #ruby
[02:18:51] tethra_: has joined #ruby
[02:18:51] bafbomb_: has joined #ruby
[02:18:53] badeball_: has joined #ruby
[02:18:53] euoia_: has joined #ruby
[02:18:56] ccooke_: has joined #ruby
[02:18:56] connor_g1odwolf: has joined #ruby
[02:18:56] [ace]: has joined #ruby
[02:18:57] janno_: has joined #ruby
[02:18:57] OmegaA_: has joined #ruby
[02:18:57] gregf__: has joined #ruby
[02:18:58] bubuntu_: has joined #ruby
[02:19:00] kiki_lam1: has joined #ruby
[02:19:01] uxp_: has joined #ruby
[02:19:01] pygospa: has joined #ruby
[02:19:06] dtordabl1: has joined #ruby
[02:19:06] axisys_: has joined #ruby
[02:19:10] silverdust: has joined #ruby
[02:19:10] jamo: has joined #ruby
[02:19:15] L1nuX: has joined #ruby
[02:19:19] Vagnerlandio: has joined #ruby
[02:19:32] EminenceHC: has joined #ruby
[02:19:56] Vagnerlandio: my first time in irc chat
[02:20:45] pawnbox: has joined #ruby
[02:21:56] Azure: has joined #ruby
[02:22:22] Ox0dea: vagnerlandio: The world is quiet here.
[02:25:21] Azure: has joined #ruby
[02:27:26] FunkyJunky: has joined #ruby
[02:27:28] Azure: has joined #ruby
[02:27:43] copious: has joined #ruby
[02:32:43] UniFreak: has joined #ruby
[02:32:58] IrishGringo: has joined #ruby
[02:33:17] freerobby: has joined #ruby
[02:34:45] blackmesa: has joined #ruby
[02:35:11] pyon: has joined #ruby
[02:36:54] ellisTAA: i???m running this program trying to traverse through my file system but it???s taking forever ??? i decided to add the paths of every searched file to an array and check if that path has been searched, but it???s still taking forever. could someone glance at this file and see if anything is causing it to maybe loop? https://github.com/ellismarte/neatfreak/blob/master/neatfreak.rb#L15
[02:37:47] havenwood: EllisTAA: Are you doing it for fun or to learn or rather to accomplish the task?
[02:38:23] hahuang61: has joined #ruby
[02:38:31] Radar: EllisTAA: Dir.glob("**/*") will save a lot of that code.
[02:38:44] ellisTAA: havenwood: fun and to learn
[02:38:48] nateberkopec: has joined #ruby
[02:38:55] ellisTAA: Radar: what do u mean will save a lot of that code?
[02:39:03] Radar: EllisTAA: Try it and find out.
[02:39:20] havenwood: Radar: Earlier I was suggesting: require 'find'; Find.find('/') { |path| puts path }
[02:39:31] malconis: has joined #ruby
[02:39:43] havenwood: EllisTAA: Ah, good! :)
[02:40:00] Radar: EllisTAA: I hope the difference between Dir.glob("*") and Dir.glob("**/*") are obvious from their output.
[02:40:04] Radar: havenwood: TIL about Find
[02:40:16] maloik: has joined #ruby
[02:41:34] stannard: has joined #ruby
[02:41:52] WillAmes: has joined #ruby
[02:43:45] ellisTAA: Radar: so running Dir.glob(???**/*???) grabs all files & all files in all of the folder???s sub folders?
[02:43:54] Radar: EllisTAA: yup
[02:44:03] dikaio: has joined #ruby
[02:46:53] fedexo: has joined #ruby
[02:48:13] RainBowww: has joined #ruby
[02:48:43] DLSteve: has joined #ruby
[02:52:23] yoongkang: has joined #ruby
[02:54:41] ellisTAA: has joined #ruby
[02:56:34] benlovell: has joined #ruby
[02:58:08] djbkd: has joined #ruby
[02:59:02] nofxx: has joined #ruby
[02:59:04] Rubie: has joined #ruby
[02:59:47] jetpackjoe: has joined #ruby
[03:01:27] connor_goodwolf: has joined #ruby
[03:03:00] juddey: has joined #ruby
[03:03:05] pdoherty: has joined #ruby
[03:03:21] speakingcode: has joined #ruby
[03:08:48] dfinninger: has joined #ruby
[03:10:12] lemondom: has joined #ruby
[03:11:27] lemondom: config.ru - that is a Rake specific config thing, right?
[03:11:45] bb010g: has joined #ruby
[03:12:20] idefine: has joined #ruby
[03:15:20] cmoneylulz: has joined #ruby
[03:16:33] karapetyan: has joined #ruby
[03:16:35] mozzarella: Russian configuration
[03:16:40] mozzarella: set your squat levels
[03:17:12] TomPeed: has joined #ruby
[03:18:51] RobertBirnie: has joined #ruby
[03:20:33] antoniobeyah: has joined #ruby
[03:21:54] arescorpio: has joined #ruby
[03:21:58] lemondom: I also though that first because of the .ru :D
[03:22:47] lemondom: Hm, on what server tech this thing is running?: https://github.com/geminabox/geminabox
[03:22:49] lemondom: Is that Rack?
[03:22:51] idefine: has joined #ruby
[03:22:52] ibouvousaime_: has joined #ruby
[03:22:59] lemondom: ah, sinatra
[03:24:24] UniFreak: has joined #ruby
[03:27:50] _stu_: has joined #ruby
[03:28:21] zfez: has joined #ruby
[03:28:51] saddad: has joined #ruby
[03:29:23] lemondom: hmm, how can I configure Sinatra::Base instance to listen to a specific host/ip address? :/
[03:29:49] cyberfawkes: has left #ruby: ()
[03:31:46] baweaver: has joined #ruby
[03:33:25] dmcp_: has joined #ruby
[03:34:13] zfez: has left #ruby: ()
[03:38:06] DLSteve: has joined #ruby
[03:38:11] lemondom: anyone here with experience in sinatra?
[03:39:04] pawnbox: has joined #ruby
[03:40:39] dmcp_: has joined #ruby
[03:44:41] ismaelga: has joined #ruby
[03:45:44] zfez_: has joined #ruby
[03:46:46] RazorX: has joined #ruby
[03:46:58] Antiarc: has joined #ruby
[03:48:44] rickmasta: has joined #ruby
[03:51:00] EminenceHC: has joined #ruby
[03:52:08] dfinninger: has joined #ruby
[03:52:53] atomical: has joined #ruby
[03:53:25] Antiarc: has joined #ruby
[03:54:36] roshanavand: has joined #ruby
[03:55:30] Antiarc: has joined #ruby
[03:59:44] houhoulis: has joined #ruby
[03:59:53] yes`r: has joined #ruby
[04:01:03] lemondom_: has joined #ruby
[04:02:34] moeabdol: has joined #ruby
[04:04:04] diegoaguilar: has joined #ruby
[04:06:59] howdoicomputer: has joined #ruby
[04:09:26] quazimodo: has joined #ruby
[04:10:29] nathan1: has joined #ruby
[04:13:39] Antiarc: has joined #ruby
[04:15:15] braincrash: has joined #ruby
[04:17:07] chipotle: has joined #ruby
[04:18:23] pawnbox: has joined #ruby
[04:22:49] davedev24: has joined #ruby
[04:23:42] djbkd: has joined #ruby
[04:24:58] atomical: has joined #ruby
[04:27:07] NathanNg: has joined #ruby
[04:29:10] davedev24: has joined #ruby
[04:29:34] B1n4r10: has joined #ruby
[04:30:29] benlieb: has joined #ruby
[04:31:59] saddad: has joined #ruby
[04:32:38] baweaver: has joined #ruby
[04:33:16] juddey: has joined #ruby
[04:34:43] Oog: has joined #ruby
[04:36:38] blackmesa: has joined #ruby
[04:37:10] weemsledeux: has joined #ruby
[04:40:21] Antiarc: has joined #ruby
[04:41:12] iateadonut: has joined #ruby
[04:42:57] stannard: has joined #ruby
[04:44:05] RobertBirnie: has joined #ruby
[04:44:44] Antiarc: has joined #ruby
[04:44:49] benlovell: has joined #ruby
[04:46:32] UniFreak: has joined #ruby
[04:47:36] kp666: has joined #ruby
[04:48:28] psmolen: has left #ruby: ()
[04:49:45] baweaver: has joined #ruby
[04:51:52] pawnbox: has joined #ruby
[04:52:29] araujo_: has joined #ruby
[04:56:37] gix: has joined #ruby
[04:57:01] crystalmaiden: has joined #ruby
[04:57:05] benlieb: has joined #ruby
[04:58:51] s2013: has joined #ruby
[04:59:59] tmtwd_: has joined #ruby
[05:00:28] davedev24: has joined #ruby
[05:02:19] axl_: has joined #ruby
[05:03:33] hinbody: has joined #ruby
[05:04:05] atomical: has joined #ruby
[05:04:11] meltdown: has joined #ruby
[05:04:29] quazimodo: has joined #ruby
[05:11:47] dealpete: has joined #ruby
[05:13:41] makenoise: has joined #ruby
[05:13:58] IrishGringo: has joined #ruby
[05:14:05] tmtwd: has joined #ruby
[05:17:04] Antiarc: has joined #ruby
[05:19:34] willardg: has joined #ruby
[05:19:55] ohaibbq: has joined #ruby
[05:22:16] Bellthoven: has joined #ruby
[05:22:25] atomical: has joined #ruby
[05:22:30] yfeldblum: has joined #ruby
[05:23:03] howdoicomputer: has joined #ruby
[05:24:22] benlieb_: has joined #ruby
[05:24:47] dopie: has joined #ruby
[05:29:37] kp666: has joined #ruby
[05:30:44] Rodya_: has joined #ruby
[05:30:44] benlovell: has joined #ruby
[05:31:15] pawnbox: has joined #ruby
[05:31:54] jetpackjoe: has joined #ruby
[05:34:07] makenoise: has joined #ruby
[05:36:30] darkf: has joined #ruby
[05:37:21] blackmesa: has joined #ruby
[05:37:58] antoniobeyah: has joined #ruby
[05:38:26] Bellthoven: has joined #ruby
[05:39:02] darkxploit: has joined #ruby
[05:39:51] EminenceHC: has joined #ruby
[05:42:21] antoniobeyah: lemondom_: never really used sinatra but looking at the source it seems it takes cli args: https://github.com/sinatra/sinatra/blob/52b9a798a71ac3594be44c99f3fa786bbe6c8824/lib/sinatra/main.rb#L16-L17
[05:47:36] Bellthoven: has joined #ruby
[05:49:14] sarkis: has joined #ruby
[05:50:39] moeabdol: has joined #ruby
[05:51:12] juddey: has joined #ruby
[05:54:55] yoongkang: has joined #ruby
[05:56:58] benlieb: has joined #ruby
[05:57:39] brainfire: has joined #ruby
[05:58:01] arup_r: has joined #ruby
[06:00:48] diegoaguilar: has joined #ruby
[06:01:14] Rubie: has joined #ruby
[06:02:07] rippa: has joined #ruby
[06:02:16] meltdown: has joined #ruby
[06:02:50] shinenelson: has joined #ruby
[06:03:09] cjbottaro: has joined #ruby
[06:04:30] Axsuul: has joined #ruby
[06:07:04] djbkd: has joined #ruby
[06:10:33] CloCkWeRX: has joined #ruby
[06:10:36] pawnbox: has joined #ruby
[06:11:19] maloik: has joined #ruby
[06:13:34] kiki_lam1: Hey... if I've got an object that has optional features that can be enabled, is there any particular reason why implementing this by having it dynamically prepend modules onto it's eigenclass in response to a method call is a bad idea?
[06:16:41] framling: has joined #ruby
[06:16:57] kp666: has joined #ruby
[06:17:44] lxsameer: has joined #ruby
[06:18:41] benlieb_: has joined #ruby
[06:18:53] PDI: has joined #ruby
[06:20:17] lxsameer: has joined #ruby
[06:20:18] lxsameer: has joined #ruby
[06:22:08] maloik: has joined #ruby
[06:23:02] makenoise: has joined #ruby
[06:26:39] araujo__: has joined #ruby
[06:29:35] dionysus69: has joined #ruby
[06:31:21] CloCkWeRX: has joined #ruby
[06:35:08] makenoise: has joined #ruby
[06:35:42] Rodya_: has joined #ruby
[06:42:53] Axsuul: has joined #ruby
[06:47:36] quazimodo: has joined #ruby
[06:53:48] terminalrecluse: has joined #ruby
[06:54:22] sunya7a: has joined #ruby
[06:55:59] yoongkang: has joined #ruby
[07:00:20] lemur: has joined #ruby
[07:00:39] ibouvousaime: has joined #ruby
[07:00:46] Spami: has joined #ruby
[07:02:31] arup_r: What you guys use to validate emails using Regex? I am literally confused after seeing this long thread http://stackoverflow.com/questions/46155/validate-email-address-in-javascript ?
[07:02:49] arup_r: I am looking for a good email validate regex
[07:04:31] tmtwd: has joined #ruby
[07:06:40] Coraline: There is no email validation regex
[07:07:02] Coraline: You should send an email to see if it's valid
[07:07:06] Coraline: Trust the user
[07:09:23] eam: well, while that's true, helping people correct obvious typos goes a very long way
[07:09:32] pawnbox: has joined #ruby
[07:09:47] eam: for example, if your user types in gmal.com you may want to prompt them for a fix right away
[07:10:01] arup_r: Actually you both are true. http://stackoverflow.com/a/815242/2767755
[07:10:18] eam: you can also check to see if the domain has an MX record at all
[07:11:33] arup_r: eam: how to do that ?
[07:17:46] tjohnson: has joined #ruby
[07:20:38] bkxd: has joined #ruby
[07:21:27] User458764: has joined #ruby
[07:22:09] juddey: has joined #ruby
[07:22:14] dionysus69: has joined #ruby
[07:22:27] gambl0re: has joined #ruby
[07:22:42] lessless: has joined #ruby
[07:26:29] EminenceHC: has joined #ruby
[07:27:08] kies: has joined #ruby
[07:27:38] pawnbox: has joined #ruby
[07:27:39] hackeron: has joined #ruby
[07:31:12] dikiaap: has joined #ruby
[07:31:26] eam: arup_r: to check for mx? Do a DNS lookup
[07:31:37] eam: for the rest, it's all heuristics and guesswork
[07:31:58] dikiaap: I have two version ruby in my computer. 1.9 version and 2.2. How can I switch to 2.2 version?
[07:32:19] Axsuul: has joined #ruby
[07:32:22] arup_r: dikiaap: Use Rvm or any version manager
[07:36:06] CloCkWeRX: has joined #ruby
[07:36:53] dikiaap: ok, I done installed rvm and what the command to change it?
[07:38:08] blackmesa: has joined #ruby
[07:38:45] moeabdol: has joined #ruby
[07:38:52] shevy: rvm --default use 1.9.3 # <-- use proper version there I suppose
[07:39:03] shevy: rvm list default
[07:40:29] ur5us: has joined #ruby
[07:42:06] raeoks: has joined #ruby
[07:44:08] Coldblackice: has joined #ruby
[07:45:02] skcin7: has joined #ruby
[07:46:29] bodgix: has joined #ruby
[07:46:46] dikiaap: shevy : yes, but I've installed two versions. and RVM want to download again.
[07:48:16] raeoks: has joined #ruby
[07:49:13] shevy: what a silly software
[07:49:41] auzty: has joined #ruby
[07:50:10] al2o3-cr: arup_r: you can check for mx records using resolv: Resolv::DNS.open { |dns| dns.getresources(domain, Resolv::DNS::Resource::IN::MX) }
[07:52:14] myztic: has joined #ruby
[07:53:54] cwong_on_irc: has joined #ruby
[07:54:21] CloCkWeRX: has joined #ruby
[07:54:25] cwong_on_irc: has joined #ruby
[07:58:06] stannard: has joined #ruby
[07:59:49] arup_r: >> p /\A\s*([^@\s]{1,64})@((?:[-\p{L}\d]+\.)+\p{L}{2,})\s*\z/i === "arup@gmail.com"
[07:59:50] ruboto: arup_r # => true ...check link for more (https://eval.in/473188)
[08:00:09] arup_r: working.. but the same in JS not working.. what the heck :)
[08:00:31] maloik: has joined #ruby
[08:00:32] apeiros: oh, email validation done wrong
[08:00:39] apeiros: recurring topic :)
[08:00:40] arup_r: "arup@gmail.com".match(/\A\s*([^@\s]{1,64})@((?:[-\p{L}\d]+\.)+\p{L}{2,})\s*\z/i) is `null`
[08:01:28] apeiros: no it isn't?
[08:01:30] apeiros: >> "arup@gmail.com".match(/\A\s*([^@\s]{1,64})@((?:[-\p{L}\d]+\.)+\p{L}{2,})\s*\z/i)
[08:01:31] ruboto: apeiros # => #<MatchData "arup@gmail.com" 1:"arup" 2:"gmail.com"> (https://eval.in/473189)
[08:01:55] arup_r: What Regex engine JS use then.. it is saying my email id is not valid as per the regex
[08:02:13] arup_r: apeiros: what do you mean by no it is not.. ?:)
[08:02:13] apeiros: did you say you use JS before?
[08:02:48] apeiros: JS doesn't have \p afair.
[08:02:52] arup_r: yes, I will use the same regex frontend and backend .. backend is saying email is valid, frontend is saying not valid
[08:02:59] apeiros: yeah, forget that.
[08:03:16] lessless: has joined #ruby
[08:03:21] Channel6: has joined #ruby
[08:03:30] arup_r: Now I am in trouble then
[08:03:35] apeiros: there's a couple of discrepancies. unless you're careful, using the same won't work.
[08:04:02] apeiros: but again, that regex is wrong for mail validation.
[08:04:23] arup_r: apeiros: I copied it from https://github.com/balexand/email_validator/blob/master/lib/email_validator.rb
[08:04:52] arup_r: I thought I'll use it in frontend to give user hints, and then do double check in backend
[08:05:19] apeiros: there are solutions to give user hints in the front-end
[08:05:47] apeiros: trying to remember the name. wanted to use that myself too.
[08:06:08] arup_r: apeiros: some hints/references please
[08:06:24] apeiros: as said: trying to remember.
[08:07:33] trosborn: has joined #ruby
[08:07:34] jetpackjoe: has joined #ruby
[08:08:57] shevy: arup_r it's way too early for him to remember anything right now!
[08:09:04] apeiros: ah I think it iwas this: https://github.com/mailcheck/mailcheck
[08:09:11] apeiros: no idea how good it is, though.
[08:09:40] Xeago: has joined #ruby
[08:10:39] pawnbox: has joined #ruby
[08:11:43] k3asd`: has joined #ruby
[08:12:47] Rubie: has joined #ruby
[08:14:30] howdoicomputer: has joined #ruby
[08:15:36] dionysus69: has joined #ruby
[08:17:53] helpa-bot: has joined #ruby
[08:19:52] helpa-bot: has joined #ruby
[08:21:54] helpa-bot: has joined #ruby
[08:23:09] NeverDie: has joined #ruby
[08:24:29] helpa-bot: has joined #ruby
[08:24:41] makenoise: has joined #ruby
[08:24:42] codecop: has joined #ruby
[08:24:42] pawnbox_: has joined #ruby
[08:26:29] helpa: has joined #ruby
[08:26:48] Scripore: has joined #ruby
[08:31:03] shevy: hmm ... I suppose there are no simple one-line way to suppress warnings? I know I can modify $VERBOSE but I find this somewhat inelegant
[08:31:15] solocshaw: has joined #ruby
[08:31:17] darkf: has joined #ruby
[08:31:42] dikiaap: has left #ruby: ("Bye!")
[08:33:55] timonv: has joined #ruby
[08:35:26] aeontech: has joined #ruby
[08:38:06] hakunin: has joined #ruby
[08:39:59] karapetyan: has joined #ruby
[08:41:36] UniFreak: has left #ruby: ()
[08:42:39] karapetyan: has joined #ruby
[08:43:55] juddey: has joined #ruby
[08:47:40] lessless: has joined #ruby
[08:53:42] asas: has joined #ruby
[08:55:46] moeabdol: has joined #ruby
[08:56:47] bmalum: has joined #ruby
[09:00:03] sarkis: has joined #ruby
[09:00:10] TomPeed: has joined #ruby
[09:03:59] maloik: has joined #ruby
[09:05:19] sinkensabe: has joined #ruby
[09:05:45] pandaant: has joined #ruby
[09:19:01] skcin7: has joined #ruby
[09:21:36] tildes: has joined #ruby
[09:23:04] karapetyan: has joined #ruby
[09:25:31] BlackGear: has joined #ruby
[09:26:09] voker57: has joined #ruby
[09:26:37] k3asd`: has joined #ruby
[09:28:25] dlitvak: has joined #ruby
[09:29:41] Jackneill: has joined #ruby
[09:30:43] maloik: has joined #ruby
[09:31:29] ta: has joined #ruby
[09:38:57] CloCkWeRX: has joined #ruby
[09:38:57] blackmesa: has joined #ruby
[09:41:04] rgtk: has joined #ruby
[09:47:36] maloik: has joined #ruby
[09:51:35] User458764: has joined #ruby
[09:59:16] shevy: File.expand_path() will also expand to the full path? I did not know that, thought it would only work on ~
[09:59:27] shevy: will also/will always
[10:00:40] akem: has joined #ruby
[10:01:02] SCHAAP137: has joined #ruby
[10:01:46] blackmesa: has joined #ruby
[10:08:05] maloik: has joined #ruby
[10:09:21] tercenya: has joined #ruby
[10:09:26] solars: has joined #ruby
[10:15:44] aryaching: has joined #ruby
[10:15:58] kp666: has joined #ruby
[10:16:12] Gustavo: has joined #ruby
[10:17:56] dlitvak: has joined #ruby
[10:18:41] k3asd`: has joined #ruby
[10:19:43] arup_r: has joined #ruby
[10:20:34] bubbys: has joined #ruby
[10:26:17] EminenceHC: has joined #ruby
[10:29:24] TomPeed: has joined #ruby
[10:32:34] jxs_: has joined #ruby
[10:34:26] joonty: has joined #ruby
[10:35:44] spiman: has joined #ruby
[10:37:16] nso95__: has joined #ruby
[10:37:46] moeabdol: has joined #ruby
[10:37:56] kp666: has joined #ruby
[10:38:10] ruid: has joined #ruby
[10:39:26] k3asd`: has joined #ruby
[10:40:25] wildlander: has joined #ruby
[10:41:12] maloik: has joined #ruby
[10:44:19] quazimodo: has joined #ruby
[10:47:03] dfdfdf: has joined #ruby
[10:47:56] blackmesa: has joined #ruby
[10:50:39] norc: has joined #ruby
[10:51:05] norc: https://eval.in/473226 -- why is this code failing?
[10:51:31] apeiros: norc: precedence
[10:51:39] apeiros: the block is associated with puts, not foo. use {} or parens.
[10:51:50] apeiros: also you only need either &block or yield
[10:52:03] norc: apeiros: I know, was just a reminensce from my original code. :)
[10:52:05] apeiros: in this case, just yield will be faster as it doesn't force ruby to convert the block to a proc.
[10:53:12] yes`r: has joined #ruby
[10:54:22] norc: apeiros: Ah well this is silly. I could have simply looked at the compiled YARV code.
[10:54:35] apeiros: yes, you could have! why didn't you!
[10:54:39] apeiros: ACTION stares down norc
[10:55:51] norc: 0019 send <callinfo!mid:puts, argc:1, block:block in <compiled>, FCALL>
[10:56:40] agit0: has joined #ruby
[10:56:51] norc: But on the bright side, I am getting closer every day. :)
[10:56:57] apeiros: why did I read that last one as fuckall?
[10:57:25] apeiros: closer to what? world dominance? stay away from that. that's mine!
[11:00:03] norc: apeiros: A year ago I would have shuddered just reading "AST"
[11:00:35] futilegames: has joined #ruby
[11:01:38] shevy: what are you doing norc
[11:01:50] apeiros: timezones are terrifying indeed.
[11:01:58] agit0: has joined #ruby
[11:02:05] apeiros: alaskan state troopers too
[11:02:47] arup_r: Can you help me to write this heredoc successfully? https://gist.github.com/aruprakshit/6a7361d68a6bbbcab325 the `Array#join` not working rather coming a "..." :p
[11:03:35] tildes: has joined #ruby
[11:03:42] kp666: has joined #ruby
[11:04:07] apeiros: why on earth do you even use a heredoc there?
[11:04:27] arup_r: seeing the output as "invalid_emails.join(', ') is not valid." not the one I want
[11:04:54] arup_r: save local variables .. :)
[11:05:23] apeiros: I'm not sure I want to comment that.
[11:06:00] arup_r: comment or commit you meant ?
[11:06:13] TomPeed: has joined #ruby
[11:06:13] apeiros: I said what I meant
[11:06:18] apeiros: I also meant what I said
[11:06:37] DoubleMalt: has joined #ruby
[11:07:11] dlitvak: has joined #ruby
[11:07:28] apeiros: also you may want to take a look at Enumerable#partition
[11:08:15] arup_r: ok. How that partition will help me here ?
[11:08:28] apeiros: it'll save line 3
[11:08:31] apeiros: since you like saving.
[11:08:35] nso95__: has joined #ruby
[11:09:11] nofxx: has joined #ruby
[11:09:14] arup_r: ok. What is wrong with Heredoc .. just asking.?
[11:09:35] arup_r: I mean why did you not like in this usecase ?
[11:10:25] arup_r: I fixed it. want to know why is that a code smell ?
[11:10:30] karapetyan: has joined #ruby
[11:10:34] apeiros: because it's utterly pointless. there's absolutely no string in your string. only code.
[11:10:48] apeiros: it's like a = "#{some code here}"
[11:10:57] apeiros: why have "#{}" at all there?
[11:12:21] arup_r: ok. convinced
[11:13:30] apeiros: but your code is full with silly stuff tbh. e.g. invalid_emails.size == 0 -> singular. well, no. zero is plural. only 1 is singular. and an empty list of emails results in " is not valid".
[11:13:55] apeiros: or: EOF as token - EOF means End Of File. your heredoc doesn't really mark the end of file
[11:14:20] arup_r: MSG is a good name
[11:14:23] apeiros: and I sure hope that the test for @ is only a placeholder for an actually useful email validation
[11:14:33] shevy: apeiros is having a day :-)
[11:14:55] apeiros: and email.rindex("@").to_i > 0 as a test for "contains an @" - seriously?
[11:15:19] shevy: it's creative!
[11:15:26] apeiros: email =~ /@/, or email.include?("@"). if you want to make sure it's not the first char: email =~ /.@/
[11:15:32] arup_r: yes. which has first letter as `@` is not valid
[11:15:48] apeiros: (and of course, still the same comment about "actually meaningful email validation")
[11:16:33] apeiros: yeah, it's quite arbitrary to allow a billion invalid email addresses, BUT NOT THOSE starting with @.
[11:16:39] arup_r: rindex will tell me the word has @ but not at first prostion with > 0 test
[11:16:50] apeiros: not really.
[11:16:57] apeiros: >> "@@foo".rindex("@")
[11:16:58] ruboto: apeiros # => 1 (https://eval.in/473235)
[11:17:01] apeiros: hahaaaa, fooled!
[11:17:34] apeiros: not sure why I even wrote "foo" there. "@@" alone is valid as per your test.
[11:17:41] arup_r: I'll accept it. :) Then if it is not valid email id, Mail server will not send it
[11:17:53] arup_r: but I will get it from UI
[11:18:02] arup_r: minimal check in UI :D
[11:18:55] apeiros: um, yeah. UI checks are never authoritative.
[11:19:03] arup_r: it is user responsibility when subscribing a mailing list .. that is less headache
[11:19:34] apeiros: you can just as well add a checkbox "I swear this email is valid" to your form. same amount of certainty that it's valid.
[11:20:21] unrar: has joined #ruby
[11:20:29] apeiros: unrar: hi gal
[11:20:38] unrar: Is there a way to sort of store/reference functions in a list and then call each of them?
[11:20:59] apeiros: unrar: see Object#send and Proc
[11:21:07] unrar: sort of like: functions = [:add, :delete]; functions.each do { |f| f }
[11:21:25] apeiros: actually, drop Object#send and instead see Object#public_send. and additionally: Object#method + Method#call
[11:21:53] unrar: Yeah I've been doing some research and found some references to Object#send but I'm not really getting it
[11:22:17] apeiros: &ri Object#public_send @unrar
[11:22:17] `derpy: unrar: http://www.rubydoc.info/stdlib/core/Object#public_send-instance_method
[11:22:23] apeiros: which which parts do you have troubles?
[11:22:55] unrar: Object#send seems to be used to call methods, what if it's a standalone function?
[11:23:05] apeiros: that doesn't exist
[11:23:26] unrar: oh too bad
[11:23:36] apeiros: I mean: standalone functions don't exist.
[11:24:10] unrar: what object are they methods of then? Object?
[11:24:25] apeiros: >> method(:puts).owner
[11:24:26] ruboto: apeiros # => Kernel (https://eval.in/473238)
[11:24:43] apeiros: and you *always* call a method on an object. if you don't have an explicit receiver, the receiver *always* is self.
[11:25:08] Scripore: has joined #ruby
[11:25:15] Xeago: has joined #ruby
[11:25:15] BlackCoyote: has joined #ruby
[11:25:55] apeiros: i.e., `puts "foo"` is really `self.puts "foo"` (just that that wouldn't work because puts is private)
[11:29:13] arup_r: ready and corrected all typos and logical errors.. :) lets commit it
[11:29:15] CloCkWeRX: has joined #ruby
[11:30:12] raeoks: has joined #ruby
[11:36:39] nso95__: has joined #ruby
[11:37:15] PaulCapestany: has joined #ruby
[11:37:57] The_Phoenix: has joined #ruby
[11:39:17] The_Phoenix: has joined #ruby
[11:39:35] maloik: has joined #ruby
[11:40:35] skade: has joined #ruby
[11:42:02] TomPeed: has joined #ruby
[11:43:38] minimalism: has joined #ruby
[11:45:33] bkxd: has joined #ruby
[11:46:44] dlitvak: has joined #ruby
[11:47:31] karapetyan: has joined #ruby
[11:47:58] CloCkWeRX: has joined #ruby
[11:50:39] norc: shevy: Hacking up a Amazon MWS library.
[11:51:19] norc: unrar: To be exact a method does not belong to an object either
[11:51:23] norc: It always belongs to a class.
[11:54:56] yeshacker: has joined #ruby
[11:55:18] lipoqil: has joined #ruby
[11:59:15] DexterLB: has joined #ruby
[12:04:00] maloik: has joined #ruby
[12:05:13] rgtk: has joined #ruby
[12:07:52] ht__: has joined #ruby
[12:10:29] nofxx: has joined #ruby
[12:10:30] ItSANgo: has joined #ruby
[12:10:46] Olipro_: has joined #ruby
[12:12:19] ht__: has joined #ruby
[12:16:05] kp666: has joined #ruby
[12:16:58] voker57: has joined #ruby
[12:17:05] Gustavo: has joined #ruby
[12:18:13] Mia: has joined #ruby
[12:18:31] shinnya: has joined #ruby
[12:19:56] fantazo: has joined #ruby
[12:22:47] karapetyan: has joined #ruby
[12:22:51] Scripore: has joined #ruby
[12:23:03] kvltar: has joined #ruby
[12:25:47] ruurd: has joined #ruby
[12:26:23] toretore: has joined #ruby
[12:31:37] segfalt: has joined #ruby
[12:32:22] ht__: has joined #ruby
[12:32:59] silverdust: has joined #ruby
[12:33:56] pwned: has joined #ruby
[12:35:23] User458764: has joined #ruby
[12:36:00] lemondom_: some nice guy, antonio or so - just told me that sinatra takes the host to listen over its cli
[12:36:09] lemondom_: so it is not possible to set this using config.ru instead?
[12:36:23] lemondom_: What I want: I just want that the app listens on a specific host address...
[12:38:35] lemondom_: bundle exec rackup
[12:38:39] lemondom_: how can I pass a host to listen on?
[12:38:46] rickmasta: has joined #ruby
[12:38:47] lemondom_: of course, I would love to use the config.ru instead
[12:38:51] lemondom_: but when the cli is the only way
[12:39:31] voker57_: has joined #ruby
[12:40:17] ht__: has joined #ruby
[12:41:45] sdothum: has joined #ruby
[12:42:15] kirun: has joined #ruby
[12:43:56] sgambino: has joined #ruby
[12:44:36] voker57: has joined #ruby
[12:46:11] darkxploit: has joined #ruby
[12:47:33] Scripore: has joined #ruby
[12:50:35] spiman: has joined #ruby
[12:51:32] maloik: has joined #ruby
[12:51:35] pwned: lemondom_: you mean rackup --binding=yourhost ?
[12:51:48] pwned: rackup --host yourhost
[12:52:21] ht__: has joined #ruby
[12:54:11] gguggi: has joined #ruby
[12:56:39] Pupp3tm4st3r: has joined #ruby
[12:58:18] ht__: has joined #ruby
[12:58:51] mostlybadfly: has joined #ruby
[12:59:34] felltir: has joined #ruby
[13:00:13] ruid: has joined #ruby
[13:01:05] yoongkang: has joined #ruby
[13:02:55] Ox0dea: has joined #ruby
[13:03:10] ibouvousaime: has joined #ruby
[13:04:06] maloik: has joined #ruby
[13:04:12] lemondom_: pwned: it works - and one can't set this in config.ru I guess, right?
[13:06:19] diegoaguilar: has joined #ruby
[13:07:01] skade: has joined #ruby
[13:07:48] unrar: Hey I managed to do the running-functions-in-a-list thingie, feedback? :P https://github.com/unrar/midb/blob/gem/lib/midb/hooks.rb
[13:08:39] ruid: has joined #ruby
[13:11:28] maloik: has joined #ruby
[13:12:15] raeoks: has joined #ruby
[13:13:33] pwned: lemondom_: I remember reading something like set :bind in sinatra configuration docs
[13:13:59] lemondom_: pwned: yes, I tried that, nothing worked. the cli is fine for me
[13:14:14] lemondom_: pwned: but I cannot pass extra config over cli instead using config.ru? some must be set in config.ru
[13:14:19] ht__: has joined #ruby
[13:15:02] pwned: lemondom_: perhaps it needs a bit of coding (reading from environment variables or parsing commandline options)
[13:15:50] krz: has joined #ruby
[13:20:21] ht__: has joined #ruby
[13:20:55] lemondom_: pwned: yes, env variables
[13:21:58] allcentury: has joined #ruby
[13:23:13] maloik: has joined #ruby
[13:23:32] tildes: has joined #ruby
[13:25:10] zotherstupidguy: has joined #ruby
[13:26:24] karapetyan: has joined #ruby
[13:29:25] skade: has joined #ruby
[13:30:18] ht__: has joined #ruby
[13:32:08] _blizzy_: has joined #ruby
[13:32:19] ht__: has joined #ruby
[13:33:29] houhoulis: has joined #ruby
[13:33:37] _blizzy_: has joined #ruby
[13:35:10] _blizzy_: has joined #ruby
[13:36:37] marcosantoniocar: has joined #ruby
[13:36:48] _blizzy_: has joined #ruby
[13:37:59] voodo: has joined #ruby
[13:42:51] SenpaiSilver: has joined #ruby
[13:43:04] crdpink: has joined #ruby
[13:44:55] ruurd: has joined #ruby
[13:45:49] maloik: has joined #ruby
[13:45:59] Bellthoven: has joined #ruby
[13:46:03] futilegames: has joined #ruby
[13:47:01] sarkis: has joined #ruby
[13:47:45] Gustavo: has joined #ruby
[13:49:40] freerobby: has joined #ruby
[13:50:56] spiman: has joined #ruby
[13:54:07] zenguy_pc: has joined #ruby
[13:54:47] ht__: has joined #ruby
[13:58:51] houhoulis: has joined #ruby
[14:00:06] brainfire: is there something like priority sorting? sort by one attribute first and then by another?
[14:01:43] RobertBirnie: has joined #ruby
[14:02:17] ht__: has joined #ruby
[14:04:20] havenwood: brainfire: sort_by { |foo| [foo.bar, foo.baz] }
[14:04:21] apeiros: sort_by { |thingy| [first, second, third] }
[14:04:24] akem: has joined #ruby
[14:04:48] apeiros: also can use sorting: https://github.com/apeiros/sorting
[14:05:06] apeiros: nice if you want asc/desc and handling of nils.
[14:05:20] karapetyan: has joined #ruby
[14:05:38] apeiros: or have expensive to calculate properties which aren't first thing to sort by.
[14:07:58] arup_r: has joined #ruby
[14:08:46] AndyBotwin: has joined #ruby
[14:08:49] brainfire: does this work with .sort! as well?
[14:09:51] last_staff: has joined #ruby
[14:10:32] banister: has joined #ruby
[14:11:23] apeiros: "this"? sort/sort! works quite a bit differently from sort_by.
[14:11:26] benlovell: has joined #ruby
[14:11:51] nofxx: has joined #ruby
[14:11:51] apeiros: and why'd you want to use sort! over sort_by! ?
[14:12:19] atmosx: has joined #ruby
[14:12:54] brainfire: just because I'm more familiar with it. I just started using ruby a couple of days ago.
[14:12:55] aryaching: has joined #ruby
[14:13:34] apeiros: using any of the above described ways with sort/sort! is just you making your own life harder for no reason. learn how sort_by works instead.
[14:13:37] BaroMeter: has joined #ruby
[14:13:49] brainfire: I'm looking into it right now ;)
[14:14:16] apeiros: (and yes, you can make them work with sort)
[14:18:19] ht__: has joined #ruby
[14:18:59] dorei: has joined #ruby
[14:19:26] brainfire: apeiros: I got it :) thanks
[14:21:26] karapetyan: has joined #ruby
[14:22:20] ht__: has joined #ruby
[14:24:42] dlitvak: has joined #ruby
[14:29:57] aryaching: has joined #ruby
[14:30:18] ht__: has joined #ruby
[14:30:29] decoponio: has joined #ruby
[14:32:51] ht__: has joined #ruby
[14:33:16] Macaveli: has joined #ruby
[14:34:42] Pupp3tm4st3r: has joined #ruby
[14:34:47] tildes: has joined #ruby
[14:36:38] tulak: has joined #ruby
[14:37:01] karapetyan: has joined #ruby
[14:38:35] davedev24: has joined #ruby
[14:38:48] dstarh: has joined #ruby
[14:40:15] ruurd: has joined #ruby
[14:40:55] A124: has joined #ruby
[14:41:04] psye: has joined #ruby
[14:41:14] Rollabunna: has joined #ruby
[14:41:26] agit0: has joined #ruby
[14:43:24] IrishGringo: has joined #ruby
[14:44:43] lessless: guys, what's most eloquent way to accept both integer and array as an argument, so the integer would be an array eventually?
[14:44:54] oli: has joined #ruby
[14:45:04] lessless: i.e. x(1) => [1], x([2,3]) => [2,3]
[14:45:17] davedev24: has joined #ruby
[14:45:30] toretore: the most elegant way is to not accept both
[14:45:50] toretore: if there's any chance that you want to accept more than one of something, always demand an array
[14:46:25] blue_deref: has joined #ruby
[14:46:32] jhass: or use a splat and demand the caller to do so too
[14:46:52] jhass: x(1), x(*[2, 3]), def x(*values)
[14:47:27] RobertBirnie: has joined #ruby
[14:47:50] toretore: and then when you want to add another parameter you're screwed ;)
[14:48:26] episage: has joined #ruby
[14:48:39] j5s7: has joined #ruby
[14:49:10] encapuzado: has left #ruby: ()
[14:49:11] jhass: ruby's pretty tolerant about that actually
[14:49:28] apeiros: lessless: +1 to toretore's suggestion.
[14:49:48] apeiros: also sometimes splat is the appropriate answer.
[14:49:55] jhass: >> def x(*values, value); [values, value]; end; [x(1), x(1, 2), x(1, 2, 3)]
[14:49:56] ruboto: jhass # => [[[], 1], [[1], 2], [[1, 2], 3]] (https://eval.in/473314)
[14:49:59] toretore: yes, sometimes
[14:50:09] apeiros: ah, and that's already been mentioned by jhass
[14:50:23] toretore: but it's like singletons, rarely does is not come back to bite you
[14:50:46] apeiros: toretore: well, for single/last argument, I prefer splat over taking an array.
[14:51:09] apeiros: caller can still easily normalize
[14:51:14] toretore: i just like being very explicit about everything i guess
[14:51:23] apeiros: splat is explicit :)
[14:51:30] jhass: so, switch to Java? :P
[14:51:54] toretore: java 8 looks inviting actually ;)
[14:53:10] j5s7: has joined #ruby
[14:53:53] dkphenom: has joined #ruby
[14:54:48] ht__: has joined #ruby
[14:55:22] ruurd: has joined #ruby
[14:56:16] Rubie: has joined #ruby
[14:56:20] apeiros: java starts to look more attractive indeed.
[14:56:36] apeiros: if only they could reduce their twenty five gazillion classes to something more sane???
[14:58:16] adaedra: but that would make it less entreprise-y
[14:58:47] apeiros: adaedra: all they have to do is call it "oracle java". boom. enterprise-y
[14:58:59] toretore: that's also part of the attraction - they have libs for everything, good quality ones too
[14:59:16] apeiros: toretore: IME a mixed bag too.
[14:59:18] Papierkorb: Java is outdated from a language standpoint
[15:00:05] apeiros: it's only the 10th character in the alphabet.
[15:00:16] apeiros: s/it's/J is/
[15:00:35] apeiros: so it must be outdated. Kava would be newer
[15:00:42] Papierkorb: toretore: The OOP model is just old. no real mixins. Takes more code to do the same, while not being faster at all times
[15:01:43] Papierkorb: Not everything is an Object. no operator overloading.
[15:02:06] Papierkorb: And yes, operator overloading comes to bite you back when you want to write something like an_array + an_array
[15:02:37] davedev24: has joined #ruby
[15:03:02] Papierkorb: Writing tests is annoying. static methods (comparable to rubys "class methods") are a special kind of snowflake, so no simple mocking for them
[15:03:11] monod: has joined #ruby
[15:03:40] Xeago: has joined #ruby
[15:04:02] Papierkorb: You can have an int, or an Integer. int works most of the time, but as they're not an Object, not as an Generic type (e.g.: List<Integer>, not List<int>)
[15:04:05] dlitvak: has joined #ruby
[15:04:32] Papierkorb: The list goes on. That language has too many annoyances.
[15:06:12] atomical: has joined #ruby
[15:07:23] benhuda: has joined #ruby
[15:07:47] ruurd: has joined #ruby
[15:10:22] czsr: has joined #ruby
[15:11:05] shevy: it is too verbose
[15:11:13] bmalum: has joined #ruby
[15:11:29] j5s7: has joined #ruby
[15:12:21] tildes: has joined #ruby
[15:12:29] shevy: it does have a lot of graphic stuff though - I remember at my old workplace when we looked at electron microscopy dataset, there were two fat java apps that did not have any good replacement (electron microscopy have the weirdest binary format types)
[15:12:56] Papierkorb: shevy: not to confuse with GUI development. Java is horrible at that.
[15:13:32] Papierkorb: JavaFX. Creating a new button only requires to create three distinct classes! Because only one would not be enterprais for srs bsns
[15:13:33] j5s7: has joined #ruby
[15:14:28] Papierkorb: And then, it still looks completely outlandish. Expect it to look n' feel native to the platform? Don't use Java. (Use e.g. C++/Qt)
[15:16:52] dfdfdf: has joined #ruby
[15:17:07] htmldrum: has joined #ruby
[15:17:32] stannard: has joined #ruby
[15:17:43] davedev24: has joined #ruby
[15:20:29] ruurd: has joined #ruby
[15:20:38] arup_r: has joined #ruby
[15:21:41] kab: has joined #ruby
[15:22:13] s2013: has joined #ruby
[15:22:36] FreelancerBR: has joined #ruby
[15:25:06] chipotle: has joined #ruby
[15:26:19] ht__: has joined #ruby
[15:29:52] ruurd: has joined #ruby
[15:30:24] AndyBotwin: has joined #ruby
[15:31:03] freerobby: has joined #ruby
[15:35:37] Papierkorb: Does someone know if Hash#values copies anything, or is it just returning part of the internal representation in MRI?
[15:35:48] cornerma1: has joined #ruby
[15:36:52] dealpete: has joined #ruby
[15:36:53] banister: has joined #ruby
[15:38:17] arup_r: has joined #ruby
[15:39:51] Yzguy: has joined #ruby
[15:42:01] CodingWolf: has joined #ruby
[15:42:22] _blizzy_: has joined #ruby
[15:43:17] jhass: it does allocate an array and fills it with the "internal" references, I'd assume
[15:46:22] BaroMeter: has joined #ruby
[15:46:49] lemondom: has joined #ruby
[15:48:20] zomgbie: has joined #ruby
[15:48:32] skweek: has joined #ruby
[15:50:16] benlovell: has joined #ruby
[15:50:21] toretore: has joined #ruby
[15:51:10] symm-: has joined #ruby
[15:53:50] al2o3-cr: has joined #ruby
[15:54:25] Yzguy: has joined #ruby
[15:54:42] Yzguy: has joined #ruby
[15:55:00] tildes: has joined #ruby
[15:55:13] l4cr0ss: has joined #ruby
[15:55:36] sanna: has joined #ruby
[15:55:49] fedexo: has joined #ruby
[15:56:20] ht__: has joined #ruby
[15:58:10] arup_r: so here in this Proxy class (https://github.com/amatsuda/kaminari/blob/master/lib/kaminari/helpers/paginator.rb#L116), in this class I want to add a helper method for my own project. Is it possible ?
[15:58:22] A124: has joined #ruby
[15:58:28] arup_r: ok, let me ask it to #rails .. sorry
[15:58:33] arup_r: moving there
[15:58:36] Tref: has joined #ruby
[16:02:22] sumark: has joined #ruby
[16:02:25] markfletcher: has joined #ruby
[16:03:07] terminalrecluse: has joined #ruby
[16:05:22] bmalum: has joined #ruby
[16:05:31] ismaelga: has joined #ruby
[16:08:48] skweek: has joined #ruby
[16:09:19] pdoherty: has joined #ruby
[16:10:02] Mon_Ouie: has joined #ruby
[16:11:29] sondr3: has joined #ruby
[16:13:44] s2013: has joined #ruby
[16:13:51] ruurd: has joined #ruby
[16:14:25] nofxx: has joined #ruby
[16:14:36] da3mian: has joined #ruby
[16:14:53] kp666: has joined #ruby
[16:17:25] felltir: has joined #ruby
[16:18:09] skade: has joined #ruby
[16:18:19] ht__: has joined #ruby
[16:19:55] User458764: has joined #ruby
[16:20:03] Bellthoven: has joined #ruby
[16:20:50] araujo: has joined #ruby
[16:20:59] sunya7a: has joined #ruby
[16:23:06] myztic: has joined #ruby
[16:23:30] darkxploit: has joined #ruby
[16:25:04] myztic: has joined #ruby
[16:28:20] ht__: has joined #ruby
[16:28:35] tekk: has joined #ruby
[16:29:12] arup_r: has joined #ruby
[16:35:57] The_Phoenix: has joined #ruby
[16:36:48] Axsuul: has joined #ruby
[16:37:18] IrishGringo: has joined #ruby
[16:37:36] adac: has joined #ruby
[16:39:22] Eiam_: has joined #ruby
[16:40:54] build22: has joined #ruby
[16:42:28] sankaber: has joined #ruby
[16:44:19] sarkis: has joined #ruby
[16:44:21] ht__: has joined #ruby
[16:44:30] nathan1: has joined #ruby
[16:44:34] ruurd: has joined #ruby
[16:49:50] angiebadillo: has joined #ruby
[16:50:17] zfez: has joined #ruby
[16:50:21] ht__: has joined #ruby
[16:51:10] braderhart: has joined #ruby
[16:52:11] RobertBirnie: has joined #ruby
[16:52:32] aphprentice: has joined #ruby
[16:54:49] amirpro: has joined #ruby
[16:56:30] bjmllr: has joined #ruby
[16:57:41] ruurd: has joined #ruby
[16:59:49] futilegames: has joined #ruby
[17:00:13] vdamewood: has joined #ruby
[17:01:37] Scripore: has joined #ruby
[17:05:12] NeverDie: has joined #ruby
[17:06:07] stannard: has joined #ruby
[17:08:02] davedev24: has joined #ruby
[17:08:30] howdoicomputer: has joined #ruby
[17:08:59] dfinninger: has joined #ruby
[17:09:41] griffindy: has joined #ruby
[17:12:56] flashbck: has joined #ruby
[17:12:58] ruurd: has joined #ruby
[17:14:32] flashbck: What is the recommended way to develop an applicaiton that depends on a custom gem that is hosted in a private gem server?
[17:15:02] skade: has joined #ruby
[17:15:10] flashbck: Say I've got a rails applicaiton, my_rails, and a custom gem, my_gem
[17:15:27] adaedra: Add the custom source to the Gemfile
[17:15:34] flashbck: I typically host my_gem from a private gem server
[17:15:45] jamesfordummies: has joined #ruby
[17:15:49] flashbck: I know that I can use :path in the Gemfile
[17:15:54] nofxx: has joined #ruby
[17:16:00] weemsledeux: has joined #ruby
[17:16:07] flashbck: but I'd have to modify my gemfile for local dev but revert that for deployment?
[17:16:38] jhass: flashbck: why do you have to use a local development checkout of the private gem for development?
[17:16:51] jhass: as adaedra pointed out, just use the source option
[17:17:02] flashbck: Because I am making modifications to my gem and the rails app
[17:17:40] jhass: well, that has nothing to do with it being on a private gem server then
[17:17:47] VeryBewitching: has joined #ruby
[17:18:21] flashbck: I'm just wondering if the only way that I can make updates to the gem is to modify my Gemfile to reference the local copy instead of the gem server copy
[17:18:48] flashbck: I know that npm has the ability to do some sort of link option
[17:19:08] jhass: flashbck: pretty much, there are some shenigans for using the git option and specifying a local override for that in your local bundler configuration, but it's not really making it any easier
[17:19:12] s2013: has joined #ruby
[17:19:19] jhass: flashbck: switch it back before releasing the gem
[17:19:29] jhass: or when rather
[17:19:31] troulouliou_dev: has joined #ruby
[17:20:01] ChanServ: -b jetty!*@*
[17:20:05] jamesfordummies: has joined #ruby
[17:20:06] flashbck: Yeah, I saw the bundle config options for a git based gem
[17:20:07] ruurd: has joined #ruby
[17:20:51] xet7: has joined #ruby
[17:20:56] skade: has joined #ruby
[17:21:03] karapetyan: has joined #ruby
[17:22:35] yoongkang: has joined #ruby
[17:24:56] sarkis: has joined #ruby
[17:25:32] sankaber: has joined #ruby
[17:25:32] nofxx: has joined #ruby
[17:28:11] jamesfordummies: has joined #ruby
[17:29:06] jamesfordummies: has left #ruby: ()
[17:30:47] arup_r: has joined #ruby
[17:31:11] moeabdol: has joined #ruby
[17:34:33] tmtwd: has joined #ruby
[17:35:33] guacjack: has joined #ruby
[17:37:13] Guest42726: has joined #ruby
[17:37:59] maloik: has joined #ruby
[17:39:52] 18WAA6551: has joined #ruby
[17:40:48] myztic: has joined #ruby
[17:41:07] ruurd: has joined #ruby
[17:43:43] Axsuul: has joined #ruby
[17:44:29] willardg: has joined #ruby
[17:46:09] voker57: has joined #ruby
[17:46:09] voker57: has joined #ruby
[17:47:07] aphprentice: has joined #ruby
[17:47:24] mikolalysenko: has joined #ruby
[17:47:43] benlakey: has joined #ruby
[17:47:57] colstrom: has joined #ruby
[17:48:33] golgaroth: has joined #ruby
[17:48:36] zrl: has joined #ruby
[17:48:37] amirpro: has joined #ruby
[17:48:46] bttf: has joined #ruby
[17:49:45] pmarreck: has joined #ruby
[17:50:49] EvilJStoker: has joined #ruby
[17:50:50] twistedpixels: has joined #ruby
[17:50:59] Fire-Dragon-DoL: has joined #ruby
[17:51:11] lele: has joined #ruby
[17:51:15] yosafbridge: has joined #ruby
[17:51:17] elektronaut: has joined #ruby
[17:51:23] mistym: has joined #ruby
[17:51:23] mistym: has joined #ruby
[17:51:44] antoniobeyah: has joined #ruby
[17:51:45] centrx: has joined #ruby
[17:53:21] drPoggs: has joined #ruby
[17:53:21] machty: has joined #ruby
[17:54:55] ruurd: has joined #ruby
[17:55:40] Fire-Dragon-DoL: has joined #ruby
[17:57:21] banister: has joined #ruby
[17:58:09] shinnya: has joined #ruby
[17:58:17] gregf: has joined #ruby
[17:58:20] dlitvak: has joined #ruby
[17:58:22] zapata: has joined #ruby
[17:59:00] nrk: has joined #ruby
[17:59:17] null2: has joined #ruby
[17:59:55] torpig: has joined #ruby
[18:00:22] blackmesa: has joined #ruby
[18:01:38] trouloulioud_dev: has joined #ruby
[18:02:35] mallu: has joined #ruby
[18:02:58] mallu: can you please tell me what I am doing wrong? https://gist.github.com/anonymous/8210251cf31c0ccff06a
[18:03:46] jhass: mallu: what's puts hash(d) supposed to do?
[18:04:07] jhass: mallu: accesing a value of a hash is done with []
[18:04:12] mallu: jhass: I wanted to get the value of d
[18:04:40] kies: has joined #ruby
[18:04:47] jhass: mallu: so you were calling Object#hash there with the argument d, but Object#hash doesn't take an argument ;)
[18:05:41] marcosantoniocar: has left #ruby: ()
[18:05:48] akem: has joined #ruby
[18:05:50] mallu: jhass: ok.. I'm learning ruby so let me read hash doc again.. thank you
[18:06:56] gregf: has joined #ruby
[18:07:30] jhass: mallu: a tip: don't name your local variables like the datastructure, so instead of hash name it dna_pairs or something
[18:07:34] err_ok: has joined #ruby
[18:07:52] mallu: jhass: ok thank you
[18:07:58] jhass: base_pairs? I don't know the correct english term
[18:08:34] jhass: hah, guessed right https://en.wikipedia.org/wiki/Base_pair
[18:08:39] ruurd: has joined #ruby
[18:09:24] mallu: jhass: so this is what I was expecting to get from that method
[18:09:28] mallu: irb(main):034:0> hash = {'G' => 'C', 'C' => 'G', 'T' => 'A', 'A' => 'U'} => {"G"=>"C", "C"=>"G", "T"=>"A", "A"=>"U"} irb(main):035:0> hash['G'] => "C"
[18:09:49] jhass: I figured
[18:09:55] Tref: has joined #ruby
[18:10:24] mallu: jhass: so what do you mean by "but Object#hash doesn't take an argument"
[18:10:26] Vile`: has joined #ruby
[18:10:39] apeiros: oy, genetics
[18:10:47] jhass: apeiros: not really :P
[18:11:03] jhass: apeiros: Hash rather
[18:11:20] apeiros: GCTA & U sounds suspiciously like adenin, cytosin, guanin, and whatever the others were
[18:11:28] jhass: mallu: so, hash("C") wasn't using your local variable named hash, because it was a method call, we could also write it as self.hash("C")
[18:11:46] apeiros: err, DNA in english
[18:11:48] jhass: mallu: Object is the base for everything and defines a hash method, so that method was called
[18:12:05] jhass: mallu: but then Object#hash doesn't take an argument and that raised your ArgumentError
[18:12:50] apeiros: mallu: working with some bio stuff? dna related? (because of the keys/values in your hash)
[18:13:02] jhass: apeiros: the task is mapping a DNA base to its pair, but it's just a exercism or codewars challenge iirc
[18:13:20] dkphenom: has joined #ruby
[18:13:27] jhass: so it's much more about Hash than about DNA :P
[18:13:32] mallu: aperios: learning ruby and found this exercise online
[18:14:20] apeiros: ?tabnick mallu
[18:14:20] ruboto: mallu, pro-tip - use tab completion for nicks. avoids typos in nicks.
[18:14:36] mallu: jhass: so if I change my hash variable to dna_hash then it should work?
[18:14:39] apeiros: I really have to auto that for all known apeiros mutilations
[18:14:58] mallu: ruboto: thanks
[18:15:34] apeiros: ?justabot mallu
[18:15:34] ruboto: mallu, I'm just a bot. You don't need to address me.
[18:15:39] apeiros: and that I should auto as well
[18:15:58] howdoicomputer: has joined #ruby
[18:16:01] voodo: has joined #ruby
[18:16:15] UtkarshRay: has joined #ruby
[18:16:52] jaequery: has joined #ruby
[18:17:34] twe4ked: has joined #ruby
[18:17:39] mallu: jhass: I'm still getting the same error def self.of_dna(dna_pairs) dna_hash = {'G' => 'C', 'C' => 'G', 'T' => 'A', 'A' => 'U'} dna_hash['dna_pairs'] end
[18:17:58] pen: has joined #ruby
[18:18:03] jhass: mallu: the same? I highly doubt that?
[18:18:11] jhass: did you save your file?
[18:18:30] jhass: brb, apeiros has to take over :P
[18:18:38] mallu: I am getting nil I suppoed to get G
[18:18:44] stannard: has joined #ruby
[18:19:55] dtordable: has joined #ruby
[18:20:24] mallu: jhass: apeiros: https://gist.github.com/anonymous/0f86672533099fd47396
[18:21:11] jhass: >> dna_pairs = "C"; dna_pairs == 'dna_pairs'
[18:21:12] ruboto: jhass # => false (https://eval.in/473450)
[18:21:18] dtordable: has joined #ruby
[18:21:34] mallu: ah.. found the issue
[18:21:45] EminenceHC: has joined #ruby
[18:22:06] ruurd: has joined #ruby
[18:23:44] ellisTAA: has joined #ruby
[18:24:56] IrishGringo: has joined #ruby
[18:29:10] maloik: has joined #ruby
[18:31:22] bb010g: has joined #ruby
[18:32:03] agentmeerkat: has joined #ruby
[18:33:58] myztic: has joined #ruby
[18:33:59] howdoicomputer: has joined #ruby
[18:34:54] Melpaws: has joined #ruby
[18:35:59] makenoise: has joined #ruby
[18:36:05] ruurd: has joined #ruby
[18:39:16] darkxploit: has joined #ruby
[18:40:37] skcin7: has joined #ruby
[18:42:20] dfinninger: has joined #ruby
[18:49:39] Axsuul: has joined #ruby
[18:50:24] maloik: has joined #ruby
[18:51:08] pdoherty: has joined #ruby
[18:51:22] aibot: has joined #ruby
[18:51:28] nolic: has joined #ruby
[18:51:50] yqt: has joined #ruby
[18:53:07] tchv09: has joined #ruby
[18:53:52] makenoise: has joined #ruby
[18:55:37] arup_r: has joined #ruby
[18:56:52] EminenceHC: has joined #ruby
[18:57:26] gregf: has joined #ruby
[18:59:12] yeticry: has joined #ruby
[19:00:24] norc: Ox0dea: Meh my question was silly. Ruby does not recover from longjmps anyway.
[19:01:03] norc: But at least I have learned a few interesting pieces how Exceptions are raised. :)
[19:03:28] Axsuul: has joined #ruby
[19:05:39] zomgbie: has joined #ruby
[19:05:50] pskosinski: has joined #ruby
[19:05:56] symm-: has joined #ruby
[19:07:08] Axsuul: has joined #ruby
[19:10:47] pawnbox: has joined #ruby
[19:11:18] maloik: has joined #ruby
[19:11:53] EminenceHC: has joined #ruby
[19:13:33] kadoppe: has joined #ruby
[19:14:19] khwilo: has joined #ruby
[19:15:14] benlovell: has joined #ruby
[19:16:31] khwilo_: has joined #ruby
[19:17:18] myztic: has joined #ruby
[19:17:48] crazydiamond: has joined #ruby
[19:20:27] kobain: has joined #ruby
[19:20:34] saddad: has joined #ruby
[19:20:51] pawnbox: has joined #ruby
[19:23:27] kobain: has joined #ruby
[19:23:46] mallu: please take a look at this and tell me how I can make it better. I feel like I am repeating lots of code. https://gist.github.com/anonymous/613d964f73d9cb1e5266
[19:24:12] jhass: ?gist_usage mallu
[19:24:12] ruboto: mallu, To properly use gist, please enable syntax highlighting, either by choosing the language manually or by entering a proper filename. If you post multiple things, separate them into multiple files. If you have a Github account, please update your gist with new information instead of posting a new one.
[19:24:28] yoongkang: has joined #ruby
[19:25:09] linduxed: has joined #ruby
[19:25:31] jhass: &ri Array#map Hash#invert @mallu
[19:25:31] `derpy: mallu: http://www.rubydoc.info/stdlib/core/Array#map-instance_method, http://www.rubydoc.info/stdlib/core/Hash#invert-instance_method
[19:25:48] banister: has joined #ruby
[19:26:06] jhass: mallu: and true, you can extract the logic to a method that takes the map as argument
[19:26:45] jhass: well, or just use Hash#values_at with a splat I guess, then the repetition would become a minor issue
[19:27:06] akem2: has joined #ruby
[19:27:17] jhass: &ri Hash#fetch Hash#has_key?
[19:27:17] `derpy: http://www.rubydoc.info/stdlib/core/Hash#fetch-instance_method, http://www.rubydoc.info/stdlib/core/Hash#has_key%3F-instance_method
[19:27:25] jhass: mallu: ^ two more methods to take a look at
[19:28:31] minimalism: has joined #ruby
[19:29:12] aeontech: has joined #ruby
[19:31:51] ellisTAA: could someone tell me where to look for how i???d access unix commands from inside my ruby program? i want to access gzip
[19:32:22] jhass: EllisTAA: check zlib stdlib
[19:32:34] ellisTAA: jhass: thanks
[19:36:06] ellisTAA: jhass: what about Shell.gzip
[19:36:18] maikowblue: has joined #ruby
[19:36:31] jhass: that's a thing?
[19:36:53] jhass: can't find it, where did you find that?
[19:37:12] ellisTAA: yeah ur right it isn???t ???
[19:37:30] ellisTAA: thought Shell gave me access to all commands
[19:38:28] adac: has joined #ruby
[19:39:40] segy_: has joined #ruby
[19:39:44] yfeldblum: has joined #ruby
[19:39:45] jhass: no, that's not what it does
[19:40:04] finisherr: has joined #ruby
[19:40:14] aeontech: has joined #ruby
[19:41:05] ruurd: has joined #ruby
[19:41:57] k3asd`: has joined #ruby
[19:42:17] solars: has joined #ruby
[19:43:07] al2o3-cr: has joined #ruby
[19:43:11] rgrmatt: has joined #ruby
[19:43:51] towski_: has joined #ruby
[19:45:38] ismaelrb: has joined #ruby
[19:46:10] segy_: has joined #ruby
[19:46:50] craysiii: has joined #ruby
[19:47:32] Uranio: has joined #ruby
[19:49:09] maloik: has joined #ruby
[19:49:41] _blizzy_: has joined #ruby
[19:50:51] dlitvak: has joined #ruby
[19:51:20] blackjid: has joined #ruby
[19:52:59] bmalum: has joined #ruby
[19:53:02] IrishGringo: has joined #ruby
[19:53:48] ta: has joined #ruby
[19:55:31] antoniobeyah: has joined #ruby
[19:56:38] blackmesa: has joined #ruby
[19:58:48] unclouded: has joined #ruby
[20:01:22] al2o3-cr1: has joined #ruby
[20:03:04] finisherr: has joined #ruby
[20:03:23] bluOxigen: has joined #ruby
[20:03:35] bluOxigen: has joined #ruby
[20:03:47] goodcodeguy: has joined #ruby
[20:03:50] timonv: has joined #ruby
[20:10:06] IrishGringo: has joined #ruby
[20:12:13] diegoaguilar: has joined #ruby
[20:12:50] arup_r: has joined #ruby
[20:13:47] ellisTAA: man zlib is confusing
[20:14:54] Xeago: has joined #ruby
[20:23:41] moei: has joined #ruby
[20:23:57] Coldblackice: has joined #ruby
[20:24:11] terminalrecluse: has joined #ruby
[20:26:22] maloik: has joined #ruby
[20:27:24] beauby: has joined #ruby
[20:27:27] Outlastsheep: has joined #ruby
[20:29:06] diegoaguilar: has joined #ruby
[20:29:15] ohaibbq: has joined #ruby
[20:32:21] ellisTAA: when i run this i expect my files to get compressed but when i check the files they arent compressed ??? https://gist.github.com/ellismarte/b1cb88fd52f731f0efed#file-neat-rb-L14-L16
[20:33:31] jhass: EllisTAA: it returns the compressed data as a string
[20:34:06] jhass: &ri Zlib::deflate
[20:34:06] `derpy: http://www.rubydoc.info/stdlib/zlib/Zlib#deflate-class_method
[20:35:51] ellisTAA: jhass: is it possible to get file hello.txt on my desktop to = hello.txt.gz?
[20:36:54] ellisTAA: jhass: using the Zlib?
[20:37:10] jhass: File.open(path) do |file| File.write("#{path}.gz", Zlib.deflate(file)); end; File.unlink(path)
[20:38:06] cdg: has joined #ruby
[20:39:14] ellisTAA: jhass: sweet. what does it mean to unlink a path? i could just look it up
[20:39:39] jhass: &ri File.unlink
[20:39:39] `derpy: http://www.rubydoc.info/stdlib/core/File#unlink-class_method
[20:40:01] jhass: ah we have it aliased as delete these days
[20:40:29] moeabdol: has joined #ruby
[20:40:39] voker57: has joined #ruby
[20:40:39] voker57: has joined #ruby
[20:41:07] norc: EllisTAA: Unlinking is a more concise terms since pretty much all filesystem have/support hard links.
[20:41:23] ellisTAA: jhass: so in the code u wrote up there, i???d deflate the file then use unlink to delete the file that isn???t compressed?
[20:42:03] jhass: gzip(1) doesn't do anything else
[20:42:21] SenpaiSilver: has joined #ruby
[20:42:36] nomadic: has joined #ruby
[20:44:03] varunwachaspati_: has joined #ruby
[20:44:08] User458764: has joined #ruby
[20:45:00] User458764: has joined #ruby
[20:45:28] yfeldblum: has joined #ruby
[20:46:35] gambl0re: has joined #ruby
[20:48:24] ellisTAA: jhass: so deflate is expecting a string ??? could i just pass it the path and still create a compressed file on this line https://gist.github.com/ellismarte/b1cb88fd52f731f0efed#file-neat-rb-L15
[20:49:04] jhass: then you would just compress the path
[20:49:47] weemsledeux: has joined #ruby
[20:51:02] houhoulis: has joined #ruby
[20:51:06] ellisTAA: am i correct in thinking if i pass it the path then i can delete line 14?
[20:51:18] zotherstupidguy: has joined #ruby
[20:52:03] ellisTAA: oh dang it works!
[20:52:14] jhass: EllisTAA: zcat it
[20:52:56] DLSteve: has joined #ruby
[20:53:51] IrishGringo: has joined #ruby
[20:54:35] blackmesa: has joined #ruby
[20:54:43] ellisTAA: jhass: thanks 4 the help
[20:54:55] jhass: EllisTAA: seriously, zcat the result
[20:55:26] ellisTAA: ill look it up but what???s that
[20:55:37] jhass: a command, like gzip
[20:56:11] jhass: decompresses it and prints the result to stdout
[20:56:13] s00pcan: has joined #ruby
[20:57:59] s00pcan: has joined #ruby
[20:58:45] ruurd: has joined #ruby
[21:00:37] terminalrecluse: has joined #ruby
[21:01:46] ellisTAA: ok gotta do the dishes first
[21:05:07] gambl0re: has joined #ruby
[21:06:13] Xeago: has joined #ruby
[21:06:57] purplexed-: has joined #ruby
[21:06:58] purplexed-: has joined #ruby
[21:08:39] allcentury: has joined #ruby
[21:09:04] symm-: has joined #ruby
[21:10:01] dikaio: has joined #ruby
[21:12:24] shevy: I want robots that program for me
[21:13:16] akem2: do i hear satan clauss?
[21:13:33] zapata: has joined #ruby
[21:16:04] solars: has joined #ruby
[21:16:48] ruurd: has joined #ruby
[21:17:34] beauby: has joined #ruby
[21:18:53] gix: has joined #ruby
[21:19:21] BSaboia: has joined #ruby
[21:20:44] arup_r: has joined #ruby
[21:21:32] adac: has joined #ruby
[21:23:17] maloik: has joined #ruby
[21:24:00] Sp4rKy: has joined #ruby
[21:24:48] sparr: has joined #ruby
[21:25:12] sondr3: hello, newbie question: I'm trying to wrap my head around OptionParser but can't figure out how to send a name on an option to another function... here's my current progress: https://gist.github.com/sondr3/c4739d6e17a6efdea4ae. It works fine except it doesn't seem to trigger anything in the lib file. Anybody care to help me a bit? Sorry if I'm missing something obvious
[21:25:19] asas: has joined #ruby
[21:25:57] yoongkang: has joined #ruby
[21:26:16] adaedra: It's all your code?
[21:27:11] mary5030: has joined #ruby
[21:27:18] sondr3: well, I took most from the example I found on ruby-doc.org and modified it from there
[21:28:04] adaedra: It's obviously not all the code, as it lacks at least opts definition
[21:28:20] tlaxkit: has joined #ruby
[21:28:45] sondr3: oh, like that, yeah, I just ripped it out from the middle of everything, but since I just used the example on ruby-docs I figured that wasn't needed
[21:29:24] sondr3: it all works fine, except I can't figure out how to "get" the name in the cli.rb file
[21:29:52] saddad: has joined #ruby
[21:29:53] adaedra: Ah, it works?
[21:30:08] adaedra: well, just pass the parameter to new then
[21:30:17] pskosinski_: has joined #ruby
[21:30:27] sondr3: uh, yeah, that's what I can't figure out how to do, hehe, quite new to this
[21:30:32] ur5us: has joined #ruby
[21:30:36] gix: has joined #ruby
[21:30:37] adaedra: like any other function
[21:31:40] adaedra: the parameters you pass to new are passed to initialize
[21:31:50] droptone: Question: When searching an array of hashes for a value, I normally use .select, is this the quickest method?
[21:32:19] pskosinski_: has joined #ruby
[21:32:23] adaedra: For only one value?
[21:32:31] droptone: such as test = [{"name" => "jim", "job" => "boss"}, {"name" => "steve", "job" => "vp"}]
[21:32:45] droptone: then test.select { |t| t['name'] == "jim" }
[21:32:53] droptone: Yes, I only need one value
[21:33:09] adaedra: If you just need the key, there's Hash#key
[21:33:17] jhass: &ri Enumerable#find
[21:33:17] `derpy: http://www.rubydoc.info/stdlib/core/Enumerable#find-instance_method
[21:33:20] droptone: Well, no, I need all the values within that array entry
[21:33:20] sondr3: okay, thanks guys, I'll figure it out :)
[21:33:22] droptone: I need that hash
[21:33:44] jhass: droptone: so your .first afterwards? use .find instead of select
[21:33:45] droptone: so I need it to return the hash itself with the various parameters.
[21:33:47] adaedra: Otherwise, yes, for one value you need Hash#find
[21:33:56] droptone: Yes, jhass, exactly, so .find is better?
[21:34:00] droptone: Perfect, thank you.
[21:34:06] jhass: droptone: it doesn't allocate an array
[21:34:09] adaedra: yes, as it will return first match
[21:34:11] droptone: Yes, I am having to use .first.
[21:34:15] droptone: Brilliant, thank you.
[21:34:17] jhass: and stops on the first match
[21:34:32] droptone: Is the syntax the same?
[21:34:42] norc: I get an Error: uninitialized constant Pry::ObjectPath::StringScanner every time I try to tab complete require filesystem paths, i.e.: require "./<TAB>
[21:34:44] adaedra: You have the doc above, linked by `derpy
[21:34:48] droptone: test.find { |t| t['name'] == "jim" }
[21:34:48] norc: This is from pry 0.10.3
[21:34:50] toretore: has joined #ruby
[21:35:39] adaedra: but that's not a hash you're searching, droptone
[21:36:00] adaedra: duh, I succeeded at misreading badly.
[21:37:58] finisherr: has joined #ruby
[21:38:06] malconis: has joined #ruby
[21:38:38] hrs: has joined #ruby
[21:38:46] mack25: has joined #ruby
[21:38:56] maloik: has joined #ruby
[21:39:48] SCHAAP137: has joined #ruby
[21:41:13] ruurd: has joined #ruby
[21:41:38] droptone: adaedra: It's an array of hashes, no?
[21:41:46] adaedra: yeah yeah ignore me
[21:41:57] adaedra: I thought you had a simple hash
[21:42:04] droptone: hah, no problem man.
[21:42:08] droptone: I appreciate the help.
[21:42:09] gregf: has joined #ruby
[21:42:09] adaedra: I read a tiny bit too fast sometimes :x
[21:42:16] droptone: I'm at version 3 of this project, it's a major overhaul.
[21:42:43] droptone: We're getting customers all over the world, so I'm having to add catchalls for all eventualities.
[21:42:53] symm-: has joined #ruby
[21:42:55] droptone: I'm really glad we chose Ruby instead of Python when we began this project.
[21:43:09] hrs: has joined #ruby
[21:44:57] lemondom: but I use ansible over puppet :O
[21:44:59] lemondom: am I a bad guy now? :
[21:45:03] norc: Good lord, pry is so amazing. :<
[21:45:16] norc: How did I survive all those years without it....
[21:45:36] stannard: has joined #ruby
[21:46:04] droptone: Here's a question: I have code here that does the following: test = test2.to_s; test3 = test[2..-1]
[21:46:35] droptone: Is there a way to combine the two statements, so I can convert the value to a string and assign the value [2..-1] in the same statement?
[21:46:47] droptone: Like the way Ruby allows chaining methods like .to_time.strftime() and what not?
[21:47:30] adaedra: just chain :)
[21:47:36] maloik: has joined #ruby
[21:47:36] jhass: droptone: [] is in fact just a method call, we could (but shouldn't) rewrite it to test.[](2..-1)
[21:48:30] jhass: so test2.to_s[2..-1] is valid
[21:48:41] droptone: Very nice, thank you.
[21:50:00] glanzi: has joined #ruby
[21:51:54] gambl0re: has joined #ruby
[21:52:44] mary5030: has joined #ruby
[21:53:17] cibs: has joined #ruby
[21:55:39] Papierkorb: Is there a way to alias_method a method on a instance alone?
[21:56:33] Mon_Ouie: You can use that instance's singleton class
[21:56:49] Papierkorb: is that the eigenclass?
[21:57:17] Mon_Ouie: Yes, the methods to manipulate it use the word 'singleton' so that's how I refer to it
[21:57:31] Papierkorb: thanks, reading up on that
[21:57:38] troulouliou_div2: has joined #ruby
[22:00:11] ismaelga: has joined #ruby
[22:01:10] Papierkorb: Mon_Ouie: that worked, thanks!
[22:03:09] maloik: has joined #ruby
[22:03:25] nsuke: has joined #ruby
[22:04:53] Tref: has joined #ruby
[22:07:01] auxbuss: has joined #ruby
[22:07:17] Channel6: has joined #ruby
[22:08:17] rbowlby: has joined #ruby
[22:12:49] lemondom_: has joined #ruby
[22:13:48] EminenceHC: has joined #ruby
[22:14:28] freerobby: has joined #ruby
[22:15:36] ta: has joined #ruby
[22:18:23] nolic: has joined #ruby
[22:19:08] beauby: has joined #ruby
[22:19:30] AlexRussia: has joined #ruby
[22:20:38] gambl0re: has joined #ruby
[22:21:29] centrx: has joined #ruby
[22:23:56] doddok: what's the best CPU for ruby?
[22:24:56] doddok: apple a9 seems the best
[22:25:15] doddok: what do u think
[22:25:52] Fire-Dragon-DoL: doddok: I'm not sure why "best cpu" should exist for ruby. Isn't it something like XEON with lot of cores?
[22:26:34] norc: Papierkorb: It can be quite helpful to understand how Rubys Object model works behind the scenes. It makes everything from default asignee/receiver to instance methods really easy to understand. :)
[22:26:42] yoongkang: has joined #ruby
[22:27:54] dstarh: has joined #ruby
[22:28:07] icbm: has joined #ruby
[22:28:22] Papierkorb: norc: I knew about the eigenclass stuff through def the_instance.the_method hacks, but didn't knew that there's #singleton_class. But thinking about it, is define_singleton_method by that a short-hand for self.singleton_class.define_method ?
[22:28:53] norc: Papierkorb: Well, that method would be private.
[22:29:20] Papierkorb: nothing a just-do-it #send won't fix
[22:29:28] norc: So rather self.singleton_class.send(:define_method) which is really cumbersome
[22:29:29] norc: But yes.
[22:29:38] marr: has joined #ruby
[22:29:56] mary5030: has joined #ruby
[22:30:24] norc: Papierkorb: Also, everytime you do class << self; end what you actually do is open the singleton class of whatever self is.
[22:30:32] _blizzy_: has joined #ruby
[22:30:33] norc: And set that to the new self
[22:30:44] ellisTAA: has joined #ruby
[22:30:44] yfeldblum: has joined #ruby
[22:31:10] ruid: has joined #ruby
[22:31:24] pawnbox: has joined #ruby
[22:32:32] dmcp_: has joined #ruby
[22:33:30] norc: Papierkorb: Also there is a much much much more common way to do self.singleton_class.send(:define_method)
[22:33:38] norc: It's this:
[22:33:52] norc: >> def self.people_do_this_for_class_methods; end
[22:33:53] ruboto: norc # => :people_do_this_for_class_methods (https://eval.in/473622)
[22:34:02] Tref: has joined #ruby
[22:34:23] norc: Which also just adds a method to self's singleton class.
[22:34:47] s2013: has joined #ruby
[22:36:27] chipotle: has joined #ruby
[22:37:06] ElSif: has joined #ruby
[22:37:22] rgrmatt: has joined #ruby
[22:37:23] Freijo: has joined #ruby
[22:38:42] norc: If you look at the implementation (click on "Toggle source") you will see that it is just syntactic sugar for what you said. http://ruby-doc.org/core-2.0.0/Object.html#method-i-define_singleton_method
[22:38:45] shevy: doddok for me it never seemed to be a problem; I usually buy very cheap machines altogether, only thing that I have had looked for where that the RAM was in the 4-8 Gig range
[22:39:31] weaksauce: has joined #ruby
[22:40:23] Xeago: has joined #ruby
[22:40:37] baweaver: has joined #ruby
[22:41:05] diegoaguilar: has joined #ruby
[22:41:07] pdoherty: has joined #ruby
[22:41:26] ruurd: has joined #ruby
[22:41:33] Xeago: has joined #ruby
[22:41:49] IrishGringo: has joined #ruby
[22:43:24] arescorpio: has joined #ruby
[22:46:53] postmodern: has joined #ruby
[22:48:37] jetpackjoe: has joined #ruby
[22:48:46] postmodern: what is the defacto way of handling optional dependencies? autoload the constant? Object.const_defined?(:ThatLib) ?
[22:49:00] auxbuss: has joined #ruby
[22:49:16] postmodern: require the user require mylib/enable_optional_dependency
[22:50:37] ruurd: has joined #ruby
[22:51:19] gambl0re: has joined #ruby
[23:00:15] cdg: has joined #ruby
[23:00:23] sunya7a_: has joined #ruby
[23:01:16] cwong_on_irc: has joined #ruby
[23:02:31] beauby: has joined #ruby
[23:03:27] waka: has joined #ruby
[23:03:35] waka: has joined #ruby
[23:03:36] CBX: has joined #ruby
[23:05:04] shevy: probably or do a rescue LoadError perhaps
[23:06:31] postmodern: shevy, so like require the dependency within the method, if they pass in the option to enable it
[23:07:05] Ox0dea: has joined #ruby
[23:08:35] duncannz: has joined #ruby
[23:08:36] Jardayn: has joined #ruby
[23:08:37] gambl0re: has joined #ruby
[23:10:53] pawnbox: has joined #ruby
[23:11:40] auxbuss: has joined #ruby
[23:11:44] jetpackjoe: has joined #ruby
[23:12:06] shevy: I have a few gems where there are a bunch of important dependencies, which must be satisfied; for the other ones, such as local .rb files that are just addons to make it more convenient for me, I do silent begin/rescue and handle the cases where this constant is unavailable, usually via a Object.const_defined? check (or defining a convenience method such as: if available? :AsciiParty; AsciiParty.dance!; en
[23:12:06] shevy: d; I do this only for small stuff like singular .rb files or small projects, for larger projects I use autoload, it seems to be better for when you have to require big projects with lots of .rb files
[23:12:30] CloCkWeRX: has joined #ruby
[23:12:34] jhass: postmodern: I've seen that but also doing it at the top of the file and defining/setting something (constant or value in the gems configuration)
[23:13:10] jhass: or just defined?/ const_defined? in the runtime code
[23:13:32] rbowlby: has joined #ruby
[23:14:50] BiHi: has joined #ruby
[23:19:14] EminenceHC: has joined #ruby
[23:20:13] ta: has joined #ruby
[23:23:32] pandaant: has joined #ruby
[23:27:25] yoongkang: has joined #ruby
[23:29:26] maloik: has joined #ruby
[23:29:48] centrx: has joined #ruby
[23:30:29] rgrmatt: has joined #ruby
[23:34:53] SCHAAP137: has joined #ruby
[23:37:21] lkba: has joined #ruby
[23:38:22] sgambino: has joined #ruby
[23:39:41] s2013: has joined #ruby
[23:42:32] Sembei: has joined #ruby
[23:46:40] cwong_on_irc: has joined #ruby
[23:47:41] maloik: has joined #ruby
[23:48:43] saddad: has joined #ruby
[23:49:35] BTRE: has joined #ruby
[23:50:05] pawnbox: has joined #ruby
[23:52:18] allcentury: has joined #ruby
[23:52:26] s2013: has joined #ruby
[23:55:06] maloik: has joined #ruby
[23:56:13] DrShoggoth: has joined #ruby
[23:56:19] rbowlby: has joined #ruby
[23:58:07] s2013: has joined #ruby