« Back to channel list

#ruby - 19 April 2017

« Back 1 day Forward 1 day »
[00:04:10] quobo: has joined #ruby
[00:05:13] mooser: has joined #ruby
[00:07:29] esObe: has joined #ruby
[00:09:58] CloCkWeRX: has joined #ruby
[00:10:53] nertzy: has joined #ruby
[00:12:21] bruce_lee: has joined #ruby
[00:13:28] croberts: has joined #ruby
[00:14:29] Cohedrin: has joined #ruby
[00:16:09] brent__: been a while since i tried out the meta programming stuff
[00:17:14] brent__: i have 2 methods that do a query with different values, whats the best way to to create some sort of method missing/send to remove duplicate code
[00:18:42] ineb: i dont think that i understand. two methods with different values? that is one method with a parameter for me. :)
[00:19:02] brent__: thats what I was thinking initially
[00:19:03] ineb: if only these values differ
[00:19:41] brent__: but then thought about using send or something to try and get keep the method names the same
[00:20:14] brent__: i'll probably just go w/ the variable passed in
[00:20:40] ineb: if you want to keep the methods then change them to use your new parametrized method
[00:21:37] ineb: so their behaviour from the outside does not change and to get rid of code duplication
[00:22:21] brent__: yeah not worried about behaviour, I guess just tryign to avoid having to change where the methods are used
[00:22:29] brent__: being lazy
[00:24:41] SeepingN_: has joined #ruby
[00:25:01] dar123: has joined #ruby
[00:36:51] houhoulis: has joined #ruby
[00:37:32] Cyrus: has joined #ruby
[00:39:43] LastWhisper____: has joined #ruby
[00:49:40] patarr: has joined #ruby
[00:52:03] watersoul: has joined #ruby
[00:52:17] railswebdev: has joined #ruby
[00:54:41] boshhead: has joined #ruby
[00:55:00] ionte: has joined #ruby
[00:55:06] bmurt: has joined #ruby
[00:55:51] tripolisenten: has joined #ruby
[00:57:13] gse: has joined #ruby
[00:58:48] syndikate: has joined #ruby
[00:59:11] yasu: has joined #ruby
[01:05:33] Channel6: has joined #ruby
[01:10:40] Trynemjoel: has joined #ruby
[01:12:41] patarr: has joined #ruby
[01:12:53] charliesome: has joined #ruby
[01:20:30] nicolai86: has joined #ruby
[01:23:10] patarr: has joined #ruby
[01:25:53] nofxxx: has joined #ruby
[01:27:35] jrafanie: has joined #ruby
[01:27:58] olivier__: has joined #ruby
[01:28:26] jcao219: has joined #ruby
[01:31:16] mzo: has joined #ruby
[01:31:40] charliesome: has joined #ruby
[01:32:05] railswebdev: has joined #ruby
[01:32:34] olivier__: has joined #ruby
[01:33:21] olivier__: has joined #ruby
[01:35:53] olivier__: has joined #ruby
[01:38:50] jdawgaz: has joined #ruby
[01:41:25] Tempesta: has joined #ruby
[01:42:30] mim1k: has joined #ruby
[01:51:59] mooser: has joined #ruby
[01:53:50] Jameser: has joined #ruby
[01:54:20] olivier__: has joined #ruby
[01:55:40] latemus: has joined #ruby
[02:03:27] mooser: has joined #ruby
[02:04:22] olivier__: has joined #ruby
[02:04:35] lmc: has joined #ruby
[02:04:50] dn`_: has joined #ruby
[02:06:15] libastral: has joined #ruby
[02:07:00] HoierM: has joined #ruby
[02:11:17] enterprisey: has joined #ruby
[02:19:01] brent__: has joined #ruby
[02:19:32] cmhobbs: has left #ruby: ()
[02:20:24] genpaku: has joined #ruby
[02:21:29] CloCkWeRX: has joined #ruby
[02:22:21] olivier__: has joined #ruby
[02:28:31] jcao219: has joined #ruby
[02:31:33] DaniG2k: has joined #ruby
[02:37:56] jdawgaz: has joined #ruby
[02:48:15] __Yiota: has joined #ruby
[02:58:21] jdawgaz: has joined #ruby
[02:59:36] olivier__: has joined #ruby
[03:03:03] jdawgaz: has joined #ruby
[03:03:07] duderonomy: has joined #ruby
[03:03:12] Guest96: has joined #ruby
[03:04:32] ledestin: has joined #ruby
[03:05:10] PorcoRex: has joined #ruby
[03:05:17] PorcoRex: Howdy Ruby.
[03:08:20] xenops: has joined #ruby
[03:14:03] cfec0b8d: has joined #ruby
[03:15:15] upen15: PorcoRex: howdy WOP
[03:16:13] Silthias1: has joined #ruby
[03:17:54] bronson: has joined #ruby
[03:18:07] PorcoRex: I'm not familiar with the acronym.
[03:20:01] pifon: has joined #ruby
[03:22:48] mooser: has joined #ruby
[03:25:49] Guest96: has joined #ruby
[03:26:10] bronson: has joined #ruby
[03:27:02] Channel6: has joined #ruby
[03:29:00] __Yiota: has joined #ruby
[03:33:22] astrobunny: has joined #ruby
[03:33:46] Guest55: has joined #ruby
[03:35:32] plujon: has joined #ruby
[03:47:14] baweaver: upenn15: you realize what that means, correct?
[03:47:48] upenn15: Everyone in school is saying it
[03:48:02] upenn15: It's the sound of the police
[03:48:38] baweaver: speaking of sound of police....
[03:48:42] enterprisey: has joined #ruby
[03:48:54] benlieb: has joined #ruby
[03:49:14] baweaver: you have about 30 seconds to look it up and apologize.
[03:49:33] baweaver: because that's a rather vile slur against Italians
[03:51:05] baweaver: Very well then, you have an hour to reconcile with it
[03:51:08] baweaver: !rude upenn15
[03:51:09] ruby[bot]: +qq upenn15!*@* *!*@gateway/web/freenode/ip.185.112.82.43
[03:51:38] bronson: has joined #ruby
[03:56:20] upenn15: has left #ruby: ()
[03:57:21] upenn15: has joined #ruby
[03:58:36] mim1k: has joined #ruby
[03:59:19] gix: has joined #ruby
[04:03:54] xenops: has joined #ruby
[04:08:13] mooser: has joined #ruby
[04:09:18] mim1k: has joined #ruby
[04:09:45] esObe: has joined #ruby
[04:10:07] esObe__: has joined #ruby
[04:10:25] upenn15: has left #ruby: ()
[04:13:55] jcao219: has joined #ruby
[04:16:03] ruurd: has joined #ruby
[04:17:51] timvisher: has joined #ruby
[04:23:39] Guest55: has joined #ruby
[04:28:24] jdawgaz: has joined #ruby
[04:29:08] _aeris_: has joined #ruby
[04:31:41] jdawgaz: has joined #ruby
[04:36:40] loy_aqua: has joined #ruby
[04:37:53] renchan: has joined #ruby
[04:39:00] hays: has joined #ruby
[04:39:00] hays: has joined #ruby
[04:43:16] jdawgaz: has joined #ruby
[04:50:48] mogaj: has joined #ruby
[04:51:35] ruby[bot]: -qq upenn15!*@* *!*@gateway/web/freenode/ip.185.112.82.43
[04:51:56] jdawgaz: has joined #ruby
[04:53:01] lucas: has joined #ruby
[04:53:59] hays: I feel like there is a more compact way to depict this.. or better way https://bpaste.net/show/321818c6f50a
[04:58:26] PorcoRex: What are you trying to do?
[05:00:45] hays: the fact you cant tell makes me worry about my code clarity
[05:01:48] hays: the function returns random characters that meet a certain criterion
[05:02:14] hays: the rng spits one out until the criterion is met
[05:02:31] dminuoso: hays: Use Array#sample for easiness.
[05:02:53] dminuoso: hays: i.e. define an array with all possible characters, and then just go n.times.map { charArray.sample }.join
[05:03:59] hays: worried that sample doesn't meet cryptographic requirements
[05:04:13] dminuoso: hays: Good thing that sample accepts an rng as an argument.
[05:04:39] raul782: has joined #ruby
[05:04:40] dminuoso: n.times.map { charArray.sample(rng: SecureRandom) }.join
[05:05:38] dminuoso: >> chars = %w{a b c d e f}; puts 5.times.map { chars.sample(rng: SecureRandom) }.join # hays
[05:05:41] ruby[bot]: dminuoso: # => uninitialized constant SecureRandom ...check link for more (https://eval.in/778774)
[05:05:55] dminuoso: >> require 'securerandom'; chars = %w{a b c d e f}; puts 5.times.map { chars.sample(rng: SecureRandom) }.join # hays
[05:05:56] ruby[bot]: dminuoso: # => unknown keyword: rng (ArgumentError) ...check link for more (https://eval.in/778775)
[05:06:09] dminuoso: >> require 'securerandom'; chars = %w{a b c d e f}; puts 5.times.map { chars.sample(random: SecureRandom) }.join # hays
[05:06:11] ruby[bot]: dminuoso: # => fbeba ...check link for more (https://eval.in/778776)
[05:06:13] dminuoso: ugh reading helps. :-)
[05:07:12] hays: ok the magic in that i don't understand is how sample knows how to interface with securerandom
[05:07:23] mooser: has joined #ruby
[05:07:37] PorcoRex: But in plain English, what is this supposed to do? It doesn't seem to be too efficient because you're getting a secure random (whatever that is) and then you're looping until it matches something.
[05:08:03] loy_aqua: has joined #ruby
[05:08:28] PorcoRex: I think what you want to do is probably generate any random number and generate a string that matches your criterion accordingly, without needing the loop.
[05:09:56] dminuoso: PorcoRex: Imagine generating passwords that meet certain criteria
[05:10:26] dminuoso: hays: Gotta run. If you stay around Ill explain in about half an hour
[05:10:48] PorcoRex: dminuoso, yeah, seems a bit of a brute force approach.
[05:10:49] hays: its late here i probably wont make it. maybe catch you later
[05:11:14] PorcoRex: hays, what's your criterion for a secure random?
[05:11:16] esObe: has joined #ruby
[05:11:20] hays: it is a bit of brute force
[05:12:09] PorcoRex: hays, are you trying to reverse engineer a system?
[05:12:36] hays: no im writing a little throwaway function to generate random password strings for databases
[05:13:12] PorcoRex: Ok, but why do you need a special criterion for the passwords?
[05:13:17] howdoi: has joined #ruby
[05:13:23] hays: but since its a password, i figure I want something cryptographically secure. like /dev/urandom is probably OK. openssl i trust a bit more I think
[05:13:58] hays: PorcoRex: because the passwords get stored in plaintext config files with syntax limitations usually
[05:14:22] PorcoRex: So it's the actual characters that are bothering you.
[05:14:24] elomatreb: If you're worried about syntax I'd recommend avoiding everything but alphanumerics
[05:14:26] hays: for example including a password with \ in it causes complications sometimes. as does #
[05:14:52] hays: elomatreb: yeah. the thought had crossed my mind to just use base64
[05:14:54] elomatreb: e.g. $ may cause interpolation in some languages
[05:16:05] anisha_: has joined #ruby
[05:16:22] PorcoRex: hays, how about SecureRandom.hex
[05:16:53] hays: PorcoRex: SecureRandom.base64
[05:17:22] PorcoRex: hays, sure. Why not?
[05:17:38] elomatreb: If you just want typeable passwords that don't break syntax that seems like the best choice honestly
[05:17:48] hays: I'm overthinking it. For the sake of learning something about the language
[05:18:37] jtd: has joined #ruby
[05:18:44] electrostat: has joined #ruby
[05:19:00] hays: the construction I came up with seemed clumsy from a language perspective. kinda repetetive
[05:19:09] elomatreb: >> require "securerandom"; SecureRandom.random_bytes(1).encoding # One thing to watch out for
[05:19:11] ruby[bot]: elomatreb: # => #<Encoding:ASCII-8BIT> (https://eval.in/778777)
[05:19:15] PorcoRex: I think you are hays, because what you are doing is taking a library that already has what you need and you loop on it until it gives you something that matches your regexp. And the regexp may not be that secure anyways.
[05:19:46] hays: im increasing the space of the possible passwords
[05:20:04] PorcoRex: In terms of characters?
[05:20:17] elomatreb: The most ruby-ish way would probably be to generate an Array containg all possible characters, sample and join
[05:20:25] elomatreb: Like described earlier
[05:20:27] hays: in terms of possible passwords given a fixed length
[05:20:54] mooser: has joined #ruby
[05:21:05] hays: elomatreb: yeah that was nice. i still don't quite understand how .sample knows how to use SecureRandom
[05:21:38] hays: also i do wonder how sample works.. whether it has some wierd bias in it
[05:21:45] PorcoRex: hays, ok, to be honest I think hex or base 64 is definitely the best approach. But if it weren't what I would do is take the random bytes and have a hash where each byte maps to a safe character.
[05:22:12] PorcoRex: Instead of looping, that is.
[05:22:21] elomatreb: IIRC sample uses the same RNG by default rand uses, so it's certainly not cryptographically secure
[05:22:54] hays: PorcoRex: before I did that I would get access to the bitstream and use modulo/division to strip off the bits i needed
[05:23:11] hays: elomatreb: yeah but you can pass it an rng, somehow
[05:23:26] esObe: has joined #ruby
[05:24:31] PorcoRex: And since we're in the subject, you might want to get a real random number from https://www.random.org/ in order to generate your password.
[05:24:38] hays: despite having somewhat different methods than the Random class
[05:25:17] hays: i am definitely not trusting some website for random numbers
[05:25:27] nofxxx: has joined #ruby
[05:25:38] PorcoRex: hays, you can add 2 to them! :)
[05:26:11] elomatreb: hays: Both SecureRandom and Random have rand, which is enough to generate an array index from
[05:28:56] hays: hmm.. SecureRandom.rand tells me its private
[05:28:57] jeyraof^mbpr: has joined #ruby
[05:29:29] hays: the documentation seems kinda sh*t. https://ruby-doc.org/stdlib-2.3.0/libdoc/securerandom/rdoc/SecureRandom.html
[05:31:39] hays: leaves me with a lot of questions to be honest
[05:33:03] rakm: has joined #ruby
[05:35:49] hutch34_: has joined #ruby
[05:39:17] electrostat: has joined #ruby
[05:41:56] mogaj: has joined #ruby
[05:42:00] cfec0b8d: has joined #ruby
[05:42:40] anisha: has joined #ruby
[05:43:51] aufi: has joined #ruby
[05:44:46] brent__: has joined #ruby
[05:48:29] andikr: has joined #ruby
[05:54:36] mogaj: has joined #ruby
[06:07:55] Gabemo: has joined #ruby
[06:09:54] Guest96: has joined #ruby
[06:24:04] mogaj: has joined #ruby
[06:24:13] esObe: has joined #ruby
[06:29:09] alazred: has joined #ruby
[06:29:09] alazred: has joined #ruby
[06:30:16] Guest96: has joined #ruby
[06:33:10] mogaj: has joined #ruby
[06:37:04] jusa: has joined #ruby
[06:39:30] bronson: has joined #ruby
[06:40:26] kke_: if i have a gem installed, and it looks like lib/foo-gem.rb. then in a another project i do "require 'foo-gem'", i guess it does something else than loads foo-gem.rb from the loadpaths
[06:40:40] alazred: has left #ruby: ("Leaving")
[06:40:50] mogaj: has joined #ruby
[06:41:11] kke_: i guess it loads the gemspec and activates load paths from the dependencies
[06:42:52] PorcoRex: kke_, the required paths are part of each gem's gemspec file.
[06:45:07] harfangk: has joined #ruby
[06:46:32] mogaj: has joined #ruby
[06:49:20] patarr: has joined #ruby
[06:50:13] kke_: i have gem-a and gem-b (with runtime_dependency 'gem-a') when gem-a requires gem-b i get Gem::LoadError : unable to find a version of 'gem-a' to activate (eventhough it's obviously already loaded)
[06:51:26] chichou: has joined #ruby
[06:52:38] Radar: Should've used Bundler.
[06:52:59] PorcoRex: Did you try installing gem-a with gem install gem-a.gemspec?
[06:53:19] PorcoRex: Or was it build?
[06:56:32] esObe: has joined #ruby
[06:57:49] pikender: has joined #ruby
[06:58:52] pikender: just tried Net::FTP class and it worked to connect and execute basic commands like pwd and chdir
[06:59:24] pikender: but when using `list` or `getbinaryfile` action times out
[06:59:57] pikender: solution here https://matt.blwt.io/blog/2014/12/24/ruby-net-ftp-and-extended-passive-mode/ worked
[07:00:28] jcao219: has joined #ruby
[07:00:44] pikender: just wondering why in the first place, Net::FTP not working for list and getbinaryfile :(
[07:01:32] pikender: to add, I also found suggestions to use ftp.passive=true to make it work but that has no effect too :(
[07:01:47] pikender: going with the above mentioned solution but looks hacky
[07:02:10] pikender: anyone having insights, please help
[07:02:34] pikender: does this qualify to be added as a bug to Net::FTP class ?
[07:03:14] ytti: i think so
[07:03:19] mogaj: has joined #ruby
[07:03:32] ytti: but those things are not exactly maintained
[07:03:41] ytti: they dropped telnet entirely from standard lib
[07:03:53] ytti: i wish i never needed tftp, ftp and telnet
[07:03:58] ytti: but alas, i do
[07:04:16] dminuoso: FTP is weird anyway.
[07:04:28] ytti: what were they thinking
[07:05:20] pikender: looks like patching is the more reliable way then :)
[07:06:00] dminuoso: pikender: I have a patch for you.
[07:06:08] PorcoRex: pikender, I don't remember exactly at this moment, but I was able to use `ls` and `getbinaryfile` without issues (although I think I had some originally). This is a link to some old code using it: https://github.com/gdeoliveira/core_headers/blob/development/tasks/catalog.rb
[07:06:10] dminuoso: But you don't apply it to code.rb but Gemfile, and it includes a sed script.
[07:06:16] dminuoso: It changes all FTP to SSH.
[07:06:59] PorcoRex: I think I needed to do Net::FTP.open(HOST) {|ftp| ftp.passive = true; ftp.login }
[07:07:13] PorcoRex: And then the rest.
[07:09:35] dminuoso: PorcoRex: Agreed. Net::SSH looks good.
[07:10:39] jgnagy: has joined #ruby
[07:15:26] pikender: @PorcoRex, I did tried above but to no gain :(
[07:16:02] PorcoRex: pikender, sorry, it's old code. It worked for me back then. What error are you getting?
[07:16:36] pikender: oh my bad, I was referring to your next comment ftp.passive=true :)
[07:17:42] kke_: let's say my gem is called "foo-bar" but it has lib/foo_bar.rb. so i use "require 'foo_bar'", which is not the gem's name. when does the foo-bar.gemspec get loaded?
[07:19:22] PorcoRex: kke_, why not make a file called lib/foo-bar.rb with the content `require "foo_bar"` in it?
[07:19:54] pikender: PorcoRex, I will try your patch and share how did it go .. Thanks for sharing :)
[07:20:18] PorcoRex: pikender, sure, hopefully it has something useful still.
[07:22:09] kke_: PorcoRex: yes i can do that but i'm wondering how the heck ruby figures out it needs to load the gemspec (since it seems to do it)
[07:23:06] PorcoRex: For gems Rubygems always takes the gemspec file as a reference for things a particular gem needs.
[07:23:38] vali: has joined #ruby
[07:23:41] PorcoRex: kke_, you may be looking for this configuration option: http://guides.rubygems.org/specification-reference/#require_paths=
[07:23:49] antgel: has joined #ruby
[07:25:04] flying: has joined #ruby
[07:26:06] charliesome: has joined #ruby
[07:28:18] kke_: no, i'm looking for what makes ruby to load the gemspec in the first place
[07:28:24] snickers: has joined #ruby
[07:28:26] kke_: http://erik.hollensbe.org/2013/05/11/gem-activation-and-you/ this sheds some light
[07:29:59] PorcoRex: I'm sorry, I don't think I understand what you're trying to get at.
[07:35:23] Hanmac: has joined #ruby
[07:36:16] esObe: has joined #ruby
[07:37:44] j2k: has joined #ruby
[07:39:31] ddffg: has joined #ruby
[07:40:19] kke_: i'm trying to figure out what "activates" a gem in such a situation
[07:42:43] mark_66: has joined #ruby
[07:42:49] nhhc: has joined #ruby
[07:44:57] mikecmpbll: has joined #ruby
[07:45:22] brent__: has joined #ruby
[07:45:46] PorcoRex: Gems are handled by Rubygems. They are installed via the "gem" (or wrapper app like "bundler"). A gem has a unique name and a gemspec file associated with it. The gemspec file contain information like what files are included in the gem and what paths should be added when requiring gems.
[07:46:10] loy_aqua: has joined #ruby
[07:47:05] ljarvis: kke_: What do you mean "activates" a gem?
[07:47:12] Silthias: has joined #ruby
[07:48:38] marr: has joined #ruby
[07:49:04] Silthias2: has joined #ruby
[07:51:38] bigkevmcd: has joined #ruby
[07:55:49] maattdd_: has joined #ruby
[07:56:03] mikecmpbll: has joined #ruby
[08:02:22] djbkd: has joined #ruby
[08:02:50] kristofferR: has joined #ruby
[08:04:15] Qchmqs: has joined #ruby
[08:04:41] mim1k: has joined #ruby
[08:07:14] scrapy: has joined #ruby
[08:07:57] scrapy: Guys I used a module that could get website info had addons like google whois etc.
[08:08:10] scrapy: Can anyone tell me the name of the module
[08:08:31] scrapy: If I remember correctly it's either nodekjs or ruby
[08:08:52] ljarvis: scrapy: that's awfully vague
[08:08:54] Cohedrin: has joined #ruby
[08:09:05] ljarvis: you can get whois easily, but is that all you want?
[08:09:57] scrapy: It's basically a module that gets tons of data about websites like whois, JS libraries used, ngix or not, backend, etc
[08:10:12] scrapy: It has addons for every info
[08:10:34] scrapy: Kinda a grey hat one
[08:11:14] ljarvis: metasploit?
[08:12:04] scrapy: lol no I'm not that stupid.
[08:12:15] ljarvis: no idea then
[08:12:53] scrapy: It's a module used for gathering information about websites. Almost all the data through multiple sources and addons
[08:13:04] mim1k: has joined #ruby
[08:15:46] scrapy: https://github.com/urbanadventurer/WhatWeb
[08:16:00] scrapy: Found it. Thanks
[08:16:21] scrapy: I didn't even remember which langauge it was written in
[08:18:12] vali: has joined #ruby
[08:23:29] govg: has joined #ruby
[08:24:04] mogaj: has joined #ruby
[08:25:03] xenops: has joined #ruby
[08:25:30] armyriad: has joined #ruby
[08:27:53] quobo: has joined #ruby
[08:28:35] Beams: has joined #ruby
[08:37:52] loy_aqua: has joined #ruby
[08:40:23] raul782: has joined #ruby
[08:40:43] lxsameer: has joined #ruby
[08:41:12] starmix: has joined #ruby
[08:42:04] mogaj: has joined #ruby
[08:42:34] starmix: has joined #ruby
[08:45:09] mooser: has joined #ruby
[08:48:55] kent\n: has joined #ruby
[08:50:14] patarr: has joined #ruby
[08:53:21] stoffus: has joined #ruby
[09:00:42] charliesome: has joined #ruby
[09:01:03] TreyG: has joined #ruby
[09:05:56] bruce_lee: has joined #ruby
[09:06:02] biberu: has joined #ruby
[09:07:45] Trynemjoel: has joined #ruby
[09:08:16] rgtk: has joined #ruby
[09:09:51] elaptics: has joined #ruby
[09:10:34] rakm: has joined #ruby
[09:14:59] PaulCape_: has joined #ruby
[09:16:07] bsartek: has joined #ruby
[09:17:14] Emmanuel_Chanel: has joined #ruby
[09:20:30] p0p0pr37_: has joined #ruby
[09:21:38] thebigj: has joined #ruby
[09:22:03] pavelz: wonder why can't ruby spawn separate interpreter for a thread if gil is such problem
[09:22:43] thebigj: Hello, I am non ruby programmer. My blog is based on Jekyll plugin. Recently I was trying to add one functionality which was not natively provided by the Jekyll plugin. Can someone review the customization I have written?
[09:22:47] thebigj: https://github.com/ultimatecoder/ultimatecoder.github.io/pull/11
[09:23:02] pavelz: dupe AST and way you go
[09:23:14] SuperLag: has joined #ruby
[09:23:25] thebigj: Above is the link of PR. Please write your comments to the PR. Thanks!
[09:25:27] workmad3: has joined #ruby
[09:29:53] mogaj: has joined #ruby
[09:30:56] jamesaxl: has joined #ruby
[09:35:32] astrobunny: has joined #ruby
[09:36:16] hutch34_: has joined #ruby
[09:36:18] astrobunny: has joined #ruby
[09:36:28] glcx: has joined #ruby
[09:37:07] NL3limin4t0r_afk: has joined #ruby
[09:38:47] Guest14: has joined #ruby
[09:38:49] pikender: has joined #ruby
[09:39:27] astrobunny: has joined #ruby
[09:42:35] pandaant: has joined #ruby
[09:45:20] byte512: has joined #ruby
[09:49:39] ferr: has joined #ruby
[09:56:45] alfiemax: has joined #ruby
[09:56:57] alfiemax: what does this line of code do :
[09:57:16] alfiemax: if a = [1,2,3,4,5,6,7]
[09:57:23] alfiemax: a[4, 1] = [11,22,33]
[09:57:39] alfiemax: a is returned as : => [1, 2, 3, 4, 11, 22, 33, 6, 7]
[09:59:17] alfiemax: i think the 4 is for specifying the index from which the elements are to be changed
[09:59:51] alfiemax: but what is the next number passed, changing that to a number greater or less than the size of the array in the RHS gives confusing results
[10:00:10] herwin: try a[4,1] and a[4,2]
[10:01:09] jsrn_: has joined #ruby
[10:02:47] NL3limin4t0r: has joined #ruby
[10:14:21] toretore: has joined #ruby
[10:16:59] dlitvak: has joined #ruby
[10:19:39] acalycine: has joined #ruby
[10:22:57] tvw: has joined #ruby
[10:24:39] arup_r: has joined #ruby
[10:25:02] Silthias: has joined #ruby
[10:26:07] NL3limin4t0r: has joined #ruby
[10:29:49] NL3limin4t0r: has joined #ruby
[10:38:15] NL3limin4t0r: has joined #ruby
[10:39:09] manveru: pavelz: fork exists :)
[10:39:49] manveru: speaking of which, i'm a bit annoyed that EventMachine.watch_process doesn't work on linux :(
[10:43:33] nowhere_man: has joined #ruby
[10:48:23] mooser: has joined #ruby
[10:50:24] hutch34_: has joined #ruby
[10:51:05] patarr: has joined #ruby
[10:51:44] jaruga: has joined #ruby
[10:53:22] pickle_: has joined #ruby
[10:53:34] bmurt: has joined #ruby
[10:54:05] Puffball: has joined #ruby
[11:00:09] anisha: has joined #ruby
[11:01:55] cajone: has left #ruby: ()
[11:11:42] cajone: has joined #ruby
[11:12:32] t-recx: has joined #ruby
[11:13:04] hutch34_: has joined #ruby
[11:15:15] sepp2k: has joined #ruby
[11:16:57] jokester: has joined #ruby
[11:17:19] jokester: has joined #ruby
[11:18:52] hutch34: has joined #ruby
[11:23:40] petruff: has joined #ruby
[11:24:18] Takumo: has joined #ruby
[11:24:18] Takumo: has joined #ruby
[11:28:30] pickle_: has joined #ruby
[11:28:54] j2k: has joined #ruby
[11:30:26] cek: has joined #ruby
[11:32:16] thebigj: https://github.com/ultimatecoder/ultimatecoder.github.io/pull/11
[11:32:21] thebigj: Hello, I am non ruby programmer. My blog is based on Jekyll plugin. Recently I was trying to add one functionality which was not natively provided by the Jekyll plugin. Can someone review the customization I have written?
[11:32:37] thebigj: Please help me by reviewing my PR.
[11:40:04] antoniobeyah: has joined #ruby
[11:41:30] olivier__: has joined #ruby
[11:43:22] Guest96: has joined #ruby
[11:45:49] ldnunes: has joined #ruby
[11:46:04] HoierM: has joined #ruby
[11:46:51] Vingador: has joined #ruby
[11:46:54] charliesome: has joined #ruby
[11:48:16] nadir: has joined #ruby
[11:50:01] mooser: has joined #ruby
[12:00:16] jdawgaz: has joined #ruby
[12:01:12] olivier__: has joined #ruby
[12:01:50] synthroid: has joined #ruby
[12:06:01] t-recx: has joined #ruby
[12:06:08] petruff: has joined #ruby
[12:06:27] olivier__: has joined #ruby
[12:07:31] mogaj: has joined #ruby
[12:08:01] millerti: has joined #ruby
[12:08:12] nertzy: has joined #ruby
[12:09:48] Puffball: has joined #ruby
[12:11:18] Vingador: has joined #ruby
[12:17:45] vizay: has joined #ruby
[12:22:26] Jameser: has joined #ruby
[12:22:54] segmond: has joined #ruby
[12:23:22] surrounder: has joined #ruby
[12:23:29] robert_reilly: has joined #ruby
[12:24:31] pawandubey: has joined #ruby
[12:24:50] pratn: has joined #ruby
[12:27:06] pratn: has left #ruby: ()
[12:28:23] hinbody: has joined #ruby
[12:29:52] Guest14: has joined #ruby
[12:30:26] igniting: has joined #ruby
[12:31:41] mogaj: has joined #ruby
[12:33:15] olivier__: has joined #ruby
[12:33:31] olivier__: has joined #ruby
[12:34:19] jcao219: has joined #ruby
[12:35:02] mogaj: has joined #ruby
[12:36:17] robert_reilly: has left #ruby: ()
[12:36:58] robert_reilly: has joined #ruby
[12:43:22] cseder: has joined #ruby
[12:51:57] patarr: has joined #ruby
[12:54:04] maxirater: has joined #ruby
[13:00:22] houhoulis: has joined #ruby
[13:01:53] ramortegui: has joined #ruby
[13:08:26] Jameser: has joined #ruby
[13:11:47] lmc: has joined #ruby
[13:14:08] lmc: has joined #ruby
[13:14:45] yeticry_: has joined #ruby
[13:15:27] Guest96: has joined #ruby
[13:17:20] kaspergrubbe: has joined #ruby
[13:19:13] hays: has joined #ruby
[13:19:13] hays: has joined #ruby
[13:21:28] nofxxx: has joined #ruby
[13:22:05] mogaj: has joined #ruby
[13:25:23] agent_white: has joined #ruby
[13:28:06] DLSteve: has joined #ruby
[13:28:30] hays: has joined #ruby
[13:31:49] j2k: has joined #ruby
[13:35:14] jdawgaz: has joined #ruby
[13:35:26] millerti: has joined #ruby
[13:35:29] olivier__: has joined #ruby
[13:36:57] agent_white: mornin' folks
[13:37:53] hays: has joined #ruby
[13:37:53] hays: has joined #ruby
[13:39:00] jcao219: has joined #ruby
[13:39:08] mogaj: has joined #ruby
[13:39:19] phoo1234567: has joined #ruby
[13:46:38] hays__: has joined #ruby
[13:46:53] jrafanie: has joined #ruby
[13:47:14] Silthias1: has joined #ruby
[13:48:00] __Yiota: has joined #ruby
[13:51:27] mooser: has joined #ruby
[13:52:01] TomyLobo3: has joined #ruby
[13:53:48] ben_alman: has joined #ruby
[13:54:01] mogaj: has joined #ruby
[13:54:35] jdawgaz: has joined #ruby
[13:55:06] hays: has joined #ruby
[13:55:06] hays: has joined #ruby
[13:56:30] jphase: has joined #ruby
[13:57:26] Silthias: has joined #ruby
[14:03:53] olivier__: has joined #ruby
[14:04:48] Silthias1: has joined #ruby
[14:07:00] chouhoulis: has joined #ruby
[14:10:50] olivier__: has joined #ruby
[14:12:48] olivier__: has joined #ruby
[14:13:58] cdg: has joined #ruby
[14:17:07] alan_w_: has joined #ruby
[14:17:22] jcao219: has joined #ruby
[14:20:20] Paraxial: has joined #ruby
[14:25:03] surrounder: has joined #ruby
[14:25:28] chouhoulis: has joined #ruby
[14:28:46] burgestrand: has joined #ruby
[14:31:07] chouhoul_: has joined #ruby
[14:31:22] mooser: has joined #ruby
[14:31:40] AlexRussia: has joined #ruby
[14:36:13] __Yiota: has joined #ruby
[14:37:55] millerti: has joined #ruby
[14:38:22] esObe_: has joined #ruby
[14:38:35] esObe: has joined #ruby
[14:39:18] phreakocious: has joined #ruby
[14:41:03] nemish: has joined #ruby
[14:46:01] pikender: has joined #ruby
[14:47:34] jrafanie: has joined #ruby
[14:48:29] mim1k: has joined #ruby
[14:49:48] rakm: has joined #ruby
[14:50:50] jamesaxl: has joined #ruby
[14:51:43] rgtk: has joined #ruby
[14:52:36] jaruga: has joined #ruby
[14:54:33] mogaj: has joined #ruby
[14:54:52] aglorei: has joined #ruby
[14:56:47] jrafanie_: has joined #ruby
[14:57:00] anisha: has joined #ruby
[14:58:50] rippa: has joined #ruby
[15:01:04] snickers: has joined #ruby
[15:01:46] jusa: has joined #ruby
[15:03:23] igniting: has joined #ruby
[15:03:29] __Yiota: has joined #ruby
[15:04:37] mikecmpbll: has joined #ruby
[15:06:43] gregf_: has joined #ruby
[15:09:27] LastWhisper____: has joined #ruby
[15:11:38] olivier__: has joined #ruby
[15:12:32] __Yiota: has joined #ruby
[15:13:32] jdawgaz: has joined #ruby
[15:14:28] hays: has joined #ruby
[15:16:17] jcao219: has joined #ruby
[15:17:57] synthroid: has joined #ruby
[15:18:18] whiteline: has joined #ruby
[15:18:51] synthroid: has joined #ruby
[15:19:55] polishdub: has joined #ruby
[15:22:12] mogaj: has joined #ruby
[15:25:43] tlaxkit: has joined #ruby
[15:26:08] etehtsea: has joined #ruby
[15:27:48] theunraveler: has joined #ruby
[15:28:35] Phrogz: has joined #ruby
[15:29:13] Phrogz: G'day, all.
[15:30:13] theunraveler: has joined #ruby
[15:31:16] olivier__: has joined #ruby
[15:31:39] hxegon: mornin Phrogz
[15:33:47] lmc: has joined #ruby
[15:33:57] dionysus69: has joined #ruby
[15:35:13] lmc: has joined #ruby
[15:35:43] psychicist__: has joined #ruby
[15:38:49] dyyylan: has joined #ruby
[15:39:15] Polysics: has joined #ruby
[15:41:09] mikecmpbll: has joined #ruby
[15:43:20] alazred: has joined #ruby
[15:43:20] alazred: has joined #ruby
[15:44:18] cdg: has joined #ruby
[15:45:39] mzo: has joined #ruby
[15:46:24] minimalism: has joined #ruby
[15:46:35] AlexRussia: has joined #ruby
[15:47:31] shinnya: has joined #ruby
[15:48:18] whiteline: has joined #ruby
[15:49:39] swirlsMD_: has joined #ruby
[15:50:59] username: has joined #ruby
[15:53:16] hamza_rubyist: has joined #ruby
[15:54:46] hamza_rubyist: has left #ruby: ()
[15:55:21] niftylettuce: has joined #ruby
[15:55:48] MrBusiness: has joined #ruby
[15:56:38] ddffg: has joined #ruby
[15:56:41] niftylettuce: has joined #ruby
[15:58:17] hays: why does this work? [*?a..?z]
[15:58:41] hays: I understand literally nothing about it other than the fact that its in brackets might make it an array
[15:58:53] adam12: It's a range, expanded to an array
[15:59:04] adam12: and then splatted into the original array
[15:59:17] hays: whats ? about?
[15:59:23] baweaver: Throwback to 1.8
[15:59:24] adam12: character literals
[15:59:25] baweaver: don't use it
[15:59:36] baweaver: same as 'a'
[15:59:37] adam12: ?a == 'a'
[15:59:37] ruby[bot]: adam12: I don't see no ==, whom should I tell about a?
[15:59:43] adam12: ruby[bot]: shush
[15:59:56] hays: so [*'a'..'z']
[15:59:59] hays: is better?
[16:00:08] hays: what is splatting
[16:00:21] hays: I have only a vague understanding of this...
[16:00:22] baweaver: what does splatting normally do to an arguments list?
[16:00:33] TomyLobo3: has joined #ruby
[16:01:50] baweaver: >> def testing(a,b,c) a + b + c end; testing(1,2,3) == testing(*[1,2,3])
[16:01:51] canton7: splatting takes collection of <stuff>, and pretends that each item in the collection is a separate parameter
[16:01:51] ruby[bot]: baweaver: # => true (https://eval.in/779138)
[16:02:06] alazred: has joined #ruby
[16:02:06] alazred: has joined #ruby
[16:02:27] baweaver: pretty much
[16:02:39] baweaver: it literally "splats" an array down
[16:02:46] hays: def foo *args seems to do opposite?
[16:03:02] TomyLobo3: has joined #ruby
[16:03:15] baweaver: it treats your list of args as an array instead of as params
[16:03:27] chouhoulis: has joined #ruby
[16:03:34] canton7: yeah, 'args' there is being written into, rather than read out of. so the splat operator kinda does the opposite
[16:03:43] baweaver: I'd almost be tempted to call that a gatherer instead of spreader/splat like ES6 does.
[16:03:49] hays: yeah.. alright. so what are valid destinations for a splat?
[16:03:51] alan_w_: has joined #ruby
[16:04:20] baweaver: >> first, *rest = [1,2,3,4,5]
[16:04:21] ruby[bot]: baweaver: # => [1, 2, 3, 4, 5] (https://eval.in/779139)
[16:04:26] baweaver: >> first, *rest = [1,2,3,4,5]; rest
[16:04:29] canton7: so you can do things like... that ^
[16:04:31] canton7: beat me to it
[16:04:31] ruby[bot]: baweaver: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[16:04:49] baweaver: >> first, *rest = [1,2,3,4,5]; rest
[16:04:55] ruby[bot]: baweaver: I'm terribly sorry, I could not evaluate your code because of an error: OpenURI::HTTPError:500 Internal Server Error
[16:04:55] baweaver: apeiros save me
[16:05:07] hays: foo=[1,2]; add *foo
[16:05:12] hays: that works too.. interesting
[16:05:12] apeiros: baweaver: can't. error on eval.in's part (and an error in handling that error in the bot)
[16:05:46] apeiros: left side of an assignment -> collect, right side of an assignment -> splat
[16:05:54] apeiros: argument passing =~ right side
[16:06:00] apeiros: argument receiving =~ left side
[16:06:55] jcao219: has joined #ruby
[16:08:16] raul782: has joined #ruby
[16:11:04] raul782: has joined #ruby
[16:11:27] kaspergr1bbe: has joined #ruby
[16:11:57] vizay: has joined #ruby
[16:12:14] lmc: has joined #ruby
[16:12:53] olivier__: has joined #ruby
[16:14:32] synthroid: has joined #ruby
[16:15:34] bkxd: has joined #ruby
[16:18:25] surrounder: has joined #ruby
[16:20:47] amclain: has joined #ruby
[16:21:08] blackpajamas: has joined #ruby
[16:21:21] cfec0b8d: has joined #ruby
[16:21:23] marxarelli: has joined #ruby
[16:25:34] gusrub: has joined #ruby
[16:27:33] lmc: has joined #ruby
[16:29:17] olivier__: has joined #ruby
[16:29:26] Polysics: has joined #ruby
[16:31:13] lmc__: has joined #ruby
[16:32:08] yeticry: has joined #ruby
[16:32:17] nerglish: has joined #ruby
[16:32:48] __Yiota: has joined #ruby
[16:35:03] Guest88: has joined #ruby
[16:37:17] hobodave: has joined #ruby
[16:37:50] lmc: has joined #ruby
[16:41:00] mjago: has joined #ruby
[16:43:05] mooser: has joined #ruby
[16:43:27] nhhc: has joined #ruby
[16:48:28] rakm: has joined #ruby
[16:51:15] skweek: has joined #ruby
[16:52:16] TheShadowBrokers: has joined #ruby
[16:54:23] alazred: has joined #ruby
[16:54:49] bmurt: has joined #ruby
[16:56:38] pmden: has joined #ruby
[16:56:55] __Yiota: has joined #ruby
[16:57:01] outreachdan: has joined #ruby
[16:58:54] snickers: has joined #ruby
[16:59:44] snickers: has joined #ruby
[17:00:25] snickers: has joined #ruby
[17:01:04] skweek: has joined #ruby
[17:01:07] snickers: has joined #ruby
[17:01:41] gusrub: has joined #ruby
[17:01:50] snickers: has joined #ruby
[17:02:52] Silthias: has joined #ruby
[17:04:51] aryaching: has joined #ruby
[17:07:34] nerglish: has joined #ruby
[17:07:56] ytti: https://www.youtube.com/watch?v=uNjxe8ShM-8
[17:08:05] pilne: has joined #ruby
[17:08:39] mogaj: has joined #ruby
[17:09:02] chouhoulis: has joined #ruby
[17:09:09] AndBobsYourUncle: has joined #ruby
[17:09:38] GodFather: has joined #ruby
[17:09:48] chouhoulis: has joined #ruby
[17:10:18] dasher^0_o: has joined #ruby
[17:14:24] mim1k: has joined #ruby
[17:17:27] AlexRussia: has joined #ruby
[17:17:59] cseder: has joined #ruby
[17:18:17] synthroid: has joined #ruby
[17:18:24] aglorei: has joined #ruby
[17:23:02] __Yiota: has joined #ruby
[17:23:04] cbyrda: has joined #ruby
[17:27:33] cd-rum: has joined #ruby
[17:27:50] MrBismuth: has joined #ruby
[17:27:53] cd-rum: has joined #ruby
[17:28:07] gusrub: has joined #ruby
[17:29:42] postmodern: has joined #ruby
[17:29:48] dasher^0_o: has joined #ruby
[17:30:29] duderonomy: has joined #ruby
[17:31:27] webopsx: has joined #ruby
[17:32:03] lmc: has joined #ruby
[17:33:03] lmc: has joined #ruby
[17:34:07] lmc: has joined #ruby
[17:35:45] Cohedrin: has joined #ruby
[17:40:37] ResidentBiscuit: has joined #ruby
[17:42:07] olivier__: has joined #ruby
[17:43:42] jcao219: has joined #ruby
[17:43:52] xco: has joined #ruby
[17:44:26] xco: is the documentation example of #tap bad or i am? http://ruby-doc.org/core-2.4.1/Object.html#method-i-tap
[17:44:43] xco: i’d like to run a few examples in irb with #tap
[17:45:21] ltem: has joined #ruby
[17:45:52] hxegon: #tap is a bit confusing at first, the docs are good
[17:46:41] xco: hxegon: i can’t run the examples given :(
[17:46:53] xco: wanted to test it. cause it’s really confusing me
[17:47:37] Phrogz: Although I keep finding people that hate it, I love using .tap when I have to create an object that will be my return value, but I have to operate on it, first.
[17:48:01] hxegon: Phrogz: yeah, love using it to avoid assigning tmp vars
[17:48:15] Phrogz: http://phrogz.net/tap-vs-each_with_object
[17:48:27] hxegon: xco: are you trying to run the doc examples verbatim?
[17:48:44] ljarvis: https://eval.in/779213
[17:49:01] xco: hxegon: yes, verbatim :P
[17:49:21] alazred: has joined #ruby
[17:49:37] Phrogz: xco: You can't paste multiple lines like that in IRB
[17:49:49] Phrogz: You'd have to move them all onto the same line.
[17:50:05] xco: not like that
[17:50:07] xco: i’ll show you
[17:50:19] hxegon: also, what error are you getting?
[17:50:28] ljarvis: these 2 methods pretty much sum it up imo https://eval.in/779215
[17:51:00] chouhoul_: has joined #ruby
[17:51:02] ljarvis: Phrogz: did you recently change your website design?
[17:51:02] xco: not getting any error
[17:51:03] Phrogz: ? (1..10).tap{ |x| puts "original: #{x}" }.to_a.tap{ |x| puts "array: #{x}" }.select{ |x| x.even? }.tap{ |x| puts "evens: #{x}" }.map{ |x| x*x }.tap{ |x| puts "squares: #{x}" }
[17:51:04] xco: look https://gist.github.com/siaw23/ba0feb23cee9773ccc52f7c0640313a0
[17:51:17] mwlang: has joined #ruby
[17:51:36] ljarvis: xco: that's working fine
[17:51:53] ljarvis: what did you expect to see? x is 1..10
[17:51:54] Phrogz: xco: Here's what tap does: 1) pass the receiver of the message as a parameter to the block. 2) Return the value of the receiver
[17:52:07] xco: my bad!
[17:52:13] ljarvis: def tap(); yield self; self; end
[17:52:14] hobodave: has joined #ruby
[17:52:15] surrounder: has joined #ruby
[17:52:19] xco: i didn’t see the “original: 1..10 :D
[17:52:28] ljarvis: (excluding pedantry)
[17:52:44] baweaver: ACTION needs to redo his site later
[17:52:48] Phrogz: ljarvis: Is there pedantry?
[17:52:57] xco: yield is confusing on its own already
[17:52:58] ljarvis: Phrogz: isn't there always?
[17:53:08] xco: combined with tap makes me want to go crazy
[17:53:16] ljarvis: Phrogz: it was a disclaimer mostly, before someone was like "naahhhh it also does x, y, z"
[17:53:25] Phrogz: Like the []= wars.
[17:53:25] chouhoul_: has joined #ruby
[17:53:27] ljarvis: i've been here too long heh
[17:53:28] havenwood: >> module Kernel; def let; yield self end end; 5.let { |n| n + 42 }
[17:53:29] ruby[bot]: havenwood: # => 47 (https://eval.in/779216)
[17:53:39] havenwood: I want that ^ simple method.
[17:53:47] havenwood: Whatever the name.
[17:54:02] havenwood: I proposed reuse of #itself, and that was frowned upon (fair enough).
[17:54:05] havenwood: What's a good name?
[17:54:21] baweaver: https://github.com/baweaver/pipeable
[17:54:33] ljarvis: havenwood: #wtf
[17:54:35] havenwood: I think #let is pretty good, but folk feel like Rspec has claimed it.
[17:54:45] hxegon: havenwood: excuse my ignorance, what would the practical use of that be?
[17:55:44] baweaver: 1.pipe(&add).pipe(&multiply)
[17:55:59] dminuoso: baweaver: You mean compose() right?
[17:56:06] Phrogz: class Object; def me; self; end; end # I want this, for those times that you have to pass a block like { |x| x }
[17:56:08] havenwood: hxegon: It's like mapping rather than declaring a variable and appending to it. When you're method chaining it's not too uncommon that you want to return a method called directly on the receiver.
[17:56:12] baweaver: you'll scare the children
[17:56:30] havenwood: hxegon: We currently have to use an intermediate local variable.
[17:56:39] havenwood: hxegon: It's nice to be able to just continue on with your chain.
[17:56:47] hxegon: Phrogz: #itself is this pretty sure
[17:56:56] Phrogz: ACTION rushes to the docs.
[17:57:09] ljarvis: havenwood: praiseth the language that shalt not be mentioned
[17:57:11] havenwood: Phrogz: Yeah, they've added that. :-)
[17:57:13] mogaj: has joined #ruby
[17:57:17] havenwood: ljarvis: :-D
[17:57:24] Phrogz: Hawt! I haven't followed Ruby updates since about 2.1
[17:57:29] ljarvis: baweaver: haha
[17:57:31] baweaver: Wait until 3
[17:57:40] dminuoso: baweaver: I've been hearing this "wait until 3" for like 3 years now.
[17:57:45] hxegon: Phrogz: there's tons of cool (or awful depending on who you ask) stuff lik &.
[17:58:00] baweaver: lonely operator
[17:58:04] havenwood: baweaver: haha, yup, exactly - i want pipe in the stdlib
[17:58:07] dminuoso: baweaver: Ruby 3 will feel like Perl 5 -> 10 years too late.
[17:58:07] ljarvis: a yes, the law of demeter operator
[17:58:11] mzo: >> module Kernel; def under; yield self end end; 22.under { |k| k + 20 }
[17:58:13] ruby[bot]: mzo: # => 42 (https://eval.in/779218)
[17:58:20] havenwood: baweaver: hmm, #pipe as the name...
[17:58:24] Phrogz: Apparently #itself was added in 2.2. Yay! :)
[17:58:27] havenwood: interesting
[17:58:34] baweaver: better that than python's 2 -> 3 jump :D
[17:59:03] ljarvis: you may also enjoy Hash#dig
[17:59:13] dminuoso: I dig that.
[17:59:39] patarr: has joined #ruby
[17:59:46] hxegon: ljarvis: can't read that without eye twitching
[17:59:55] Phrogz: Lonely operator: nice. Terse. I like.
[17:59:59] ljarvis: hxegon: read what?
[18:00:12] havenwood: https://bugs.ruby-lang.org/issues/12760
[18:00:25] hxegon: a 6 letter unholy tense abomination
[18:01:35] ljarvis: havenwood: they need to sort out method(&:x) before adding that
[18:01:50] havenwood: ljarvis: lower hanging fruit
[18:01:59] ljarvis: ACTION goes back to wishing ruby had first class methods
[18:01:59] havenwood: baweaver: #pipe hasn't been proposed ^
[18:02:08] Phrogz: Hash#dig: Hrm. Smells like it's tailored to terse JSON communication. I suppose that's acceptable.
[18:02:22] baweaver: Yeah, debating on that
[18:02:29] Phrogz: ACTION commiserates with ljarvis
[18:02:31] baweaver: I may sign in and propose in a bit
[18:02:37] baweaver: but if you want to go for it feel free havenwood
[18:02:43] nobodyzxc: has joined #ruby
[18:03:07] ljarvis: .with_itself
[18:03:10] Phrogz: ljarvis: Though I will say: http://phrogz.net/insights-into-ruby-from-lua#the-trouble-with-first-class-functions
[18:03:32] Phrogz: That discovery made me a little more OK with Ruby's methods not being first-class.
[18:03:35] sorah___: has joined #ruby
[18:03:38] havenwood: ljarvis: i thought just a block form of #itself was nice
[18:03:50] havenwood: maybe that's too convoluted
[18:04:15] ljarvis: Phrogz: yeah fair comment
[18:04:26] ljarvis: havenwood: yeah i think that'd be fine too tbh
[18:05:05] bronson: has joined #ruby
[18:05:40] lxsameer: has joined #ruby
[18:05:49] ljarvis: good job ruby is monkeypatchable eh...
[18:05:53] ljarvis: said nobody sane ever
[18:06:07] Phrogz: ACTION must be insane
[18:06:20] dminuoso: ljarvis: You know the funny thing is, JS has rooted me back to earth.
[18:06:24] ljarvis: meh, it has its upsides, but creates more problems than it solves imo
[18:06:29] dminuoso: HOFs is all you need to customize magic.
[18:06:37] ljarvis: dminuoso: JS destroys my soul in a similar way I suspect
[18:06:58] ljarvis: I hate few things more than JS
[18:07:21] dminuoso: ljarvis: JS has been extremely pleasant for me ever since I discovered redux and started writing pure functional code left and right.
[18:07:23] ljarvis: Java brings me down to earth sometimes
[18:07:35] ljarvis: dminuoso: right, I do love me some functional code
[18:07:59] synthroid: has joined #ruby
[18:08:01] ljarvis: tbh, Elixir comes closest to being the perfect language for me. There's only a few things I'd change if I could
[18:08:11] dminuoso: ljarvis: I really want to change our Rails APIs to Phoenix. :)
[18:08:21] ljarvis: and funnily enough, my own language I'm working on also has some issues I dislike because this stuff is hard :)
[18:08:44] ljarvis: dminuoso: I'm a huge fan myself, and I work at a Rails shop too
[18:11:16] Guest96_: has joined #ruby
[18:12:26] Phrogz: ljarvis: What are your inspirations and changes for your language?
[18:13:04] Phrogz: changes ~= "things that bugged you about another language that you set out as a goal to change"
[18:13:07] anybody307249: has joined #ruby
[18:13:11] dminuoso: ljarvis: The sad thing is, I have implemented a language before with basic optimizations and flow analysis already. But I don't even have a single clue how to tackle pure functional languages.
[18:13:24] baweaver: Phrogz: played with the CSS of your site a bit. Look into: `font-size: 110%; line-height: 175%;` for standard font and `text-shadow: none;` for headers
[18:13:28] dminuoso: Like, implementing seems like no real issue. But implementing them well is completely opague to mne.
[18:13:51] baweaver: Makes it easier to parse through
[18:13:54] mzo: dminuoso: http://dev.stephendiehl.com/fun/
[18:13:57] anybody307249: does anybody know if activerecord persistence with save! works within a config/initializers/ devise auth strategy?
[18:14:03] ljarvis: heh, yeah it's really tough
[18:14:14] maattdd: has joined #ruby
[18:14:30] ljarvis: Phrogz: i want something like elixir but a little more terse and with first class functions
[18:14:41] dminuoso: mzo: Oh wow. That's interesting.
[18:16:10] baweaver: well there goes my weekend mzo
[18:16:15] baweaver: ACTION bookmarks
[18:16:16] Phrogz: baweaver: Thanks. That site design is circa 1998, with a few patched on changes over the years (like the text shadow when it was new and hot 10 years ago).
[18:16:29] baweaver: Yeah, mine needs some love: baweaver.com
[18:16:35] anybody307249: i have the user record that devise is attempting to authenticate with and im trying to persist an attribute in the devise strategy; the output of save! is true yet the data is not persisting in the database, the column is still nil
[18:16:35] baweaver: mainly in form of actually writing stuff
[18:17:37] chouhoulis: has joined #ruby
[18:17:55] dminuoso: mzo: Yeah my weekend is now blocked too.
[18:18:27] inersha: has joined #ruby
[18:19:21] SeepingN: has joined #ruby
[18:19:48] dminuoso: anybody307249: ?rails
[18:19:52] dminuoso: ?rails anybody307249
[18:19:52] ruby[bot]: anybody307249: Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
[18:20:11] anybody307249: thanks ruby bot
[18:20:47] Phrogz: ljarvis: Got anything of your language online yet?
[18:20:57] raul782: has joined #ruby
[18:22:28] baweaver: mzo / dminuoso: https://twitter.com/keystonelemur/status/854761687525670912
[18:22:45] baweaver: haven't seen much content on it, but there's a lot of interest in funding
[18:23:37] mzo: it would be a shame if it didn't get completed
[18:24:33] skweek: has joined #ruby
[18:26:08] ljarvis: Phrogz: not yet no, it's been in development for.. well, a long time. I would like to get it online soon-ish, but i've been saying that for a while :)
[18:27:42] pwillard: has joined #ruby
[18:28:14] sepp2k: has joined #ruby
[18:29:00] pwillard: New to ruby. What does the "!" mean in this context? --> user_input.downcase!
[18:29:31] dminuoso: pwillard: It's part of the method name.
[18:29:53] webopsx: has joined #ruby
[18:29:56] dminuoso: pwillard: Such methods are colloquially called "bang methods", and are usually used to imply that it mutates the receiver.
[18:30:04] LastWhisper____: for `def content_thumbnail_url(content, width:, height:)` -- what does the `height:` mean? is it the same as height = nil ?
[18:30:15] dminuoso: pwillard: However, don't assume that if there's no bang at the end that it's not mutated. Likewise some bang methods don't mutate their receiver either.
[18:30:21] ytti: much like downcase? would be understood by ruby programmer to return boolean value
[18:30:34] dminuoso: LastWhisper____: Almost. It's naming a keyword argument.
[18:30:34] ytti: while language itself makes no promises or guarantees, they are just names
[18:30:51] ytti: behaviour is out of convention
[18:31:18] ytti: def downcase?; end
[18:31:19] pwillard: Ah. ok. that was the answer I was trying to find. quite the noob at this stage but I really like it so far
[18:31:21] dminuoso: LastWhisper____: It may become more obvious if the kwarg has a default, such as def foo(bar: 1)
[18:31:25] ytti: def downcase!; end
[18:31:28] ytti: def downcase; end
[18:31:31] ytti: are three separate methods
[18:31:48] LastWhisper____: pwillard in laymans terms "mutates the receiver" means it saves the original variable/object to what downcase would transform it to be. so string = "Bob"; string.downcase; puts string; "Bob", string.save; puts string; "bob"
[18:31:57] LastWhisper____: plz correct me if i'm wrong there xD
[18:32:07] dminuoso: LastWhisper____: Spot on.
[18:32:09] olivier__: has joined #ruby
[18:32:22] dminuoso: LastWhisper____: Though, it may not be the case either.
[18:32:39] LastWhisper____: exactly; but conventionally, and especially in models, that seems to be the case
[18:32:41] dminuoso: LastWhisper____: There are some things that just have destructive or mutatible side-effects.
[18:32:42] pwillard: I'm doing the CodeAcademy online thing as an introduction and they started using the ! without explanation.
[18:33:04] dminuoso: And in Rails a ! often indicates that a method will throw an exception on error.
[18:33:13] dminuoso: (And these are often paired with methods without that ! that dont throw)
[18:33:27] dminuoso: Stress on "often"
[18:33:49] LastWhisper____: ya i forgot this is the ruby channel
[18:33:52] pwillard: I'm not sure I'm headed in the rails direction... though I like the CLI aspect of ruby so far...
[18:33:54] LastWhisper____: they may not even be working with models :)
[18:34:39] dminuoso: pwillard: Likewise a method name may contain a question mark, these are conventionally used as "interrogative methods" that yield a boolean.
[18:34:57] dminuoso: Basically you can view them as a question, and the method will answer "true" or "false" (sometimes nil).
[18:35:02] dminuoso: This concvention you can mostly actually rely onb.
[18:35:13] pwillard: wow... liking this even more now
[18:35:19] dminuoso: For example:
[18:35:28] dminuoso: >> array = []; puts array.empty?
[18:35:29] ruby[bot]: dminuoso: # => true ...check link for more (https://eval.in/779236)
[18:36:22] ski7777: has joined #ruby
[18:36:23] dminuoso: pwillard: But in the end don't use a method without checking its API documentation, which should tell you what it does and what it returns. :-)
[18:39:16] pwillard: sounds like a good plan to me
[18:40:49] tristanp_: has joined #ruby
[18:42:06] pwillard: So in a nutshell --> user_input.downcase! is saying modify variable user_input "in place".
[18:42:27] dminuoso: pwillard: Maybe. Or maybe it throws an exception. Or maybe it has some non-obvious side-effects.
[18:42:31] dminuoso: Or maybe it's just a dangerous method.
[18:42:48] dminuoso: pwillard: In the standard library I think it always means it modifies the variable in place. I think.
[18:45:12] rgtk: has joined #ruby
[18:46:11] yeticry: has joined #ruby
[18:47:42] cseder: I'm working through the ubiquitous PickAxe book (4th edt) and the more I learn the more true the "Easy to learn, difficult to Master" maxim becomes.
[18:49:34] jusa: has joined #ruby
[18:53:56] cseder: Try wrapping your head around this: https://gist.github.com/cseder/1cdee876a40786e062fb30797631386c
[18:54:17] ramfjord: has joined #ruby
[18:56:56] nerglish: has joined #ruby
[18:59:19] enterprisey: has joined #ruby
[19:01:31] TinkerTyper_: has joined #ruby
[19:04:01] dminuoso: cseder: Took me about 6 seconds.
[19:04:14] hxegon: cseder list of all divisible ints with 3 in them?
[19:04:22] hxegon: divisible by 10*
[19:04:58] AaronLasseigne: has joined #ruby
[19:05:08] cseder: triangular numbers devisable by 10
[19:05:59] cseder: first five triangular numbers that are multiples of 10 and that have the digit 3 in them
[19:06:57] cseder: to be exact
[19:07:02] olivier__: has joined #ruby
[19:07:40] jrafanie: has joined #ruby
[19:07:47] hxegon: ah. Seems like something that could be done with lazyness elegantly, but I can't seem to get the hang of how ruby handles lazy enumerators
[19:08:14] cseder: It wasn't meant as a quiz, it just demonstrates the compact syntax that makes my head spin, coming from C++ and Java
[19:08:25] nerglish: has joined #ruby
[19:09:39] hxegon: Just commenting on that "It could be a line shorter" itch :)
[19:10:07] skweek: has joined #ruby
[19:14:29] hxegon: cseder: actually, messing with that snippet in pry, you don't need to define infinite_select
[19:15:51] hxegon: cseder: https://eval.in/779245
[19:15:51] swirlsMD_: has joined #ruby
[19:16:13] hxegon: lazyness is something I need to practice taking advantage of
[19:16:36] dminuoso: cseder: You can do this with with C++17 though.
[19:16:48] cseder: hxegon something about built-in functionality for infinite sequences / lazy enumerators in Ruby 2.0 +
[19:16:50] dminuoso: cseder: Enumerators are basically coroutines. :-)
[19:16:55] dminuoso: Well sort of.
[19:17:02] dminuoso: They are generators.
[19:18:40] toretore: enumerators use fibers, which are coroutines
[19:20:36] marr: has joined #ruby
[19:21:00] snickers: has joined #ruby
[19:21:29] cseder: "none of the lazy versions of the methods actually consume any data from the collection until that data is requested, and then they only consume enough to satisfy that request"
[19:21:44] cseder: Ruby Magic
[19:21:58] hxegon: How would you idiomatically generate triangular numbers more functionally? Not saying the code is bad, or even non-optimal, but I'm just not sure how.
[19:24:09] hxegon: cseder: Ever since reading why FP matters, I've been finding any excuse I can to write lazy code.
[19:24:58] cseder: hxegon Yes, it's a beautiful thing
[19:25:13] dminuoso: hxegon: I dont write code anymore, I just became lazy instead.
[19:25:26] dminuoso: Adding newlines and committing them to keep the commit quota.
[19:25:41] dminuoso: Also I never break the CI pipeline anymore!
[19:25:49] hxegon: "the functionality will be there when requested by a user, not before that"
[19:33:46] alazred: has joined #ruby
[19:33:46] alazred: has joined #ruby
[19:34:26] acalycine: has joined #ruby
[19:36:37] hays: has joined #ruby
[19:39:17] jeffreylevesque: has joined #ruby
[19:39:53] jeffreylevesque: what does it mean @someVal ! []
[19:40:02] jeffreylevesque: what does it mean @someVal != []
[19:40:32] cseder: hxegon I don't now much about FP, but I learned a little Lisp a couple of ages ago. What did you read about FP causing you to embrace FP?
[19:40:50] olivier__: has joined #ruby
[19:41:29] dminuoso: jeffreylevesque: It means you need to get a
[19:41:35] dminuoso: ?books jeffreylevesque
[19:41:36] ruby[bot]: jeffreylevesque: You can find a list of recommended books at http://ruby-community.com/pages/links
[19:41:58] rakm: has joined #ruby
[19:45:44] hxegon: answered my own question about functional triangular numbers cseder https://eval.in/779252
[19:46:18] jeffreylevesque: dminuoso: ah ok just googled it
[19:46:23] hxegon: cseder: Learning to program without side-effects in FP languages has probably halved the amount of terrible code I output
[19:46:34] jeffreylevesque: are books even worth anything these days
[19:46:35] hxegon: although your loop code in that case is really fine
[19:46:39] dminuoso: jeffreylevesque: Yes.
[19:46:44] jeffreylevesque: or is it to humor ppl like you dminuoso
[19:47:06] dminuoso: jeffreylevesque: No, there's folks who thinks that people who just think books are not worth the money and time usually end up becoming horrid programmers.
[19:47:23] dminuoso: But honestly I don't care because these folks don't make it into any interview worth mentioning ever.
[19:48:01] hxegon: jeffreylevesque: is class var someVal not equal to an empty array?
[19:48:12] hxegon: s/class/instance
[19:48:44] cseder: hxegon what FP languages have you used most?
[19:49:15] dminuoso: jeffreylevesque: In fact I believe that books are worth more than ever because it's so easy to publish bad resources online. People with egos larger than mine have a tendency for self-proliferation.
[19:49:44] haylon: has joined #ruby
[19:50:09] hxegon: cseder: clojure and haskell. I haven't used either of them for anything serious or bigger than a trivial project, but just learning how they work, how idiomatic code is written in them, is worth it for sure
[19:50:10] jeffreylevesque: humans have relative emotions on things
[19:51:33] cseder: hxegon Yeah, guess so. I have the Programming Erlang book from Pragmatic Programmers (Armstrong) that's waiting in my bookshelf
[19:51:35] vuoto: has joined #ruby
[19:52:47] cseder: Containers, blocks, and iterators are core concepts in Ruby and I'm still trying to wrap my head around its uses
[19:52:56] hxegon: That's another thing I'm looking forward to; checking out the actor model
[19:53:53] cseder: hxegon Haven't had time to learn Erlang yet, but it sure looks interesting!
[19:54:19] hxegon: cseder: also, check out elixir! To oversimplify it, it's erlang with ruby syntax
[19:54:34] cseder: hxegon Will do
[19:55:30] moei: has joined #ruby
[19:58:17] hahuang65: has joined #ruby
[20:00:51] mikecmpbll: has joined #ruby
[20:00:54] outreachdan: has joined #ruby
[20:05:55] username1: has joined #ruby
[20:06:39] robert_reilly_: has joined #ruby
[20:07:26] __Yiota: has joined #ruby
[20:08:14] hays: has joined #ruby
[20:08:14] hays: has joined #ruby
[20:08:15] nerglish: has joined #ruby
[20:09:45] segy: has joined #ruby
[20:13:30] mogaj: has joined #ruby
[20:17:29] __Yiota: has joined #ruby
[20:18:44] Cohedrin: has joined #ruby
[20:19:32] rakm: has joined #ruby
[20:25:30] jenrzzz: has joined #ruby
[20:27:51] Cohedrin_: has joined #ruby
[20:35:34] jdawgaz: has joined #ruby
[20:40:49] jrafanie: has joined #ruby
[20:41:06] rgr: has joined #ruby
[20:41:17] xco: has joined #ruby
[20:42:12] xco: has joined #ruby
[20:43:02] xco: has joined #ruby
[20:43:48] xco: has joined #ruby
[20:44:38] xco: has joined #ruby
[20:45:18] xco: has joined #ruby
[20:49:02] latemus: has joined #ruby
[20:49:05] theunraveler: has joined #ruby
[20:50:15] theunraveler: has joined #ruby
[20:53:33] raul782: has joined #ruby
[20:54:16] outreachdan: has joined #ruby
[20:54:43] gsnedders: has joined #ruby
[20:55:06] ledestin: has joined #ruby
[20:55:15] ramortegui: has joined #ruby
[20:56:01] __Yiota: has joined #ruby
[20:56:10] gsnedders: has left #ruby: ()
[20:56:37] stupidsenpai: has joined #ruby
[20:57:35] spicerack: has joined #ruby
[20:58:17] rhyselsmore: has joined #ruby
[20:58:55] Guest916: has joined #ruby
[20:59:07] millerti: has joined #ruby
[21:01:41] jenrzzz_: has joined #ruby
[21:02:25] JC: has joined #ruby
[21:03:54] cdg_: has joined #ruby
[21:04:42] outreachdan: has joined #ruby
[21:05:30] jeffreylevesque: has joined #ruby
[21:09:16] jcao219: has joined #ruby
[21:15:15] olivier__: has joined #ruby
[21:16:36] raul782: has joined #ruby
[21:16:53] SegFaultAX: has joined #ruby
[21:17:03] chouhoul_: has joined #ruby
[21:19:44] enterprisey: has joined #ruby
[21:27:32] jphase: has joined #ruby
[21:27:50] skweek: has joined #ruby
[21:29:27] xco: has joined #ruby
[21:29:29] mim1k: has joined #ruby
[21:31:10] olivier__: has joined #ruby
[21:32:37] jenrzzz: has joined #ruby
[21:37:27] pupsicle: has joined #ruby
[21:39:02] jusa: has joined #ruby
[21:39:28] raul782: has joined #ruby
[21:39:34] outreachdan: has joined #ruby
[21:40:07] mooser: has joined #ruby
[21:44:24] gusrub: has joined #ruby
[21:44:30] jrafanie: has joined #ruby
[21:45:09] yokel: has joined #ruby
[21:47:23] ddffg: has joined #ruby
[21:47:42] jenrzzz: has joined #ruby
[21:51:25] mooser: has joined #ruby
[21:52:24] dmarr: has left #ruby: ()
[21:52:26] riddley: has joined #ruby
[21:53:08] __Yiota: has joined #ruby
[21:53:42] riddley: has left #ruby: ("Leaving")
[21:56:27] AlexRussia: has joined #ruby
[21:58:07] AndBobsYourUncle: has joined #ruby
[22:00:31] ruby[bot]: has joined #ruby
[22:00:31] ChanServ: +o ruby[bot]
[22:02:41] outreachdan: has joined #ruby
[22:08:12] mogaj: has joined #ruby
[22:08:55] outreachdan: has joined #ruby
[22:10:07] helpa-bot: has joined #ruby
[22:10:40] slima_: has joined #ruby
[22:10:57] outreachdan: has joined #ruby
[22:12:07] helpa: has joined #ruby
[22:12:52] kristofferR: has joined #ruby
[22:14:45] raul782: has joined #ruby
[22:16:25] cdg: has joined #ruby
[22:16:41] jdawgaz: has joined #ruby
[22:17:07] olivier__: has joined #ruby
[22:18:03] sonOfRa: has joined #ruby
[22:19:24] patr0clus: has joined #ruby
[22:19:27] kristofferR: has joined #ruby
[22:19:52] pwnd_nsfw: has joined #ruby
[22:20:28] GodFather: has joined #ruby
[22:21:22] AndBobsYourUncle: has joined #ruby
[22:24:06] pytuger: has joined #ruby
[22:29:23] raul782: has joined #ruby
[22:29:52] mooser: has joined #ruby
[22:34:47] petruff: has joined #ruby
[22:43:53] __Yiota: has joined #ruby
[22:48:31] outreachdan: has joined #ruby
[22:49:22] pifon: has joined #ruby
[22:51:37] outreachdan: has joined #ruby
[22:54:08] robert_reilly: has joined #ruby
[22:57:20] outreachdan: has joined #ruby
[22:57:35] snockerton: has joined #ruby
[23:01:56] jcao219: has joined #ruby
[23:02:40] outreachdan: has joined #ruby
[23:04:39] jhack: has joined #ruby
[23:05:10] outreachdan: has joined #ruby
[23:07:16] Derperperd: has joined #ruby
[23:08:52] mooser: has joined #ruby
[23:09:38] enterprisey: has joined #ruby
[23:10:18] JoshS: has joined #ruby
[23:10:40] Jameser: has joined #ruby
[23:12:28] bmurt: has joined #ruby
[23:16:06] Derperperd: has joined #ruby
[23:20:12] olivier__: has joined #ruby
[23:22:33] jdawgaz: has joined #ruby
[23:29:56] mim1k: has joined #ruby
[23:31:05] skweek: has joined #ruby
[23:31:16] CloCkWeRX: has joined #ruby
[23:39:21] olivier__: has joined #ruby
[23:40:10] minimalism: has joined #ruby
[23:44:04] charliesome: has joined #ruby
[23:47:51] olivier__: has joined #ruby
[23:51:28] mooser: has joined #ruby
[23:52:31] raul782: has joined #ruby
[23:54:20] houhoulis: has joined #ruby
[23:54:20] chouhoulis: has joined #ruby
[23:55:22] naprimer_3: has joined #ruby