« Back to channel list

#ruby - 14 July 2017

« Back 1 day Forward 1 day »
[00:00:30] rohitpaulk: has joined #ruby
[00:00:59] mim1k: has joined #ruby
[00:01:57] daivyk: has joined #ruby
[00:02:20] milardovich: has joined #ruby
[00:02:35] mrconfused: has joined #ruby
[00:03:40] umaaji: has joined #ruby
[00:04:00] TunaBee: has joined #ruby
[00:04:44] GinoMan: has joined #ruby
[00:05:53] wilbert: has joined #ruby
[00:07:44] nowhere_man: has joined #ruby
[00:07:44] brent__: has joined #ruby
[00:07:49] ecuanaso: has joined #ruby
[00:08:50] nowhereman: has joined #ruby
[00:14:20] Dimik: has joined #ruby
[00:17:48] milardovich: has joined #ruby
[00:19:59] cdg: has joined #ruby
[00:20:00] PaulCape_: has joined #ruby
[00:20:07] ascarter: has joined #ruby
[00:20:11] jenrzzz: has joined #ruby
[00:21:30] boto: has joined #ruby
[00:22:46] millerti: has joined #ruby
[00:23:46] apparition: has joined #ruby
[00:28:34] eckhardt: has joined #ruby
[00:29:43] brent__: has joined #ruby
[00:31:33] Puffball: has joined #ruby
[00:31:39] himynameisvic: has joined #ruby
[00:33:39] jottr: has joined #ruby
[00:34:29] Puffball: has joined #ruby
[00:37:33] moei: has joined #ruby
[00:39:58] SteenJobs_: has joined #ruby
[00:47:51] umaaji: has joined #ruby
[00:52:38] cagomez: has joined #ruby
[00:53:30] boto: has joined #ruby
[00:59:24] cdg: has joined #ruby
[01:05:39] jhooker: has joined #ruby
[01:08:29] jhooker: has joined #ruby
[01:09:11] tAn: has joined #ruby
[01:10:16] gothicsouth: has joined #ruby
[01:13:07] jhooker: has joined #ruby
[01:14:39] juggler: has joined #ruby
[01:15:42] jhooker: has joined #ruby
[01:15:44] kculpis: has joined #ruby
[01:15:44] bronson: has joined #ruby
[01:18:41] jhooker: has joined #ruby
[01:18:58] d5sx43: has joined #ruby
[01:20:03] hndk: has joined #ruby
[01:22:23] jhooker: has joined #ruby
[01:24:14] jhooker: has joined #ruby
[01:25:56] quiller: has joined #ruby
[01:25:58] charliesome: has joined #ruby
[01:27:10] jhooker: has joined #ruby
[01:28:46] cagomez: has joined #ruby
[01:29:40] jhooker: has joined #ruby
[01:30:48] milardovich: has joined #ruby
[01:31:27] randomA: why does rails runs on port 3000 and not 80
[01:33:10] jhooker: has joined #ruby
[01:34:26] ixti: has joined #ruby
[01:34:48] bhrgunatha: has joined #ruby
[01:35:08] jhooker: has joined #ruby
[01:35:41] ixti: has joined #ruby
[01:36:23] gizmore|2: has joined #ruby
[01:36:47] eputnam: has joined #ruby
[01:37:41] milardovich: has joined #ruby
[01:37:44] jhooker: has joined #ruby
[01:41:12] __Yiota: has joined #ruby
[01:41:44] jhooker: has joined #ruby
[01:42:30] charliesome: has joined #ruby
[01:44:27] jhooker: has joined #ruby
[01:46:14] jhooker: has joined #ruby
[01:47:35] dennisvennink: has joined #ruby
[01:50:17] jhooker: has joined #ruby
[01:51:47] jhooker: has joined #ruby
[01:52:46] uranellus: has joined #ruby
[01:53:06] cagomez: has joined #ruby
[01:54:01] __Yiota: has joined #ruby
[01:54:15] jhooker: has joined #ruby
[01:55:38] d^sh: has joined #ruby
[01:56:02] rundor: has joined #ruby
[01:58:07] jhooker: has joined #ruby
[01:58:12] charliesome: has joined #ruby
[01:58:52] PaulCapestany: has joined #ruby
[02:01:03] mim1k: has joined #ruby
[02:01:42] jhooker: has joined #ruby
[02:05:12] jhooker: has joined #ruby
[02:06:59] hahuang65: has joined #ruby
[02:08:09] jhooker: has joined #ruby
[02:09:42] jhooker: has joined #ruby
[02:10:39] Jameser: has joined #ruby
[02:12:15] jhooker: has joined #ruby
[02:15:09] jhooker: has joined #ruby
[02:16:11] Jameser`: has joined #ruby
[02:17:28] cagomez: has joined #ruby
[02:18:15] jhooker: has joined #ruby
[02:19:41] mrconfused: has joined #ruby
[02:20:45] jhooker: has joined #ruby
[02:22:35] DK2: has joined #ruby
[02:23:45] jhooker: has joined #ruby
[02:26:17] jhooker: has joined #ruby
[02:29:24] genpaku: has joined #ruby
[02:30:17] jhooker: has joined #ruby
[02:31:48] jhooker: has joined #ruby
[02:33:23] uZiel: has joined #ruby
[02:33:56] ecuanaso: has joined #ruby
[02:34:19] jhooker: has joined #ruby
[02:34:58] tAn: has joined #ruby
[02:36:58] jottr: has joined #ruby
[02:37:41] jhooker: has joined #ruby
[02:38:28] choke: has joined #ruby
[02:40:25] __Yiota: has joined #ruby
[02:40:38] jhooker: has joined #ruby
[02:42:23] planigan: has joined #ruby
[02:43:15] jhooker: has joined #ruby
[02:44:46] umaaji: has joined #ruby
[02:45:12] rivalomega: has joined #ruby
[02:46:14] jhooker: has joined #ruby
[02:47:30] cam27: has joined #ruby
[02:48:18] rubycoder37: given (1..100).to_a, how can I rotate this array in a loop? the elements of the array, and limit it to 5 elements, e.g. arr[0,5]
[02:48:39] jhooker: has joined #ruby
[02:51:14] jhooker: has joined #ruby
[02:51:46] mtkd: has joined #ruby
[02:53:55] cagomez: has joined #ruby
[02:54:45] elomatreb: rubycoder37: What do you mean by rotate?
[02:55:20] jhooker: has joined #ruby
[02:56:41] jhooker: has joined #ruby
[02:57:37] jenrzzz: has joined #ruby
[02:57:37] jenrzzz: has joined #ruby
[02:57:49] PorcoRex: has joined #ruby
[02:58:43] TunaBee: has joined #ruby
[02:59:05] rubycoder37: I have a rails app with a range of dates, e.g. start_date..end_date, let's say the array results in a month (so ~30 elements), I want to be able to pass these elements to a function and return different dates for each result
[03:00:03] elomatreb: So you want #map? Get a new array with a different value for each original element?
[03:00:43] jhooker: has joined #ruby
[03:01:21] Rr4sT: has joined #ruby
[03:01:51] PorcoRex: elomatreb, I think they might be interested in a mock implementation.
[03:02:18] elomatreb: The rotate part they asked about earlier has me thinking about #each_cons
[03:02:56] jhooker: has joined #ruby
[03:03:32] PorcoRex: Just came in, missed that one.
[03:03:37] rubycoder37: in my application an owner sets an mount of money and a date (start_date and end_date), I need to figure out a way to display each item with different dates
[03:03:46] rubycoder37: s/owner/user/
[03:03:58] rubycoder37: s/mount/amount/
[03:04:31] elomatreb: You should probably put some example input/expected output in a gist, I'm not quite sure what you mean
[03:06:02] jhooker: has joined #ruby
[03:07:00] PorcoRex: rubycoder37, you need to step back from you app and consider that we don not know anything about it. Then ponder on what the thing you don't completely understand is. Then as a question, with a simplified example for everyones convenience.
[03:08:43] jhooker: has joined #ruby
[03:10:45] jhooker: has joined #ruby
[03:14:35] jhooker: has joined #ruby
[03:16:19] bronson: has joined #ruby
[03:16:43] jhooker: has joined #ruby
[03:17:06] rubycoder37: I think it's a design issue, I'm basically entering an amount and a date range, I have to be able to extract a specific set of elements out of that array for each product I'm showing, without the product itself knowing about this data, I have no idea how to do that
[03:18:18] elomatreb: Extracting an array of elements from another array is done with #select. The interesting part is how you decide which elements you want to select
[03:18:52] PorcoRex: elomatreb, it's not an array though, it's a range.
[03:19:25] elomatreb: In the earlier message they mentioned they have turned the range into an array
[03:20:41] rubycoder37: I currently have a method with something like this: (user.target.start_date..user.target.end_date).to_a
[03:20:54] jhooker: has joined #ruby
[03:20:58] rundor: has joined #ruby
[03:21:20] rubycoder37: but it doesn't feel right to be picking a bunch of dates randomly also
[03:22:07] rubycoder37: something tells me I might have misunderstood something about the specification, I think I'll go back to that
[03:23:54] jhooker: has joined #ruby
[03:26:03] jhooker: has joined #ruby
[03:29:16] jhooker: has joined #ruby
[03:29:59] cahoots: has joined #ruby
[03:31:43] jhooker: has joined #ruby
[03:33:51] larissa: has joined #ruby
[03:35:35] jhooker: has joined #ruby
[03:36:37] PorcoRex: rubycoder37, so let's say, you have an array of dates (is each representing a different calendar day?). And then if I understand correctly there is some sort of ammount (is this a single value representing an ammount?). After an operation we want (a new array? with what kind of values?)
[03:37:22] ecuanaso: has joined #ruby
[03:37:29] jhooker: has joined #ruby
[03:39:09] cschneid: has joined #ruby
[03:40:24] jhooker: has joined #ruby
[03:43:13] jhooker: has joined #ruby
[03:43:26] milardovich: has joined #ruby
[03:44:04] rubycoder37: PorcoRex: yes, different days, the amount is a single value (integer), yes
[03:45:09] rubycoder37: PorcoRex: I'm still undecided if I should be returning a new array or a hash for my rails view to parse the data, in that case, I'm also not sure how to convert the array to a hash
[03:45:30] jhooker: has joined #ruby
[03:45:50] elomatreb: At this point a gist with example input and expected result for that input would be helpful, we can then help you implement it
[03:46:12] PorcoRex: Well, if you must employ a hash, what would be the key?
[03:46:47] rubycoder37: that's my problem, the specifications are a bit lacking
[03:47:18] PorcoRex: rubycoder37, what specification, you're designing this, right?
[03:47:22] rubycoder37: thanks for your help
[03:47:38] rubycoder37: PorcoRex: no, it's something I've been told to do
[03:48:04] PorcoRex: rubycoder37, ok. Assume that is terribly wrong. How would you rather do it?
[03:49:34] rubycoder37: good question
[03:49:36] rundor: has joined #ruby
[03:49:49] daivyk: has joined #ruby
[03:50:08] PorcoRex: rubycoder37, I'm sure you've had a couple of fringe ideas.
[03:50:16] PorcoRex: Did you not?
[03:50:54] jhooker: has joined #ruby
[03:50:57] rubycoder37: yes, I think I'll keep working on it until I solve it, I think it's a good way to keep learning ruby
[03:51:51] PorcoRex: I mean, you've got dates... you've got ammounts. Are we leaving these two things out to fend for themselves or are we actually creating a class, that defines how both of these people can coexist peacefully?
[03:52:00] cyfr0n: has joined #ruby
[03:52:21] daivyk: has joined #ruby
[03:53:00] PorcoRex: And if we do create a shelter for these peoples, what should it be called? DateDollar? Not too friendly certainly.
[03:53:08] daivyk: has joined #ruby
[03:53:11] PorcoRex: Maybe the whole thing does not make sense.
[03:53:54] jhooker: has joined #ruby
[03:55:00] PorcoRex: rubycoder37, what do you think?
[03:55:31] gix: has joined #ruby
[03:56:11] Jameser: has joined #ruby
[03:56:28] tAn: has joined #ruby
[03:56:32] jhooker: has joined #ruby
[03:58:33] __Yiota: has joined #ruby
[03:58:36] cdg: has joined #ruby
[03:59:30] jhooker: has joined #ruby
[03:59:36] rubycoder37: PorcoRex: I have an amount and dates (30 days), I also have stores in my app, this amount needs to be distributed between the stores and sellers, my problem is how to select the elements from the date array and display them in my rails views in a way that makes sense
[03:59:47] rubycoder37: sorry for the vagueness
[04:01:34] mim1k: has joined #ruby
[04:02:24] umaaji: has joined #ruby
[04:02:34] rubycoder37: I'm listing the stores in my app for each user and I don't know how select different dates from that array for each store without duplicating results (in the same view)
[04:02:58] jhooker: has joined #ruby
[04:03:21] elomatreb: So you want to assign each store a date from your array, without duplicates?
[04:03:39] PorcoRex: rubycoder37, seems a bit of a Rails question.
[04:04:07] PorcoRex: But is it more query related?
[04:04:41] PorcoRex: I mean DB query.
[04:04:57] rivalomega: has joined #ruby
[04:05:28] rubycoder37: not sure about that, I think so, yes
[04:05:53] jhooker: has joined #ruby
[04:06:34] elomatreb: If they're both arrays of something, Array#zip can "zip" two arrays together, creating pairs of values from both arrays
[04:07:18] PorcoRex: But uhm, let me be blunt. So for instance in your latest reply you say you're listing "apps" for each "user", there are "dates", there are "stores". But in that latest explanation there is nothing about the "ammount", which was a principal issue. I think you need to give us a mock example of your problem instead.
[04:07:55] jhooker: has joined #ruby
[04:08:10] rubycoder37: PorcoRex: no, users can have many stores
[04:08:31] PorcoRex: rubycoder37, you need to try and sinthesise your problem.
[04:08:45] PorcoRex: rubycoder37, what is your problem, in a little box?
[04:11:50] jhooker: has joined #ruby
[04:14:31] jhooker: has joined #ruby
[04:15:27] rubycoder37: I'm still confused about what I have to do
[04:16:30] jhooker: has joined #ruby
[04:16:37] renchan: has joined #ruby
[04:17:30] nowhereman: has joined #ruby
[04:18:57] jhooker: has joined #ruby
[04:19:48] tunaBee_: has joined #ruby
[04:21:46] PorcoRex: rubycoder37, your problem, it's hard to understand. What is it?
[04:21:55] jhooker: has joined #ruby
[04:22:34] Jameser: has joined #ruby
[04:24:04] ascarter: has joined #ruby
[04:24:10] auzty: has joined #ruby
[04:24:29] jhooker: has joined #ruby
[04:26:34] conta: has joined #ruby
[04:29:20] jhooker: has joined #ruby
[04:33:07] moei: has joined #ruby
[04:33:31] rubycoder37: PorcoRex: let me see if I can be a little more clear, this is how my application looks at the moment: https://i.imgur.com/Qf0C5WW.png -- and this is my code: https://gist.github.com/anonymous/f7c8a4860b36997e6e7bb5e62de1a9e9 -- I want to be able to show different dates, I don't understand how to generate different dates from that helper code, I don't understand why it's duplicating the data
[04:35:39] chouhoul_: has joined #ruby
[04:36:38] eightlimbed: has joined #ruby
[04:37:47] jottr: has joined #ruby
[04:38:35] PorcoRex: rubycoder37, this is definitely a Rails question. Do you have their IRC channel?
[04:39:02] rubycoder37: I will ask there, thanks
[04:39:30] PorcoRex: rubycoder37, before you go.
[04:40:20] PorcoRex: Keep on it, rubycoder37, don't give up.
[04:40:33] rubycoder37: I understand why 'date = (current_user.target.start_date..current_user.target.end_date).to_a' would give me the same output, but I don't know what I have to do to show different results in that loop
[04:41:09] PorcoRex: rubycoder37, what loop?
[04:41:51] rubycoder37: PorcoRex: my display_dates function is being called inside that @stores.each loop
[04:42:30] alamar: has joined #ruby
[04:43:34] PorcoRex: Yeah, but what does that mean?
[04:46:55] PorcoRex: rubycoder37, I'm sorry rubycoder37, maybe it's just me, but the thing is you need to take your real problem and make it smaller.
[04:50:28] cdg: has joined #ruby
[04:52:47] rubycoder37: calling shuffle on the array gives me different results as I was expecting
[04:53:01] astrobunny: has joined #ruby
[04:53:58] rubycoder37: https://i.imgur.com/dVATmQD.png
[04:56:44] Derperperd: has joined #ruby
[04:58:29] Derperperd: has joined #ruby
[05:02:30] bronson: has joined #ruby
[05:02:45] ecuanaso: has joined #ruby
[05:03:36] shiranuidong: has joined #ruby
[05:03:48] tAn: has joined #ruby
[05:04:27] rubycoder37: I think my problem solving skills is lacking, or maybe my imagination
[05:05:02] rubycoder37: thanks for your help
[05:05:24] dviola: has joined #ruby
[05:08:20] brent__: has joined #ruby
[05:10:54] anisha: has joined #ruby
[05:12:30] shiranuidong: has joined #ruby
[05:17:30] Bock: has joined #ruby
[05:17:45] kies: has joined #ruby
[05:18:37] nickjj_: has joined #ruby
[05:20:54] weaksauce: has joined #ruby
[05:21:45] Dimik: has joined #ruby
[05:22:57] Bock: has joined #ruby
[05:23:49] uZiel: has joined #ruby
[05:27:19] cdg: has joined #ruby
[05:34:08] ecuanaso: has joined #ruby
[05:35:52] rundor: has joined #ruby
[05:38:24] aupadhye: has joined #ruby
[05:41:05] szymon: has joined #ruby
[05:42:17] Guest43584: i have a question i try to build method where args can by hash or number
[05:42:52] Guest43584: i try do def some_method(*args)
[05:43:44] Guest43584: if args[0].is_a?(Intiger) .... elsif args[0].is_a?(Hash)
[05:44:11] Guest43584: but i think it is simply way
[05:44:25] Guest43584: someone can help
[05:47:36] aufi: has joined #ruby
[05:48:14] szymon_: has joined #ruby
[05:55:38] jaruga: has joined #ruby
[05:56:08] nicolai86: has joined #ruby
[05:59:14] nicolai86: has joined #ruby
[06:02:08] mim1k: has joined #ruby
[06:03:26] cdg: has joined #ruby
[06:03:50] nicolai86: has joined #ruby
[06:05:04] roshanavand: has joined #ruby
[06:07:46] cjohnson: Guest43584: sounds like code smell. Why wouldn't you just make one method for each input? You can abstract the common logic into a third method
[06:08:11] cjohnson: Or assuming the number-input method is really just controlling one of the options in the hash, make it the wrapper for the hash method
[06:09:02] anisha: has joined #ruby
[06:12:40] Guest43584: cjohnson, thanks i do rekrut exerise and in Rspec i have 2 option in this method so it must br in one method
[06:13:59] enterprisey: has joined #ruby
[06:20:58] andrzejku: has joined #ruby
[06:21:49] dcluna: has joined #ruby
[06:31:59] andikr: has joined #ruby
[06:38:51] jottr: has joined #ruby
[06:40:18] DK2: has joined #ruby
[06:49:31] nanoz: has joined #ruby
[06:49:33] nanoz: has joined #ruby
[06:52:33] ahrs: has joined #ruby
[07:01:08] ecuanaso: has joined #ruby
[07:02:14] workmad3: has joined #ruby
[07:03:23] bronson: has joined #ruby
[07:04:18] m4sk1n: has joined #ruby
[07:04:39] nickjj__: has joined #ruby
[07:14:49] TomyWork: has joined #ruby
[07:16:40] patarr: has joined #ruby
[07:17:50] nanoz: has left #ruby: ("Leaving")
[07:21:36] nofxxxx: has joined #ruby
[07:22:38] pandaant: has joined #ruby
[07:23:30] Neptu: has joined #ruby
[07:29:44] jottr: has joined #ruby
[07:30:00] cdg: has joined #ruby
[07:30:41] ur5us: has joined #ruby
[07:31:15] hs366: has joined #ruby
[07:33:26] latemus: has joined #ruby
[07:33:58] garathem: has joined #ruby
[07:42:01] hs366: has joined #ruby
[07:45:01] oded: has joined #ruby
[07:46:27] bkxd: has joined #ruby
[07:46:32] bkxd_: has joined #ruby
[07:48:45] tvw: has joined #ruby
[07:51:37] dionysus69: has joined #ruby
[07:53:01] hs366: has joined #ruby
[07:53:25] Hanmac: has joined #ruby
[07:55:35] vondruch: has joined #ruby
[07:58:15] vondruch: has joined #ruby
[08:00:09] mim1k: has joined #ruby
[08:00:36] mikecmpbll: has joined #ruby
[08:01:25] vondruch: has joined #ruby
[08:05:11] vondruch: has joined #ruby
[08:06:39] jenrzzz: has joined #ruby
[08:06:39] jenrzzz: has joined #ruby
[08:08:21] Rory: has joined #ruby
[08:11:37] Rory: has left #ruby: ()
[08:15:39] latemus: has joined #ruby
[08:20:47] mjanssen: has left #ruby: ()
[08:21:50] charliesome: has joined #ruby
[08:22:02] yeticry: has joined #ruby
[08:23:50] MrJoshua: has joined #ruby
[08:24:58] hahuang65: has joined #ruby
[08:25:56] marr: has joined #ruby
[08:26:15] Ishido: has joined #ruby
[08:26:42] cdg: has joined #ruby
[08:30:25] hightower2: has joined #ruby
[08:31:19] jottr: has joined #ruby
[08:36:55] derekjc: has joined #ruby
[08:38:33] Beams: has joined #ruby
[08:46:00] mim1k: has joined #ruby
[08:48:42] latemus: has joined #ruby
[08:48:59] lxsameer: has joined #ruby
[08:49:27] vondruch: has joined #ruby
[08:50:31] bkxd_: has joined #ruby
[08:51:03] bkxd: has joined #ruby
[08:55:01] PaulCapestany: has joined #ruby
[08:57:49] PaulCape_: has joined #ruby
[08:58:00] anisha: has joined #ruby
[08:59:05] vondruch: has joined #ruby
[09:04:40] bronson: has joined #ruby
[09:05:22] vondruch: has joined #ruby
[09:05:30] roshanavand: has joined #ruby
[09:07:39] bkxd__: has joined #ruby
[09:08:04] bkxd___: has joined #ruby
[09:08:35] jaruga: has joined #ruby
[09:09:04] vondruch: has joined #ruby
[09:09:28] jenrzzz: has joined #ruby
[09:09:28] jenrzzz: has joined #ruby
[09:10:28] mark_66: has joined #ruby
[09:15:34] Serpent7776: has joined #ruby
[09:16:38] jottr: has joined #ruby
[09:17:32] patarr: has joined #ruby
[09:18:04] bkxd: has joined #ruby
[09:18:46] cdg: has joined #ruby
[09:19:53] ltem: has joined #ruby
[09:20:34] ferr: has joined #ruby
[09:23:08] testnia: has joined #ruby
[09:24:48] cadillac_: has joined #ruby
[09:27:08] uZiel: has joined #ruby
[09:27:22] high_fiver: has joined #ruby
[09:31:21] vondruch: has joined #ruby
[09:31:43] charliesome: has joined #ruby
[09:34:57] vondruch: has joined #ruby
[09:36:56] Mia: has joined #ruby
[09:36:56] Mia: has joined #ruby
[09:43:10] jottr: has joined #ruby
[09:44:51] ziyangtian: has joined #ruby
[09:45:03] pmden: has joined #ruby
[09:46:03] noe: has joined #ruby
[09:49:05] vondruch: has joined #ruby
[09:52:20] pmden: has joined #ruby
[09:53:12] vondruch: has joined #ruby
[10:00:48] Guest24: has joined #ruby
[10:01:31] vondruch: has joined #ruby
[10:01:47] GodFather: has joined #ruby
[10:03:39] bkxd: has joined #ruby
[10:03:41] bkxd_: has joined #ruby
[10:03:55] chouhoulis: has joined #ruby
[10:05:45] pmden: has joined #ruby
[10:06:03] mrgrieves: has joined #ruby
[10:06:34] rundor: has joined #ruby
[10:08:12] Bish: >> [{},{}].to_h
[10:08:18] ruby[bot]: Bish: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[10:08:36] Bish: >> [Time.now=>Time.now]
[10:08:41] ruby[bot]: Bish: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[10:08:47] Bish: am i stupid?
[10:09:02] Bish: ah. i get it.. damn im stupid
[10:09:03] psychicist__: has joined #ruby
[10:09:08] gr33n7007h: has joined #ruby
[10:09:17] vondruch: has joined #ruby
[10:12:03] im0nde: has joined #ruby
[10:13:38] rohitpaulk: has joined #ruby
[10:13:58] Inoperable: has joined #ruby
[10:15:58] patarr: has joined #ruby
[10:16:56] vondruch: has joined #ruby
[10:25:31] DrCode: has joined #ruby
[10:29:24] ascarter: has joined #ruby
[10:31:04] vondruch: has joined #ruby
[10:51:41] rohitpaulk: has joined #ruby
[10:54:53] mim1k: has joined #ruby
[10:57:04] gregf_: has joined #ruby
[11:02:41] high_fiver: has joined #ruby
[11:05:41] bronson: has joined #ruby
[11:18:31] pmden: has joined #ruby
[11:20:57] sepp2k: has joined #ruby
[11:28:38] cdg: has joined #ruby
[11:30:31] ascarter: has joined #ruby
[11:31:05] chmurifree: has joined #ruby
[11:31:18] vondruch: has joined #ruby
[11:33:31] jottr: has joined #ruby
[11:35:07] mim1k: has joined #ruby
[11:35:08] vondruch: has joined #ruby
[11:36:40] hightower2: has joined #ruby
[11:37:22] pmden: has joined #ruby
[11:39:16] vondruch: has joined #ruby
[11:39:44] dasher00: has joined #ruby
[11:41:38] workmad3: has joined #ruby
[11:41:41] ldnunes: has joined #ruby
[11:42:07] tvw: has joined #ruby
[11:49:01] vondruch: has joined #ruby
[11:50:47] twe4ked: has joined #ruby
[11:51:45] im0nde: has joined #ruby
[11:53:19] vondruch: has joined #ruby
[11:53:42] DK2: has joined #ruby
[11:54:20] diegorv: has joined #ruby
[11:58:58] vondruch: has joined #ruby
[11:59:26] diegorv: has joined #ruby
[11:59:31] diegorv: has joined #ruby
[12:01:16] petruff2: has joined #ruby
[12:07:47] mim1k: has joined #ruby
[12:07:56] noe: has joined #ruby
[12:09:47] GinoMan: has joined #ruby
[12:15:01] vondruch: has joined #ruby
[12:20:29] rivalomega: has joined #ruby
[12:20:53] cdg: has joined #ruby
[12:25:01] splitshot: has joined #ruby
[12:25:26] dennisvennink: has joined #ruby
[12:29:47] rohitpaulk: has joined #ruby
[12:32:20] mim1k_: has joined #ruby
[12:33:17] nowhereman: has joined #ruby
[12:33:18] workmad3: has joined #ruby
[12:33:46] andikr: has joined #ruby
[12:35:53] aufi: has joined #ruby
[12:36:53] synthroid: has joined #ruby
[12:45:44] InfinityFye: has joined #ruby
[12:46:28] mim1k: has joined #ruby
[12:47:46] vondruch: has joined #ruby
[12:48:11] dminuoso: Bike shedding type.
[12:48:17] dminuoso: Preferred bracket type?
[12:48:33] dminuoso: %w<> $w{} %() %[] ?
[12:49:30] dminuoso: The last one is particularly sexy and not otherwise used in Ruby.
[12:50:52] dminuoso: %w[] at least gives a visual indicator that it produces an array
[12:51:17] dminuoso: Guest43584: Why?
[12:51:26] vondruch: has joined #ruby
[12:51:35] dminuoso: Just mere preference is uninteresting. Reasons for your choice is what Im after.
[12:52:19] Guest43584: dminuoso, i don`t i only know this you give a oportunity thansk :)
[12:53:12] Guest43584: dminuoso, but what is a difrents
[12:53:20] dminuoso: %w.a b c. is admissable too
[12:53:23] dminuoso: For giggles.
[12:53:27] dminuoso: Guest43584: None.
[12:53:29] dminuoso: That's the point.
[12:54:36] rohitpaulk: has joined #ruby
[12:54:38] Guest43584: dminuoso, %(a b c) give me "a b c" and %w(a b c) give me a ["a", "b" "c"]
[12:55:31] ule: and %i(a b c) gives us [:a, :b, :c] :)
[12:55:54] Guest43584: dminuoso, oh sory i try this in irb first time i don't exacly understand
[12:56:13] Guest43584: dminuoso, in first time
[12:56:34] dminuoso: Guest43584: there is q, Q, r, i, l, w, W, x, s
[12:56:41] dminuoso: Each means something different. :-)
[12:57:05] yeticry_: has joined #ruby
[12:57:16] dminuoso: And that should have been I not l :P
[12:57:17] al2o3-cr: has joined #ruby
[12:58:20] Guest43584: oo i was looking what doing l :)
[12:58:33] nowhereman: has joined #ruby
[12:58:55] dminuoso: Guest43584: upper case generally means interpolatable, lower case means non-interpolatable
[12:59:14] dminuoso: though x and r are also interpolatable
[12:59:28] ruby[bot]: dminuoso: # => ["a"] (https://eval.in/832622)
[12:59:36] ruby[bot]: dminuoso: # => ["a"] (https://eval.in/832623)
[12:59:40] dminuoso: I LIKE THAT!
[12:59:54] ruby[bot]: dminuoso: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[13:03:39] koenrh: has joined #ruby
[13:06:11] tacoboy: has joined #ruby
[13:06:22] workmad3: has joined #ruby
[13:06:43] bronson: has joined #ruby
[13:08:38] guardianx: has joined #ruby
[13:08:40] nowhereman: has joined #ruby
[13:09:12] oleo: has joined #ruby
[13:09:21] chouhoulis: has joined #ruby
[13:13:45] nowhereman: has joined #ruby
[13:15:54] sgen: has joined #ruby
[13:17:36] nowhereman: has joined #ruby
[13:24:10] rohitpaulk: has joined #ruby
[13:25:41] vondruch: has joined #ruby
[13:25:44] minimalism: has joined #ruby
[13:26:17] aclark: has joined #ruby
[13:28:14] rkellermeyer: has joined #ruby
[13:29:15] dminuoso: >> %w%w%*$$
[13:29:16] ruby[bot]: dminuoso: # => ["w", "w", "w", "w", "w", "w", "w", "w", "w", "w", "w", "w", "w", "w", "w", "w", "w", "w", "w", "w", ...check link for more (https://eval.in/832632)
[13:29:17] dminuoso: This is amazing!
[13:29:48] vondruch: has joined #ruby
[13:30:00] DLSteve: has joined #ruby
[13:30:38] DK2: has joined #ruby
[13:31:14] mrgrieves: I'm getting 'bundler: failed to load command' whenever I try to run rake tasks despite the fact the gem is present. Any ideas what I might be missing?
[13:31:21] __Yiota: has joined #ruby
[13:31:39] Dry_Lips: has joined #ruby
[13:31:39] Dry_Lips: has joined #ruby
[13:31:46] Guest43584: why is 9951 elements ??
[13:31:55] millerti: has joined #ruby
[13:32:05] ascarter: has joined #ruby
[13:33:26] shiranuidong: has joined #ruby
[13:33:59] dminuoso: Guest43584: I'll let you riddle on that! :-)
[13:36:26] sekmo: has joined #ruby
[13:39:29] vondruch: has joined #ruby
[13:40:10] jottr: has joined #ruby
[13:41:06] cam27: has joined #ruby
[13:42:35] ar1a_: has joined #ruby
[13:43:45] RustyJ: has joined #ruby
[13:45:34] bigkevmcd: has joined #ruby
[13:48:23] Bish: dminuoso: the fuq
[13:48:50] ruby[bot]: Bish: # => /tmp/execpad-62e579807435/source-62e579807435:2: unterminated string meets end of file ...check link for more (https://eval.in/832645)
[13:48:57] ruby[bot]: Bish: # => /tmp/execpad-7453c835b7a9/source-7453c835b7a9:2: unterminated string meets end of file ...check link for more (https://eval.in/832646)
[13:49:12] Bish: ACTION opens up a console
[13:49:33] Bish: wat.. why
[13:49:42] Bish: %w%w% <=
[13:49:44] vondruch: has joined #ruby
[13:50:00] Bish: Guest43584: i can tell you for 45 schmeckles
[13:51:58] Bish: asm>> %w%w%
[13:52:03] ruby[bot]: Bish: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[13:52:18] Bish: holy crap.
[13:52:26] Bish: dminuoso: enlighten me please
[13:52:41] al2o3-cr: Bish: it's just a delimiter
[13:52:54] Bish: it = % ?
[13:53:08] ruby[bot]: al2o3-cr: # => ["a"] (https://eval.in/832648)
[13:53:47] Bish: hm, so everything in ruby thats not alphanumeric becomes a delimiter for %w?
[13:54:02] trinaldi: has joined #ruby
[13:54:17] al2o3-cr: not everything
[13:54:36] al2o3-cr: and not just for %w
[13:55:06] ruby[bot]: al2o3-cr: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[13:55:18] cpruitt: has joined #ruby
[13:56:25] dminuoso: al2o3-cr: Im thinking this is weirdly put into the lexer right?
[13:57:19] al2o3-cr: i would assume so
[13:57:22] dminuoso: Just found it.
[13:57:28] dminuoso: Ruby calls them percent strings.
[13:57:31] dminuoso: https://github.com/ruby/ruby/blob/trunk/parse.y#L7482
[13:57:53] Bish: do you read ruby code 24/7?
[13:58:20] ineb: more like rubys code
[13:58:28] nowhereman: has joined #ruby
[13:59:10] Bish: always depressed me to read MRI c code, i dont know what it is, but it's not pretty
[13:59:37] dminuoso: It's okayish. Worst part is just the complete lack of documentation and strange usage of macro composition.
[13:59:54] Rapture: has joined #ruby
[14:00:00] skweek: has joined #ruby
[14:00:13] Bish: rubinius code is much cooler, too bad it sucks.
[14:00:21] ljarvis: >> (%w%w%-[?????:??])[0]==%%w%
[14:00:27] ruby[bot]: ljarvis: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[14:00:31] ljarvis: gtfo ruby[bot]
[14:00:45] rohitpaulk: has joined #ruby
[14:01:01] trinaldi: has joined #ruby
[14:01:11] dminuoso: ljarvis: I immediately read and understood that.
[14:01:24] vondruch: has joined #ruby
[14:01:25] dminuoso: ljarvis: => true
[14:02:57] dminuoso: ljarvis: But only because I've done the ?????:?? part myself a few times. The rest was too obvious :P
[14:02:58] Bish: did anyone work with rbx lately?
[14:03:04] t-recx: has joined #ruby
[14:03:38] koenrh: has joined #ruby
[14:05:04] dminuoso: Bish | hm, so everything in ruby thats not alphanumeric becomes a delimiter for %w?
[14:05:15] Bish: why is ?? == "?"
[14:05:26] ruby[bot]: dminuoso: # => "a" (https://eval.in/832657)
[14:05:34] Bish: but, why.
[14:05:38] Bish: this language
[14:05:53] __Yiota: has joined #ruby
[14:06:00] dminuoso: Bish: the better question should be
[14:06:07] ruby[bot]: dminuoso: # => "w" (https://eval.in/832658)
[14:07:21] dminuoso: Bish: But yes to your earlier question. Everything that is not alphanumeric becomes a delimiter. And if it happens to be either (, [, { or < the closing has to be the respective closing paren.
[14:07:27] garathem: has joined #ruby
[14:08:36] Bish: its really amazing ruby syntax is not amgibious enough to break stuff
[14:09:28] rundor: has joined #ruby
[14:09:42] vondruch: has joined #ruby
[14:09:52] shiranuidong: has joined #ruby
[14:10:33] rundor: has joined #ruby
[14:11:08] choke: has joined #ruby
[14:11:48] bkxd: has joined #ruby
[14:11:49] bkxd_: has joined #ruby
[14:13:20] dminuoso: Bish: The parser regularly chokes when you start leaving parens away.
[14:15:36] dminuoso: Bish: f g {} // without trying out, could you tell me from the top off your head which function the block is associated with?
[14:16:38] Bish: i write lines like that
[14:16:40] Bish: so i should
[14:17:10] romankapitonov: has joined #ruby
[14:17:18] Bish: ACTION guesses g
[14:17:29] rickumali: has joined #ruby
[14:17:45] dminuoso: Congratulations.
[14:17:48] dminuoso: You have just earned a minus point.
[14:17:59] vondruch: has joined #ruby
[14:18:06] dminuoso: Smartass. :|
[14:18:28] Bish: but what does f get?
[14:18:33] Bish: the return value of g?
[14:18:44] Bish: what if g is not a function?
[14:19:11] Bish: btw, as a ruby beginner i got super confused by hash-syntax and block syntax
[14:19:13] Bish: things like
[14:19:19] Bish: a {a:1,b:2}
[14:19:38] dminuoso: Bish: That's the thing.. the decision whether g is a method or variable is decided during lexing.
[14:19:43] dminuoso: So there's no grammatical confusion.
[14:19:53] dionysus69: has joined #ruby
[14:20:48] dminuoso: Bish: But essentially that is the correct answer you have just given indirectly.
[14:20:59] dminuoso: The question of whether the block is associated with f or g depends on whether g is a method or not :P
[14:21:22] dminuoso: But I guess I made the mistake of implying both are `functions'
[14:23:12] dminuoso: Bish: an example where lack of parens leads to a parser error:
[14:23:21] ruby[bot]: dminuoso: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[14:23:26] dminuoso: SyntaxError: (irb):1: syntax error, unexpected { arg, expecting end-of-inpu
[14:23:45] dminuoso: >> p({}) {}
[14:23:51] ruby[bot]: dminuoso: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[14:24:41] dminuoso: Bish: Interestingly its not related the curly braces either
[14:24:46] dminuoso: >> p {} begin; end
[14:24:52] ruby[bot]: dminuoso: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[14:24:52] dminuoso: ACTION kicks ruby[bot]
[14:25:12] Bish: how do i get a random permutation of an array?
[14:25:15] Bish: inb4 .premute
[14:25:21] Bish: but i got no clue about that function
[14:25:31] Bish: oh. i could .sample
[14:25:46] vondruch: has joined #ruby
[14:26:59] rickumali: Bish: Array has permutation function
[14:27:03] rickumali: but read the docs carefully
[14:27:17] rickumali: it seems to calculate all permutations!
[14:29:05] m4sk1n: has left #ruby: ()
[14:29:54] ltem: has joined #ruby
[14:30:54] rivalomega: has joined #ruby
[14:31:33] vondruch: has joined #ruby
[14:31:57] dminuoso: Bish: what is a random permutation exactly?
[14:32:31] dminuoso: Bish: .shuffle ?
[14:35:41] vondruch: has joined #ruby
[14:37:55] SteenJobs_: has joined #ruby
[14:38:32] romankapitonov: has joined #ruby
[14:38:40] nopolitica: has joined #ruby
[14:39:39] coreyw: has joined #ruby
[14:39:52] ledestin: has joined #ruby
[14:40:14] coreyw: $ irb, require 'json' => true.... $ bundle console, require 'json' => LoadError: cannot load such file -- json
[14:40:17] coreyw: anybody know why?
[14:40:32] coreyw: on Centos 7, ruby and rubygem-bundler installed via yum
[14:41:12] coreyw: ruby 2.0.0p648 (2015-12-16) [x86_64-linux], Bundler version 1.7.8
[14:42:04] dminuoso: CoreyW: Because your bundle probably doesn't have the 'json' gem available?
[14:42:16] dminuoso: CoreyW: It doesn't matter what you have installed "globally", bundle _only_ cares about what your bundle has.
[14:42:58] coreyw: dminuoso: I had read JSON came builtin in Ruby 2, so I didn't think that would be the issue.
[14:43:06] coreyw: but it makes sense if so
[14:43:27] coreyw: i just thought since i can require things like 'xmlrpc/client' builtin, that 'json' would work the same
[14:43:32] boombox_: has joined #ruby
[14:43:59] dminuoso: CoreyW: Mmm.
[14:44:06] workmad3_: has joined #ruby
[14:45:04] dminuoso: CoreyW: My best bet is that you're not running ruby 2.0 in there. Can you specify a ruby version in your Gemfile?
[14:45:27] coreyw: I pasted `ruby --version` above. 2.0.0p648
[14:45:44] coreyw: I only have one version of ruby installed, so idk how it could be running any other version
[14:48:10] mtkd: has joined #ruby
[14:48:44] polishdub: has joined #ruby
[14:50:43] snath: has joined #ruby
[14:51:44] TheBrayn: you have one version and you chose an old one :P
[14:51:48] alex``: has joined #ruby
[14:51:49] vondruch: has joined #ruby
[14:52:17] coreyw: dminuoso: oh well, I added spec.add_dependency "json" to .gemspec and all is good now.
[14:52:20] coreyw: thanks for help
[14:52:30] mim1k: has joined #ruby
[14:53:51] soahccc: has joined #ruby
[14:53:59] RustyJ: has left #ruby: ("Leaving")
[14:56:55] amclain: has joined #ruby
[15:00:56] soahccc: has joined #ruby
[15:02:53] TomyLobo: has joined #ruby
[15:03:26] vondruch: has joined #ruby
[15:05:20] romankapitonov: has joined #ruby
[15:07:31] bronson: has joined #ruby
[15:08:09] romankapitonov: has joined #ruby
[15:08:11] chouhoulis: has joined #ruby
[15:08:21] nowhereman: has joined #ruby
[15:08:22] soahccc: has joined #ruby
[15:09:43] bkxd: has joined #ruby
[15:11:42] soahccc: has joined #ruby
[15:12:34] Ishido: has joined #ruby
[15:15:03] bkxd: has joined #ruby
[15:17:35] patarr: has joined #ruby
[15:21:45] cagomez: has joined #ruby
[15:26:59] mim1k: has joined #ruby
[15:27:09] soahccc: has joined #ruby
[15:27:23] rundor: has joined #ruby
[15:27:46] romankapitonov: has joined #ruby
[15:30:05] soahccc: has joined #ruby
[15:30:35] romankapitonov: has joined #ruby
[15:30:44] choke: has joined #ruby
[15:34:47] apparition: has joined #ruby
[15:35:30] romankapitonov: has joined #ruby
[15:35:44] vondruch: has joined #ruby
[15:37:26] daivyk: has joined #ruby
[15:38:10] romankapitonov: has joined #ruby
[15:38:51] brent__: has joined #ruby
[15:39:55] vondruch: has joined #ruby
[15:40:55] romankapitonov: has joined #ruby
[15:41:00] jottr: has joined #ruby
[15:45:48] romankapitonov: has joined #ruby
[15:45:49] ajnulo: has joined #ruby
[15:45:53] vuoto: has joined #ruby
[15:46:30] noe: has joined #ruby
[15:46:52] blackwind_123: has joined #ruby
[15:48:01] ruby-lang834: has joined #ruby
[15:53:10] shinnya: has joined #ruby
[15:54:46] noe: has joined #ruby
[15:56:22] romankapitonov: has joined #ruby
[15:58:13] gothicsouth: has joined #ruby
[15:58:23] jackjackdripper: has joined #ruby
[16:00:20] cyfr0n: has joined #ruby
[16:00:51] SteenJobs_: has joined #ruby
[16:04:06] cdg: has joined #ruby
[16:05:11] cdg: has joined #ruby
[16:09:05] romankapitonov: has joined #ruby
[16:09:17] bkxd: has joined #ruby
[16:11:30] cdg_: has joined #ruby
[16:12:38] ajnulo: has joined #ruby
[16:14:16] noe: has joined #ruby
[16:19:01] benlieb: has joined #ruby
[16:22:21] noe: has joined #ruby
[16:24:28] ajnulo: has joined #ruby
[16:29:51] ajnulo: has joined #ruby
[16:34:26] ascarter: has joined #ruby
[16:34:45] psychicist__: has joined #ruby
[16:35:02] rundor: has joined #ruby
[16:35:34] sp00ky_spooooky: has joined #ruby
[16:40:10] Xeago: has joined #ruby
[16:40:12] choke: has joined #ruby
[16:40:17] sarmiena_: has joined #ruby
[16:43:26] mikecmpbll: has joined #ruby
[16:44:44] eightlimbed: has joined #ruby
[16:46:50] jnollette: has joined #ruby
[16:52:45] __Yiota: has joined #ruby
[16:56:30] chouhoulis: has joined #ruby
[16:57:25] chouhoulis: has joined #ruby
[16:57:35] nowhereman: has joined #ruby
[16:57:51] dionysus69: has joined #ruby
[16:57:56] cagomez: has joined #ruby
[16:59:49] psychicist__: has joined #ruby
[17:00:28] ajnulo: has joined #ruby
[17:02:56] antgel: has joined #ruby
[17:05:23] roshanavand: has joined #ruby
[17:06:08] psychicist__: has joined #ruby
[17:06:15] cwood: has joined #ruby
[17:07:00] Dimik: has joined #ruby
[17:07:39] knight33: has joined #ruby
[17:07:58] Tau: has joined #ruby
[17:08:32] SeepingN: has joined #ruby
[17:08:45] Tau: has left #ruby: ()
[17:08:48] bronson: has joined #ruby
[17:10:22] cagomez: has joined #ruby
[17:12:41] eckhardt: has joined #ruby
[17:14:26] dasher00: has joined #ruby
[17:15:09] dennisvennink: has joined #ruby
[17:15:18] rippa: has joined #ruby
[17:15:28] cwood: Not sure where I ask about rubocop... but why doesn't it like code such as: x, y = This.that
[17:16:29] cwood: I get a "useless assignment to variable", but it's not useless when that returns an array.
[17:16:29] bougyman: that's a specific cop
[17:16:55] bougyman: cwood: you're not using either x or y somewhere after that.
[17:17:35] cwood: Oh, ok. I thought it means nothing would be assigned to the variable. Thank you
[17:19:39] rohitpaulk: has joined #ruby
[17:22:08] InfinityFye: has joined #ruby
[17:23:02] vuoto: has joined #ruby
[17:25:06] jottr: has joined #ruby
[17:27:02] mim1k: has joined #ruby
[17:34:48] SteenJobs_: has joined #ruby
[17:42:23] kies: has joined #ruby
[17:43:27] dstrunk: has joined #ruby
[17:43:28] cagomez: has joined #ruby
[17:50:37] __Yiota: has joined #ruby
[17:53:27] uZiel: has joined #ruby
[17:56:10] uZiel: I want an 8 byte long integer to increment so I created x = "\x00"*8 and do x.next
[17:56:25] uZiel: but after 57 increments x becomes 9 bytes long as it changes from "\u0000\u0000\u0000\u0000\u0000\u0000\u00009" to "\u0000\u0000\u0000\u0000\u0000\u0000\u000010"
[17:57:11] uZiel: any workaround or any better solutions?
[17:58:19] boto: has joined #ruby
[18:01:37] duderonomy: has joined #ruby
[18:03:22] chouhoul_: has joined #ruby
[18:03:25] centrx: has joined #ruby
[18:03:55] SeepingN: real numbers not numbers created from strings ;)
[18:04:53] hndk: has joined #ruby
[18:11:28] nb_bez______: has joined #ruby
[18:17:12] cagomez: has joined #ruby
[18:18:28] bmurt_: has joined #ruby
[18:20:53] theunraveler: has joined #ruby
[18:23:47] himynameisvic: has joined #ruby
[18:32:22] rundor: has joined #ruby
[18:34:38] sepp2k: has joined #ruby
[18:37:51] Timba-as: has joined #ruby
[18:42:12] __Yiota: has joined #ruby
[18:46:15] daivyk: has joined #ruby
[18:46:50] guacamole: has joined #ruby
[18:47:02] jenrzzz: has joined #ruby
[18:47:02] jenrzzz: has joined #ruby
[18:47:10] havenwood: uZiel: Are you incrementing to 255 with all 8 positions or just the last?
[18:49:15] mostlybadfly: has joined #ruby
[18:50:53] mrconfused: has joined #ruby
[18:51:10] jackjackdripper: has joined #ruby
[18:55:41] vondruch: has joined #ruby
[19:00:59] t-recx: has joined #ruby
[19:02:01] vondruch: has joined #ruby
[19:04:00] VeryBewitching: has joined #ruby
[19:04:46] andrzejku: has joined #ruby
[19:05:02] patarr1: has joined #ruby
[19:07:46] gavxn: has joined #ruby
[19:08:08] gavxn: Woo! I figured it out. Took an hour or two
[19:08:10] gavxn: https://stackoverflow.com/questions/45069400/unpredictable-behavior-with-ruby-vt100-escape-sequences-on-windows-10/45110068#45110068
[19:08:54] gavxn: I'm surprised (and happy) that Ruby added support for VT mode
[19:09:42] bronson: has joined #ruby
[19:10:54] noe: has joined #ruby
[19:12:05] ResidentBiscuit: has joined #ruby
[19:14:34] Paraxial: has joined #ruby
[19:19:06] hahuang65: has joined #ruby
[19:19:51] ajnulo: has joined #ruby
[19:23:40] SteenJobs_: has joined #ruby
[19:25:10] cagomez: has joined #ruby
[19:28:12] rundor: has joined #ruby
[19:28:33] Rapture: has joined #ruby
[19:32:27] jottr: has joined #ruby
[19:34:20] antgel: has joined #ruby
[19:34:45] ajnulo: has joined #ruby
[19:39:03] __Yiota: has joined #ruby
[19:43:22] patarr: has joined #ruby
[19:47:38] mrconfused: has joined #ruby
[19:50:43] shinnya: has joined #ruby
[19:51:07] dionysus69: has joined #ruby
[19:51:38] kies: has joined #ruby
[19:56:49] brodul: has joined #ruby
[19:57:06] ajnulo: has joined #ruby
[19:58:00] patarr: has joined #ruby
[20:03:08] eckhardt: has joined #ruby
[20:05:09] snath: has left #ruby: ("Leaving")
[20:08:09] splitshot: Is there an easy way to create a Time object for today's date at a specified time?
[20:08:47] havenwood: splitshot: Time is more specific than just date. But you can: Time.now
[20:09:09] havenwood: splitshot: Or: Date.today
[20:09:36] havenwood: >> Time.now
[20:09:38] ruby[bot]: havenwood: # => 2017-07-14 20:09:34 +0000 (https://eval.in/832768)
[20:09:38] vondruch: has joined #ruby
[20:09:39] splitshot: For example, I'd like a Time object representing Today at 1800.
[20:09:42] havenwood: >> require 'date'; Date.today
[20:09:43] ruby[bot]: havenwood: # => #<Date: 2017-07-14 ((2457949j,0s,0n),+0s,2299161j)> (https://eval.in/832769)
[20:09:51] lxsameer: has joined #ruby
[20:10:00] splitshot: I don't want the current time.
[20:10:35] dennisvennink: has joined #ruby
[20:10:50] lxsameer: has joined #ruby
[20:11:05] splitshot: Right now the only thing I'm thinking is get Time.now, and then build a new Time object passing in the 7 params but was hoping for an easier way.
[20:11:34] havenwood: splitshot: And it's not Rails/ActiveSupport?
[20:11:51] splitshot: Does Rails have something like that?
[20:12:24] havenwood: DateTime.now.change(hour: 18)
[20:13:06] havenwood: You could cherry pick the method from ActiveSupport.
[20:13:09] splitshot: Fantastic just what I was looking for. Thanks.
[20:13:13] havenwood: Or there's a little repetition in pure Ruby.
[20:13:31] havenwood: splitshot: You're welcome. Happy coding!
[20:14:16] noe: has joined #ruby
[20:14:21] SegFaultAX: You could just bring in active_support as a dependency. active_support/core_ext/time has lots of useful stuff.
[20:14:37] SegFaultAX: (As a possible alternative to copy and paste)
[20:16:01] havenwood: Or cherry picking: require 'active_support/core_ext/date_time/calculations'; DateTime.now.change hour: 18
[20:16:14] havenwood: #=> #<DateTime: 2017-07-14T18:00:00-07:00 ((2457950j,3600s,0n),-25200s,2299161j)>
[20:16:24] dviola: has joined #ruby
[20:19:12] nadir: has joined #ruby
[20:19:39] vuoto: has joined #ruby
[20:25:27] cagomez: has joined #ruby
[20:25:45] vondruch: has joined #ruby
[20:27:27] cagomez_: has joined #ruby
[20:28:14] ur5us: has joined #ruby
[20:28:53] SteenJobs_: has joined #ruby
[20:29:27] matthewd: require 'active_support'; require 'active_support/core_ext/date_time/calculations'; DateTime.now.change hour: 18
[20:29:35] eckhardt: has joined #ruby
[20:30:28] matthewd: splitshot: There's also Time.parse("4:30") (also Active Support)
[20:33:09] splitshot: Oh cool. Thank you.
[20:35:00] theunraveler: has joined #ruby
[20:43:33] SteenJobs__: has joined #ruby
[20:43:38] workmad3: has joined #ruby
[20:43:40] rundor: has joined #ruby
[20:44:29] mtkd: has joined #ruby
[20:44:59] AX3L: has joined #ruby
[20:49:02] dreammaker: has joined #ruby
[20:50:19] sniffer: has joined #ruby
[20:51:02] lamduh: has joined #ruby
[20:53:11] minimalism: has joined #ruby
[20:55:11] br0d1n: has joined #ruby
[20:55:23] Xeronate: has joined #ruby
[20:56:33] lamduh: has left #ruby: ("Leaving")
[20:56:50] Ramddd: has joined #ruby
[20:57:03] Ramddd: best place for learning ruby for a total programming beginner
[20:58:21] AX3L: has joined #ruby
[20:59:56] matthewd: Ramddd: I've heard good things about https://pragprog.com/titles/ltp2/learn-to-program-2nd-edition
[21:02:41] gusrub: has joined #ruby
[21:08:31] cagomez: has joined #ruby
[21:09:13] cagomez: has joined #ruby
[21:10:37] bronson: has joined #ruby
[21:12:34] sniffer: has joined #ruby
[21:14:04] dennisvennink: has joined #ruby
[21:18:18] SteenJobs_: has joined #ruby
[21:20:29] AX3L: has joined #ruby
[21:22:40] cadillac__: has joined #ruby
[21:24:51] ecuanaso: has joined #ruby
[21:31:33] rivalomega: has joined #ruby
[21:35:25] vondruch: has joined #ruby
[21:36:08] Inoperable: has joined #ruby
[21:37:03] AxelAlex: has joined #ruby
[21:40:56] nathan: has joined #ruby
[21:44:40] mrconfused: has joined #ruby
[21:44:43] daivyk: has joined #ruby
[21:45:21] nathan: Anyone know if there's a good way to get active support's `Object#to_param` to use `URI.escape` rather than `CGI.escape`? I was trying to use a refinement, but the lexical scoping seems to make it difficult (in my scope, `to_param` is called on a hash, which then calls it on a string, and the string version is the one that needs patching)
[21:45:47] AxelAlex: has joined #ruby
[21:46:03] tvw: has joined #ruby
[21:49:17] latemus: has joined #ruby
[21:57:35] johnny56_: has joined #ruby
[21:58:06] ecuanaso: has joined #ruby
[22:01:09] sarmiena_: has joined #ruby
[22:02:05] cagomez: has joined #ruby
[22:02:34] cagomez: has joined #ruby
[22:03:41] mrconfused: has joined #ruby
[22:06:26] SegFaultAX: nathan: I don't know of a way to do that, but I probably would just write a helper method instead of trying to monkey patch a monkey patch. :)
[22:07:38] Inoperable: has left #ruby: ("User derezzed")
[22:07:39] Inoperable: has joined #ruby
[22:09:53] jackjackdripper: has joined #ruby
[22:14:06] nathan: Thanks SegFaultAX. I think that's probably what I'll do, but it _almost_ seemed like a great opportunity to finally try out refinements. Maybe some day!
[22:14:09] ecuanaso: has joined #ruby
[22:23:11] misery_: has joined #ruby
[22:23:45] brent__: has joined #ruby
[22:30:55] sarmiena_: has joined #ruby
[22:35:28] sepp2k: has joined #ruby
[22:36:48] helpa-bot: has joined #ruby
[22:37:47] mim1k: has joined #ruby
[22:38:47] helpa: has joined #ruby
[22:42:36] rubycoder37: has joined #ruby
[22:43:52] dennisvennink: has joined #ruby
[22:44:38] havenwood: rubycoder37: hi
[22:45:19] nicholascho: has joined #ruby
[22:45:32] rubycoder37: I have the following code: Hash[(user.start_date..user.end_date).to_a.zip] -- I'm having a bit of trouble adding a value to the keys, e.g. if I do Hash[(user.start_date..user.end_date).to_a.zip, ['foo']] I think foo is added to the last key only
[22:45:43] rubycoder37: I'm not sure what I'm doing wrong :(
[22:47:58] rubycoder37: any ideas please?
[22:48:35] elomatreb: rubycoder37: Hash[] expects an array containing arrays of the form [key, value]. You're creating a Hash that has only keys, since your array always have only one element
[22:49:57] rubycoder37: that makes sense, thank you
[22:55:58] mrconfused: has joined #ruby
[22:56:45] SteenJobs_: has joined #ruby
[23:02:03] rubycoder37: elomatreb: I got it to work: https://gist.github.com/anonymous/faed1d9c42f04cb45d6b88c2ff56db76
[23:02:17] rivalomega: has joined #ruby
[23:06:25] gigetoo: has joined #ruby
[23:06:32] benlieb: has joined #ruby
[23:07:21] nertzy: has joined #ruby
[23:08:08] rkellermeyer: has joined #ruby
[23:08:52] noizex: anyone using ruby-debug-ide with rubymine?
[23:11:54] bronson: has joined #ruby
[23:15:53] mrconfused: has joined #ruby
[23:18:01] InfinityFye: has joined #ruby
[23:26:52] kobain: has joined #ruby
[23:30:35] rubycoder37: is there something like shift(n) for hashes? or that will only work with arrays?
[23:31:20] DLSteve: has joined #ruby
[23:31:52] elomatreb: There is shift, but it doesn't take a parameter on Hash
[23:32:07] elomatreb: So it only returns the first key-value pair
[23:32:48] rubycoder37: I see, thanks
[23:34:51] lacuna: has joined #ruby
[23:35:25] cdg: has joined #ruby
[23:35:41] alveric1: has joined #ruby
[23:36:10] cdg: has joined #ruby
[23:36:43] ecuanaso: has joined #ruby
[23:38:02] cagomez: has joined #ruby
[23:39:57] ascarter: has joined #ruby
[23:40:53] mrconfused_: has joined #ruby
[23:42:43] mrconfused__: has joined #ruby
[23:53:53] SteenJobs_: has joined #ruby
[23:57:23] SteenJobs_: has joined #ruby