« Back to channel list

#ruby - 01 November 2018

« Back 1 day Forward 1 day »
[00:08:12] Dimik: has joined #ruby
[00:10:43] canton7: has joined #ruby
[00:12:42] eddof13: has joined #ruby
[00:17:20] havenwood: Inside: What's the difference before and after?
[00:21:38] za1b1tsu: has joined #ruby
[00:31:48] mroutis: has joined #ruby
[00:34:03] orbyt_: has joined #ruby
[00:39:13] nexraf1: has joined #ruby
[00:41:24] brkkyk: has joined #ruby
[00:53:47] vutral1: has joined #ruby
[01:06:56] helpa: has joined #ruby
[01:10:28] agent_white: has joined #ruby
[01:12:31] darkhanb: has joined #ruby
[01:16:06] segy: has joined #ruby
[01:20:54] siaw23: has joined #ruby
[01:20:57] gix: has joined #ruby
[01:23:28] nine_milli__: has joined #ruby
[01:23:40] nine_milli__: HI IS MICHALE MYERS THE REAL SUPERMAN?
[01:24:11] nchambers: has joined #ruby
[01:27:41] djellemah_: has joined #ruby
[01:29:10] nine_milli__: has left #ruby: ("Leaving")
[01:39:17] baweaver: !badnick nine_milli__
[01:39:17] ruby[bot]: +bb nine_milli__!*@*$#ruby-banned *!*@c-76-23-234-152.hsd1.ct.comcast.net$#ruby-banned
[01:39:25] baweaver: faster way to permaban trolls
[01:41:48] darkhanb: has joined #ruby
[01:42:39] Hobbyboy: has joined #ruby
[01:44:24] darkhanb: has joined #ruby
[01:45:54] kapil____: has joined #ruby
[01:52:50] cow[moo]: has joined #ruby
[02:00:19] kurko_: has joined #ruby
[02:04:25] darkhanb: has joined #ruby
[02:09:38] za1b1tsu: has joined #ruby
[02:10:23] asphyxia: has joined #ruby
[02:19:55] kurko_: has joined #ruby
[02:22:31] siaw23: has joined #ruby
[02:32:11] Hobbyboy: has joined #ruby
[02:34:08] ghormoon: has joined #ruby
[02:35:02] mangold: has joined #ruby
[02:35:38] SolarAquarion: has joined #ruby
[02:37:10] ghormoon: has joined #ruby
[02:43:13] ghormoon: has joined #ruby
[02:45:01] esrse: has joined #ruby
[02:46:39] kurko_: has joined #ruby
[02:51:48] ghormoon: has joined #ruby
[02:59:34] cow[moo]: has joined #ruby
[03:04:51] ghormoon: has joined #ruby
[03:06:01] mangold: has joined #ruby
[03:10:45] cagomez: has joined #ruby
[03:15:06] regedit: has joined #ruby
[03:32:23] kurko_: has joined #ruby
[03:44:31] zwliew: has joined #ruby
[03:53:09] mangold: has joined #ruby
[03:57:44] za1b1tsu: has joined #ruby
[04:06:23] johnny56: has joined #ruby
[04:06:51] za1b1tsu: has joined #ruby
[04:09:05] braincrash: has joined #ruby
[04:18:22] kurko_: has joined #ruby
[04:18:31] sauvin: has joined #ruby
[04:21:30] roshanavand1: has joined #ruby
[04:23:55] sanscoeur: has joined #ruby
[04:28:51] nchambers: has joined #ruby
[04:31:23] eckhardt: has joined #ruby
[04:45:16] kurko_: has joined #ruby
[04:48:23] meinside: has joined #ruby
[04:50:54] Puffball: has joined #ruby
[05:01:57] mangold: has joined #ruby
[05:04:01] MoritaShinobu: has joined #ruby
[05:10:08] Puffball: has joined #ruby
[05:23:10] kurko_: has joined #ruby
[05:33:00] Puffball: has joined #ruby
[05:34:45] sanscoeur: has joined #ruby
[05:45:06] mangold: has joined #ruby
[05:53:43] solocshaw: has joined #ruby
[05:58:25] solocshaw: has joined #ruby
[06:14:54] OrangeManBad: has joined #ruby
[06:16:44] aupadhye: has joined #ruby
[06:22:23] roshanavand: has joined #ruby
[06:30:43] pragathoys: has joined #ruby
[06:35:50] doubledup: has joined #ruby
[06:37:39] pragathoys: has joined #ruby
[06:44:27] nchambers: has joined #ruby
[07:02:00] gix: has joined #ruby
[07:11:29] despai: has joined #ruby
[07:21:01] pragathoys: has joined #ruby
[07:31:11] dellavg_: has joined #ruby
[07:37:14] aufi: has joined #ruby
[07:43:41] aufi: has joined #ruby
[08:03:01] conta: has joined #ruby
[08:18:28] MyMind: has joined #ruby
[08:19:31] clemens3: has joined #ruby
[08:20:04] kurko_: has joined #ruby
[08:29:58] kurko_: has joined #ruby
[08:35:03] roshanavand: has joined #ruby
[08:38:37] nchambers: has joined #ruby
[08:41:03] clemens3: has joined #ruby
[09:01:57] lupine: has joined #ruby
[09:18:15] nchambers: has joined #ruby
[09:31:32] alem0lars: has joined #ruby
[09:32:26] reber: has joined #ruby
[09:33:25] SuperL4g: has joined #ruby
[09:33:44] SuperLag_: has joined #ruby
[09:34:56] hightower3: has joined #ruby
[09:35:30] hightower3: Hey, I am looking at rspec tests where they invoke e.g. "post" to make a HTTP POST request, and then the response object is automatically available in the 'response' variable or method.
[09:35:58] hightower3: How exactly is this 'response' defined and set? I would need to write a helper method which does the same thing essentially
[09:38:38] xfbs: has joined #ruby
[09:42:04] venmx: has joined #ruby
[09:44:10] alem0lars: has joined #ruby
[09:44:52] alem0lars: has joined #ruby
[10:01:15] c0san0stra: has joined #ruby
[10:02:25] nchambers: has joined #ruby
[10:05:44] whysthatso: has joined #ruby
[10:05:48] TvL2386: hey guys. I know it's possible to use the tiny_tds gem to connect to a MSSQL Database from linux, but is it also possible to connect to a MSSQL database when running ruby on windows?
[10:14:27] NL3limin4t0r: has joined #ruby
[10:14:53] CrazyEddy: has joined #ruby
[10:18:12] NL3limin4t0r: Is it possible to use *.so libraries in Ruby? I use a proprietary piece of software that has an API. However this API comes only as *.so library file (plus the Windows variant).
[10:20:14] hightower3: but you have header files for it, right?
[10:22:00] NL3limin4t0r: Not at the moment. I'll have to check if they are provided.
[10:23:55] NL3limin4t0r: I currently wrote a small C program that acts like a daemon, opening a UNIX socket to which it listens. Incomming data is passed to the library and the response is passed back to the socket.
[10:24:37] NL3limin4t0r: It works fine, but I was wondering if it could be done in Ruby itself.
[10:30:37] ams__: has joined #ruby
[10:30:51] hightower3: NL3limin4t0r, of course it could
[10:37:32] NL3limin4t0r: Let me phrase that differently. I was wondering if Ruby supports the intergration with *.so files without dirty hacks.
[10:40:09] nchambers: has joined #ruby
[10:46:35] jespada: has joined #ruby
[10:47:50] al2o3-cr: NL3limin4t0r: is the so file a ruby c extension? if so, then it's a simple require 'foo.so'. if not, then you'd have to use ffi or some such.
[10:49:25] NL3limin4t0r: al2o3-cr: the so extension stands for Shared Object and is used in the Linux C and C++ languages. Windows uses dll for this.
[10:49:59] kurko_: has joined #ruby
[10:50:21] al2o3-cr: NL3limin4t0r: i'm aware and for mac dylib?
[10:52:04] NL3limin4t0r: I have no clue about macs.
[10:53:45] al2o3-cr: NL3limin4t0r: what i'm saying if it's not a ruby c extension you would have to use ffi to interact with said so file.
[10:56:17] ur5us: has joined #ruby
[11:00:34] NL3limin4t0r: Ah, I can work with that. Didn't know about the ffi gem. ty
[11:00:35] jespada: has joined #ruby
[11:02:33] al2o3-cr: NL3limin4t0r: btw, there is also fiddle in the stdlib.
[11:03:14] al2o3-cr: which is also libffi wrapper.
[11:07:14] phaul: has joined #ruby
[11:08:39] mangold: has joined #ruby
[11:09:22] jespada: has joined #ruby
[11:10:09] JusticeFries: has joined #ruby
[11:10:23] gilfoyle: has joined #ruby
[11:13:12] AJA4350: has joined #ruby
[11:16:30] jespada: has joined #ruby
[11:20:50] phaul: has joined #ruby
[11:26:29] jespada: has joined #ruby
[11:39:30] Fusselgesicht: has joined #ruby
[11:41:21] nchambers: has joined #ruby
[11:45:02] OrangeManBad: has joined #ruby
[11:48:35] JusticeFries: has joined #ruby
[11:52:15] apparition: has joined #ruby
[11:54:39] conta: has joined #ruby
[12:01:32] roshanavand: has joined #ruby
[12:10:33] djellemah: NL3limin4t0r: fiddle is (as usual for ruby's lesser-known std libraries) very competent but somewhat under-documented.
[12:28:22] mostlybadfly: has joined #ruby
[12:30:49] nezt0r: has joined #ruby
[12:36:00] tAn: has joined #ruby
[12:36:23] za1b1tsu: has joined #ruby
[12:42:54] nchambers: has joined #ruby
[12:48:03] NL3limin4t0r: djellemah: I'll have a look ty for the suggestion.
[12:52:16] m0nty0ne: has joined #ruby
[12:53:07] m0nty0ne: has joined #ruby
[13:04:17] kapil____: has joined #ruby
[13:07:23] GodFather: has joined #ruby
[13:11:51] bak1an: has joined #ruby
[13:14:10] voolik: has joined #ruby
[13:15:31] dachi: has joined #ruby
[13:17:41] roshanavand: has joined #ruby
[13:26:55] dachi: Do you think class variables are (@@) going to get deprecated, or do you think they're going to be used by gems like URI and others? Do you use them?
[13:32:19] dachi: I mean ruby-3xx
[13:41:27] TheBloke: has joined #ruby
[13:49:05] jsc: has joined #ruby
[13:56:05] dachi: I was just saying that this is a pretty solid establishment and not going to be changed
[13:56:16] dachi: But still I asked for your opinion
[13:58:58] dmitch: has joined #ruby
[13:59:28] brkkyk: has joined #ruby
[14:00:35] yokel: has joined #ruby
[14:27:36] bauruine: has joined #ruby
[14:28:36] spiette: has joined #ruby
[14:31:10] JusticeFries: has joined #ruby
[14:33:29] spiette: has joined #ruby
[14:33:58] kaleido: has joined #ruby
[14:37:58] aufi: has joined #ruby
[14:38:34] egourlao: has joined #ruby
[14:41:48] roshanavand: has joined #ruby
[14:49:19] kirun: has joined #ruby
[14:49:22] conta: has joined #ruby
[14:52:57] Puffball: has joined #ruby
[14:55:42] rippa: has joined #ruby
[15:08:26] Deesl: has joined #ruby
[15:10:08] chouhoulis: has joined #ruby
[15:11:20] desperek: has joined #ruby
[15:16:55] Dimik: has joined #ruby
[15:17:10] brendan-: has joined #ruby
[15:18:36] pskosinski: has joined #ruby
[15:21:46] orbyt_: has joined #ruby
[15:34:40] roshanavand: has joined #ruby
[15:38:17] sanscoeur: has joined #ruby
[15:40:37] sanscoeur: has joined #ruby
[15:42:01] ivanskie: has joined #ruby
[15:44:16] mniip: has joined #ruby
[15:45:08] eddof13: has joined #ruby
[15:48:43] havenwood: dachi: It's unlikely they'll have their semantics fixed or that they'll be deprecated in Ruby 3. It would cause too many breaking changes.
[15:49:13] havenwood: dachi: That said, they continue to be an anti-pattern to use. Just like with global variables, it's recommended to not use class variables, but they won't be removed anytime soon.
[15:49:38] havenwood: "the use of class variables is not recommended (like global variables)" ~Matz
[15:49:45] dachi: havenwood thanks, that's what I was thinking too
[15:49:51] Inside: Everything is a singleton!
[15:50:01] havenwood: dachi: This is the best thread to follow for the issue: https://bugs.ruby-lang.org/issues/14541
[15:50:11] Inside: SingletonGenerator::makeSingleton(SingletonStringFactory)
[15:51:32] havenwood: Inside: Singleton is one of the stdlib libs that Matz himself maintains!
[15:54:20] troulouliou_dev: has joined #ruby
[15:54:44] phaul: has joined #ruby
[15:55:15] Inside: huh interesting
[15:55:30] Inside: I like a good singleton here and there, but I thought they were considered a no-no anti-patterns?
[15:56:44] havenwood: Inside: When you actually only have one instance of state, they're great.
[15:57:03] havenwood: Inside: Modules for no state, pure functions. Singletons for a single instance of state. Classes for multiple instances of state.
[16:01:14] moei: has joined #ruby
[16:09:01] hurricanehrndz: has joined #ruby
[16:09:36] jcarl43: has joined #ruby
[16:13:37] apeiros_: has joined #ruby
[16:15:10] Xiti: has joined #ruby
[16:17:51] darkhanb: has joined #ruby
[16:21:53] krawchyk: has joined #ruby
[16:26:20] sanscoeur: has joined #ruby
[16:28:24] Inside: Q: Is iterating over a hash guaranteed to have the same order if you iterate over the hash multiple times?
[16:28:28] Inside: (without modifying the hash, obv)
[16:29:02] apeiros_: Inside: as of 1.9, yes
[16:29:08] Inside: ah goodie
[16:29:12] apeiros_: hashes are ordered (insertion order)
[16:29:19] Inside: wait what
[16:29:49] Inside: I've been using ActiveSupport::OrderedHash over here if I need that
[16:30:09] apeiros: I would be surprised if it wasn't an alias to Hash nowadays.
[16:30:32] dachi: I just love ruby, all these years!
[16:30:35] apeiros: "DEPRECATED: ActiveSupport::OrderedHash implements a hash that preserves insertion order"
[16:30:39] apeiros: says the docs :-D
[16:30:47] apeiros: (also `ActiveSupport::OrderedHash < Hash`)
[16:30:51] dachi: I dream of it being superfast
[16:31:06] Inside: where do you see that, apeiros?
[16:31:13] apeiros: https://api.rubyonrails.org
[16:31:23] apeiros: u no docs?
[16:31:28] Inside: https://apidock.com/rails/ActiveSupport/OrderedHash
[16:32:05] apeiros: rails 4 docs…
[16:32:24] Inside: well - it is what I am using
[16:32:48] Inside: but yup yup looks like it's just Hash these days
[16:32:49] Inside: fun times
[16:42:37] sanscoeur: has joined #ruby
[16:51:21] donofrio: has joined #ruby
[16:55:36] ivanskie: i gave up with my quest of making it work with net::ssh. can't beat it into submission. though it's just not meant for what i want obviously. ended up just doing Kernel.exec launching a cooked up ssh command.
[16:59:39] TheBloke: has joined #ruby
[17:00:56] desperek: does somebody use cuba.rb?
[17:01:08] desperek: how do i make 404/403 and all these
[17:02:34] krawchyk: has joined #ruby
[17:03:07] AJA4350: has joined #ruby
[17:04:01] apeiros: ivanskie: tried sshkit?
[17:09:07] za1b1tsu: has joined #ruby
[17:13:53] roshanavand: has joined #ruby
[17:16:32] kurko_: has joined #ruby
[17:19:07] TheBloke: has joined #ruby
[17:19:56] eckhardt: has joined #ruby
[17:25:08] roshanavand: has joined #ruby
[17:26:20] spiette: has joined #ruby
[17:41:55] postmodern: has joined #ruby
[17:42:39] cow[moo]: has joined #ruby
[17:54:02] sanscoeur: has joined #ruby
[17:54:30] roshanavand: has joined #ruby
[17:56:54] tdy: has joined #ruby
[17:58:02] Fusl: has joined #ruby
[18:08:39] Fusselgesicht: has joined #ruby
[18:10:04] Fusselgesicht: has left #ruby: ()
[18:19:52] bak1an: has joined #ruby
[18:22:55] MoritaShinobu: has joined #ruby
[18:26:48] akaiiro: has joined #ruby
[18:29:38] eckhardt: has joined #ruby
[18:33:10] kurko__: has joined #ruby
[19:02:02] despai: has joined #ruby
[19:05:52] ramfjord: has joined #ruby
[19:06:16] ivanskie: has joined #ruby
[19:06:46] ivanskie: apeiros I haven't tried sshkit. but it looks like it could be quite useful in my case. it doesn't help with interactive shell though.
[19:08:41] ivanskie: thanks for the suggestion though!
[19:09:16] kurko_: has joined #ruby
[19:16:35] jmcgnh: has joined #ruby
[19:16:42] mangold: has joined #ruby
[19:17:34] spiette: has joined #ruby
[19:19:44] eckhardt: has joined #ruby
[19:31:42] nowhere_man: has joined #ruby
[19:33:55] Nicmavr: has joined #ruby
[19:39:25] Inv1s1ble: has joined #ruby
[19:40:06] eam: ivanskie: I always shell out to ssh, there's unfortunately no other way to do fully featured ssh sessions
[19:40:15] aufi: has joined #ruby
[19:40:17] Inv1s1ble: I've got a function that takes in two functions and I'm trying to figure out how to determine the correct function is called within rspec: https://bpaste.net/show/dfb33b2131ed
[19:40:27] eam: every ssh library across all languages has some crucial feature they're missing
[19:40:31] Inv1s1ble: What should I be doing to ensure the first lambda is called and the second isn't?
[19:40:48] ivanskie: yeah i had to find that out the hard way.. rather I assumed i could do it and went on.
[19:41:20] ivanskie: but thats what i just ended up doing. just build the ssh command string then Kernel.exec into it.
[19:41:49] ivanskie: sshkit looks cool for running rake commands on remotes after jumping through jumpbox tho.
[19:42:35] eam: I've not yet found an ssh library which can handle kerberos auth
[19:42:45] eam: in any language, not just ruby
[19:43:17] ivanskie: so i could do.. `$ app rake super-awesome-rake-task --app my-cool-app --env staging`. and it'd jump to right box and run the rake command within correct folder and envars, etc etc with pretty output. looks promising haha
[20:11:26] nexraf1: has joined #ruby
[20:13:07] eckhardt: has joined #ruby
[20:16:59] nowhere_man: has joined #ruby
[20:30:23] eckhardt: has joined #ruby
[20:35:26] zenspider: eam: wow. I used kerberos once... in 1997. (really) I assume it hasn't gotten easier.
[20:36:04] ivanskie: there's some hardware that uses kerberous auth to get into xml api
[20:36:25] ivanskie: ACTION gets unpleasant shiver from the memories
[20:37:05] ivanskie: though i've never had to ssh with that
[20:42:59] nowhere_man: has joined #ruby
[20:44:39] SeepingN: has joined #ruby
[20:47:03] eddof13: has joined #ruby
[21:08:20] eddof13: has joined #ruby
[21:10:40] venmx: has joined #ruby
[21:11:14] asphyxia: has joined #ruby
[21:13:52] nowhere_man: has joined #ruby
[21:19:47] AJA4350: has joined #ruby
[21:19:51] SuperLag: has joined #ruby
[21:20:24] Sup3rLurk: has joined #ruby
[21:25:19] eckhardt: has joined #ruby
[21:31:46] eckhardt: has joined #ruby
[21:32:10] eam: zenspider: it's uh, eh. There's a reason most ssh libraries lack support :)
[21:32:39] eam: it's really nice from a user perspective at least
[21:33:34] eam: we need more SSO systems
[21:34:12] MoritaShinobu: has joined #ruby
[21:48:51] dmitch: has joined #ruby
[22:00:17] jp: has joined #ruby
[22:03:23] SirFunk: has joined #ruby
[22:06:17] nexraf1: has joined #ruby
[22:12:25] nexraf1: has joined #ruby
[22:22:22] ellcs: has joined #ruby
[22:24:29] RougeR: has joined #ruby
[22:29:58] nexraf1: has joined #ruby
[22:35:38] eckhardt: has joined #ruby
[22:36:23] eckhardt_: has joined #ruby
[22:42:45] sagax: how to see where module placed?
[22:46:59] wojnar: has joined #ruby
[23:09:47] cliluw: has joined #ruby
[23:10:50] clemens3: has joined #ruby
[23:13:20] tjbp_: has joined #ruby
[23:13:31] nexraf1: has joined #ruby
[23:23:16] ged: has joined #ruby
[23:24:13] wojnar_: has joined #ruby
[23:24:27] ivanskie: hey uhm how do you do this in ruby? namespace = 'aws:elasticbeanstalk:application:environment'
[23:24:28] ivanskie: vars = {n['OptionName']: n['Value'] for n in settings
[23:24:29] ivanskie: if n["Namespace"] == namespace}
[23:26:26] ivanskie: settings.map {|n| n{'OptionName'] = n['Value'] if n==namespace }. ?
[23:26:36] teardown: has joined #ruby
[23:28:21] ivanskie: nevermind got it
[23:32:59] funnel: has joined #ruby
[23:37:40] Fusl: has joined #ruby
[23:43:56] ivanskie: nope dont got it
[23:44:17] teardown: has joined #ruby
[23:44:39] phaul: ivanskie: paste the inspect of settings somewhere, it's not clear what the structure is
[23:49:01] phaul: dpaste.de is recommended in the topic..
[23:50:27] warrshrike: has joined #ruby
[23:50:45] warrshrike: are ruby objects 'unique'
[23:50:46] havenwood: hi warrshrike
[23:51:07] havenwood: warrshrike: what do you mean by "unique"?
[23:51:07] warrshrike: i.e. i have a ruby linked list and I want to detect whether it has a circle
[23:51:54] phaul: pff that old chestnut ..:)
[23:52:01] baweaver: Object hash certainly is unique.
[23:52:11] havenwood: SipHash13 ftw.
[23:52:12] warrshrike: if i do keep a pointer to the head and start iterating and checking if if (node == head)
[23:52:16] warrshrike: will this work?
[23:52:21] ivanskie: i got it figured out. in that i didn't have to do the map at all
[23:52:26] baweaver: ivanskie: You want to make a hash out of EBS data?
[23:52:43] ivanskie: yeah i'm trying to get env vars.
[23:52:53] warrshrike: havenwood: does that make sense?
[23:53:26] warrshrike: also does equality work automatically for classes ala === javascript or does it have to be overloaded like c++
[23:53:28] ivanskie: looks like in ruby sdk, it just stuffs them all into single option setting called 'EnvironmentVariables'. a comma separated list of assignments. as one string
[23:53:36] ivanskie: which im now trying to convert to a hash.
[23:53:50] baweaver: settings.select { |s| s['Namespace'] == namespace }.map { |s| [s['OptionName'], s['Value']] }.to_h
[23:55:30] havenwood: warrshrike: See: https://ruby-doc.org/core-2.5.3/Object.html#method-i-eql-3F
[23:55:34] warrshrike: so it seems like the .equal? method ('pointer equality') would work here?
[23:55:49] ivanskie: baweaver you are a genius
[23:57:24] havenwood: warrshrike: equal? checks object id, so "" isn't #equal? to another ""
[23:57:58] warrshrike: havenwood: yes but , h = 1, g = h, h.equals? g is true
[23:58:17] baweaver: It's not really intuitive to make hashes from a set of values in Ruby.
[23:58:20] warrshrike: havenwood: this makes it look like ruby is doing pass by ref
[23:58:31] warrshrike: which isnt really true
[23:58:37] warrshrike: g = 7 wont update h
[23:58:43] havenwood: warrshrike: h.rehash
[23:58:44] warrshrike: im not trying to make hashes lol
[23:58:45] lupine: ruby mostly does pass by roulette
[23:58:58] warrshrike: what is that lupine
[23:58:59] lupine: never know what you're going to get
[23:59:25] lupine: come on, it deserves a sensible chuckle at minimum
[23:59:27] havenwood: warrshrike: it's pass by reference to a value, which is an object ¯\_(ツ)_/¯