« Back to channel list

#ruby - 21 April 2016

« Back 1 day Forward 1 day »
[00:02:30] sid_fules: has joined #ruby
[00:02:43] GriffinHeart: has joined #ruby
[00:02:45] Es0teric: has joined #ruby
[00:03:39] Rubie: has joined #ruby
[00:03:41] mfb2: has joined #ruby
[00:04:55] ensyde: has joined #ruby
[00:07:50] statelesscode: has joined #ruby
[00:10:30] bronson: has joined #ruby
[00:12:09] PaulCapestany: has joined #ruby
[00:14:21] RahulT: has joined #ruby
[00:15:49] yfeldblum: has joined #ruby
[00:19:17] diegoviola: has joined #ruby
[00:19:55] freerobby: has joined #ruby
[00:20:58] CloCkWeRX: has joined #ruby
[00:21:41] ssiris: has joined #ruby
[00:23:19] cdg: has joined #ruby
[00:24:16] baweaver: has joined #ruby
[00:25:53] thejamespinto_: has joined #ruby
[00:26:43] darkf: has joined #ruby
[00:27:49] _djbkd: has joined #ruby
[00:28:11] sid_fules: has joined #ruby
[00:28:59] tw1sted: has joined #ruby
[00:29:35] bradleyprice: has joined #ruby
[00:29:59] _djbkd: has joined #ruby
[00:31:52] ensyde__: has joined #ruby
[00:32:34] diegoaguilar: has joined #ruby
[00:32:58] pawnbox: has joined #ruby
[00:35:27] jaguarmagenta: has joined #ruby
[00:35:51] chipotle: has joined #ruby
[00:36:10] idefine: has joined #ruby
[00:36:13] SilverKey: has joined #ruby
[00:36:26] fowl: has joined #ruby
[00:36:26] ChanServ: +b *!*@unaffiliated/fowlmouth
[00:36:26] ChanServ: ChanServ kicked fowl: Obsessive troll, see http://logs.ryanbigg.com/p/fowl
[00:36:30] arlek_: has joined #ruby
[00:36:34] yaewa: has joined #ruby
[00:36:41] ruby[bot]: -b+b *!*@unaffiliated/fowlmouth *!*@unaffiliated/fowlmouth$#ruby-banned
[00:36:52] mfb2: has joined #ruby
[00:36:56] blackgoat_: has joined #ruby
[00:37:20] dn`_: has joined #ruby
[00:37:44] rahult_: has joined #ruby
[00:37:53] yude_: has joined #ruby
[00:37:58] diprotic: has joined #ruby
[00:38:20] idefine: has joined #ruby
[00:38:43] moei: has joined #ruby
[00:40:04] neanderslob: has joined #ruby
[00:40:09] ixti: has joined #ruby
[00:40:19] armyriad: has joined #ruby
[00:40:50] kaleido: has joined #ruby
[00:40:59] flashpoint9: has joined #ruby
[00:41:02] joneshf-laptop: has joined #ruby
[00:41:12] kappy: has joined #ruby
[00:41:18] jolts: has joined #ruby
[00:42:21] jolts: has joined #ruby
[00:42:29] _djbkd: has joined #ruby
[00:42:45] baweaver: !unban fowl
[00:43:02] stannard: has joined #ruby
[00:43:02] ruby[bot]: -b *!*@unaffiliated/fowlmouth$#ruby-banned
[00:43:18] Spami: has joined #ruby
[00:44:34] Thai_: has joined #ruby
[00:44:41] xMopxShell: has joined #ruby
[00:44:42] nullwarp: has joined #ruby
[00:44:42] alexblom: has joined #ruby
[00:44:51] unsymbol: has joined #ruby
[00:44:59] bqscott: has joined #ruby
[00:45:02] sdothum: has joined #ruby
[00:45:03] apeiros: has joined #ruby
[00:46:09] jolts: has joined #ruby
[00:46:24] torandu: has joined #ruby
[00:46:54] segy: has joined #ruby
[00:47:16] jolts: has joined #ruby
[00:48:33] Takumo: has joined #ruby
[00:49:06] Takumo: has joined #ruby
[00:49:23] EdwardIII: has joined #ruby
[00:50:18] fowl: has joined #ruby
[00:50:18] ChanServ: +b *!*@unaffiliated/fowlmouth
[00:50:18] ChanServ: ChanServ kicked fowl: Obsessive troll, see http://logs.ryanbigg.com/p/fowl
[00:50:19] ruby[bot]: -b+b *!*@unaffiliated/fowlmouth *!*@unaffiliated/fowlmouth$#ruby-banned
[00:51:37] BTRE: has joined #ruby
[00:51:47] polishdub: has joined #ruby
[00:51:54] jolts: has joined #ruby
[00:51:54] mfb2: has joined #ruby
[00:52:16] gregf: has joined #ruby
[00:52:17] GodFather: has joined #ruby
[00:52:28] lemur: has joined #ruby
[00:52:52] darkxploit: has joined #ruby
[00:52:57] jolts: has joined #ruby
[00:52:59] catpoop: has joined #ruby
[00:53:02] nirix: has joined #ruby
[00:53:07] alexherbo2: has joined #ruby
[00:53:10] moeabdol: has joined #ruby
[00:53:10] mnrmnaugh: has joined #ruby
[00:53:15] cdg: has joined #ruby
[00:53:44] binaryplease: has joined #ruby
[00:53:45] william3: has joined #ruby
[00:54:22] kriskropd: has joined #ruby
[00:56:01] jolts: has joined #ruby
[00:56:30] GriffinHeart: has joined #ruby
[00:57:04] flashpoint9: has joined #ruby
[00:58:25] ixti: has joined #ruby
[00:59:23] jenrzzz: has joined #ruby
[01:02:05] Emmanuel_Chanel: has joined #ruby
[01:04:06] bruno-: has joined #ruby
[01:05:54] mfb2: has joined #ruby
[01:10:18] Dimik1: has joined #ruby
[01:12:19] bronson: has joined #ruby
[01:12:21] kareeoleez: has joined #ruby
[01:16:22] stardiviner: has joined #ruby
[01:16:53] swills: has joined #ruby
[01:16:59] LoneHerm_: has joined #ruby
[01:18:13] diegoviola: has joined #ruby
[01:18:54] workmad3: has joined #ruby
[01:19:23] GriffinHeart: has joined #ruby
[01:20:59] johnmilton: has joined #ruby
[01:25:46] pawnbox: has joined #ruby
[01:25:57] mfb2: has joined #ruby
[01:30:29] Ropeney: has joined #ruby
[01:32:01] GriffinHeart: has joined #ruby
[01:32:28] kaleido: has joined #ruby
[01:34:09] jpfuentes2: has joined #ruby
[01:34:22] thejamespinto_: has joined #ruby
[01:35:42] Authenticator: has joined #ruby
[01:35:47] mfb2: has joined #ruby
[01:36:08] Rubie: has joined #ruby
[01:37:20] brainslug: has joined #ruby
[01:38:33] rodfersou: has joined #ruby
[01:39:15] LastWhisper____: has joined #ruby
[01:39:54] Kharma: has joined #ruby
[01:41:10] shibly: has joined #ruby
[01:41:15] idefine: has joined #ruby
[01:41:15] shibly: What are the disadvantages of ruby?
[01:41:43] kaleido: hard quaestion to answer when youre so specific, can you be ore vague?
[01:42:02] Ropeney: it's all perspective
[01:42:21] pipework: shibly: They exist deep within yourself and are only manifested within ruby. It is a reflection of yourself.
[01:43:20] xxneolithicxx: has joined #ruby
[01:44:04] jgrevich: has joined #ruby
[01:44:05] idefine: has joined #ruby
[01:45:03] stannard: has joined #ruby
[01:46:33] shibly: Can anyone answer?
[01:46:34] kies: has joined #ruby
[01:47:11] RahulT: has joined #ruby
[01:48:12] bruno-: has joined #ruby
[01:48:45] SilverKey: has joined #ruby
[01:49:01] tenzan: has joined #ruby
[01:50:04] ramfjord_: shibly: ruby is not suitable for applications where performance is of paramount concern - be it memory or CPU
[01:50:17] ramfjord_: I worked a a company that made their own mapreduce framework in ruby - that was a really bad idea
[01:50:34] ramfjord_: similarly it would be a bad idea to use it for embedded systems
[01:50:46] PaulCapestany: has joined #ruby
[01:51:16] ramfjord_: ruby uses duck typing, which can be considered an advantage or a disadvantage. You're not going to get a nice IDE like eclipse to do a bunch of autocompletes for you, but you do get a lot of freedom
[01:51:23] havenwood: ramfjord_: mruby ftw?
[01:51:30] ledestin: has joined #ruby
[01:51:42] havenwood: re embedded*
[01:51:50] ramfjord_: you miss out type safety, but most rubyists will argue that you should be guaranteeing behavior with unit tests anyway
[01:52:21] cdg: has joined #ruby
[01:52:22] shibly: Is using thread available and good in ruby?
[01:52:34] GriffinHeart: has joined #ruby
[01:52:43] wldcordeiro: has joined #ruby
[01:52:59] ramfjord_: yeah, that... the main "Matz" ruby implementation (MRI) has a global interpreter lock which prevents multiple statements from being executed concurrently in a single process
[01:53:02] havenwood: shibly: Ruby uses system threads. It's implementation-specific whether or not there's a global vm lock but the reference implementation currently has one.
[01:53:14] mfb2: has joined #ruby
[01:53:54] markfletcher: has joined #ruby
[01:54:17] shibly: So there is no problem with thread?
[01:54:20] RegulationD: has joined #ruby
[01:54:44] havenwood: shibly: Threads are a fairly low level concurrency primitive and they're fraught with peril.
[01:54:55] rodferso1: has joined #ruby
[01:55:07] ramfjord_: There are languages with better built in concurrency support for a lot of use cases
[01:55:16] william3: has joined #ruby
[01:56:32] Arcaire: See: Go, Erlang.
[01:56:44] shibly: ramfjord_: What did you mean by performance?
[01:56:47] Arcaire: Probably better off with Go than Erlang to be honest.
[01:57:22] shibly: ramfjord_: Is performance related with cpu,memory?
[01:57:23] ramfjord_: I still get a lot of benefit out of using threads in ruby - they are super easy to use, just not super concurrent. Good for things like making concurrent API calls, where there may be a wait between each call
[01:57:48] ramfjord_: both - if you want to be super strict about your memory management, you probably don't want anything with a garbage collector built in
[01:58:20] ramfjord_: cpu sort of problems are often mitigated by using libraries which are backed by fast C libraries
[01:58:31] havenwood: shibly: See the general rules for using Threads in JRuby (same as other platforms): https://github.com/jruby/jruby/wiki/Concurrency-in-jruby#concurrency-basics
[01:58:45] Arcaire: >JRuby maps Ruby threads to Java threads, which are usually mapped directly to native threads.
[01:58:46] ramfjord_: for instance the ruby CSV library isn't slow at all, and I wouldn't chose anything else
[01:58:49] Arcaire: It's mapping all the way down.
[01:58:58] GriffinHeart: has joined #ruby
[01:59:10] ramfjord_: but in Jruby (or rubinius) you miss out on a lot of libraries that work on MRI
[01:59:38] Arcaire: shibly: The general rule of thumb is that if you can't tell what the disadvantages of Ruby are with respect to your current project, you probably don't need to worry about them.
[02:00:00] ramfjord_: Arcaire: +1
[02:00:06] Arcaire: Most of them boil down to a couple things: It's not the highest performing language, and people who use NodeJS will endlessly tell you to start using JavaScript.
[02:00:29] Arcaire: If neither of those concern you, you should use Ruby (imo). It's a wonderful language that got a lot of things right based on mistakes other languages made.
[02:01:10] ramfjord_: I like to think of it as a nice mix of perl and smalltalk - super practical and super object oriented
[02:01:38] Arcaire: The substances you're taking must be of the highest quality known to man.
[02:01:45] PaulCapestany: has joined #ruby
[02:02:01] Arcaire: But in seriousness, that's the direction that Matz wants/wanted Ruby to go originally, iirc.
[02:02:14] ramfjord_: I also really like Bundler - ruby's main dependency manager
[02:03:09] elifoster: has joined #ruby
[02:03:10] Arcaire: The general library ecosystem around Ruby is honestly awesome.
[02:03:24] ramfjord_: For concurrency I've been looking into celluloid, but I don't have much experience with the actor model
[02:03:32] Arcaire: There's a few issues I have with it but are mostly small edge-case irks I've found regarding ecosystem security.
[02:03:34] ramfjord_: tbh for the most part I've been using Queue + Threadpool
[02:03:36] Arcaire: Celluloid is pretty good.
[02:03:46] Arcaire: In a lot of cases you can ignore the actor model entirely and just use Celluloid/IO.
[02:03:51] ramfjord_: but I'm not making anything complicated
[02:03:52] Arcaire: (I do that lol)
[02:03:55] wilbert: has joined #ruby
[02:04:17] Arcaire: I wrote an IRC services system (think Nickserv, Chanserv) using Celluloid/IO. Good performance even under a stress test.
[02:06:22] kaleido: is node even 50% js anymore?
[02:07:41] ramfjord_: Arcaire: so my main use case is making a ton of API calls, and loading them into a database (preferably on a single connection/transaction)
[02:08:24] ramfjord_: do you think that's something Celluloid would be better suited for than Queue + ThreadPool (one thread with reading from a queue, a bunch of api call threads writing to it)?
[02:08:26] zzach: has joined #ruby
[02:08:52] ramfjord_: the thing that I've really thought would be best for this would be to ignore the queue/threads, and just call select on a socket pool hehe
[02:09:22] ramfjord_: but afaik no libraries do this, and I'd have to actually manually write the http requests to the pool of TcpSockets
[02:09:34] ramfjord_: aaaaand there's absolutely no reason it needs to be that performant anyway
[02:09:59] LoneHerm_: has joined #ruby
[02:13:17] william3: has joined #ruby
[02:14:05] Arcaire: ramfjord_: Hm you'll probably want the actor pooling and supervision anyway then.
[02:14:37] Arcaire: I was using the simplistic celluloid for async TCP but single socket.
[02:15:02] shibly: Did ruby take anything from python? Any syntax similarity? Or any concept of feature?
[02:16:14] shibly: Can you metion few of those?
[02:23:03] GriffinHeart: has joined #ruby
[02:26:07] chagel: has joined #ruby
[02:26:37] stannard: has joined #ruby
[02:28:11] bruno-: has joined #ruby
[02:30:15] Devalo: has joined #ruby
[02:30:30] shibly: has left #ruby: ()
[02:31:20] rahult_: has joined #ruby
[02:32:12] shayan: has joined #ruby
[02:32:52] william3: has joined #ruby
[02:33:18] Chagel_: has joined #ruby
[02:36:01] ICantCook: has joined #ruby
[02:36:28] jaguarmagenta: has joined #ruby
[02:37:56] Spami: has joined #ruby
[02:37:58] pawnbox: has joined #ruby
[02:41:15] moeabdol: has joined #ruby
[02:42:10] mfb2: has joined #ruby
[02:42:12] Es0teric: has joined #ruby
[02:43:57] Rubie: has joined #ruby
[02:47:14] Ebok: has joined #ruby
[02:50:41] LoneHermit: has joined #ruby
[02:51:25] lkba: has joined #ruby
[02:53:18] baweaver: has joined #ruby
[02:53:58] amclain: has joined #ruby
[02:56:40] machinewar: has joined #ruby
[02:56:52] GriffinHeart: has joined #ruby
[02:56:52] machinewar: is there any way to version an API without copying all the code?
[02:57:02] machinewar: since you can't really depend on most of it between versions right?
[02:57:19] machinewar: at least any of the business logic around the response bodies
[02:58:32] mfb2: has joined #ruby
[02:58:44] arescorpio: has joined #ruby
[03:00:24] flaf: Hi, I'm using ruby 2.1.8 and I'm trying to do something like “curl --key $my_privkey --cert $my_cert --cacert $ca_cert https://xxxx” (it's 2-way SSL) but in ruby with 'net/http'. I have problems with the ssl part. Do you have examples in the web which could help me?
[03:00:28] BSaboia: has joined #ruby
[03:00:46] droptone_: has left #ruby: ()
[03:01:28] jobewan: has joined #ruby
[03:08:16] stannard: has joined #ruby
[03:08:22] jaguarmagenta: has joined #ruby
[03:09:14] Rubie: has joined #ruby
[03:12:25] Trynemjoel: has joined #ruby
[03:12:41] bronson: has joined #ruby
[03:13:15] bruno-: has joined #ruby
[03:13:58] mfb2: has joined #ruby
[03:14:22] braincras: has joined #ruby
[03:15:46] jyaworski: has joined #ruby
[03:17:53] Arcaire: What problems, flaf?
[03:18:02] zast: has joined #ruby
[03:18:42] Arcaire: Client-side certificate auth or what?
[03:19:15] skol: has joined #ruby
[03:19:16] postmodern: has joined #ruby
[03:20:08] phaza: has joined #ruby
[03:22:15] stannard: has joined #ruby
[03:23:15] jyaworski: has joined #ruby
[03:24:58] finisherr: has joined #ruby
[03:26:29] GriffinHeart: has joined #ruby
[03:28:55] jgrevich: has joined #ruby
[03:28:57] flaf: Arcaire: in fact, I find no example in the web to just make the equivalent of my curl command above.
[03:29:31] baweaver: has joined #ruby
[03:29:35] flaf: ie how to set my priv key, my cert and the cert of the CA.
[03:29:42] Arcaire: https://www.irccloud.com/pastebin/JZkBjUFr/meme
[03:29:44] ruby[bot]: Arcaire: we in #ruby do not like irccloud.com, I reposted your paste to gist for you: https://gist.github.com/58e63a1fafdda3761106b41569a988d8
[03:29:44] ruby[bot]: Arcaire: irccloud.com has no syntax highlighting, distracting formatting and loads slowly for most.
[03:30:21] Arcaire: p sure it does bud but ok
[03:30:31] GriffinHeart: has joined #ruby
[03:30:35] Arcaire: also that's a literal copy-paste of the meme for pastebin
[03:30:44] Arcaire: with a switch out of pastebin.com to irccloud.com
[03:30:55] Arcaire: am i only allowed to shill gist.github.com in here?
[03:32:38] bb010g: has joined #ruby
[03:32:54] mfb2: has joined #ruby
[03:33:59] baweaver: Arcaire: That's about the gist of it, yeah
[03:34:05] noService: has joined #ruby
[03:34:08] Arcaire: Not again.
[03:34:37] baweaver: Rather forked up isn't it?
[03:34:43] flaf: Arcaire: I have a problem with “http.cert = OpenSSL::X509::Certificate.new(pem)”
[03:34:53] flaf: => OpenSSL::X509::CertificateError: nested asn1 error
[03:34:57] Arcaire: baweaver: ur killing me here
[03:35:13] baweaver: I'm rather mercurial about it.
[03:35:23] A5101: has joined #ruby
[03:35:23] Arcaire: flaf: “Neither PUB key nor PRIV key:: nested asn1 error” ?
[03:35:55] A5101_: has joined #ruby
[03:36:02] flaf: No just the message I have given above.
[03:36:19] jyaworski: has joined #ruby
[03:36:24] flaf: My pem is a valid private key.
[03:36:45] Arcaire: Couple reasons it could be caused and most of them are on stackoverflow if you google for that exact error.
[03:37:13] A5101: has joined #ruby
[03:37:27] Arcaire: It's probably the way your .pem was exported though, as a .pem isn't necessarily a private (or public) key.
[03:38:35] flaf: My shell "curl" command works well, so I think I'm ok concerning my private key, my cert and the CA cert.
[03:39:57] Arcaire: I've found that when I drive non-European cars, using the right stalk does not appear to activate my indicators.
[03:40:01] Arcaire: The same principle applies here.
[03:40:21] Arcaire: It's similar, but not the same.
[03:40:40] Arcaire: afaik 'net/http' isn't built off libcurl.
[03:41:03] flaf: Yes, sure. Furthermore, I'm not a ruby expert at all.
[03:41:55] Arcaire: Where'd you get the .pem from?
[03:42:40] flaf: It's a .pem generated automatically via puppet (/etc/puppetlabs/puppet/ssl/private_keys/$fqdn.pem).
[03:43:07] gix: has joined #ruby
[03:43:17] tildes: has joined #ruby
[03:43:52] Nawn: has joined #ruby
[03:43:55] crdpink2: has joined #ruby
[03:45:23] idl3_: has joined #ruby
[03:46:07] Rodya_: has joined #ruby
[03:46:16] flaf: The file command tells me => “PEM RSA private key”
[03:47:50] Arcaire: i thought you needed both priv and pub in a .pem for things like this
[03:49:03] chagel: has joined #ruby
[03:49:16] mfb2: has joined #ruby
[03:50:18] pawnbox: has joined #ruby
[03:51:24] william3: has joined #ruby
[03:52:38] aiguu: has joined #ruby
[03:52:44] GriffinHeart: has joined #ruby
[03:53:09] diegoviola: has joined #ruby
[03:55:30] chihhsin: has joined #ruby
[03:56:07] flaf: No, like in the curl command I have given above I have a file for my private key, a file for my certificate and a file for the cert of the CA.
[03:56:46] chihhsin: has joined #ruby
[03:56:53] moeabdol: has joined #ruby
[03:57:21] pawnbox: has joined #ruby
[03:57:30] idefine: has joined #ruby
[04:00:28] jyaworski: has joined #ruby
[04:06:02] AnoHito: has joined #ruby
[04:08:31] dcunit3d: has joined #ruby
[04:08:59] _blizzy_: has joined #ruby
[04:09:22] _djbkd: has joined #ruby
[04:12:00] jyaworski: has joined #ruby
[04:12:08] kp666: has joined #ruby
[04:12:27] nickjj_: has joined #ruby
[04:13:00] william3: has joined #ruby
[04:13:53] kareeoleez: has joined #ruby
[04:14:06] hk238: has joined #ruby
[04:17:40] Rodya_: has joined #ruby
[04:20:28] fedexo: has joined #ruby
[04:20:32] mfb2: has joined #ruby
[04:20:53] LoneHerm_: has joined #ruby
[04:21:41] Rubie: has joined #ruby
[04:22:19] Rodya_: has joined #ruby
[04:22:53] Dry_Lips: has joined #ruby
[04:22:53] Dry_Lips: has joined #ruby
[04:23:59] flaf: Where is my error here? https://gist.github.com/anonymous/58e63a1fafdda3761106b41569a988d8#gistcomment-1758095
[04:25:14] rohit: has joined #ruby
[04:28:34] KnownSyntax: has joined #ruby
[04:29:14] Mendenhall: has left #ruby: ("WeeChat 1.0.1")
[04:29:41] CloCkWeRX: has joined #ruby
[04:29:58] tenzan: has joined #ruby
[04:32:00] Devalo: has joined #ruby
[04:33:52] Dry_Lips: has joined #ruby
[04:33:52] Dry_Lips: has joined #ruby
[04:37:45] htmldrum: has joined #ruby
[04:38:00] blackgoat: has joined #ruby
[04:40:03] dionysus69: has joined #ruby
[04:40:43] gmci_: has joined #ruby
[04:40:57] moeabdol: has joined #ruby
[04:41:03] kareeole_: has joined #ruby
[04:41:36] idefine: has joined #ruby
[04:41:45] Radar: http.cert = '/etc/puppetlabs/puppet/ssl/certs/puppet.athome.priv.pem'
[04:41:46] Radar: This line
[04:41:56] flaf: yes, indeed thx.
[04:42:09] flaf: Sometimes an object is expected.
[04:42:20] flaf: (not a string)
[04:42:26] meinside: has joined #ruby
[04:42:45] AdamMeghji__: has joined #ruby
[04:42:49] flaf: (ok a string is an object but you know what I mean ;))
[04:43:46] zrl__: has joined #ruby
[04:43:49] stannard: has joined #ruby
[04:44:20] olivierjanss: has joined #ruby
[04:45:01] matthew__: has joined #ruby
[04:45:08] RahulT: has joined #ruby
[04:47:01] troter__________: has joined #ruby
[04:48:07] saramic: has joined #ruby
[04:51:47] mfb2: has joined #ruby
[04:51:52] rbennacer: has joined #ruby
[04:52:39] rbennacer: has joined #ruby
[04:53:28] rbennacer: has joined #ruby
[04:54:30] rbennacer: has joined #ruby
[04:55:30] rbennacer: has joined #ruby
[04:56:52] rbennacer: has joined #ruby
[04:57:25] saneax: has left #ruby: ("Leaving")
[04:57:46] noService: has joined #ruby
[04:58:14] Abhijit: has joined #ruby
[04:58:24] Abhijit: i just came to know about this https://web.nvd.nist.gov/view/vuln/search-results?query=Ruby&search_type=all&cves=on
[04:58:35] Abhijit: how would i know if my centos gave me patches for those or not?
[04:58:47] Abhijit: this one https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2016-2098
[04:58:56] Abhijit: centos and ubuntu
[04:59:37] idefine: has joined #ruby
[05:02:28] Devalo: has joined #ruby
[05:04:38] rahult_: has joined #ruby
[05:05:31] astrobun_: has joined #ruby
[05:06:48] YaknotiS: has joined #ruby
[05:07:24] Dimik1: has joined #ruby
[05:07:52] speaking1ode: has joined #ruby
[05:09:19] sauvin: has joined #ruby
[05:09:35] bluOxigen: has joined #ruby
[05:09:55] Radar: Abhijit: Uh, that looks to be depending on a specific Rails version? Isn't the solution to just upgrade to the most modern version of Rails specific to your app?
[05:10:02] Radar: So if you have a 3.2 app, upgrade to 3.2.22.2
[05:10:21] agit0: has joined #ruby
[05:10:47] Abhijit: Radar, ok so its should be taken care by ruby / rails and not by os. fine.
[05:11:01] Radar: Abhijit: It should be taken care of by your application's Gemfile
[05:11:39] Abhijit: yeah. but due to one another get restriction i am stuck to 4.1.8 rails.
[05:11:48] wasane: has joined #ruby
[05:12:02] Abhijit: i just wanted to know confirm that its os responsibility or not.
[05:12:07] Arcaire: Abhijit: It's not the OS responsibility.
[05:12:40] Arcaire: These things aren't installed by the OS and aren't in the package manager archives, it's stuff you gotta manage yourself.
[05:12:55] Arcaire: Also that vulnerability isn't an issue unless you do stupid things with the Rails render method.
[05:13:01] Arcaire: I work in infosec and I've only seen it in the wild once.
[05:14:27] william3: has joined #ruby
[05:14:33] bronson: has joined #ruby
[05:14:41] flaf: Arcaire: Finally I got it => https://gist.github.com/anonymous/58e63a1fafdda3761106b41569a988d8#gistcomment-1758095 . Thx for your help.
[05:15:16] Arcaire: Nice work flaf. Thanks for your solution too, it might come up in the future.
[05:22:48] howdoi: has joined #ruby
[05:25:26] baweaver: has joined #ruby
[05:29:38] moeabdol: has joined #ruby
[05:29:49] bruno-: has joined #ruby
[05:30:50] GriffinHeart: has joined #ruby
[05:31:29] moeabdol: has joined #ruby
[05:34:58] Abhijit: Arcaire, ok
[05:35:13] pawnbox: has joined #ruby
[05:35:49] Rodya_: has joined #ruby
[05:37:16] lxsameer: has joined #ruby
[05:40:36] joonty: has joined #ruby
[05:46:13] SuperLag: has joined #ruby
[05:47:38] morochena: has joined #ruby
[05:48:03] navneet: has joined #ruby
[05:49:36] pandaant: has joined #ruby
[05:50:53] djbkd_: has joined #ruby
[05:52:07] yfeldblum: has joined #ruby
[05:52:55] kareeoleez: has joined #ruby
[05:54:34] astrobun_: has joined #ruby
[05:54:42] saramic: has joined #ruby
[05:57:25] galeido: has joined #ruby
[06:00:36] jgrevich: has joined #ruby
[06:06:19] RahulT: has joined #ruby
[06:10:55] pLaToOn: has joined #ruby
[06:11:11] sphex_: has joined #ruby
[06:11:40] Macaveli: has joined #ruby
[06:12:36] aganov: has joined #ruby
[06:14:38] tvw: has joined #ruby
[06:15:01] chagel: has joined #ruby
[06:15:05] william3: has joined #ruby
[06:16:06] saramic: has joined #ruby
[06:16:07] Polysics: has joined #ruby
[06:16:11] Xeago: has joined #ruby
[06:16:44] tAn: has joined #ruby
[06:19:09] saramic: has joined #ruby
[06:19:53] saramic: has joined #ruby
[06:20:55] benlieb: has joined #ruby
[06:26:49] firstdayonthejob: has joined #ruby
[06:28:23] thejamespinto: has joined #ruby
[06:28:30] codecop: has joined #ruby
[06:28:33] codecop_: has joined #ruby
[06:30:24] lemur: has joined #ruby
[06:31:04] bruno-: has joined #ruby
[06:31:06] GriffinHeart: has joined #ruby
[06:31:50] ur5us: has joined #ruby
[06:33:21] tildes: has joined #ruby
[06:34:03] pelegreno: has joined #ruby
[06:34:10] william3: has joined #ruby
[06:34:27] pelegreno: has joined #ruby
[06:34:59] Macaveli: has joined #ruby
[06:35:08] baweaver: has joined #ruby
[06:35:50] tildes: has joined #ruby
[06:37:58] noService: has joined #ruby
[06:38:18] toretore: has joined #ruby
[06:39:13] lkba_: has joined #ruby
[06:39:53] GriffinHeart: has joined #ruby
[06:42:08] navneet_: has joined #ruby
[06:43:46] chagel: has joined #ruby
[06:43:48] armyriad: has joined #ruby
[06:44:18] lemur: has joined #ruby
[06:48:05] last_staff: has joined #ruby
[06:49:41] william3: has joined #ruby
[06:53:12] aswen: has joined #ruby
[06:53:19] baweaver: has joined #ruby
[06:54:44] mark_66: has joined #ruby
[06:55:21] minster_prime: has joined #ruby
[06:56:32] jaruga___: has joined #ruby
[06:57:40] jaruga___: has joined #ruby
[06:59:01] baweaver: has joined #ruby
[06:59:58] astrobun_: has joined #ruby
[07:00:26] rickmasta: has joined #ruby
[07:01:01] DoubleMalt: has joined #ruby
[07:01:31] waxxy: has joined #ruby
[07:01:44] lkba: has joined #ruby
[07:02:19] biberu: has joined #ruby
[07:05:08] tessi: has joined #ruby
[07:09:02] RahulT: has joined #ruby
[07:09:30] dionysus69: has joined #ruby
[07:13:10] Xeago: has joined #ruby
[07:13:32] rodfersou: has joined #ruby
[07:14:15] x77686d: has joined #ruby
[07:14:23] TomyWork: has joined #ruby
[07:15:18] kareeole_: has joined #ruby
[07:15:35] tagaulap: has joined #ruby
[07:16:19] anisha: has joined #ruby
[07:16:49] igam: has joined #ruby
[07:18:06] benlieb: has joined #ruby
[07:18:08] william3: has joined #ruby
[07:18:19] lkba_: has joined #ruby
[07:18:25] ur5us: has joined #ruby
[07:18:40] tvw: has joined #ruby
[07:19:53] benlieb: has joined #ruby
[07:23:01] stannard: has joined #ruby
[07:23:54] ramfjord: has joined #ruby
[07:25:15] the_drow: has joined #ruby
[07:28:29] pawnbox: has joined #ruby
[07:28:59] thejamespinto: has joined #ruby
[07:29:30] aufi_: has joined #ruby
[07:32:05] bruno-: has joined #ruby
[07:33:00] joonty: has joined #ruby
[07:33:03] Infra-Red: has joined #ruby
[07:33:44] Xeago: has joined #ruby
[07:33:54] Prominent: has joined #ruby
[07:34:07] Infra-Red: has joined #ruby
[07:34:40] jenrzzz: has joined #ruby
[07:34:41] jenrzzz: has joined #ruby
[07:35:45] william3: has joined #ruby
[07:37:07] nobitanobi: has joined #ruby
[07:37:28] andikr: has joined #ruby
[07:37:39] konsolebox: has joined #ruby
[07:38:12] CausaMortis: has joined #ruby
[07:38:52] n008f4g_: has joined #ruby
[07:38:56] antgel: has joined #ruby
[07:41:03] speaking1ode: has joined #ruby
[07:44:16] araujo: has joined #ruby
[07:45:04] karapetyan: has joined #ruby
[07:45:14] febuiles_: has joined #ruby
[07:48:11] jenrzzz: has joined #ruby
[07:51:57] iDontWantToBeTha: has joined #ruby
[07:52:33] Couch: has joined #ruby
[07:52:48] iDontWantToBeTha: has left #ruby: ()
[07:56:31] GriffinHeart: has joined #ruby
[07:58:11] last_staff: has joined #ruby
[07:58:11] terlar: has joined #ruby
[07:58:31] ur5us: has joined #ruby
[07:58:58] tAn: has joined #ruby
[08:00:53] PedramT: has joined #ruby
[08:04:21] darkxploit: has joined #ruby
[08:06:59] haraoka: has joined #ruby
[08:07:15] the_drow: has joined #ruby
[08:09:42] drptbl: has joined #ruby
[08:11:05] Rodya_: has joined #ruby
[08:14:15] Rodya_: has joined #ruby
[08:16:11] Macaveli: has joined #ruby
[08:16:44] weckl: has joined #ruby
[08:16:53] bronson: has joined #ruby
[08:18:29] myntcake: has joined #ruby
[08:19:21] snowy: has joined #ruby
[08:19:54] modin: has joined #ruby
[08:21:28] htmldrum: has joined #ruby
[08:22:04] norc: has joined #ruby
[08:22:10] pawnbox: has joined #ruby
[08:22:23] Devalo: has joined #ruby
[08:23:39] lxsameer: has joined #ruby
[08:24:31] lkba: has joined #ruby
[08:26:07] mikecmpbll: has joined #ruby
[08:26:18] poerror: has joined #ruby
[08:26:58] karapetyan: has joined #ruby
[08:27:05] navneet_: has joined #ruby
[08:27:09] astrobun_: has joined #ruby
[08:27:19] mfb2: has joined #ruby
[08:29:26] moeabdol: has joined #ruby
[08:29:43] thejamespinto: has joined #ruby
[08:31:05] gdp: has joined #ruby
[08:32:40] bruno-: has joined #ruby
[08:33:10] Xeago: has joined #ruby
[08:33:53] Infra-Red: has joined #ruby
[08:35:24] ekroon: has joined #ruby
[08:36:11] ur5us: has joined #ruby
[08:36:20] Xeago: has joined #ruby
[08:37:59] ekroon: has left #ruby: ()
[08:38:21] ujjain: Can somebody help me fix this integration test error? http://pastebin.com/KkctLFKr
[08:38:22] ruby[bot]: ujjain: as I told you already, please use https://gist.github.com
[08:38:40] ujjain: Your block takes 1 argument, but the Regexp matched 0 arguments. (Cucumber::ArityMismatchError) - features/step_definitions/my_steps.rb:310:in `/^the output should be 'Err, timeout, ouch'$/'
[08:41:48] matp: has joined #ruby
[08:43:14] lkba: has joined #ruby
[08:45:02] apeiros: hm, Ox0dea, I bet you've investigated this - is there a way to have capturing groups higher than 9 in the \1-\9 notation in sub? e.g. str.sub(/(.) […](.)/, '\11') - straight \11 sadly inserts 11, not capturing group 11
[08:45:06] poerror: has left #ruby: ("Textual IRC Client: www.textualapp.com")
[08:46:35] RyanMcCoskrie: has joined #ruby
[08:47:53] ujjain: now I have expected: "Err, timeout, ouch"
[08:47:53] ujjain: got: "", looks like @timeout_exception isn't set during the gherkin test
[08:47:57] Infra-Red: has joined #ruby
[08:48:23] ponga: has joined #ruby
[08:50:02] Infra-Red: has joined #ruby
[08:50:29] kspencer: has joined #ruby
[08:55:11] GriffinHeart: has joined #ruby
[08:55:41] evidex: has joined #ruby
[08:55:58] jhass: apeiros: I think I'd consider using the named stuff when I get that many groups
[08:57:28] tessi: has joined #ruby
[08:58:01] Infra-Red: has joined #ruby
[08:58:46] mfb2: has joined #ruby
[08:58:51] Shashikant86: has joined #ruby
[08:59:36] rbennacer: has joined #ruby
[09:00:05] Infra-Red: has joined #ruby
[09:00:33] Spami: has joined #ruby
[09:02:25] skislak: has joined #ruby
[09:03:23] blaxter: has joined #ruby
[09:06:12] karapetyan: has joined #ruby
[09:07:08] yosafbridge: has joined #ruby
[09:07:54] pawnbox: has joined #ruby
[09:10:09] skislak: has joined #ruby
[09:12:02] yfeldblum: has joined #ruby
[09:13:57] gregf: has joined #ruby
[09:14:28] AlexJakeGreen: has joined #ruby
[09:15:15] mfb2: has joined #ruby
[09:15:59] modin: has joined #ruby
[09:19:30] GriffinHeart: has joined #ruby
[09:19:40] htmldrum: has joined #ruby
[09:21:12] mdih: has joined #ruby
[09:21:22] karapetyan: has joined #ruby
[09:21:47] mdih: has joined #ruby
[09:22:53] mdih: has joined #ruby
[09:23:09] thejamespinto: has joined #ruby
[09:25:07] doublemalt_: has joined #ruby
[09:25:20] bridge: has joined #ruby
[09:28:24] Rodya_: has joined #ruby
[09:28:42] workmad3: has joined #ruby
[09:28:44] terlar: has joined #ruby
[09:35:11] pawnbox: has joined #ruby
[09:35:22] astrobunny: has joined #ruby
[09:35:47] lsmola: has joined #ruby
[09:37:03] GriffinHeart: has joined #ruby
[09:40:15] lkba_: has joined #ruby
[09:41:11] Ropeney: has joined #ruby
[09:41:27] Ox0dea: apeiros: This doesn't look promising: https://git.io/vwCSU
[09:42:01] Ox0dea: If nothing else, you've unveiled a solid candidate for a refactor.
[09:43:06] pawnbox_: has joined #ruby
[09:44:09] galeido: has joined #ruby
[09:44:09] galeido: has joined #ruby
[09:44:29] charliesome: has joined #ruby
[09:44:51] marr: has joined #ruby
[09:44:52] bridge: has joined #ruby
[09:46:28] mfb2: has joined #ruby
[09:46:50] chipotle: has joined #ruby
[09:46:53] apeiros: god, I'm horrible
[09:47:02] apeiros: I walked away and didn't tell. my apologies jhass and Ox0dea
[09:47:10] apeiros: jhass: I used named captures as a workaround
[09:47:17] apeiros: Ox0dea: thanks. that does indeed not look promising :D
[09:47:36] Ox0dea: apeiros: I can't imagine why it was done that way, honestly.
[09:47:40] SuperSaiyan: has joined #ruby
[09:47:43] waxxy: 11 capture groups :o what are you parsing?
[09:47:44] Ox0dea: Eating digits isn't exactly an unsolved problem. :/
[09:47:44] SuperSaiyan: someone please chat with me :)
[09:48:03] noobsu: has joined #ruby
[09:48:28] Ox0dea: waxxy: My bet's on `ps aux` or the like.
[09:48:43] apeiros: waxxy: mixing bits :)
[09:48:48] apeiros: sounds weird, I know
[09:48:51] Ox0dea: Use math.
[09:48:59] SuperSaiyan: what is math?
[09:49:01] apeiros: slower for this and much much more code
[09:49:12] apeiros: (slower mainly due to method call overhead)
[09:49:16] navneet_: has joined #ruby
[09:50:33] shevy: hah who would have known that Ox0dea's being sceptical about the up-to-9 capture groups, would have a follow up like this with apeiros today!
[09:50:43] SuperSaiyan: please stop ignoring me :'(
[09:50:46] apeiros: ACTION afk, jogging
[09:50:46] shevy: hmm scratch the 's there
[09:51:09] apeiros: SuperSaiyan: this is a chat for problems around the ruby programming language. not a chat for your entertainment.
[09:51:21] SuperSaiyan: Im super saiyan! I ll destroy you all !!!
[09:51:30] jhass: the latter would be to found at #ruby-offtopic
[09:51:32] apeiros: !spam SuperSaiyan
[09:51:32] ruby[bot]: +bbb Bridge!*@*$#ruby-banned SuperSaiyan!*@*$#ruby-banned *!*@gateway/web/cgi-irc/kiwiirc.com/ip.45.117.135.174$#ruby-banned
[09:51:32] ruby[bot]: ruby[bot] kicked SuperSaiyan: is a bannable offense, see http://ruby-community.com/pages/user_rules
[09:52:15] jhass: aw you stole my toy before I could put it into the sandbox
[09:53:26] johnmilton: has joined #ruby
[09:56:17] blackmesa: has joined #ruby
[09:56:20] adaedra: They're SuperGone now.
[09:59:04] Polysics_: has joined #ruby
[10:01:37] neanderslob: has joined #ruby
[10:02:35] resin: has joined #ruby
[10:02:36] PedramT: has joined #ruby
[10:02:59] yfeldblum: has joined #ruby
[10:03:13] araujo: has joined #ruby
[10:03:48] rippa: has joined #ruby
[10:08:33] moeabdol: has joined #ruby
[10:10:48] biberu: has joined #ruby
[10:10:51] pawnbox: has joined #ruby
[10:11:08] ruby421: has joined #ruby
[10:13:35] chosen1: has joined #ruby
[10:13:49] drptbl_: has joined #ruby
[10:14:24] tristanp: has joined #ruby
[10:14:44] william3: has joined #ruby
[10:16:27] shevy: that was a short hi
[10:16:28] ocbtec: has joined #ruby
[10:16:36] andikr: has joined #ruby
[10:17:36] mfb2: has joined #ruby
[10:18:07] baweaver: has joined #ruby
[10:21:09] jaguarmagenta: has joined #ruby
[10:21:13] william3: has joined #ruby
[10:22:19] armyriad: has joined #ruby
[10:22:23] nobitanobi: has joined #ruby
[10:23:37] nobitanobi: has joined #ruby
[10:24:29] edwinvdgraaf: has joined #ruby
[10:25:11] shibly: has joined #ruby
[10:25:56] Carella: has joined #ruby
[10:26:02] shibly: has left #ruby: ("Leaving")
[10:26:19] Gasher: has joined #ruby
[10:30:14] allisterantosik: has joined #ruby
[10:32:46] charliesome: has joined #ruby
[10:33:06] RahulT: has joined #ruby
[10:34:02] mfb2: has joined #ruby
[10:34:04] lxsameer: has joined #ruby
[10:34:09] bruno-: has joined #ruby
[10:38:10] Polysics: has joined #ruby
[10:41:04] pawnbox: has joined #ruby
[10:41:44] hk238: has joined #ruby
[10:42:10] sgambino: has joined #ruby
[10:45:22] Macaveli: has joined #ruby
[10:49:05] stannard: has joined #ruby
[10:49:29] lkba: has joined #ruby
[10:52:07] sandelius: has joined #ruby
[10:54:07] siaW: i have 2 folders, A and B which are both in another folder, C. How can i use a model method in a file in B from A?
[10:54:30] siaW: i have tried ‘require ‘filename’’
[10:54:41] siaW: ‘require_relative ‘filename’’
[10:55:04] siaW: in the file in B and none’s doing the job
[10:55:09] Emmanuel_Chanel: has joined #ruby
[10:56:18] The_Phoenix: has joined #ruby
[10:56:50] FooMunki: has joined #ruby
[10:56:57] karapetyan: has joined #ruby
[10:57:36] shevy: siaw require_relative should work, you must get some kind of error if the file does not exist
[10:58:04] shevy: require_relative 'foobar.rb' # LoadError: cannot load such file -- /Depot/j/foobar.rb
[10:58:19] siaW: the error i’m getting tells me it can load the file from folder B’s path
[10:58:31] siaW: meaning it’s not searching folder A at all
[10:58:49] jhass: siaw: can you reask with the actual paths relative to your project root please?
[10:58:55] The_Phoenix: has joined #ruby
[10:59:13] jhass: I feel like the abstraction here will just add confusion
[10:59:37] Ox0dea: siaw: require_relative '../B/foo'
[10:59:52] blaxter: has joined #ruby
[11:01:26] evidex_: has joined #ruby
[11:01:49] meee: has joined #ruby
[11:02:42] siaW: Ox0dea: require_relative '../B/foo' works
[11:02:43] jterra_: has joined #ruby
[11:02:56] Polysics: has joined #ruby
[11:03:06] siaW: thanks you
[11:03:10] gnufied: has joined #ruby
[11:03:11] Ox0dea: Happy to help. :)
[11:03:33] eregon_: has joined #ruby
[11:03:48] The_Phoenix: has joined #ruby
[11:04:06] araujo: has joined #ruby
[11:04:11] joonty1: has joined #ruby
[11:04:36] toretore: siaw: what's the reason you want to use require_relative instead of just require?
[11:04:40] meee: has left #ruby: ()
[11:05:10] pandaant: has joined #ruby
[11:05:36] siaW: toretore: i don’t know
[11:05:40] mnrmnaugh_: has joined #ruby
[11:05:49] icey_: has joined #ruby
[11:06:07] s1kx-: has joined #ruby
[11:06:19] siaW: i was expecting require to work
[11:06:27] siaW: but it wasn't
[11:07:14] toretore: siaw: in general, you shouldn't require relative to the source file, you should expect the file you're requiring to be in $PATH
[11:07:42] siaW: so in which cases can we use require_relative then?
[11:07:46] joneshf-laptop_: has joined #ruby
[11:07:50] Rixius|Alt: has joined #ruby
[11:07:52] n008f4g_: has joined #ruby
[11:07:55] toretore: when you have a really good reason to
[11:08:02] moeabdol: has joined #ruby
[11:08:14] toretore: and if you don't know why then you probably don't have one
[11:09:04] nisstyre_: has joined #ruby
[11:09:35] Adam_FrVancouver: has joined #ruby
[11:11:01] blackmesa: has joined #ruby
[11:11:18] siaW: meaning i should still use require here?
[11:11:58] yeticry: has joined #ruby
[11:12:21] shevy: siaw for instance, in my gems I can use require() just fine, I don't have to use require_relative()
[11:12:23] Ox0dea: siaw: `require` will search every directory in $LOAD_PATH for a matching file; toretore is suggesting that it would be better for you to get '../B' into $LOAD_PATH and then just require 'foo'.
[11:12:26] toretore: siaw: probably, but it's hard to say without knowing anything about your project
[11:14:05] coyo: has joined #ruby
[11:14:14] blackgoat: has joined #ruby
[11:15:18] siaW: ok my file path looks like this https://github.com/siaw23/devsnap/tree/ground/app
[11:15:18] navneet_: has joined #ruby
[11:15:30] siaW: the folders in question here are “models” and “services”
[11:15:48] siaW: in services i have snapchat_svg_service.rb
[11:16:12] siaW: which i want to use in ‘models/developer.rb'
[11:16:17] ferr: has joined #ruby
[11:16:40] siaW: so i have https://github.com/siaw23/devsnap/blob/ground/app/services/snapchat_svg_service.rb
[11:16:56] janelleb: has joined #ruby
[11:16:57] siaW: that i want to use here https://github.com/siaw23/devsnap/blob/ground/app/models/developer.rb
[11:17:02] staticfox: has joined #ruby
[11:17:20] toretore: you should require('services/snapchat_svg_service')
[11:17:57] toretore: or just require('snapchat_svg_service')
[11:18:08] siaW: i tried that alread and i get “cannot load such file -- services/snapchat_svg_service”
[11:18:11] toretore: depending on what you put in $LOAD_PATH
[11:18:33] siaW: so have to put $LOAD_PATH on top of the line
[11:18:36] lxsameer: has joined #ruby
[11:18:38] william3: has joined #ruby
[11:18:38] lxsameer: has joined #ruby
[11:19:06] toretore: $LOAD_PATH gets set externally
[11:19:18] toretore: it's not your file that makes this decision
[11:19:24] Ox0dea: That's simply not the case.
[11:19:49] toretore: it's the invoker, whoever that may be
[11:20:11] toretore: could be `ruby -I.` or there could be some setup done in another file
[11:20:13] xMopxShell: has joined #ruby
[11:20:21] thorgi: has joined #ruby
[11:20:29] htmldrum: has joined #ruby
[11:20:53] mfb2: has joined #ruby
[11:21:06] zenlot: has joined #ruby
[11:21:34] Shashikant86: has joined #ruby
[11:21:35] siaW: anyway after a successfull require
[11:21:46] siaW: i get “uninitialized constant Developer::SnapchatSvgService”
[11:21:54] siaW: on line “include SnapchatSvgService”
[11:22:01] stannard: has joined #ruby
[11:22:14] siaW: what did i do wrong?
[11:22:18] rbennacer: has joined #ruby
[11:22:37] siaW: “SnapchatSvgService” is the name of the module in the file i just required
[11:23:01] Devalo: has joined #ruby
[11:23:45] siaW: yeap. or not?
[11:23:50] navneet_: has joined #ruby
[11:23:55] Shashika_: has joined #ruby
[11:24:01] tobiasvl: oh well maybe
[11:24:06] tobiasvl: pastebin your code
[11:24:13] siaW: i’m trying to INCLUDE the module from that file
[11:24:19] toretore: pastebin ..
[11:24:28] tobiasvl: "pastebin" as a generalized term :)
[11:24:42] tobiasvl: I don't want to say "paste" your code because that can easily be misinterpreted
[11:24:50] toretore: "gist" works well
[11:24:51] tobiasvl: maybe I should say "gist" your code since that's what's in the topic
[11:24:58] lacrosse: has joined #ruby
[11:25:27] shevy: just dump it here!
[11:25:31] jhass: siaw: given this is rails after all, I'd recommend to not explicitly require it at all, instead make sure to follow conventions and perhaps adjust autoload_paths accordingly
[11:25:41] siaW: toretore: https://gist.github.com/siaw23/a0bb294c2d4b94af4e7b2970bdce06ce
[11:26:16] johnmilton: has joined #ruby
[11:27:26] tobiasvl: wow your indentation is all over the place
[11:27:58] tobiasvl: siaw: move the require_relative inside Developer or move the include outside Developer?
[11:28:03] stardiviner: has joined #ruby
[11:28:19] shevy: drunkentation
[11:29:06] siaW: tobiasvl: same error outside Developer “uninitialized constant SnapchatSvgService”
[11:29:23] siaW: i think it’s got to do with how Rails work with file inclusion
[11:29:40] tobiasvl: siaw: well that's not the same error, earlier it said Developer::SnapchatSvgService
[11:29:44] tobiasvl: but yeah maybe some rails stuff
[11:29:45] toretore: autoload ftl
[11:29:45] Polysics_: has joined #ruby
[11:29:55] siaW: yeah right
[11:30:03] toretore: siaw: are you restarting the server?
[11:30:23] jhass: siaw: so either ensure app/ is in your autoload_paths and name it Services::SnapchatSvgService or ensure app/services is in your autoload_paths and then it should work without require
[11:30:54] toretore: so now that we know it's a rails app, rails has ways to add directories to the $LOAD_PATH which you should use instead of require_relative
[11:31:07] toretore: or, what jhass said
[11:33:27] jaruga___: has joined #ruby
[11:35:25] siaW: i’m using rails 5 beta 3 which makes things even worse
[11:35:34] siaW: it hasn’t got that autoload_paths :D
[11:35:36] workmad3: `app/*` is added to your autoload paths by default, so you should be able to just add a directory there
[11:35:56] workmad3: but you'll probably need to restart the server and run `spring stop`
[11:35:58] bruno-: has joined #ruby
[11:36:10] workmad3: (unless you've already taken spring out of your Gemfile :) )
[11:36:33] siaW: doing that now
[11:39:21] siaW: that moved me forward :)
[11:39:35] siaW: buuuut my two files look like this https://gist.github.com/siaw23/a0bb294c2d4b94af4e7b2970bdce06ce
[11:39:58] siaW: and i’m getting “undefined method `get_svg_image' for SnapchatSvgService:Module”
[11:40:17] siaW: but “get_svg_image” is a method clearly difined in that module get_svg_image
[11:40:27] jhass: &ri Module#module_function @siaw
[11:40:27] `derpy: siaw: http://ruby-doc.org/core-2.3.0/Module.html#method-i-module_function
[11:41:20] Polysics: has joined #ruby
[11:41:32] siaW: `derpy: works
[11:41:46] siaW: whew! got a lot to learn
[11:42:01] siaW: is this just in ruby 2.3?
[11:42:09] gregf_: siaw: derpy is a bot :). jhass is'nt ;)
[11:42:18] siaW: i read a whole book on 1.9 and didn’t see anything like this! :o
[11:42:22] bkxd: has joined #ruby
[11:42:23] jhass: rumors are it's the other way around I hear
[11:42:39] jhass: http://ruby-doc.org/core-1.9.3/Module.html#method-i-module_function
[11:43:01] waxxy: module_function is neat
[11:43:36] siaW: i never saw it.
[11:43:40] siaW: i saw it earlier today though
[11:43:50] jhass: I'm still biased as to whether I preferred it would create an alias or delegate instead of a copy
[11:43:51] siaW: and i was like “wth is this?”
[11:44:32] workmad3: siaw: if you only want it accessible directly on the module, you can also define it with `def self.get_svg_image(username)`
[11:46:09] workmad3: siaw: doing `def get_svg_image(username)` and then using `module_function` on it will make the method available both on the module and to objects where you mixed in the module
[11:46:19] moeabdol: has joined #ruby
[11:46:21] siaW: i get it
[11:46:53] siaW: thanks heroes :)
[11:47:04] siaW: app working perfectly as expected
[11:48:04] pawnbox: has joined #ruby
[11:48:20] jhass: ?styleguide siaw
[11:48:38] jhass: ACTION slaps ruby[bot]
[11:48:52] jhass: anyway, read one, at least your tabbing is a complete mess
[11:49:02] darkxploit: has joined #ruby
[11:53:50] BTRE: has joined #ruby
[11:58:24] karapetyan: has joined #ruby
[12:00:10] stardiviner: has joined #ruby
[12:01:18] maokomioko: has joined #ruby
[12:04:43] n008f4g_: has joined #ruby
[12:05:35] rickmasta: has joined #ruby
[12:06:11] Arcaire_: has joined #ruby
[12:07:42] flashpoint9: has joined #ruby
[12:08:07] navneet_: has joined #ruby
[12:10:08] flashpoint9: has joined #ruby
[12:10:12] synthroid: has joined #ruby
[12:10:33] crameth: has joined #ruby
[12:11:37] synthroid: has joined #ruby
[12:11:37] Xeago: has joined #ruby
[12:15:08] diegoaguilar: has joined #ruby
[12:16:33] Arcaire_: has joined #ruby
[12:19:04] Arcaire: has joined #ruby
[12:19:29] baweaver: has joined #ruby
[12:21:29] diegoaguilar: has joined #ruby
[12:21:55] jaguarmagenta: has joined #ruby
[12:23:20] pawnbox: has joined #ruby
[12:23:54] william3: has joined #ruby
[12:24:02] pawnbox: has joined #ruby
[12:26:03] navneet_: has joined #ruby
[12:26:28] CloCkWeRX: has joined #ruby
[12:29:16] Xeago: has joined #ruby
[12:29:55] aupadhye: has joined #ruby
[12:30:17] gnufied: has joined #ruby
[12:33:44] thejamespinto: has joined #ruby
[12:35:06] TheBrayn: has joined #ruby
[12:35:15] sdothum: has joined #ruby
[12:36:14] bruno-: has joined #ruby
[12:43:14] gnufied: has joined #ruby
[12:43:58] vdamewood: has joined #ruby
[12:45:28] tknz: has joined #ruby
[12:45:53] kareeoleez: has joined #ruby
[12:46:52] GodFather: has joined #ruby
[12:47:35] kimegede: has joined #ruby
[12:50:28] nando294021: has joined #ruby
[12:51:46] sgambino: has joined #ruby
[12:53:50] mfb2: has joined #ruby
[12:54:05] inukshuk_: has joined #ruby
[12:54:46] phaza: has joined #ruby
[12:55:08] LastWhisper____: has joined #ruby
[12:55:59] sandelius: has joined #ruby
[12:56:34] cdg: has joined #ruby
[12:56:47] GinoMan2440: has joined #ruby
[12:58:33] thejamespinto: has joined #ruby
[13:02:49] aegis3121: has joined #ruby
[13:03:02] ramortegui: has joined #ruby
[13:03:20] Shashikant86: has joined #ruby
[13:05:07] thejamespinto: has joined #ruby
[13:06:37] nobitanobi: has joined #ruby
[13:08:02] senayar: has joined #ruby
[13:08:02] senayar: has joined #ruby
[13:08:46] kfpratt: has joined #ruby
[13:09:07] JulienITARD: has joined #ruby
[13:09:19] JulienITARD: Hello, i need help for a regex
[13:10:01] Ox0dea: JulienITARD: Are you trying to parse HTML?
[13:10:13] TomyWork: good guess :D
[13:10:42] JulienITARD: I have string like "15, ABC 12345 CITY" how can i convert it to an array ["15, ABC","12345","CITY"] ?
[13:14:21] Ox0dea: >> "15, ABC 12345 CITY".reverse.split(' ', 3).reverse.map(&:reverse) # JulienITARD
[13:14:22] ruby[bot]: Ox0dea: # => ["15, ABC", "12345", "CITY"] (https://eval.in/557504)
[13:14:30] Ox0dea: Mostly a joke, though.
[13:14:44] Ox0dea: Something akin to #rsplit would be convenient.
[13:15:12] shreeve: has joined #ruby
[13:15:39] JulienITARD: the easy way is to split the string where there is a 5 digits sequence no ?
[13:15:43] jackdaniel: maybe "1 3 4, 5".sub(",", " ").split(" ")
[13:16:06] jackdaniel: (if it's only spaces and commas)
[13:16:10] Ox0dea: JulienITARD: But you also want to keep the 5-digit sequence.
[13:16:23] Ox0dea: #split destroys the delimiter.
[13:16:55] shreeve: looking for an easy way to: iterate through an enumerable, evaluating a block for each element and returning the first non-nil result (not the first non-nil element)
[13:17:07] jackdaniel: ach, delimiter has to be preserved. Sorry, misread the example
[13:17:08] jhass: >> "15, ABC 12345 CITY".split(/ (?<\d{5})/)
[13:17:09] Ox0dea: &ri #find shreeve
[13:17:09] `derpy: shreeve: http://ruby-doc.org/core-2.3.0/Enumerable.html#method-i-find
[13:17:25] jhass: apeiros: ruby[bot] ignores me again :(
[13:17:34] Ox0dea: It knows.
[13:17:39] shreeve: Ox0dea: #find returns the first *element*, not the first *result* of the object that is non-nil
[13:18:14] phaza: has joined #ruby
[13:18:18] toretore: shreeve: inject(nil){|r,e| something || r }
[13:18:38] jhass: JulienITARD: anyway, see above, yes, just use a lookahead to keep the digits
[13:18:48] banister: has joined #ruby
[13:19:02] Ox0dea: toretore: Where does the `nil` get injected?
[13:19:21] toretore: what do you mean?
[13:19:23] BSaboia: has joined #ruby
[13:19:57] jhass: JulienITARD: or well, "15, ABC 12345 CITY".split(/ (?=\d{5})|(?<=\d{5}) /) actually, missed the middle part
[13:20:36] toretore: Ox0dea: i guess it should be the other way around: inject(nil){|r,e| r || something }
[13:20:37] jhass: JulienITARD: .partition(/\d{5}/) if you want to keep the spaces too actually
[13:20:42] rbennacer: has joined #ruby
[13:20:51] Ox0dea: toretore: I was just poking fun at #inject; it's a terrible name.
[13:21:13] toretore: still kind of wasteful without breaking the loop
[13:21:14] htmldrum: has joined #ruby
[13:21:24] malconis: has joined #ruby
[13:21:59] toretore: Ox0dea: reduce then :)
[13:22:04] bronson: has joined #ruby
[13:23:01] Ox0dea: shreeve: Best is probably just `your_enum.lazy.map(foo).find(bar)`.
[13:23:09] LastWhisper____: has joined #ruby
[13:23:20] hogetaro: has joined #ruby
[13:23:41] Ox0dea: There's nothing on Enumerable for this, and an explicit break loop is verboten.
[13:24:22] mikecmpb_: has joined #ruby
[13:24:34] nobitanobi: has joined #ruby
[13:25:03] kfpratt: has joined #ruby
[13:25:52] JulienITARD: jhass: i'll try it
[13:26:33] mfb2: has joined #ruby
[13:28:48] skol: has joined #ruby
[13:29:19] malconis: has joined #ruby
[13:30:44] nobitanobi: has joined #ruby
[13:32:29] godzillaenlacasa: has joined #ruby
[13:35:20] araujo: has joined #ruby
[13:35:29] platzhirsch: has joined #ruby
[13:35:29] apeiros: jhass: :-S
[13:35:58] jhass: shreeve: or .lazy.map(&:foo).drop_while(&:nil?).first
[13:35:58] apeiros: jhass: I'll reboot when I'm back home (~1h)
[13:36:03] swills: has joined #ruby
[13:36:11] nobitano_: has joined #ruby
[13:36:21] jhass: that's not the proper fix :P
[13:36:38] araujo: has joined #ruby
[13:37:03] chagel: has joined #ruby
[13:37:10] ChiefAlexander: has joined #ruby
[13:37:55] ruby[bot]: You think this is broken, could be done better, or have a good feature idea? Submit an issue on the concerned project, or even better, fix it and submit a Pull Request! ;)
[13:38:47] araujo: has joined #ruby
[13:38:52] nobitano_: has joined #ruby
[13:39:29] ChiefAlexander: has joined #ruby
[13:39:42] apeiros: jhass: I know. A proper fix is about 1-2 months away. or 3-4 reboots. I think we'll manage :)
[13:39:42] pawnbox: has joined #ruby
[13:40:30] idefine: has joined #ruby
[13:42:42] ule: has left #ruby: ()
[13:42:54] mfb2: has joined #ruby
[13:44:03] anagha_: has joined #ruby
[13:44:33] phaza: has joined #ruby
[13:44:50] anagha_: How does a string split work?
[13:44:55] sepp2k: has joined #ruby
[13:45:12] anagha_: String#split('Fear is the path to the dark side')
[13:45:49] anagha_: For the above line code the output was just "string"
[13:45:57] dionysus69: has joined #ruby
[13:47:54] stannard: has joined #ruby
[13:48:05] JagaJaga: has joined #ruby
[13:48:06] jhass: anagha_: String#split is documentation notation, it refers to the instance method split of the class String
[13:48:16] JagaJaga: Hello! Anyone form Korea here?
[13:48:44] jhass: meh, I tried :P
[13:48:55] JagaJaga: s/form/from
[13:48:59] xpt: ?anyone JagaJaga
[13:48:59] ruby[bot]: JagaJaga: Just ask your question, if anyone has or can, they will respond.
[13:49:06] ddv: JagaJaga: What Korea
[13:49:07] xpt: JagaJaga: there
[13:49:11] ddv: South or North
[13:49:15] araujo: has joined #ruby
[13:49:18] xpt: jhass: there
[13:49:24] jhass: anagha_: so 'Fear is the path to the dark side' is the string instance here
[13:49:27] jhass: xpt: thanks
[13:49:34] xpt: no problem
[13:49:49] jhass: anagha_: you want to call the split method on it
[13:50:03] jhass: anagha_: a method call has the form of instance.method(arguments)
[13:50:43] garethrees: has joined #ruby
[13:51:58] jhass: has left #ruby: ("WeeChat 1.4")
[13:52:00] jhass: has joined #ruby
[13:52:19] jhass: apeiros: there, part & rejoin worksaround too
[13:53:33] _blizzy_: has joined #ruby
[13:55:58] nando293921: has joined #ruby
[14:00:19] n008f4g_: has joined #ruby
[14:01:06] griffindy: has joined #ruby
[14:01:58] agent_white: has joined #ruby
[14:02:03] Sadin: has joined #ruby
[14:03:07] Rubie: has joined #ruby
[14:03:15] mfb2: has joined #ruby
[14:03:30] stannard: has joined #ruby
[14:03:32] hartuok: has joined #ruby
[14:04:50] sepp2k: has joined #ruby
[14:05:00] morochena: has joined #ruby
[14:05:10] TvL2386: has joined #ruby
[14:05:31] idle_task: has joined #ruby
[14:05:33] tinnvec: has joined #ruby
[14:08:02] tinnvec: has joined #ruby
[14:08:20] moeabdol: has joined #ruby
[14:09:48] phaza: has joined #ruby
[14:10:56] LastWhisper____: has joined #ruby
[14:11:38] norc: has joined #ruby
[14:11:42] thejamespinto_: has joined #ruby
[14:12:00] JulienITARD: jhass: It works tanks you
[14:12:03] norc: I feel stupid.
[14:12:18] norc: How can adding line 3 possibly change the behaviour of this code? https://gist.github.com/norc/e20a7065fa6a880c9a5610669aaae782
[14:12:41] poerror: has joined #ruby
[14:12:45] theunraveler: has joined #ruby
[14:13:19] jhass: why do you parse XML with regex? :P scnr
[14:13:23] Yiota: has joined #ruby
[14:13:41] mrmortondk: has joined #ruby
[14:14:01] whippythellama: has joined #ruby
[14:14:02] norc: jhass: Because I dont really care about XML in the slightest. But that is really besides the point.
[14:14:37] norc: The exception in line 2 is never raised, but line 3 is always executed.
[14:14:38] jhass: hence "scnr"
[14:15:27] jhass: anyway, not self contained so rather hard to poke at it
[14:16:28] diegoaguilar: has joined #ruby
[14:16:57] norc: jhass: There should not be anything in Ruby that allows execution to take place after an unconditional raise, should it?
[14:17:23] phaza: has joined #ruby
[14:17:25] jhass: not aware of it
[14:17:29] LoneHermit: has joined #ruby
[14:18:14] norc: Then I think I must have stumbled onto some bizarre parsing bug.
[14:18:45] mfb2: has joined #ruby
[14:18:47] shreeve: has joined #ruby
[14:19:24] raeoks: has joined #ruby
[14:19:54] rbennacer: has joined #ruby
[14:20:36] perlgod: has joined #ruby
[14:20:44] baweaver: has joined #ruby
[14:21:02] rbennacer: has joined #ruby
[14:22:11] norc: jhass: I cannot extract a test case from it, and reducing it from a full rails application would be quite an undertaking...
[14:22:27] norc: Though I have isolated that specific line #3 to have a side effect on the code that follows.
[14:22:38] jaguarmagenta: has joined #ruby
[14:23:00] Raboo: has joined #ruby
[14:23:48] ponga: has joined #ruby
[14:24:03] Emmanuel_Chanel: has joined #ruby
[14:24:23] idefine: has joined #ruby
[14:24:33] Emmanuel_Chanel: has joined #ruby
[14:24:54] kp666: has joined #ruby
[14:26:10] TvL2386: has joined #ruby
[14:26:27] mfb2: has joined #ruby
[14:26:37] bruno-: has joined #ruby
[14:30:37] daguilaraguilar: has joined #ruby
[14:31:39] bruno-: has joined #ruby
[14:32:24] pawnbox: has joined #ruby
[14:33:15] norc: Well, I created a test case.
[14:34:44] norc: This is definitely some serious bug.
[14:36:13] toretore: let's see it
[14:36:20] mfb2: has joined #ruby
[14:37:28] idefine: has joined #ruby
[14:40:52] idefine_: has joined #ruby
[14:41:06] mustmodify: has joined #ruby
[14:41:16] mustmodify: If I said I had a pass-through equation, what would that mean to you?
[14:41:45] mustmodify: if anything?
[14:41:50] zast: has joined #ruby
[14:41:58] waxxy: not a lot
[14:42:06] coooas: has joined #ruby
[14:42:22] mustmodify: yeah, that's what I thought. :(
[14:42:41] dhollinger: has joined #ruby
[14:43:07] waxxy: norc: a monkey patched Kernel#raise?
[14:43:32] idefine: has joined #ruby
[14:43:34] mustmodify: waxxy: NEVER SUGGEST THAT AGAIN.
[14:43:43] rickmasta: has joined #ruby
[14:43:45] gdp: has joined #ruby
[14:43:49] mustmodify: I didn't see the question or whatever but... I'm against patching #raise. :)
[14:43:52] idefine_: has joined #ruby
[14:44:04] jhass: ?logs mustmodify
[14:44:04] ruby[bot]: mustmodify: You can find a log of this channel at http://irclog.whitequark.org/ruby/
[14:44:22] mustmodify: jhass: so some things are ! and some are ?...
[14:44:30] waxxy: mustmodify i'd never do that
[14:44:33] ruby[bot]: jhass: You can find a log of this channel at http://irclog.whitequark.org/ruby/
[14:45:00] mustmodify: waxxy: I'm against even joking about it. :P
[14:45:16] waxxy: check the logs ;)
[14:45:47] jhass: mustmodify: nothing you can use starts with ! here ;)
[14:45:47] norc: has joined #ruby
[14:45:51] apeiros: the ? are factoids
[14:45:58] rickmasta: has joined #ruby
[14:46:26] apeiros: there are some commands (!) which can be used by registered users. not sure whether there's any for unregistered users.
[14:46:28] ruby[bot]: don't be mean to adaedra
[14:46:46] jhass: huh, there is by now?
[14:46:55] mfb2: has joined #ruby
[14:46:59] adaedra: thanks for the gratuitous highlight
[14:46:59] karapetyan: has joined #ruby
[14:47:01] norc: jhass: Oh. I just realized, this might not be a bug, but a strange side effect from the way lvars exist.
[14:47:09] mustmodify: waxxy: Ah, yes. You are not the weakest link. Your answer is correct.
[14:47:11] apeiros: jhass: yeah, from the beginning. stuff like !ops
[14:47:22] norc: By the time the if clause is parsed, an lvar is created, and any subsequent reference uses that lvar.
[14:47:34] Xeago: has joined #ruby
[14:47:34] norc: Sorry, I meant LEXED.
[14:48:04] norc: apeiros: https://eval.in/557630
[14:48:12] norc: Here. Which brings us back to the topic we once had.
[14:48:22] norc: lvars should be created on execution. not lexing.
[14:48:26] jhass: norc: oh, so addr is a method call initially?
[14:48:40] jhass: well that was the missing context then :)
[14:49:04] jhass: nil =~ /../ is never true
[14:49:07] apeiros: sad rule of ruby: don't shadow method calls with lvars
[14:49:07] waxxy: we should all switch to using parentheses to avoid this confusion in the future!
[14:49:35] apeiros: s/ calls/s/
[14:49:36] rickmasta: has joined #ruby
[14:50:05] bruno-: has joined #ruby
[14:50:14] norc: apeiros: Things like this really make me appreciate having to declare all variables for a given scope.
[14:50:24] paultreny: has joined #ruby
[14:50:36] apeiros: things like that make me appreciate unambiguous syntax
[14:50:43] norc: I mean for languages like C it is a necessity because it needs to know how much space a function needs.
[14:50:51] phaza: has joined #ruby
[14:51:06] jhass: apeiros: right, forgot about !ops
[14:51:29] rippa: has joined #ruby
[14:51:38] norc: jhass: So yeah. I guess the lexer introducing lvars is the one and only side effect that can occur in dead code... :)
[14:51:43] norc: (And thus shadowing methods)
[14:52:13] paultreny_: has joined #ruby
[14:52:15] poerror: has joined #ruby
[14:53:39] poerror: has left #ruby: ()
[14:53:47] jhn: has joined #ruby
[14:53:50] jhass: I actually know that problem well, just didn't come to mind for a second that addr could be a method call
[14:53:59] idefine: has joined #ruby
[14:54:02] jhass: context helps so much ;)
[14:54:05] mustmodify: norc: So you had a conflict between a local var and a method name?
[14:54:13] norc: mustmodify: https://eval.in/557630
[14:54:36] idefine: has joined #ruby
[14:54:42] norc: mustmodify: My real mistake was that I accidentally tried using an attr_reader to write back.
[14:54:56] mustmodify: yeah that's not confusing.
[14:55:06] mustmodify: I mean, not the bug, but the code.
[14:55:09] mustmodify: Don't do that. :P
[14:55:27] SilverKey: has joined #ruby
[14:55:27] norc: mustmodify: No it is confusing, but it is one of these things that are unlikely to change.
[14:55:57] apeiros: mustmodify: pass-through equations - you must modify it. passing through stuff to make them equate is bad, m'kay? (I have no idea what a pass-through equation is)
[14:56:06] mustmodify: You're unlikely to stop having local variables with the same name as declared messages? Well then you're going to have a hard life.
[14:56:26] mustmodify: apeiros: thanks. Yeah, I think it's just not a good name.
[14:56:37] mustmodify: apeiros: or it's very specific to my situation.
[14:56:39] apeiros: mustmodify: care to enlighten us about the context?
[14:57:31] apeiros: google yields one equation which is used to intersect two lines…
[14:58:53] Sadin: has joined #ruby
[14:58:58] norc: mustmodify: Ruby is not known for making incompatible changes.
[14:59:09] mustmodify: sure. I have what I'm calling a micro-emr. We don't do a lot of EMR stuff, but we do collect data, do some conversions, etc., solely in support of a medical report. Some results, like bmi, are calculated based on height and weight. So we have equations. We also have some results, like Physiological Age, which are mapped to a specific other value. It isn't calculated... it's just a reference to another equation-or-value.
[14:59:27] darkxploit: has joined #ruby
[14:59:40] mustmodify: So instead of writing code to support that separately, I just created an equation with a single variable.
[14:59:43] jhass: well, MRI isn't, the community is doing it quite a bit more than elsewhere IME
[14:59:54] norc: jhass: Agreed.
[14:59:57] mustmodify: it's a pass-through equation in that we aren't doing any math... we're just passing another value through.
[15:00:38] AlexRussia: has joined #ruby
[15:00:52] norc: jhass: But even JRuby strives to mimic MRIs behaviour with all the bizarre things.
[15:01:12] jhass: well sure, it tries to be a drop in replacement
[15:01:13] waxxy: excuse my ignorance, but if it's a value, why would you call it an equation?
[15:01:14] apeiros: mustmodify: ok, not sure I fully grasped what you're saying. but I guess I wouldn't have the term "equation" in it if there is no math.
[15:01:25] norc: Heck I even managed to find a corner case where I managed to actually crash MRI and JRuby using the same code. That made me smile.
[15:01:38] norc: Fully compatible, even the bugs!
[15:01:58] Xeago: has joined #ruby
[15:04:52] bruno-: has joined #ruby
[15:06:18] htmldrum: has joined #ruby
[15:07:53] mfb2: has joined #ruby
[15:10:05] shibly: has joined #ruby
[15:10:39] shibly: I can't choose one. Python or Ruby, which one should i choose for web development?
[15:10:59] apeiros: toss a coin
[15:11:10] apeiros: why do you think we could make the decision for you?
[15:11:15] tubbo: shibly: python
[15:11:29] szulak: has joined #ruby
[15:11:49] shibly: tubbo, Why?
[15:12:34] apeiros: oh right, and:
[15:12:35] haylon: has joined #ruby
[15:12:37] apeiros: ?crosspost shibly
[15:12:38] ruby[bot]: shibly: Please do not crosspost without at least telling so and mentioning provided suggestions and their outcome in all channels. Experience shows that people don't do either, and not doing so is considered rude.
[15:12:46] finisherr: has joined #ruby
[15:12:48] tubbo: because the coin flip resulted in heads ;)
[15:13:03] apeiros: ^5 tubbo :D
[15:13:04] x77686d: has joined #ruby
[15:14:00] shevy: shibly is evil? :(
[15:14:35] apeiros: shevy: I wouldn't go as far as calling cross-posters evil. why?
[15:14:42] shevy: he crossposted!
[15:14:57] bruno-: has joined #ruby
[15:15:05] tubbo: shibly: why only python & ruby?
[15:15:30] tubbo: i put it to you! how did you come up with this choice?
[15:15:48] shevy: tubbo hmm was there not a similar conversation yesterday...
[15:16:00] kareeoleez: has joined #ruby
[15:16:25] Shashikant86: has joined #ruby
[15:16:27] shibly: tubbo, What else would you want to select?
[15:16:53] shibly: It's for web development.
[15:17:14] tubbo: shibly: well there's Go, Elixir, PHP, C++, Lua, JavaScript, Smalltalk, Erlang, Perl
[15:17:41] tubbo: shibly: all of these languages, while generally regarded as "general purpose", can be used for web development. and you'd be surprised at how many of your favorite sites are implemented in wacky languages for web dev.
[15:17:50] rkazak: has joined #ruby
[15:18:04] shevy: I like whacky
[15:19:12] jhass: shibly: pick Crystal!
[15:19:41] shibly: tubbo, You didn't mention C#.NET, java
[15:19:46] shevy: ohhh you indeed forgot crystal tubbo!
[15:19:59] kaleido: C# and java make baby jesus cry
[15:20:15] kaleido: .NET was used by the nazis in 1939
[15:20:15] apeiros: kaleido: that's no reason not to choose them!
[15:20:18] tubbo: shibly: you are correct.
[15:20:21] mustmodify: kaleido: LOL
[15:20:27] tubbo: shevy: i am currently developing a web framework in crystal SHHHHHHH
[15:20:34] DaniG2k: has joined #ruby
[15:20:39] smathy: has joined #ruby
[15:21:12] shevy: apeiros had a big ass web framework in php
[15:21:18] shevy: manveru too I think
[15:21:39] tubbo: shibly: have you done any programming before or are you just getting started to the whole thing?
[15:22:32] TomyWork: what do i need to implement in order to sort an array of my class's instances? <=>?
[15:22:50] apeiros: TomyWork: yes
[15:23:01] shibly: tubbo, I have worked with php, rails
[15:23:02] apeiros: TomyWork: for good measure, also include Comparable
[15:23:03] Shashikant86: has joined #ruby
[15:23:16] shibly: tubbo, And doing fun with django
[15:23:32] mfb2: has joined #ruby
[15:23:32] sepp2k: has joined #ruby
[15:23:45] blackmesa: has joined #ruby
[15:23:48] tubbo: shibly: i came from php as well
[15:23:50] cschneid: has joined #ruby
[15:24:02] bronson: has joined #ruby
[15:24:23] tubbo: also did some stuff in python for Sick-Beard which was pretty fun, but reminded me about how much more i enjoyed ruby
[15:24:32] Devalo: has joined #ruby
[15:24:39] apeiros: heh, over in #python: `17:12 philr: shibly: Ruby`
[15:25:25] shibly: apeiros, But he didn't mention the reason to use ruby.
[15:25:28] tubbo: apeiros: we came to using https://github.com/apeiros/chronos at the job
[15:25:53] tubbo: it's p. cool
[15:25:56] shevy: shibly the differences are not huge
[15:25:59] apeiros: tubbo: oy, for real? it's… like… super old and unmaintained (there is a JS port on the way, though)
[15:26:01] shevy: the biggest one is the philosophy
[15:26:11] apeiros: tubbo: make sure to send patches :D
[15:26:53] tubbo: apeiros: well we found this other thing that did more what we wanted https://github.com/ondrejbartas/sidekiq-cron
[15:26:58] apeiros: tubbo: and of course thanks for the compliment! :D
[15:27:02] tubbo: we were trying to replace sidetiq
[15:27:09] shevy: apeiros wrote so many things that he is already forgetting half of his old stuff - like butler! ;P
[15:27:35] apeiros: shevy: na, didn't forget. it just became heck of a lot more difficult to maintain that stuff with a 100% job :-/
[15:27:40] shibly: has left #ruby: ("Leaving")
[15:27:48] apeiros: and I have far too many fun side projects
[15:32:23] rbennacer: has joined #ruby
[15:33:12] kits: has joined #ruby
[15:33:55] TomyWork: apeiros hmm i just figured out that i only have a "less than" operation on the backend
[15:34:01] rbennacer: has joined #ruby
[15:34:14] TomyWork: i tried implementing < instead and including Comparable... didn't work
[15:34:21] TomyWork: ./foo.rb:66: stack level too deep (SystemStackError)
[15:36:28] myntcake: has joined #ruby
[15:36:49] x77686d: has joined #ruby
[15:37:29] smathy: Sounds like you're probably calling <=> within your <=>
[15:37:44] Yiota: has joined #ruby
[15:37:46] agentmeerkat: has joined #ruby
[15:37:57] IrishGringo: has joined #ruby
[15:38:34] TomyWork: does Comparable do that?
[15:38:49] kareeoleez: has joined #ruby
[15:38:59] fedexo: has joined #ruby
[15:39:02] tubuliferous: has joined #ruby
[15:39:43] TomyWork: well i removed Comparable and added a few more non-<=> operators. now it no longer crashes
[15:39:49] TomyWork: but it doesnt sort
[15:39:55] TomyWork: i'll check my criterion
[15:40:25] nando294021: has joined #ruby
[15:41:28] mfb2: has joined #ruby
[15:41:46] KnownSyntax_: has joined #ruby
[15:42:19] bradleyprice: has joined #ruby
[15:43:22] shredding: has joined #ruby
[15:44:02] cdg: has joined #ruby
[15:44:18] smathy: Does Comparable do what? It doesn't insert <=> calls into your <=> method, nor create other infinite loops.
[15:46:02] TomyWork: well i dont know... i'm not doing any recursion
[15:46:11] TomyWork: not even accidental
[15:46:44] TomyWork: Comparable gives me < > <= >= == if i define <=>
[15:46:56] TomyWork: i need the inverse :)
[15:46:58] shibly: has joined #ruby
[15:47:16] shevy: the inverse?
[15:47:21] armyriad: has joined #ruby
[15:47:23] TomyWork: or a way to sort given <, <=, ==, !=, >=, and >
[15:47:30] shibly: shevy, What did you mean by philosophy?
[15:48:05] shevy: shibly http://www.artima.com/intv/ruby.html - you'll notice a difference when you are using ruby (and have been using another programming language before, such as PHP)
[15:48:18] SilverKey: has joined #ruby
[15:48:33] shevy: things such as .map versus .collect
[15:48:45] shevy: if it would be python, there would be only .map
[15:49:10] smathy: TomyWork, they all call <=> - that's the whole idea of redefining <=>
[15:49:28] smathy: TomyWork, so maybe you're calling one of those in your <=>
[15:49:31] [Butch]: has joined #ruby
[15:49:33] tubuliferous: has joined #ruby
[15:49:46] mfb2: has joined #ruby
[15:49:47] smathy: (which would explain why the SystemStackError went away when you stopped including Comparable.
[15:50:01] stennowork: has joined #ruby
[15:50:19] TomyWork: smathy i dont have a <=> yet
[15:51:15] shibly: Python users will suggest to use python, ruby users will suggest to use ruby, then which one is to select?
[15:51:22] marr: has joined #ruby
[15:51:30] Yiota: has joined #ruby
[15:51:40] shibly: Others will say that their language is good.
[15:51:43] TomyWork: i'm kidding. perl is horrible
[15:51:49] shibly: TomyWork, Perl is old.
[15:51:59] shibly: TomyWork, Why is perl horrible.
[15:52:05] TomyWork: because it's old
[15:52:12] smathy: TomyWork, I'm so lost, you started out asking about <=> - you're telling me that you didn't override that? That *is* what you have to override to affect sort.
[15:52:14] mlakewood: has joined #ruby
[15:52:34] shibly: Perl is higly used in linux system.
[15:52:35] stennowork: are native extensions written exclusively in C, or can they also be written in C++?
[15:52:38] shevy: shibly but the difference is so small
[15:53:13] TomyWork: smathy ok i'll start over: i want to sort an array of instances of my class, and i have every comparison operator except <=>
[15:53:14] Asher: has joined #ruby
[15:53:32] stennowork: this tutorial i am following says in order to install passenger, you need c++
[15:53:40] smathy: TomyWork, why do you have the other operators?
[15:53:41] stennowork: (install from gem)
[15:53:48] shevy: stennowork you can use C++ too. hanmac here does so, he maintains one wxwidgets binding for ruby in C++ https://github.com/Hanmac/rwx
[15:53:57] stennowork: i see, thanks
[15:53:58] TomyWork: smathy because the backend implements them
[15:54:10] TomyWork: it does not implement anything similar to <=>
[15:54:20] smathy: TomyWork, what's "the backend"?
[15:54:32] TomyWork: dpkg --compare-versions
[15:54:39] JagaJaga: has joined #ruby
[15:54:41] shibly: shevy, Difference of what?
[15:55:12] siaW: has joined #ruby
[15:55:13] Hanmac: stennowork: you can do: C++ stuff <=> C function <=> Ruby API to connect ruby with C++ functions
[15:55:34] TomyWork: hanmac wont Inline work?
[15:55:50] stennowork: thanks for the info
[15:56:10] smathy: TomyWork, umm, I'm reading between the lines a bit here, so your class represents a package, and you're wanting to do various comparisons on them, and you thought in order to do that you had to implement all the comparison operators in your own class?
[15:56:12] shevy: shibly between ruby and python
[15:56:26] smathy: TomyWork, and now you're stuck because the tool you're calling out to doesn't have any notion of <=> ?
[15:56:35] TomyWork: smathy i thought that would be helpful, yes :)
[15:56:41] Hanmac: TomyWork: hm i use macros to turn C++ getter/setter into c functions i can bind to the ruby api
[15:56:51] smathy: TomyWork, ok, so you're ass backwards. Read this: http://devdocs.io/ruby~2.3/comparable
[15:57:00] brent__: has joined #ruby
[15:57:06] TomyWork: i could implement <=> in terms of the others, but i dont want to shell out more than necessary
[15:57:08] Yiota: has joined #ruby
[15:57:10] mfb2: has joined #ruby
[15:57:19] shevy: whoa... cool site. that looks better than rubydoc
[15:57:58] wilbert: has joined #ruby
[15:58:06] chagel: has joined #ruby
[15:58:08] smathy: TomyWork, read what I linked you to.
[15:58:09] TomyWork: smathy "The class must define the <=> operator" - i dont have one
[15:58:15] stennowork: assuming i know 1.9.2 pretty well, how difficult would it be to get used to 2.x?
[15:58:24] smathy: TomyWork, if you want sort then you have to have one.
[15:58:32] smathy: TomyWork, ...and read the whole thing.
[15:58:43] TomyWork: i already did 20 minutes ago :)
[15:58:55] shevy: stennowork should be quite simple really. may depend on how much code you have
[15:59:01] smathy: TomyWork, excellent, so you realize you made a mistake implementing each of the other comparison operators individualy..
[15:59:10] shevy: 1.8.x to 1.9.x was bigger than 1.9.x to 2.x really
[15:59:20] stennowork: right, thats what i wanted to ask :P
[15:59:37] TomyWork: smathy like i said, i want to minimize the amount of dpkg invocations for performance reasons
[15:59:39] brent__: Hello, hoping to get some help w/ this battleship game i'm working on, I"m getting an error when running the rspec test saying wrogn number of arguments. the attached gist has the Board & Game class along w/ the error https://gist.github.com/brentluna/7bea3c5091938f90c79e156936056ed0
[15:59:40] stennowork: 1.8., where string[index] still returned the char code :P
[15:59:54] shevy: I still use [number1,number2] out of habit!
[16:00:00] smathy: TomyWork, that goal has zero impact on the way to proceed.
[16:00:16] elifoster: has joined #ruby
[16:00:26] TomyWork: smathy but if every invocation of <=> shells out on average 2 times
[16:00:32] TomyWork: then that's bad
[16:00:34] brent__: i was under the impression taht since i'm using the splat operator, i was actually giving the board#[] method 2 args instead of 1
[16:00:59] mustmodify: brent__: I don't think your gist's line numbers are the same as in your original file... line 43 is blank.
[16:01:18] brent__: you may be right
[16:01:22] smathy: TomyWork, how are you doing it for the other operators? Just do it the same, it'll have the same perf impact.
[16:01:24] brent__: let me see what it corresponds to
[16:01:36] TomyWork: c++'s sort stuff uses a less than operator (or was it less-or-equal?), so i figured maybe ruby has that too
[16:01:54] brent__: mustmodify: it's referring to line 45 the #[] method
[16:01:56] amclain: has joined #ruby
[16:02:03] synthroid: has joined #ruby
[16:02:04] smathy: TomyWork, ...but now you've read that Comparable page, so you know better.
[16:02:09] TomyWork: smathy the other operators shell out once each
[16:02:45] TomyWork: smathy yes i know better about what's necessary in order to use the Comparable mixin
[16:02:47] smathy: TomyWork, because you already shelled out once for the object itself, but you can't `sort` an array of your objects like that.
[16:02:55] idefine_: has joined #ruby
[16:03:10] shevy: brent__ you probably still only pass the first argument, in array form there. you can find out though, add a second argument via a "," and then the invocation would happen without the error assumingly
[16:03:11] TomyWork: doesnt mean there isnt a sorting algorithm somewhere that's based on less-than operators
[16:03:20] smathy: TomyWork, if you're worried about performance then I'd approach that problem separately, eg. by caching.
[16:03:22] araujo_: has joined #ruby
[16:03:27] mustmodify: brent__: How do you initialize your grid? I suspect what you want is @grid[row, col]
[16:03:44] stennowork: could procs/lambdas be considered first class function (method) objects?
[16:03:47] Mia: has joined #ruby
[16:03:48] Mia: has joined #ruby
[16:03:59] toretore: stennowork: yes
[16:04:01] smathy: TomyWork, I'm sure you could write your own, but it doesn't matter because in an array of objects it will always be comparing two at a time, hence two shell-outs.
[16:04:05] TomyWork: smathy there's not a lot of caching i can do. dpkg --compare-versions already does compare the plain version numbers
[16:04:09] bruno-: has joined #ruby
[16:04:18] TomyWork: it doesnt compare packages if that's what you thought
[16:04:33] smathy: TomyWork, you can use sort_by in Ruby to make that only shell out once for each unique object, or you can create your own caching solution.
[16:04:42] brent__: mustmodify: the gird is intialized as a arg for initializing the game
[16:05:01] smathy: TomyWork, but you can cache the result of the shell-out.
[16:05:08] mustmodify: brent__: show me
[16:05:09] brent__: it's a 2-dimensional array
[16:05:11] idefine_: has joined #ruby
[16:05:18] TomyWork: smathy did i mention that debian's version comparison is a complicated algorithm?
[16:05:31] smathy: TomyWork, you mention a lot of irrelevant stuff.
[16:05:38] antgel: has joined #ruby
[16:05:43] mustmodify: brent__: well then [x, y] instead of [x][y]
[16:05:46] smathy: TomyWork, why do you think that impacts the solution?
[16:05:58] Dimik: has joined #ruby
[16:06:06] mustmodify: brent__: [x][y] would be for an array of arrays.
[16:06:21] brent__: mustmodify: it's the first 2 methods of the Board class, can you elaborate why it would be [x, y] instead of [x][y]
[16:06:54] brent__: it is: @grid = Array.new(10){ Array.new(10) }
[16:06:55] symm-: has joined #ruby
[16:06:57] TomyWork: i cant compare them without dpkg --compare-versions. so the only caching i could do would only be useful if the same pair of objects is compared twice. a good sorting algorithm (i.e. not bogosort) will not let that happen
[16:07:11] TomyWork: even bubblesort compares each pair at most once
[16:07:14] shibly: has left #ruby: ("Leaving")
[16:07:39] mustmodify: brent__: missed that method somehow. So you have an array of arrays.
[16:07:58] helpa: has joined #ruby
[16:08:18] smathy: TomyWork, again, reading between the lines, you're saying that what you're calling out two needs to be sent the two different packages for any comparison? So in your `<` implementation you're shelling out once, but sending BOTH versions/package-details?
[16:08:22] mustmodify: brent__: please add your failing test to the gist.
[16:08:42] brent__: mustmodify: it is in the gist
[16:08:59] diegoaguilar: has joined #ruby
[16:09:18] TomyWork: smathy my < implementation is roughly: return system("dpkg --compare-versions '#{@version}' lt '#{other.version}'")
[16:09:30] diegoaguilar: has joined #ruby
[16:09:34] brent__: https://gist.github.com/brentluna/7bea3c5091938f90c79e156936056ed0 i added the rspec test file
[16:10:20] mustmodify: brent__: great. When you said that I was like, "I know I didn't miss *that*."
[16:10:31] mustmodify: brent__: why [[1,1]] instead of just 1,1?
[16:10:41] smathy: TomyWork, ok, and what does that return?
[16:11:04] TomyWork: true if @version is less than other.version, false otherwise
[16:11:13] brent__: mustmodify: where? in the rspec test?
[16:11:20] mustmodify: brent__: rather, [1,1]
[16:11:23] smathy: TomyWork, ...so false if they're the same?
[16:11:28] brent__: expect(game.board[[1,1]])..?
[16:11:39] mustmodify: yes, board is an array of arrays. So you want to first access the row, then the column.
[16:11:43] smathy: Heh, ok, so that's terrible.
[16:11:46] mustmodify: So you want game.board[1,1]
[16:11:47] brent__: i just noticed that as well
[16:11:57] brent__: it's a given rspec file that we had to pass
[16:12:07] mustmodify: brent: Oh... hm...
[16:12:07] TomyWork: it's only terrible if you want to implement <=> with it :)
[16:12:16] brent__: but it seems like it should be game.board[1, 1].to eq(:x)
[16:12:45] RegulationD: has joined #ruby
[16:12:49] smathy: TomyWork, well no, it's terrible for ANY engine that follows a standard approach to collation.
[16:12:59] rbennacer: has joined #ruby
[16:13:02] smathy: TomyWork, collating always needs three different values for less, same, greater.
[16:13:23] brent__: mustmodify: removing the extra [] from the test gets it to pass,
[16:13:24] mustmodify: Yep. is this for a tutorial or a class?
[16:13:34] smathy: TomyWork, it'd be the same if you wanted to have a DB of some sort order those for you.
[16:13:36] smathy: TomyWork, and there's no other call you can make to just get some sort of consolidated value for the version? A plain integer or bitmask or something that would make sense out in the real world?
[16:13:37] brent__: it seems like it shoudl only have single brackets, based on my knowledge
[16:14:04] brent__: I guess a class. prepwork for a bootcamp
[16:14:04] rbennacer: has joined #ruby
[16:14:08] mustmodify: brent__: either way, check the original spec to verify. If that's right, and you think it's not likely a typo. then I would ...
[16:14:13] TomyWork: smathy i did mention C++'s approach
[16:14:33] TomyWork: http://www.cplusplus.com/reference/algorithm/sort/
[16:14:33] mustmodify: I would never do it that way, so I don't know.
[16:14:46] TomyWork: "The elements are compared using operator<"
[16:15:07] mustmodify: Ah... If Game#board was a hash, which is how you would simulate a 2-dimensional array, then it would work.
[16:15:13] allcentury: has joined #ruby
[16:15:34] mustmodify: it would be like {[1,1] => nil, [1,2] => nil, [1,3] => ..., ... [5, 5] => ... }
[16:15:44] mustmodify: Or really, just Hash.new
[16:16:09] baweaver: has joined #ruby
[16:16:18] mustmodify: which would take up less memory than the way you're doing it. Still, I would rather the spec be implementation-agnostic.
[16:16:48] TomyWork: smathy nope. librpm has a 3-way comparison function, though, which i'm going to use once i get to RPMs :)
[16:16:56] ramfjord: has joined #ruby
[16:17:15] TomyWork: but for .debs, i havent found a 3-way comparison function
[16:17:21] TomyWork: or a library, for that matter
[16:17:44] brent__: mustmodify: i was looking over the forums, it looks like they expect you to right a different syntatic sugar method for [] and []=
[16:17:50] smathy: TomyWork, you did, not sure what your point is, you want to use C++ instead?
[16:18:18] smathy: TomyWork, doesn't even need to be the cmp operator, just needs to give you a meaningful value.
[16:18:26] mustmodify: brent__: do you have enough to solve your issue?
[16:18:38] brent__: giving it a shot now
[16:18:44] Xeago: has joined #ruby
[16:19:01] brent__: it sounds like they want the #[] to take 1 arg isntead fo 2
[16:19:11] TomyWork: my point is, either you're saying C++ doesn't use a standard approach to collation or using a '<' operator to sort things is a standard approach to collation :)
[16:19:37] smathy: TomyWork, definitely the sort algorithms you can use with just a < approach are limited.
[16:19:47] Raboo: has joined #ruby
[16:19:49] TomyWork: in what way?
[16:19:50] Spami: has joined #ruby
[16:19:53] bruno-: has joined #ruby
[16:20:03] TomyWork: C++ sorts just fine. even has a stable sort
[16:20:29] Weavel: has joined #ruby
[16:21:33] TomyWork: ( http://www.cplusplus.com/reference/algorithm/stable_sort/ )
[16:21:38] karapetyan: has joined #ruby
[16:21:39] Cohedrin: has joined #ruby
[16:22:23] toretore: TomyWork: have you looked at https://github.com/spk/ruby-apt-pkg/blob/master/ext/apt_pkg/apt-pkg.cpp#L51 ?
[16:22:28] hxegon: has joined #ruby
[16:22:32] brent__: mustmodify, so i changed the #[] to [](pos);row,col = pos; @grid[row][col];end and then removed the splat from the BattleshipGame#attack method and seemed to work
[16:23:16] TomyWork: toretore owww, now how do i get to that function? :D
[16:23:18] TomyWork: ACTION digs
[16:23:24] Rodya_: has joined #ruby
[16:23:27] jaguarmagenta: has joined #ruby
[16:23:46] TomyWork: oh wait, that isn't apt, it's a rubygem
[16:24:02] kspencer: has joined #ruby
[16:24:57] brent__: thanks for the help mustmodify
[16:25:21] smathy: TomyWork, I'm not going to explain the complexities of into sort algorithms to you (for free), if you're interested in the theory here then you can start here: https://en.wikipedia.org/wiki/Three-way_comparison
[16:26:07] wilbert: has joined #ruby
[16:26:48] blackmesa: has joined #ruby
[16:27:07] mustmodify: brent__: ok. I don't have a problem with them requiring you to have a specific implementation, but know that, on an interface level, that isn't what I would call a good long-term solution.
[16:27:14] mustmodify: brent__: good luck.
[16:27:16] idefine: has joined #ruby
[16:27:33] brent__: mustmodify, woudl you mind explaining?
[16:28:00] bradleyprice: has joined #ruby
[16:28:06] mustmodify: sure. awkward or implementation-specific interfaces suck.
[16:28:10] TomyWork: smathy well if you bring in the mathematics. order relations are defined by what's less-than what. all else follows.
[16:28:28] JohnBat26: has joined #ruby
[16:28:38] mustmodify: brent__: because they pin you down.
[16:28:46] TomyWork: or more commonly less-or-equal
[16:28:53] brent__: are you referring to the need for the specific syntatic sugar method?
[16:29:14] TomyWork: but it's really equivalent, because (a<b) == !(b<a)
[16:29:33] TomyWork: err one second
[16:29:37] charliesome: has joined #ruby
[16:29:39] TomyWork: but it's really equivalent, because (a<=b) == !(b<a)
[16:29:48] mustmodify: I often find myself changing back-end implementations because an app has grown and that part of the code is now slow or doesn't meet a new requirement. I don't want to have a cascading sequence of things to change. I want to change just the one part. So your interfaces need to work hard to hide the inner mechanisms.
[16:30:31] mikecmpbll: has joined #ruby
[16:31:24] yxhuvud: has joined #ruby
[16:31:41] brent__: could you provide an example of what you would change to "hide the inner mechanisms"
[16:31:45] mustmodify: brent__: So I would rather the test be game.board[1,1]. No matter how you store the board, you can use a `def []` method and provide results.
[16:32:53] phaza: has joined #ruby
[16:33:20] Norrin: has joined #ruby
[16:33:25] rbennacer: has joined #ruby
[16:34:39] bruno-: has joined #ruby
[16:37:49] smathy: TomyWork, as I said, you can't use certain sort algorithms with that, like qsort. Anyway, digging into dpkg for you it looks like it *does* implement the cmp function: https://github.com/grondo/apt/blob/52df3fd91fd5e53ed982bbf6bc3203bb371f237e/apt/apt-pkg/deb/debversion.cc#L33-L121
[16:37:54] tribals: has joined #ruby
[16:38:19] Rubie: has joined #ruby
[16:38:20] smathy: TomyWork, that seems to be what that ruby gem exposes.
[16:38:24] tribals: what is the meaning of `SomeClass()` construct?
[16:39:30] n008f4g_: has joined #ruby
[16:39:42] toretore: tribals: do you have a concrete example?
[16:39:54] TomyWork: that goes on until line 195, btw.... 160 lines for that, wow
[16:40:04] idefine: has joined #ruby
[16:40:16] tribals: yes, `Array(name.is_a?(Hash) ? controller.url_for(name).split("://").last : name)`
[16:40:30] toretore: tribals: Array is a method defined on Kernel
[16:40:42] toretore: it's not a "call" to the Array class
[16:40:48] RegulationD: has joined #ruby
[16:41:10] TomyWork: libapt-pkg is the library... let's see if i can get at that with ffi :)
[16:41:20] toretore: tribals: for Kernel#Array specifically, it will try to convert whatever it's given to an array
[16:41:29] _wwwbukolaycom: has joined #ruby
[16:41:34] smathy: TomyWork, umm, no, there's DoCmpVersion starting at line 127. That calls CmpFragment - which is where the cmp logic is.
[16:41:38] TomyWork: oh, probably not... it uses start/end pointers and it's a C++ thing
[16:41:49] tribals: toretore: thanks! i didn't think of that
[16:41:51] TomyWork: smathy well i cant just compare fragments
[16:42:05] smathy: TomyWork, ...and seeing as you seem to think that presence within C++ legitimizes comsci methodologies, here's C++'s qsort, take note of the function you need to provide to it: http://www.cplusplus.com/reference/cstdlib/qsort/
[16:42:23] toretore: TomyWork: that's (kind of) what i linked you to
[16:42:37] smathy: toretore, yeah, your link caused me to go looking.
[16:42:37] TomyWork: cstdlib is C compatibility stuff
[16:42:43] toretore: gem install apt-pkg
[16:42:56] rubie_: has joined #ruby
[16:43:42] Sadin: has joined #ruby
[16:43:45] toretore: def <=>(other); Debian::AptPkg.cmp_version(version, other.version); end
[16:43:51] smathy: TomyWork, ok, no winning with you then. Fine, you're right, the whole concept of cmp is something totally restricted to the fringes of computer science, only used in every DB to do collation, qsort, Ruby, Python, C, Perl, ....
[16:44:24] smathy: toretore, `include Comparable`
[16:44:40] TomyWork: smathy X isn't worthless just because Y also exists
[16:45:02] bradleyprice: has joined #ruby
[16:45:45] smathy: TomyWork, what did I say was worthless? You're in #ruby asking how to do sorting and you've never stopped resisting doing it the way Ruby (and a bunch of other platforms) do it.
[16:46:21] TomyWork: i was only arguing that both are valid, that C++ does it differently than ruby and since ruby usually has a dozen ways of doing something, i figured, maybe that also applies to sorting
[16:46:40] smathy: ...despite me telling you numerous times that it didn't.
[16:46:46] smathy: Anyway, HAND.
[16:47:02] fmcgeough: has joined #ruby
[16:48:24] mnrmnaugh: has joined #ruby
[16:48:29] TomyWork: toretore thanks a lot. now i'm curious about whether dpkg uses libapt-pkg, though :)
[16:48:35] TomyWork: that sounds a bit circular
[16:48:36] mustmodify: brent__: this took longer than I wanted to spend on it. :) But here are many implementations of game.board[x, y]... interface stays the same, but implementation differs. https://gist.github.com/mustmodify/04f4b41d65f5d74e06c6f2bb83a701ae
[16:48:51] Yeomra: has joined #ruby
[16:49:22] bruno-: has joined #ruby
[16:51:20] Blaguvest: has joined #ruby
[16:52:28] idefine: has joined #ruby
[16:52:55] slash_nick: Shit... there's no #each_cons in ruby 1.8.5 D:
[16:53:11] phaza: has joined #ruby
[16:53:12] slash_nick: (for array, ok)
[16:53:59] TomyWork: https://github.com/davidben/dpkg/blob/8fd8d798a68d4c5e759637f09a229e117f0f0ccf/lib/dpkg/vercmp.c#L43 this 7-year-old version looks a lot like the one in libapt...
[16:54:49] TomyWork: but it is separate and it looks the same in the current source
[16:56:39] smathy: ...might be easier to announce the things it DOES have.
[16:57:00] Carella: has joined #ruby
[16:57:11] davedev24: has joined #ruby
[16:57:49] tubuliferous: has joined #ruby
[16:58:02] benlieb: has joined #ruby
[16:58:12] crazyphil2: has joined #ruby
[16:58:33] p0p0pr37_: has joined #ruby
[16:58:45] KnownSyntax: has joined #ruby
[16:59:08] bluOxigen_: has joined #ruby
[16:59:17] _kfpratt: has joined #ruby
[16:59:20] AnoHito_: has joined #ruby
[16:59:57] pwnd_nsfw`: has joined #ruby
[17:01:20] valeri_ufo: has joined #ruby
[17:01:23] crdpink: has joined #ruby
[17:01:32] RazorX-: has joined #ruby
[17:01:44] hpltsy: has joined #ruby
[17:01:56] joonty1: has joined #ruby
[17:02:02] Sadin: has joined #ruby
[17:02:14] tinnvec_: has joined #ruby
[17:02:15] Affix: has joined #ruby
[17:02:18] diegoaguilar: has joined #ruby
[17:02:18] iamvery: has joined #ruby
[17:02:56] Puffball: has joined #ruby
[17:03:11] mnrmnaugh__: has joined #ruby
[17:03:22] mg^: has joined #ruby
[17:03:24] JohnBat26: has joined #ruby
[17:03:28] Kim^J: has joined #ruby
[17:03:32] Alayde: has joined #ruby
[17:03:44] eregon_: has joined #ruby
[17:04:01] amoeba: has joined #ruby
[17:04:02] tAn: has joined #ruby
[17:04:02] DenSchub: has joined #ruby
[17:04:13] kapowaz: has joined #ruby
[17:04:13] joconcepts: has joined #ruby
[17:04:19] ddv: has joined #ruby
[17:04:44] sonne: has joined #ruby
[17:04:52] Alayde_: has joined #ruby
[17:05:00] gregf: has joined #ruby
[17:05:23] yo61_: has joined #ruby
[17:05:35] blaxter: has joined #ruby
[17:05:45] idefine: has joined #ruby
[17:05:53] Spami_: has joined #ruby
[17:05:53] ereslibre: has joined #ruby
[17:05:54] ereslibre: has joined #ruby
[17:05:58] manveru: has joined #ruby
[17:06:35] yorickpeterse: has joined #ruby
[17:06:40] triangles: has joined #ruby
[17:06:47] FastJack: has joined #ruby
[17:07:03] htmldrum: has joined #ruby
[17:07:46] bmn: has joined #ruby
[17:08:55] PaulCapestany: has joined #ruby
[17:09:00] phaza: has joined #ruby
[17:09:03] Fire-Dragon-DoL: has joined #ruby
[17:09:14] MaienM_: has joined #ruby
[17:09:21] EdwardIII: has joined #ruby
[17:09:22] v1n: has joined #ruby
[17:09:24] FooMunki_: has joined #ruby
[17:09:47] dumdedum: has joined #ruby
[17:10:03] ghr: has joined #ruby
[17:10:03] tjvc: has joined #ruby
[17:10:04] tjvc: has joined #ruby
[17:10:48] slash_nick: working on an ancient machine ;)
[17:10:53] tjvc: has joined #ruby
[17:10:54] tjvc: has joined #ruby
[17:11:02] Log1x: has joined #ruby
[17:11:02] Log1x: has joined #ruby
[17:11:40] bluOxigen: has joined #ruby
[17:11:58] ryotarai_: has joined #ruby
[17:12:15] DenSchub: has joined #ruby
[17:12:51] astrobun_: has joined #ruby
[17:12:51] aegis3121: has joined #ruby
[17:13:04] trollface: has joined #ruby
[17:13:14] bnagy_: has joined #ruby
[17:13:26] firstdayonthejob: has joined #ruby
[17:13:44] eggoez: has joined #ruby
[17:13:46] dostoyevsky: has joined #ruby
[17:13:54] xsdg: has joined #ruby
[17:13:58] Cohedrin_: has joined #ruby
[17:14:08] crankhar1er: has joined #ruby
[17:14:15] wldcordeiro: has joined #ruby
[17:14:43] torandu_: has joined #ruby
[17:14:48] LiquidIn1ect: has joined #ruby
[17:14:50] ahuman_: has joined #ruby
[17:14:54] Weavel_: has joined #ruby
[17:15:12] yfeldblum: has joined #ruby
[17:15:21] antgel: has joined #ruby
[17:15:32] agentmee1kat: has joined #ruby
[17:15:40] tw1sted_: has joined #ruby
[17:15:47] hoylemd_: has joined #ruby
[17:16:22] atmosx_alt: has joined #ruby
[17:16:30] meinside_: has joined #ruby
[17:17:11] zenlot6: has joined #ruby
[17:17:27] shortdudey123_: has joined #ruby
[17:17:41] manveru_: has joined #ruby
[17:17:49] elusiveother_: has joined #ruby
[17:17:52] TomyWork: what's on it?
[17:17:54] huyderman_: has joined #ruby
[17:17:54] phaza: has joined #ruby
[17:18:09] slash_nick: a whole world of things
[17:18:16] TomyWork: i mean which distro
[17:18:21] zenguy_pc2: has joined #ruby
[17:18:26] slash_nick: ah... centos
[17:18:35] Nilium_: has joined #ruby
[17:18:45] TomyWork: oh, didnt know they had ruby 1.9 yet
[17:18:46] Rixius: has joined #ruby
[17:18:52] MRB[alt]: has joined #ruby
[17:18:55] greenhat-: has joined #ruby
[17:18:56] imajes_: has joined #ruby
[17:18:59] Bilge-: has joined #ruby
[17:19:08] Papierko-: has joined #ruby
[17:19:28] stryek: has joined #ruby
[17:19:39] YaknotiS: has joined #ruby
[17:19:39] slash_nick: it's not the latest centos... not sure what latest would've shipped with
[17:19:41] bruno-: has joined #ruby
[17:19:41] tagaulap_: has joined #ruby
[17:19:46] joeyjones: has joined #ruby
[17:19:54] flughafen: has joined #ruby
[17:19:57] rikai: has joined #ruby
[17:20:00] SirFunk: has joined #ruby
[17:20:04] thomasfedb: has joined #ruby
[17:20:04] thomasfedb: has joined #ruby
[17:20:07] Xeago: has joined #ruby
[17:20:11] ekem: has joined #ruby
[17:20:25] TomyWork: i'm kidding of course, but centos is usually a bit old
[17:20:41] sauvin: has joined #ruby
[17:20:47] bmn: has joined #ruby
[17:21:05] lsmola: has joined #ruby
[17:21:15] gmci: has joined #ruby
[17:21:17] s1kx-: has joined #ruby
[17:21:49] Elysia: has joined #ruby
[17:22:12] cdg: has joined #ruby
[17:22:35] Alina-malina: has joined #ruby
[17:22:42] smathy: Heh, using the distro's ruby, always fun.
[17:23:03] johnmilton: has joined #ruby
[17:23:24] stennowork: i actually just installed ruby on centos
[17:23:25] Alina-malina: has joined #ruby
[17:23:25] ramfjord: has joined #ruby
[17:23:29] stennowork: but, of course, using rvm
[17:23:37] callumacrae: has joined #ruby
[17:24:22] stennowork: and now i have ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux]
[17:24:22] slash_nick: yeah... of course i'd build a solution on ruby 2.3.0 that I'd need to use in 1.8.5-land... undetermined whether I can get a modern ruby in this env or whether I'll have to implement the moving window (#each_cons) myself.
[17:24:53] idefine: has joined #ruby
[17:24:55] TomyWork: slash_nick so you tried rvm and the likes?
[17:24:56] nibbo: has joined #ruby
[17:24:56] frem_: has joined #ruby
[17:24:56] err_ok: has joined #ruby
[17:24:56] 6JTAACLKH: has joined #ruby
[17:24:56] hinbody: has joined #ruby
[17:24:56] Carella: has joined #ruby
[17:24:58] err_ok: has joined #ruby
[17:24:59] frem_: has joined #ruby
[17:24:59] nibbo: has joined #ruby
[17:25:03] smathy: I'm sure that whatever gems are working with 1.8 will not work with 2.3
[17:25:07] stennowork: oh kinda missed the intro on that
[17:25:30] slash_nick: TomyWork: oh no it's not a how-do-i issue... this is a not-my-decision issue
[17:25:49] slash_nick: ACTION shrugs... stdlib.
[17:25:53] smathy: Oh look, hxegon is here, you came out the other side of your rebuild?
[17:26:12] kaleido: has joined #ruby
[17:26:35] hxegon: smathy slash_nick Sort of... Arch worked, but OS X didn't. I reinstalled and I'm going to try again tonight.
[17:26:44] smathy: slash_nick, huh?
[17:27:18] smathy: You can't install a later ruby because of some stdlib error?
[17:27:34] smathy: hxegon, bummer, at least no brick.
[17:27:35] slash_nick: no, i dont care about which gems work because i'm using stdlib...
[17:27:58] TomyWork: slash_nick wait, whose braindead decision was it to force you to use a ruby version whose sucessor's successor's successor is already EOL?
[17:28:04] yfeldblum: has joined #ruby
[17:28:27] smathy: Ah ok. I can't imagine not using an gems :)
[17:28:29] slash_nick: TomyWork: whether i'm forced to is still undetermined...
[17:28:31] TomyWork: (is 2.1 EOL yet? this page here says end of march)
[17:28:35] mfb2_: has joined #ruby
[17:28:44] spastorino: has joined #ruby
[17:29:16] bruno-: has joined #ruby
[17:29:19] deepak: has joined #ruby
[17:29:49] blackmesa: has joined #ruby
[17:29:51] TheBrayn: has joined #ruby
[17:30:10] mroth: has joined #ruby
[17:30:29] TomyWork: (ah, nothing except security fixes since end of march)
[17:30:32] kapowaz: has joined #ruby
[17:30:48] mfb2__: has joined #ruby
[17:31:31] chris2: has joined #ruby
[17:31:32] jpinnix_______: has joined #ruby
[17:31:37] gizmore: has joined #ruby
[17:31:42] zrl_: has joined #ruby
[17:32:41] jackjackdripper: has joined #ruby
[17:33:14] phaza: has joined #ruby
[17:33:52] SCHAAP137: has joined #ruby
[17:34:39] rcvalle: has joined #ruby
[17:34:59] jhack: has joined #ruby
[17:36:49] blackmesa: has joined #ruby
[17:37:50] nanoz: has joined #ruby
[17:40:13] idefine: has joined #ruby
[17:40:30] jackjackdripper: has joined #ruby
[17:41:16] bradleyprice: has joined #ruby
[17:41:28] tvw: has joined #ruby
[17:42:25] jackjackdripper: has joined #ruby
[17:42:59] mfb2: has joined #ruby
[17:43:05] crdpink2: has joined #ruby
[17:43:27] n008f4g_: has joined #ruby
[17:43:37] SilverKey: has joined #ruby
[17:44:18] last_staff: has joined #ruby
[17:44:32] codecop: has joined #ruby
[17:44:43] cdg: has joined #ruby
[17:45:41] karapetyan: has joined #ruby
[17:47:08] jackjackdripper1: has joined #ruby
[17:48:13] JohnBat26: has joined #ruby
[17:48:46] bronson: has joined #ruby
[17:49:22] syk: has joined #ruby
[17:49:27] charliesome: has joined #ruby
[17:50:03] phaza: has joined #ruby
[17:50:11] jordanm: has joined #ruby
[17:50:30] mr_rich101: has joined #ruby
[17:50:34] kitallis: has joined #ruby
[17:50:38] chouhoulis: has joined #ruby
[17:50:55] agentmeerkat: has joined #ruby
[17:51:11] stannard: has joined #ruby
[17:51:34] charliesome: has joined #ruby
[17:51:58] baweaver: has joined #ruby
[17:53:49] sharkman: has joined #ruby
[17:54:11] sharkman: what does def [](k); @hash[k.to_s]; end
[17:54:24] sharkman: especially what is the def []() syntax mean
[17:54:28] charliesome: has joined #ruby
[17:54:36] jhass: [] is just a valid method name
[17:54:55] jhass: you can invoke it like foo.[](bar)
[17:55:13] jhass: but ruby also rewrites foo[bar] to foo.[](bar)
[17:56:11] aiguu: has joined #ruby
[17:56:17] MagePsycho: has joined #ruby
[17:57:46] lomex: has joined #ruby
[17:58:16] tessi: has joined #ruby
[17:58:40] baweaver: has joined #ruby
[18:00:08] mikecmpbll: has joined #ruby
[18:00:20] karapetyan: has joined #ruby
[18:00:42] Alayde_: has left #ruby: ("WeeChat 1.1.1")
[18:00:45] karapetyan: has joined #ruby
[18:01:02] s00pcan_: has joined #ruby
[18:01:15] mfb2: has joined #ruby
[18:01:20] ytti: not yikes, simple :)
[18:01:27] ytti: less special cases/expectaions
[18:01:37] ytti: 4-2 is actually 4.-(2)
[18:01:59] ytti: exceptions not expectations
[18:02:21] kareeoleez: has joined #ruby
[18:02:43] joonty1: has joined #ruby
[18:03:10] jenrzzz: has joined #ruby
[18:03:11] jenrzzz: has joined #ruby
[18:04:01] bradleyprice: has joined #ruby
[18:05:25] mfb2: has joined #ruby
[18:06:09] mfb2: has joined #ruby
[18:06:56] Rodya_: has joined #ruby
[18:08:08] jenrzzz: has joined #ruby
[18:08:52] shevy: beer not water
[18:10:06] dsimon: has joined #ruby
[18:10:08] karapetyan: has joined #ruby
[18:10:15] dsimon: hey all; i think i'm a bit confused about enumerators
[18:10:29] Hanmac: yeah but i gets more complicated when ruby has a difference between "-3" and "- 3" ;P
[18:10:31] baweaver: Care to enumerate on that?
[18:10:40] dsimon: i thought they allowed for a kind of lazy evaluation, but this code: https://gist.github.com/DavidMikeSimon/95dd0a0643c364591e4a47433f6877f9
[18:10:42] Hanmac: baweaver: XD
[18:10:46] dsimon: does not do what i would expect it to
[18:11:09] dsimon: i'd expect it to only print "AT 1", "AT 2", "ANY? true", but it prints an "AT" for every element
[18:11:12] baweaver: what do you expect it to do?
[18:11:29] dsimon: jinx, coke, etc.
[18:11:33] baweaver: select returns an Enumerator
[18:11:37] baweaver: >> [1,2].select
[18:11:38] ruby[bot]: baweaver: # => #<Enumerator: [1, 2]:select> (https://eval.in/557730)
[18:11:47] baweaver: which you put each on
[18:11:51] baweaver: making that select do nothing
[18:11:56] blackmesa: has joined #ruby
[18:12:13] RegulationD: has joined #ruby
[18:12:22] TvL: has joined #ruby
[18:12:29] baweaver: and calling each with a block returns the array itself
[18:12:39] dsimon: no, hold on
[18:12:44] baweaver: >> [1,2].select.each { |v| nil }
[18:12:44] dsimon: i'm pretty sure the each in this case is "applying" the select
[18:12:45] ruby[bot]: baweaver: # => [] (https://eval.in/557731)
[18:12:47] wldcordeiro: has joined #ruby
[18:13:00] dsimon: >> [1,2,3].select.each { |v| v >= 2}
[18:13:01] ruby[bot]: dsimon: # => [2, 3] (https://eval.in/557732)
[18:13:04] dsimon: >> [1,2,3].select.each { |v| v >= 1}
[18:13:05] ruby[bot]: dsimon: # => [1, 2, 3] (https://eval.in/557733)
[18:13:21] baweaver: but that's odd ruby in any case
[18:13:22] dsimon: yeah but TISC (today i'm still confused) :-(
[18:13:35] baweaver: why not just put the block on select?
[18:13:42] baweaver: or better yet, use find?
[18:13:52] baweaver: [1,2,3].find { |v| v > 2 }
[18:13:59] baweaver: >> [1,2,3].find { |v| v > 2 }
[18:14:00] ruby[bot]: baweaver: # => 3 (https://eval.in/557734)
[18:14:08] Dimik1: has joined #ruby
[18:14:20] jhack: has joined #ruby
[18:14:22] baweaver: >> [1,2,3].find { |v| puts "visited: #{v}"; v >= 2 }
[18:14:23] ruby[bot]: baweaver: # => visited: 1 ...check link for more (https://eval.in/557735)
[18:14:32] dsimon: because i want to do lazy calculation in some cases but not in others
[18:14:44] ruby[bot]: it seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
[18:14:50] ledestin: has joined #ruby
[18:15:07] dsimon: let's say i have an array that i want to filter on something expensive
[18:15:11] baweaver: find will break out when it finds something
[18:15:13] dsimon: sometimes i'm interested in getting all the filtered results
[18:15:19] baweaver: then make a flag
[18:15:21] dsimon: but other times i only want to know if there are *any*
[18:15:40] dsimon: i thought i could return an enumerator in either case, and call either .any? or .to_a on it depending on the use case
[18:16:03] dsimon: or, suppose i only wanted the first 3 results regardless of how many
[18:16:14] dsimon: and so on; the usual stuff that's handy about lazy evaluation
[18:16:17] Hanmac: hey checkout take_while:
[18:16:17] Hanmac: >> (1..10).take_while.each {|i| puts "AT #{i}"; i <= 2}
[18:16:18] ruby[bot]: hanmac: # => AT 1 ...check link for more (https://eval.in/557741)
[18:17:46] minster_prime: has joined #ruby
[18:17:48] baweaver: >> flag = true; (1..10).select { |v| puts "visited: #{v}"; check = v > 2; return v if check && flag; check }
[18:17:48] dsimon: hm, maybe the problem is just that i'm expecting any? to stop early if it can
[18:17:49] ruby[bot]: baweaver: # => visited: 1 ...check link for more (https://eval.in/557745)
[18:17:54] dsimon: but the documentation seems to say that it doesn't do that
[18:18:02] dsimon: so this is something about Enumerable that confuses me, rather than Enumerator, maybe?
[18:18:18] baweaver: Enumerator isn't lazy
[18:18:25] baweaver: not unless you put lazy on it
[18:18:40] dsimon: nvm, any? does stop early when applied directly on an Array
[18:18:43] dsimon: put lazy on it?
[18:18:46] baweaver: &ri Enumerable#lazy
[18:18:46] `derpy: http://ruby-doc.org/core-2.3.0/Enumerable.html#method-i-lazy
[18:19:06] chagel: has joined #ruby
[18:19:31] bruno-: has joined #ruby
[18:19:35] baweaver: though admittedly I haven't used it myself in any live code
[18:19:41] baweaver: and don't know much about it
[18:19:44] nalitia: has joined #ruby
[18:19:56] crank1988: has joined #ruby
[18:20:01] dsimon: i tried putting it as `arr.select.lazy.each`
[18:20:06] dsimon: but no effect?
[18:20:10] idefine: has joined #ruby
[18:20:28] jobewan: has joined #ruby
[18:20:54] nalitia: How can I require a module with name "Xyz" when there is already a class loaded with name "Xyz"? I always get "Xyz is not a module (TypeError)"
[18:21:00] baweaver: >> (1..10).lazy.select { |v| v > 2 }
[18:21:00] Waqas: has joined #ruby
[18:21:01] ruby[bot]: baweaver: # => #<Enumerator::Lazy: #<Enumerator::Lazy: 1..10>:select> (https://eval.in/557748)
[18:21:03] Xeago: has joined #ruby
[18:21:12] baweaver: >> (1..10).lazy.select { |v| v > 2 }.to_a
[18:21:13] ruby[bot]: baweaver: # => [3, 4, 5, 6, 7, 8, 9, 10] (https://eval.in/557749)
[18:21:18] baweaver: >> (1..10).lazy.select { |v| v > 2 }.any?
[18:21:19] ruby[bot]: baweaver: # => true (https://eval.in/557750)
[18:21:29] dsimon: yeah, just tried that and it works :-)
[18:21:36] baweaver: >> (1..10).lazy.select { |v| puts "visited: #{v}"; v > 2 }.any?
[18:21:37] ruby[bot]: baweaver: # => visited: 1 ...check link for more (https://eval.in/557751)
[18:21:48] dsimon: tho for some reason i cannot do .lazy.select.each
[18:21:52] baweaver: the each is redundant
[18:22:08] TomyLobo: has joined #ruby
[18:22:22] aegis3121: nalitia: I would say don't rename modules and classes to be the same?
[18:22:26] dsimon: well, select without block returns an enumerator, right?
[18:22:29] charliesome: has joined #ruby
[18:22:38] nalitia: aegis3121: I can't control the names, isn't there some alternative?
[18:22:44] aegis3121: not that I'm aware of
[18:22:50] nalitia: you have to be fucking kidding me...
[18:22:57] dsimon: so i'd expect .lazy.select. to return an enumerator on an enumerator... which is silly, but nonetheless :-)
[18:22:59] nalitia: that's what I thought
[18:23:02] aegis3121: Namespacing your modules/classes would get around that
[18:23:10] aegis3121: vs just Xyz
[18:23:11] nalitia: that's cute, out here in the real world, I can't!
[18:23:22] aegis3121: Do you have actual code you can share?
[18:23:26] nalitia: unreal that you guys use this trash
[18:23:32] toretore: nalitia: how about providing some real code?
[18:24:12] jaguarmagenta: has joined #ruby
[18:24:14] baweaver: dsimon: the each is irrelevant honestly, which is why I wouldn't have expected it to do that.
[18:24:37] jhn: has left #ruby: ("Textual IRC Client: www.textualapp.com")
[18:24:38] dsimon: the docs for enumerator seem to imply that #each is the default way to apply the enumerator, which does seem weird yeah
[18:24:39] baweaver: !rude nalitia
[18:24:39] ruby[bot]: +qq nalitia!*@* *!*@gateway/web/freenode/ip.67.135.42.210
[18:25:04] baweaver: just in case they come back in a bit later while I'm not here
[18:25:50] dsimon: yeah, i must be misunderstanding Enumerator#each
[18:26:23] baweaver: >> (1..10).select(&:even?)
[18:26:24] ruby[bot]: baweaver: # => [2, 4, 6, 8, 10] (https://eval.in/557752)
[18:26:33] baweaver: all those methods just take a block
[18:26:50] baweaver: >> (1..10).select(&:even?).map { |v| v * 2 }
[18:26:51] ruby[bot]: baweaver: # => [4, 8, 12, 16, 20] (https://eval.in/557753)
[18:27:00] baweaver: >> (1..10).select(&:even?).map { |v| v * 2 }.reduce(0, :+)
[18:27:01] ruby[bot]: baweaver: # => 60 (https://eval.in/557754)
[18:27:10] baweaver: so you can just chain along your merry way
[18:27:26] baweaver: though once you get over 5-6 it's probably time to break things up a bit.
[18:27:27] dsimon: indeed, and i can even be lazy that way, which is what i was seeking :-)
[18:27:46] baweaver: fair warning that I never really use it so anything I say on it is guesswork from Haskell
[18:27:58] dsimon: so then what's the use of select w/o block which returns an enumerator?
[18:28:07] aegis3121: has joined #ruby
[18:28:11] baweaver: Not sure honestly
[18:28:15] baweaver: never had a use for it
[18:28:32] baweaver: probably is one, but not one I'm immediately aware of.
[18:29:01] shevy: just like monads!
[18:29:04] baweaver: Anyways, food time for me. Ox0dea or jhass would probably know the magic there better than me.
[18:29:16] baweaver: A monad is just a monoid in the category of an endofunctor.
[18:29:50] Es0teric: has joined #ruby
[18:29:54] TomyLobo: ACTION hits shevy's monads
[18:30:05] TomyLobo: there, i found a use
[18:30:20] darkxploit: has joined #ruby
[18:31:49] tvon: has joined #ruby
[18:33:26] darkxploit: has joined #ruby
[18:33:27] x77686d: has joined #ruby
[18:33:57] idefine: has joined #ruby
[18:34:26] jhass: dsimon: I only read the beginning, but Enumerator executes each method in the chain for all elements at once, passing the result of the previous invocation to the next item in the chain. There's Enumerator::Lazy available through Enumerable#lazy (iirc), which executes the whole chain for each item before going to the next item
[18:35:00] perlgod: has joined #ruby
[18:35:43] william3: has joined #ruby
[18:35:52] ramfjord: has joined #ruby
[18:36:09] dsimon: jhass, is there any particular reason then to call methods like select without a block?
[18:36:42] dsimon: rather than just getting an enumerator first and then using its Enumerable methods in the usual way with a block
[18:37:33] jhass: >> [nil, false, 1].select.to_a
[18:37:34] ruby[bot]: jhass: # => [nil, false, 1] (https://eval.in/557756)
[18:37:38] william3: has joined #ruby
[18:38:04] jhass: >> [nil, false, 1].select.each {|x| x }
[18:38:05] ruby[bot]: jhass: # => [1] (https://eval.in/557757)
[18:38:12] jhass: interesting?
[18:38:29] jhass: dunno I think nobody really does that and it's just for consistency of some sort
[18:38:44] dsimon: in that spirit though i was surprising to find that this didn't work:
[18:38:51] dsimon: >> [nil, false, 1].lazy.select.each {|x| x}
[18:38:52] ruby[bot]: dsimon: # => tried to call lazy select without a block (ArgumentError) ...check link for more (https://eval.in/557758)
[18:39:01] MagePsycho: has joined #ruby
[18:39:02] dsimon: though this does:
[18:39:06] dsimon: >> [nil, false, 1].lazy.select {|x| x}
[18:39:07] ruby[bot]: dsimon: # => #<Enumerator::Lazy: #<Enumerator::Lazy: [nil, false, 1]>:select> (https://eval.in/557759)
[18:39:13] dsimon: >> [nil, false, 1].lazy.select {|x| x}.to_a
[18:39:14] ruby[bot]: dsimon: # => [1] (https://eval.in/557760)
[18:39:31] SilverKey: has joined #ruby
[18:39:33] jhass: Enumerator::Lazy is much much newer than Enumerator, I guess they simply didn't repeat that odd behavior ;)
[18:40:06] dsimon: fair enough :-)
[18:40:19] htmldrum: has joined #ruby
[18:41:20] sphex_: hey. I need to generate and send emails with Unicode in the subject field. Any one could recommend a module by any chance? I have zero experience with ruby and emails... Ideally it wouldn't need an SMTP server and could just spawn off sendmail(1).
[18:43:00] smathy: jhass, actually the non-lazy behavior makes sense to me. [ nil, false, 1 ].select.each {|x|x} should return the same as [ nil, false, 1 ].select {|x|x}
[18:43:22] jhass: >> [nil, false, 1].select.map {|x| x }
[18:43:23] ruby[bot]: jhass: # => [nil, false, 1] (https://eval.in/557761)
[18:44:17] jrafanie: has joined #ruby
[18:45:29] stannard: has joined #ruby
[18:45:29] kirun: has joined #ruby
[18:45:52] jhack: has joined #ruby
[18:46:12] jhass: smathy: ^ still follow that one?
[18:47:08] jhass: sphex_: pretty sure the mail gem has something to handle that
[18:47:09] smathy: Definitely less intuitive, but map returns its own damn things, whereas each does some sort of delegate my block to my input.
[18:47:36] jhass: dunno it's just inconsistent to me
[18:47:51] smathy: Yeah, definitely hard to intuit.
[18:48:20] smathy: map.select does what I'd expect.
[18:48:51] jhass: >> [nil, false, 1].select.reject.each {|x| x }
[18:48:53] ruby[bot]: jhass: # => [nil, false] (https://eval.in/557762)
[18:49:26] lacrosse: has joined #ruby
[18:50:22] superscott: has joined #ruby
[18:50:39] bronson: has joined #ruby
[18:51:26] dsimon: sphex_, this is a little off-topic, but you are almost always better off routing through an email server if you don't want to get blocked by spam filters
[18:52:11] dsimon: attempting to directly connect to the recipient's server will usually not go well, because of greylisting, DNS-based mail server verification, etc.
[18:53:17] sphex_: jhass: alright. I haven't found how yet, but I'll keep looking. probably just need to word-encode manually the header when needed...
[18:53:57] jhass: I know that Mail::Address properly handles it for names in the To/From etc headers
[18:54:12] jhass: I would have expected it just handles it for the subject too
[18:55:25] sphex_: dsimon: oh yeah.. in this specific case the server already seems to have a good reputation and has been sending emails directly for years now. people can still setup a relaying local MTA if they want though. I just hate adding extra, mandatory configurations to things...
[18:56:11] phaza: has joined #ruby
[18:56:49] dsimon: no worries then, just wanted to keep you from getting bitten by the same thing i did a while back :-)
[18:59:32] bruno-: has joined #ruby
[18:59:41] chouhoulis: has joined #ruby
[19:01:20] sphex_: jhass: huh, you're right. it all just works. I messed up my testing. :/
[19:01:34] moos3: has joined #ruby
[19:02:17] jrafanie_: has joined #ruby
[19:02:18] morochena: has joined #ruby
[19:02:27] sphex_: eh, it seems like a pretty great module
[19:02:30] davedev24: has joined #ruby
[19:03:27] joonty1: has joined #ruby
[19:05:06] davedev24: has joined #ruby
[19:08:41] phaza: has joined #ruby
[19:09:56] theRoUS: is there a non-file mutex mechanism that supports LOCK_SH and LOCK_EX? and not just exclusive all-or-nothing locking?
[19:10:50] govg: has joined #ruby
[19:12:53] GinoMan2440: has joined #ruby
[19:13:46] MagePsycho: has joined #ruby
[19:18:43] Carella: has joined #ruby
[19:19:24] TomyLobo: has joined #ruby
[19:21:08] VeryBewitching: has joined #ruby
[19:21:41] Xeago: has joined #ruby
[19:22:43] spider-mario: has joined #ruby
[19:25:35] ruby[bot]: -qq nalitia!*@* *!*@gateway/web/freenode/ip.67.135.42.210
[19:26:28] snowy: has joined #ruby
[19:26:49] smathy: theRoUS, no, you might like ReadWriteLock from concurrent-ruby: https://github.com/ruby-concurrency/concurrent-ruby
[19:29:40] Ami00: has joined #ruby
[19:29:41] baweaver: has joined #ruby
[19:30:41] theRoUS: smathy: thanks
[19:31:50] ceej: has joined #ruby
[19:32:02] Polysics: has joined #ruby
[19:32:18] uri___: has joined #ruby
[19:32:42] uri___: if i have a lazy enum and i chain two selects on it, will it only iterate through the collection once?
[19:33:04] tAn: has joined #ruby
[19:34:07] Polysics: has joined #ruby
[19:34:20] ffgghhj: has joined #ruby
[19:34:34] ffgghhj: hi, why does such error appears? http://pastie.org/10807300
[19:35:52] smathy: jhass, more about lazy enum ^
[19:36:21] jhass: uri___: I'd expect so, yes
[19:36:46] uri___: jhass thanks
[19:36:57] elusiveother: has joined #ruby
[19:37:06] smathy: ffgghhj, because Thread.exclusive is deprecated, the gem should be using Mutex
[19:37:23] smathy: ffgghhj, are you using the latest version of that gem?
[19:37:43] ffgghhj: i did "bundle update"
[19:37:57] smathy: ffgghhj, you don't seem to be.
[19:38:09] smathy: ...maybe you have the version restricted in Gemfile.
[19:38:18] ffgghhj: padrino-core-0.12.5
[19:38:30] ffgghhj: i think this is last vesrion
[19:38:37] smathy: ffgghhj, maybe you should check.
[19:38:41] jhack: has joined #ruby
[19:39:01] smathy: ffgghhj, gems are hosted here: https://rubygems.org/
[19:39:13] ffgghhj: seems found err
[19:39:19] ffgghhj: gem 'padrino', '0.12.5'
[19:39:35] smathy: ffgghhj, might be there for a good reason, but probably not.
[19:40:13] ffgghhj: Installing padrino-helpers 0.13.1
[19:40:55] ffgghhj: nice, working
[19:41:17] marens: has joined #ruby
[19:41:18] smathy: ffgghhj, you're welcome.
[19:41:50] IrishGringo: has joined #ruby
[19:42:33] allcentury: has joined #ruby
[19:42:53] ironcamel: can someone explain this code snippet to me https://gist.github.com/ironcamel/6586c087db101f17c30b7912c1b1589d
[19:43:16] ironcamel: is that a block being passed to a function file() ?
[19:43:38] govg: has joined #ruby
[19:43:43] ironcamel: and what's up with '/srv/exports': ?
[19:44:30] baweaver: has joined #ruby
[19:45:06] bruno-: has joined #ruby
[19:46:00] jhass: ironcamel: it's not actually valid ruby
[19:46:28] jhass: ironcamel: if we ignore the "file " for a moment we got a hash nested inside a hash though
[19:46:47] ixti: has joined #ruby
[19:46:58] ironcamel: this puppet code
[19:47:05] jhass: but I don't think this is ruby
[19:47:07] ruby[bot]: Please join #puppet for help with it.
[19:47:08] ironcamel: so puppet is its own language
[19:47:17] jhass: this isn't #puppet
[19:47:24] mfb2: has joined #ruby
[19:47:25] ironcamel: i don't want to learn puppet
[19:47:31] jhass: me neither
[19:47:42] ironcamel: was just trying to learn/understand the ruby code
[19:47:42] Yeomra: has joined #ruby
[19:47:57] eam: I've unfortunately learned some of it and I can confirm that yes, it is not ruby in pp files
[19:48:12] shevy: that discussion snippet between ironcamel and jhack was fun
[19:48:20] eam: though puppet itself is written in ruby (and rails!)
[19:48:52] jhass: there's no ruby code there
[19:49:30] symm-: has joined #ruby
[19:49:44] crankharder: has joined #ruby
[19:50:12] MagePsycho: has joined #ruby
[19:50:39] jenrzzz: has joined #ruby
[19:50:39] jenrzzz: has joined #ruby
[19:52:34] mfb2: has joined #ruby
[19:52:36] marens: has joined #ruby
[19:52:44] jhass: "sorry, could not resist"
[19:52:50] jjt: has joined #ruby
[19:53:01] jjt: has left #ruby: ()
[19:56:53] ramfjord: there is a pretty huge puppet IRC though
[19:57:58] SilverKey: has joined #ruby
[19:58:42] zeroDivisible: has joined #ruby
[19:59:17] freerobby: has joined #ruby
[19:59:50] last_staff1: has joined #ruby
[19:59:51] wldcordeiro: has joined #ruby
[20:00:01] Rodya_: has joined #ruby
[20:00:23] Asher: has joined #ruby
[20:00:49] idefine_: has joined #ruby
[20:01:03] infernix: has joined #ruby
[20:01:54] idefine__: has joined #ruby
[20:02:04] jenrzzz_: has joined #ruby
[20:03:16] Devalo: has joined #ruby
[20:03:49] last_staff: has joined #ruby
[20:03:53] Xeago: has joined #ruby
[20:03:55] FooMunki: has joined #ruby
[20:04:54] bruno-: has joined #ruby
[20:07:20] last_staff1: has joined #ruby
[20:08:11] idefine: has joined #ruby
[20:08:27] Affix: has joined #ruby
[20:08:44] phaza: has joined #ruby
[20:09:20] slackbotgz: has joined #ruby
[20:10:30] rickmasta: has joined #ruby
[20:11:21] shevy: but nobody wants to learn puppet!
[20:11:34] shevy: neither ironcamel ... nor jhass... nor me
[20:12:28] jhass: you don't want to be a puppetmaster?
[20:12:41] jhass: ACTION needs to watch ghost in the shell again
[20:12:54] apeiros: the movie? or standalone complex?
[20:13:10] apeiros: though, puppetmaster would be the movie, I guess
[20:14:25] jhass: though rewatching SAC would be nice too
[20:14:35] jhass: did you watch the new stuff?
[20:14:45] jhass: wait, we should go to offtopic with that
[20:14:50] apeiros: if "new stuff" = after SAC, then no
[20:14:53] apeiros: and yes, ot
[20:15:15] jobewan: has joined #ruby
[20:16:47] baweaver: or are we on Metallica now?
[20:19:24] MagePsycho: has joined #ruby
[20:19:26] last_staff: has joined #ruby
[20:19:52] antgel: has joined #ruby
[20:20:12] RegulationD: has joined #ruby
[20:20:46] phaza: has joined #ruby
[20:21:07] Waqas: has joined #ruby
[20:21:37] Waqas: has joined #ruby
[20:21:59] rodfersou: has joined #ruby
[20:22:15] Waqas: has joined #ruby
[20:23:03] snowy: has joined #ruby
[20:23:14] Waqas: has joined #ruby
[20:23:25] Gasher: has joined #ruby
[20:24:04] Polysics_: has joined #ruby
[20:24:58] jaguarmagenta: has joined #ruby
[20:25:33] bradleyprice: has joined #ruby
[20:26:13] shevy: that's not a good music to write ruby code!
[20:26:39] idefine: has joined #ruby
[20:27:31] Nilium: ACTION agrees with jhass and also needs to watch Ghost in the Shell again.
[20:27:54] Nilium: But first, implement it.
[20:28:38] haylon: has left #ruby: ("WeeChat 1.4")
[20:29:10] phaza: has joined #ruby
[20:29:35] Polysics: has joined #ruby
[20:29:59] tAn: has joined #ruby
[20:30:05] mfb2_: has joined #ruby
[20:31:07] ddv: has joined #ruby
[20:31:09] blackgoat: has joined #ruby
[20:31:42] aiguu: has joined #ruby
[20:32:38] bffff_: has joined #ruby
[20:33:53] william3: has joined #ruby
[20:34:59] idefine: has joined #ruby
[20:36:01] hxegon: Opinions on using stuff like facets or contracts in production?
[20:39:20] chipotle: has joined #ruby
[20:39:37] antgel: has joined #ruby
[20:42:40] dsimon: i've had a hell of a time getting facets to cooperate with some other gems
[20:42:51] dsimon: which is too bad cause there's some neat stuff in there i'd like to use
[20:44:14] dsimon: Hash#mash in particular really should be in the stdlib, imo...
[20:44:32] dsimon: ActiveSupport has something similar
[20:45:03] tAn: has joined #ruby
[20:45:35] hxegon: dsimon this? http://www.rubydoc.info/github/rubyworks/facets/Enumerable%3Amash
[20:45:58] dsimon: that's the one
[20:46:10] Coldblackice_: has joined #ruby
[20:46:22] dsimon: it's particularly useful to call on Hash as well
[20:46:25] tenderlove: has joined #ruby
[20:46:28] dsimon: to transform one hash into another
[20:47:25] x77686d: has joined #ruby
[20:47:44] Madplatypus: has joined #ruby
[20:48:01] phaza: has joined #ruby
[20:48:10] hxegon: dsimon agreed, a lot of HOF stuff in ruby feels really awkward when trying to return a hash
[20:48:15] replay: has joined #ruby
[20:48:21] dsimon: i mean, obviously it's just map(&block).to_h, but i don't like sticking stuff onto the `end` of multi-line blocks
[20:48:25] dsimon: i feel like it's easy to miss there
[20:48:45] dionysus69: has joined #ruby
[20:48:46] replay: has joined #ruby
[20:49:09] poerror: has joined #ruby
[20:49:25] ur5us: has joined #ruby
[20:49:40] hxegon: dsimon higher order function, so stuff like map, reduce, anything that takes a function as input.
[20:49:49] poerror: has left #ruby: ()
[20:49:49] dsimon: ah, gotcha
[20:50:27] bradleyprice: has joined #ruby
[20:51:02] idefine: has joined #ruby
[20:51:15] bronson: has joined #ruby
[20:51:35] hxegon: dsimon facets has a lot of niceties for stuff like partial application, and function composition. Most of the code I write is just stuff like
[20:51:41] sdothum: has joined #ruby
[20:53:27] hxegon: def foo x; foo.map { |e| e.something x }; end
[20:54:44] maneken: has joined #ruby
[20:55:35] stannard: has joined #ruby
[20:55:40] rikai: has joined #ruby
[20:55:45] bradleyprice: has joined #ruby
[20:55:55] hxegon: hmm... I was going to say partial application would clear that up, but I thing functions would have to be first class objects. So I'd have to rewrite a bunch of stuff to return Procs and Lambdas.
[20:56:15] stannard: has joined #ruby
[20:56:45] maneken: Hello ruby people. I'm a php developer, I have no experience with ruby, but I'm thinking about starting a project. It's gonna be a CRM/ERP open-source software, and I want to create something absolutely basic that could be extended with plugins so that anyone can contribute.
[20:57:22] senayar: has joined #ruby
[20:57:22] senayar: has joined #ruby
[20:57:22] maneken: Can you help with any resources to help with the plugin design?
[20:57:59] ljames: has joined #ruby
[20:58:34] akkad: has joined #ruby
[21:00:50] Rodya_: has joined #ruby
[21:02:00] gizmore: maneken: it is going to be a web2.0 website?
[21:02:34] mfb2: has joined #ruby
[21:02:53] gizmore: plugins, generally, need an interface they obey to
[21:02:54] maneken: gizmore, yes
[21:03:02] gizmore: maybe like "config options"
[21:03:16] gizmore: are you going to use rails?
[21:03:26] havenwood: maneken: See the Sequel and Roda plugin systems.
[21:03:42] havenwood: maneken: I don't think a CRM is a good first Ruby project.
[21:03:52] RahulT: has joined #ruby
[21:03:59] gizmore: any project is a good first ruby project, imo :)
[21:04:11] Rodya_: has joined #ruby
[21:04:21] gizmore: and any v3 version is the best version!
[21:04:52] lxsameer: has joined #ruby
[21:04:52] maneken: i have experience in PHP. I suppose it's gonna be easier for me to use symphony or some other php framework, but I find it boring and i wanted to try something else
[21:05:08] havenwood: maneken: Ruby is lovely.
[21:05:28] gizmore: Ruby has a really nice syntax (coming from php too)
[21:05:28] maneken: havenwood, it looks like it :)
[21:05:53] havenwood: maneken: https://github.com/jeremyevans/roda
[21:06:04] havenwood: maneken: https://github.com/jeremyevans/sequel
[21:06:31] joonty: has joined #ruby
[21:07:38] gizmore: btw, i am working on chatbot which has a plugin system too.... https://github.com/gizmore/ricer4-tcp this is a raw tcp/ip connector plugin for it :)
[21:08:05] gizmore: add_ricer_plugin_module(File.dirname(__FILE__)+'/ricer4/tcp') ^^
[21:08:36] gizmore: this adds the gems directory to be loaded for the bot... ugly, i bet
[21:08:53] maneken: oh god. It's gonna take a while to get used to ruby syntax :S
[21:09:17] yfeldblum: has joined #ruby
[21:09:59] gizmore: maneken: i wrote a tut once for people like you
[21:10:14] maneken: ruby for php devs?
[21:10:47] gizmore: https://www.wechall.net/ruby_tut1.php
[21:11:51] tao_: has joined #ruby
[21:12:18] gizmore: it´s pretty incomplete... missing blocks and yield stuff
[21:12:41] gizmore: and maybe def foo(*restarg)
[21:13:35] gizmore: ruby is so flexible.... it´s amazing ^^
[21:14:02] gizmore: doing it for 2 or 3 years now... and i am still happy when i wire code in it
[21:14:24] gizmore: got pushed to it by work... and after a year decided it´s cool enough to write a hobby project in it
[21:14:44] gizmore: imho, only the performance is a slight concern
[21:15:03] gizmore: but the ecosystem and language itself is pretty awe
[21:16:13] gizmore: and of course, script/dynamic languages all have the problems of flexibility vs. typesafety
[21:16:34] gizmore: but debugging ruby is fun, compared to other langs, for me
[21:16:45] vF3hNGxc47h8: has joined #ruby
[21:16:48] gizmore: byebug rules :)
[21:17:16] chipotle: has joined #ruby
[21:19:31] maneken: monkeypatching looks terrifying.. O_o
[21:20:30] gizmore: actually it´s easy
[21:20:41] gizmore: there is "load" and "require"
[21:21:03] gizmore: both is the same, of course, but require keeps track of files loaded already
[21:21:11] sameerynho: has joined #ruby
[21:21:37] idefine: has joined #ruby
[21:21:40] gizmore: so if you "load" a file, you just always overwrite (or create) definitions
[21:21:46] gizmore: you can simply do:
[21:22:09] gizmore: > class String; def to_s; "aaa"; end; end; "hello".to_s
[21:22:28] lvn: has joined #ruby
[21:22:43] sharkman: has joined #ruby
[21:23:01] gizmore: which would override the String's to_s implementation and return "aaa" always
[21:23:06] sharkman: has joined #ruby
[21:23:34] gizmore: easy to mess up core stuff.... soooo flexible =)
[21:24:33] gizmore: there is a lot discussion on the net about monkey patching and alike, but first you need to know that loading a file can just overwrite existing code without problems
[21:24:36] gizmore: unlike php
[21:24:58] gizmore: where "class Foo{}; class Foo{};" gives a crash
[21:25:23] gizmore: in ruby class Foo; end; class Foo; end; would both just work on the Foo class definitions
[21:25:35] gizmore: and either overwrite or create definitions
[21:26:24] gizmore: in PHP, monkey patching is not possible, iirc
[21:26:41] gizmore: in Ruby you should not do it, but can :) (and will!)
[21:27:15] gizmore: in PHP i wrote a chatbot and gave up on code reloading on runtime (PECL extension for it sucks)
[21:27:16] freerobby: has joined #ruby
[21:27:23] gizmore: in Ruby it was no problem :)
[21:28:08] gizmore: simply call "load" again on all files, and all methods are updated again \o/
[21:28:27] Robbie: has joined #ruby
[21:28:43] gizmore: unloading methods that had been removed would be a problem, but i ignore that :P
[21:29:14] Robbie: has joined #ruby
[21:29:22] gizmore: i assume WEBRick ignores that as well (a dev http server in rails)
[21:29:37] SilverKey: has joined #ruby
[21:29:53] noobsu: has joined #ruby
[21:30:59] Polysics: has joined #ruby
[21:31:28] idefine: has joined #ruby
[21:32:01] idefine: has joined #ruby
[21:32:30] joneshf-laptop: has joined #ruby
[21:32:30] CausaMortis: has joined #ruby
[21:33:28] jhass: gizmore: WEBRick doesn't do the code reloading, rails does
[21:33:33] jhass: and it doesn't ignore it
[21:33:46] gizmore: i bet removing methods is difficult?
[21:33:50] Azure: has joined #ruby
[21:34:11] jhass: http://blog.rkh.im/code-reloading
[21:34:13] jhass: there you go
[21:36:06] hxegon: has joined #ruby
[21:36:21] maneken: gizmore, do you think maybe ruby is not a good choice for a crm or erp system, and maybe i should something more strict?
[21:37:17] gizmore: maneken: i have learned SAP/ABAP, and the terms CRM and ERP cause mixed feelings here :)
[21:37:35] william3: has joined #ruby
[21:37:38] jhass: gizmore: tl;dr don't monkey patch, drop constants and then load the file(s) that defined them
[21:37:51] gizmore: thanks jhass :)
[21:38:18] jhass: so existing instances will continue to use the old code
[21:38:23] jhass: new instances get the new one
[21:38:26] BrunoSaboia: has joined #ruby
[21:38:36] gizmore: jhass: old instances use new code for my project =)
[21:39:27] gizless: has joined #ruby
[21:40:29] gizmore|2: has joined #ruby
[21:41:22] Gasher: has joined #ruby
[21:41:42] xingped: has joined #ruby
[21:41:44] giz|work: has joined #ruby
[21:42:18] giz|work: jhass: thanks... in my project i want old instances to use new code though... and i assume my "just load all again" approach is ok then?
[21:42:48] jhass: iirc rkh discusses that approach in the above article, but it's some time since I read it
[21:43:17] giz|work: for the ERP / CRM.... i think it would be redicule to use Java or C for a new ERP system
[21:43:35] giz|work: i guess a script language is the way to go, to create a new huge beast
[21:43:49] giz|work: so either python, perl, ruby, php, javascript, etc?
[21:43:53] Xeago: has joined #ruby
[21:44:14] giz|work: i would love to try a node.js server/client website
[21:44:17] jhass: "Go" "script language" *cough*
[21:44:32] giz|work: i know that Go is compiled :)
[21:44:40] giz|work: but maybe it´s a reasonable choice?
[21:45:06] giz|work: i wouldnt want to write a new huge website in C or Java, right?
[21:45:09] jhass: I know shit about CRM/ERP, can't judge
[21:45:25] giz|work: basically it´s just like any other website
[21:46:41] giz|work: CRM == Customer Relationship Management (a buzzword)
[21:47:00] giz|work: basically its just managing contacts
[21:47:36] giz|work: ERP == taxes + shipping + products + material + recipes + costs + departments + customers + employees + etc
[21:47:49] noobsu: has left #ruby: ()
[21:48:07] giz|work: the big problem in replacing SAP/ERP is that it really can handle a lot
[21:48:26] giz|work: its a beast, because economy is a beast
[21:49:13] giz|work: also SAP has grown since the 80's or 90's
[21:49:23] davedev24: has joined #ruby
[21:49:25] giz|work: and it really is ugly, beside being a beast handler
[21:50:10] victortyau: has joined #ruby
[21:50:26] maneken: well, it's international software as well, so it has to support pretty much everything
[21:50:53] giz|work: yep... you cant take a week off and say "i am going to recode SAP" :)
[21:51:00] Yiota: has joined #ruby
[21:51:26] maneken: well, you can't take a month off and say I'm going to learn SAP :P
[21:51:32] tubbo: giz|work: those kinds of massive services are typically pretty polyglot
[21:51:54] tubbo: like they'll use different technology for the frontend, APIs, and internal code that does the "real work"
[21:52:13] giz|work: did you notice i code whitespace morse in my chat messages? Oo
[21:52:18] maneken: would you suggest using a sql database for such a project?
[21:52:32] giz|work: of course :)
[21:52:47] swills: has joined #ruby
[21:52:57] giz|work: databases are a nice thing to store data in a structured way
[21:52:57] jbcden: has joined #ruby
[21:53:01] tubbo: definitely, i wouldn't use any NoSQL database if you're a "system of record"...especially for financial data.
[21:53:24] tubbo: data integrity > data availability in this case.
[21:53:59] giz|work: or just use System.exec "cat 'new data' > db.txt"
[21:54:35] giz|work: the data integrity is assured.... for the last and one and only entry
[21:55:27] aibot_: has joined #ruby
[21:55:27] giz|work: btw.... i have created an installer for ActiveRecord classes :P
[21:55:38] lemur: has joined #ruby
[21:55:47] giz|work: it assures that the scheme is inside the model,and the installer handles dependencies nicely :)
[21:56:00] giz|work: i like ActiveRecord, but dont like rails :)
[21:56:34] giz|work: so my classes install thyself, dependent on other install routines... way more fun than migration files
[21:57:24] tubbo: yeah i kinda wish i could just define the schema in AR and rails would infer changes on its own
[21:57:28] tubbo: s/AR/AR classes
[21:58:01] giz|work: detecting changes is not implemented... and to be honest... its not that easy
[21:58:07] Vircung: has joined #ruby
[21:58:17] giz|work: usually you have install and upgrade.... or just "upgrades"
[21:58:47] giz|work: so in my installer decoraror you just write install install install
[21:58:58] giz|work: which can have dependencies, and every install is a version++
[21:59:18] giz|work: but in the end you always, at least, have the scheme in the model
[21:59:32] giz|work: and there is never a problem with migration dependencies
[22:00:41] giz|work: https://github.com/gizmore/activerecord-magic
[22:01:40] neanderslob: has joined #ruby
[22:01:42] giz|work: its my first spec driven development :)
[22:02:58] tubbo: interesting
[22:03:15] giz|work: could be split in more gems
[22:03:26] giz|work: should spec fine for 38 tests
[22:03:27] tubbo: giz|work: did you know about the event pub/sub system implemented in ActiveSupport?
[22:03:45] giz|work: i have an own event system in my armagic
[22:03:53] giz|work: i am working on a text based chat mud
[22:04:01] giz|work: and events are a hot topic :)
[22:04:03] tubbo: yeah i saw that, i was curious as to why you made that rather than use something off the shelf
[22:04:13] poerror: has joined #ruby
[22:04:14] tubbo: unless it was just for fun, in which case more power to you!
[22:04:16] minimalism: has joined #ruby
[22:04:21] poerror: has left #ruby: ()
[22:04:24] giz|work: because..... i have cities/areas, parties, locations etc
[22:04:42] giz|work: events are submiitted to event containers
[22:04:54] giz|work: there is a global container where you publish/subscribe
[22:05:10] giz|work: but events can also be emitted to subscribers who are connected to your container
[22:05:31] giz|work: so party members and combatents get events when someone is hit
[22:05:44] tessi: has joined #ruby
[22:05:54] giz|work: i decided to code an own event system, because i am unsure if existing systems reflect my needs
[22:06:36] Caerus: has joined #ruby
[22:06:41] giz|work: wanna see my irc/mud in action?
[22:06:48] tubbo: we have our own publish/subscribe system at work, but the real meat & potatoes is this gem called Wisper
[22:06:59] giz|work: join #shadowlamb
[22:07:09] joonty: has joined #ruby
[22:07:19] karapetyan: has joined #ruby
[22:09:30] kareeoleez: has joined #ruby
[22:15:13] bruno-: has joined #ruby
[22:17:31] kfpratt: has joined #ruby
[22:18:21] gregf: has joined #ruby
[22:20:50] idefine: has joined #ruby
[22:20:54] shinnya: has joined #ruby
[22:25:41] jaguarmagenta: has joined #ruby
[22:29:14] zapata: has joined #ruby
[22:29:42] neanderslob: has joined #ruby
[22:30:45] idefine: has joined #ruby
[22:31:27] x77686d: has joined #ruby
[22:32:20] mfb2: has joined #ruby
[22:33:18] yfeldblum: has joined #ruby
[22:34:11] binaryplease1: has joined #ruby
[22:35:25] wldcordeiro: has joined #ruby
[22:37:59] zenlot: has joined #ruby
[22:38:33] baweaver: has joined #ruby
[22:39:10] william3: has joined #ruby
[22:40:06] mfb2: has joined #ruby
[22:43:15] renderful: has joined #ruby
[22:46:28] bronson: has joined #ruby
[22:47:44] idefine_: has joined #ruby
[22:49:55] idefine__: has joined #ruby
[22:51:23] jackjackdripper: has joined #ruby
[22:56:59] chipotle: has joined #ruby
[22:59:09] renderful: has joined #ruby
[23:00:00] mlakewood: has joined #ruby
[23:03:12] banister: has joined #ruby
[23:04:13] renderful: has joined #ruby
[23:04:46] charliesome: has joined #ruby
[23:05:31] bruno-: has joined #ruby
[23:07:07] senayar: has joined #ruby
[23:07:12] mfb2_: has joined #ruby
[23:08:14] renderful: has joined #ruby
[23:08:33] n008f4g_: has joined #ruby
[23:14:36] xingped: hey, can anyone help me understand what "prototypal inheritance" means, how it works in ruby, and how it's different from classical inheritance?
[23:16:50] Rutix: has joined #ruby
[23:16:50] Rutix: has joined #ruby
[23:17:18] SilverKey: has joined #ruby
[23:18:44] fmcgeough: has joined #ruby
[23:18:46] duderonomy: has joined #ruby
[23:19:15] RahulT: has joined #ruby
[23:19:18] smathy: xingped, is this an assignment?
[23:20:30] xingped: smathy, not quite. i have an interview tomorrow for a position teaching full stack web dev. they know i've never used ruby, but i need to learn anyways and this is one of the things talked about. crash coursing myself the past couple days on ruby
[23:21:21] xingped: i've only used PHP for backend dev prior to this
[23:21:51] chagel: has joined #ruby
[23:22:25] smathy: xingped, ok, and you're sure the question is about ruby? Ruby is primarily a class-inheritance based language, and in the web world the classic example of prototypical inheritance is Javascript.
[23:23:16] jackjackdripper1: has joined #ruby
[23:24:02] xingped: hm... it's a "mock teaching session" interview, but it's a bit vague on whether they meant ruby or javascript. maybe they meant javascript
[23:24:15] chipotle: has joined #ruby
[23:25:01] hxegon: xingped I would think they mean JS, as ruby (allegedly) has poor support for that kind of thing
[23:25:11] baweaver: prototypes are straight Javascript
[23:25:21] xingped: haha, alright, thanks ya'll
[23:25:42] xingped: never done prototypal anything in javascript either
[23:25:46] smathy: xingped, so ruby does _kinda_ have the mechanism via mixins, but in the ruby world no one refers to it as prototypical inheritance because ruby's primary method of inheritance is class-based.
[23:26:03] graft: has joined #ruby
[23:26:03] graft: has joined #ruby
[23:26:22] smathy: xingped, so maybe to cover all bases, take a quick look at mixins in ruby, they're easy, and then get into JS.
[23:26:33] xingped: alright, thanks smathy
[23:26:33] freerobby: has joined #ruby
[23:26:57] graft: heyo, so often i do: def initialize(foo,bar); @foo = foo; @bar = bar; end - is there a way to do this implicitly, i.e. initialize directly into an instance var?
[23:27:08] graft: like def initialize(@foo,@bar) or something
[23:27:46] smathy: xingped, but seriously, I'm over 25 years as a dev, over 10 in ruby, and if I went for a job and they asked me about prototypical inheritance in ruby I'd say: "Huh? You mean javascript right."
[23:28:03] baweaver: not really for that without passing it a hash and dynamically assign them
[23:28:23] baweaver: which presents its own dangers
[23:28:29] smathy: graft, no, but you can do a parallel assignment: @foo, @bar = foo, bar;
[23:28:48] graft: smathy: yeah... still seems like a waste of characters
[23:29:02] xingped: smathy, haha, good to know. new to ruby so didn't know it wasn't really a thing in ruby
[23:29:05] smathy: I can't cure your biases against characters.
[23:29:08] Azure: has joined #ruby
[23:29:18] smathy: xingped, yep, good luck.
[23:29:19] Nilium: What do you have against glyphs
[23:29:30] mfb2: has joined #ruby
[23:29:34] graft: they cost mana
[23:30:41] baweaver: you could make a macro type method for it based on attr_{reader, writer, accessor}
[23:30:51] smathy: graft, once I wanted to be able to just say: `def initialize @foo, @bar; end` - but y'know, it passed.
[23:32:42] bradleyprice: has joined #ruby
[23:32:57] baweaver: >> class Test < Struct.new(:foo, :bar); end; Test.new(1,2)
[23:32:59] ruby[bot]: baweaver: # => #<struct Test foo=1, bar=2> (https://eval.in/557792)
[23:33:35] Arcaire: has joined #ruby
[23:35:34] smathy: I can hear all those saved characters rejoicing.
[23:35:48] smathy: ...and future baweaver swearing.
[23:37:25] baweaver: ACTION uses Structs on occasion
[23:38:18] smathy: ACTION too, not for this reason though ;)
[23:40:42] william3: has joined #ruby
[23:40:54] baweaver: Oh I know, it's dirty
[23:41:31] Nilium: I use Go. You get over languages not being ultra-concise.
[23:42:42] crystal77: has joined #ruby
[23:43:24] crystal77: Figured this was the best place to ask this. Do we need to use "rbenv rehash" for rbenv anymore? Thought it was built in now? https://github.com/rbenv/rbenv/pull/638/commits/67f429c41de851052950ffdb372fda90a21a4356
[23:44:07] baweaver: has joined #ruby
[23:44:16] govg: has joined #ruby
[23:46:54] devbug: has joined #ruby
[23:48:48] dunj3: has joined #ruby
[23:49:53] govg: has joined #ruby
[23:53:41] mlakewood: has joined #ruby
[23:55:41] govg: has joined #ruby
[23:56:44] neha-: has joined #ruby
[23:57:09] goodroot: has joined #ruby