« Back to channel list

#ruby - 04 July 2017

« Back 1 day Forward 1 day »
[00:00:43] micalexander: has left #ruby: ()
[00:00:50] micalexander: has joined #ruby
[00:01:02] micalexander: has left #ruby: ()
[00:02:21] xMopxShell: has joined #ruby
[00:06:03] solocshaw: has joined #ruby
[00:06:27] ketan: has joined #ruby
[00:13:04] jak: has joined #ruby
[00:14:34] helpa: has joined #ruby
[00:16:37] helpa: has joined #ruby
[00:17:21] PaulCapestany: has joined #ruby
[00:20:11] nofxx: has joined #ruby
[00:22:03] jud: has joined #ruby
[00:23:38] al2o3-cr: learner123: https://eval.in/826871 # just for fun, consider using a hash :)
[00:24:52] singer22: has left #ruby: ("Leaving")
[00:24:54] nofxx: has joined #ruby
[00:25:38] ascarter: has joined #ruby
[00:25:41] solocshaw: has joined #ruby
[00:26:08] arescorpio: has joined #ruby
[00:26:30] mim1k: has joined #ruby
[00:28:01] V1s1ble: oh man, I missed a crazy spam bot
[00:28:34] V1s1ble: anyone actually check out that TOR url?
[00:31:32] al2o3-cr: ACTION eyes are like lead shutters
[00:32:48] whippythellama: has joined #ruby
[00:39:49] duderonomy: has joined #ruby
[00:44:07] solocshaw: has joined #ruby
[00:47:59] jakk: has joined #ruby
[00:51:06] jackjackdripper: has joined #ruby
[00:54:40] cyphase: has joined #ruby
[00:56:04] duderonomy: has joined #ruby
[01:01:56] V1s1ble: Is there a simple way to flatten an array of hashes into just a hash? For example:
[01:02:55] V1s1ble: [{"web1" => ["firewall","docker","web"]}, {"vpn" => ["firewall", "openvpn"] }}
[01:03:06] d^sh: has joined #ruby
[01:03:15] V1s1ble: converting that to just a hash with web1 and vpn pointing to those lists
[01:04:20] V1s1ble: Like I'm using a map to generate that first line. In Scala I know I can use flatMap or map + flatten, but flatten in Ruby doesn't seem to have the same effect
[01:05:42] mim1k: has joined #ruby
[01:05:51] jtd: has joined #ruby
[01:08:06] V1s1ble: oh nevermind .. Ruby does have a flat_map
[01:08:06] gix-: has joined #ruby
[01:10:06] al2o3-cr: V1s1ble: use Enumerable#inject
[01:10:52] whippythellama: has joined #ruby
[01:13:20] V1s1ble: al2o3-cr, ah..so inject is like reduce where you hand it an empty {} as the accumulator?
[01:13:34] al2o3-cr: >> [{"web1" => ["firewall","docker","web"]}, {"vpn" => ["firewall", "openvpn"]}].inject(:update)
[01:13:35] ruby[bot]: al2o3-cr: # => {"web1"=>["firewall", "docker", "web"], "vpn"=>["firewall", "openvpn"]} (https://eval.in/826873)
[01:15:02] Rr4sT: has joined #ruby
[01:15:26] solocshaw: has joined #ruby
[01:15:52] V1s1ble: al2o3-cr, awesome. That works great. Thanks :)
[01:16:08] al2o3-cr: V1s1ble: yw
[01:29:53] solocshaw: has joined #ruby
[01:30:12] Cohedrin_: has joined #ruby
[01:32:47] charliesome: has joined #ruby
[01:40:14] jak: has joined #ruby
[01:43:29] ioSelect: has joined #ruby
[01:43:49] SteenJobs: has joined #ruby
[01:46:35] solocshaw: has joined #ruby
[01:47:32] gizmore|2: has joined #ruby
[01:50:50] jakk: has joined #ruby
[01:53:51] whippythellama: has joined #ruby
[01:56:56] Cohedrin_: has joined #ruby
[01:58:51] mim1k: has joined #ruby
[02:01:22] Joufflu: has joined #ruby
[02:02:44] rgiscard: has joined #ruby
[02:04:13] dcunit3d: has joined #ruby
[02:06:19] NeutronStarr: has joined #ruby
[02:07:19] ketan: has joined #ruby
[02:14:31] Cohedrin_: has joined #ruby
[02:14:43] mim1k: has joined #ruby
[02:15:51] umaaji: has joined #ruby
[02:18:21] umaaji: has joined #ruby
[02:19:56] devtroid: has joined #ruby
[02:20:54] havenwood: devtroid: hi
[02:31:54] jak: has joined #ruby
[02:33:03] whippythellama: has joined #ruby
[02:33:17] Cohedrin_: has joined #ruby
[02:34:17] guest2017: has joined #ruby
[02:34:38] guest2017: has left #ruby: ()
[02:37:54] jak: has joined #ruby
[02:39:52] ascarter: has joined #ruby
[02:39:57] devtroid: I'm new here.
[02:40:10] devtroid: HOw does this work?
[02:40:26] devtroid: Good topics?
[02:40:33] devtroid: Jobs? New tech?
[02:41:52] havenwood: devtroid: Ruby!
[02:42:29] devtroid: I know, but more specific.
[02:42:53] devtroid: havenwood, Are u a pro dev?
[02:43:51] ascarter_: has joined #ruby
[02:45:06] havenwood: devtroid: it's what i get paid to do, yes
[02:45:52] devtroid: I'm just a junior rub dev.
[02:45:58] devtroid: Working with rails
[02:46:02] havenwood: devtroid: welcome
[02:46:21] havenwood: mruby 1.3.0 was just released, in Ruby news
[02:46:28] devtroid: I wanna know ruby web around the world
[02:46:53] havenwood: Or at least it was tagged. Release soon!: http://mruby.org/
[02:49:52] Jameser: has joined #ruby
[02:50:12] havenwood: devtroid: It's a lightweight implementation of Ruby that can be embedded like Lua.
[02:50:24] havenwood: devtroid: https://github.com/mruby/mruby
[02:51:07] havenwood: devtroid: Here's mruby running in the browser, for one example: https://joshnuss.github.io/mruby-web-irb/
[02:52:08] havenwood: devtroid: Or running on Nginx (quite fast): https://github.com/matsumotory/ngx_mruby
[02:53:26] havenwood: devtroid: See for example, mgx_mruby at ~380k json requests served per second: https://www.techempower.com/benchmarks/#section=data-r14&hw=ph&test=json
[02:54:11] havenwood: That even beats Roda with Sequal and Puma on MRI at ~193k requests per second.
[02:55:51] mim1k: has joined #ruby
[02:56:45] jakk: has joined #ruby
[02:58:18] devtroid: havenwood, R u senior or slt?
[03:00:01] havenwood: devtroid: What's slt?
[03:00:02] jakk: has joined #ruby
[03:00:26] devtroid: havenwood, something like that* haha
[03:02:02] havenwood: ACTION must leave in search of food
[03:03:04] devtroid: havenwood: Now? Here is late at night
[03:04:06] havenwood: devtroid: http://www.total-knowledge.com/~ilya/mips/ugt.html
[03:05:19] Cohedrin_: has joined #ruby
[03:07:41] montanonic: has joined #ruby
[03:09:32] ionte: has joined #ruby
[03:10:11] whippythellama: has joined #ruby
[03:11:47] mim1k: has joined #ruby
[03:14:01] devtroid: havenwood: Where do u work?
[03:32:49] knight33: has joined #ruby
[03:33:34] Cohedrin_: has joined #ruby
[03:34:58] isBEKaml: has left #ruby: ()
[03:36:28] ascarter: has joined #ruby
[03:36:30] nullFxn: has joined #ruby
[03:39:16] cschneid: has joined #ruby
[03:48:57] claw: has joined #ruby
[03:49:22] gix: has joined #ruby
[03:49:37] nadir: has joined #ruby
[03:49:39] ahrs: has joined #ruby
[03:53:20] cschneid_: has joined #ruby
[03:54:34] Cohedrin_: has joined #ruby
[03:55:46] mim1k: has joined #ruby
[03:56:08] Tempesta: has joined #ruby
[04:01:11] dasher00: has joined #ruby
[04:02:00] jak: has joined #ruby
[04:02:22] shinnya: has joined #ruby
[04:02:53] cschneid: has joined #ruby
[04:02:59] cadillac_: has joined #ruby
[04:08:10] ketan: has joined #ruby
[04:08:33] charliesome: has joined #ruby
[04:27:13] uZiel: has joined #ruby
[04:31:57] mim1k: has joined #ruby
[04:35:14] Rodya_: has joined #ruby
[04:45:00] enterprisey: has joined #ruby
[04:47:08] duderonomy: has joined #ruby
[04:47:37] dminuoso: ACTION pokes havenwood with an oddly Shannon-shaped stick.
[04:50:08] agent_white: has joined #ruby
[04:51:12] mniip: has joined #ruby
[04:51:38] Ishido: has joined #ruby
[04:56:00] hutch34: has joined #ruby
[04:56:09] harfangk: has joined #ruby
[04:58:28] podlech: has joined #ruby
[05:04:58] patrontechnosoft: has joined #ruby
[05:11:29] akkad: has joined #ruby
[05:11:51] SteenJobs: has joined #ruby
[05:12:03] tens0r: has joined #ruby
[05:13:03] jak: has joined #ruby
[05:22:06] govg: has joined #ruby
[05:28:27] Silthias1: has joined #ruby
[05:31:15] aupadhye: has joined #ruby
[05:31:27] AnoHito: has joined #ruby
[05:33:29] ozzloy: has joined #ruby
[05:33:29] ozzloy: has joined #ruby
[05:36:29] dcunit3d: has joined #ruby
[05:37:41] Rodya_: has joined #ruby
[05:38:53] podlech: has joined #ruby
[05:39:31] mitt3ns: has joined #ruby
[05:45:46] Jameser: has joined #ruby
[05:46:16] tastygradient: has joined #ruby
[05:47:02] zenspider: V1s1ble: inject isn't like reduce... it IS reduce. just an alias
[05:47:12] andrzejku: has joined #ruby
[05:47:18] Orbixx: has joined #ruby
[05:49:24] havenwood: and use #merge rather than #merge! or its alias #update
[05:49:55] Orbixx: I need a quick-start guide to Ruby made for programmers.
[05:50:10] havenwood: reduce(:merge)
[05:51:15] havenwood: Orbixx: https://www.zenspider.com/ruby/quickref.html
[05:51:31] havenwood: Orbixx: What background do you come from? What type of langs?
[05:52:05] havenwood: Orbixx: The Well-Grounded Rubyist, Second Edition is a good book to get quickly oriented.
[05:52:06] Orbixx: havenwood: All sorts, PHP, C#, Java, Python, ASM...
[05:52:11] tastygradient: Regardless, there's always this: https://www.ruby-lang.org/en/documentation/ruby-from-other-languages/
[05:52:58] Silthias: has joined #ruby
[05:53:08] latemus: has joined #ruby
[05:53:56] roshanavand: has joined #ruby
[05:54:08] Ishido: has joined #ruby
[05:55:12] TomyLobo: has joined #ruby
[05:55:22] Orbixx: tastygradient: That's pretty handy
[05:56:00] Hess: has joined #ruby
[05:56:05] Orbixx: Ah, so it's strongly typed
[06:00:59] Hess: has joined #ruby
[06:05:04] vondruch: has joined #ruby
[06:05:38] xall: has joined #ruby
[06:07:37] anisha: has joined #ruby
[06:09:02] ketan: has joined #ruby
[06:12:13] Ishido: has joined #ruby
[06:13:13] dasher00: has joined #ruby
[06:19:17] tvw: has joined #ruby
[06:22:42] ur5us: has joined #ruby
[06:29:24] Jameser: has joined #ruby
[06:29:27] yepobebot: has joined #ruby
[06:35:05] cschneid: has joined #ruby
[06:36:29] dionysus69: has joined #ruby
[06:39:54] conta: has joined #ruby
[06:40:03] Cohedrin_: has joined #ruby
[06:43:01] jak: has joined #ruby
[06:49:21] djbkd: has joined #ruby
[06:51:12] ascarter: has joined #ruby
[06:51:42] Alina-malina: has joined #ruby
[06:54:35] aufi: has joined #ruby
[06:55:08] doublemalt_: has joined #ruby
[06:55:55] andikr: has joined #ruby
[06:56:29] Mortomes|Work: has joined #ruby
[07:02:39] vondruch: has joined #ruby
[07:02:51] Alina-malina: has joined #ruby
[07:03:29] hutch34: has joined #ruby
[07:04:55] biberu: has joined #ruby
[07:08:32] Jameser: has joined #ruby
[07:10:23] dionysus69: has joined #ruby
[07:15:08] Pumukel: has joined #ruby
[07:20:32] jaruga: has joined #ruby
[07:23:13] eizua: has joined #ruby
[07:24:51] mark_66: has joined #ruby
[07:24:51] solocshaw: has joined #ruby
[07:31:05] Jameser: has joined #ruby
[07:31:07] cschneid: has joined #ruby
[07:31:08] tAn: has joined #ruby
[07:34:45] jakk: has joined #ruby
[07:37:34] quobo: has joined #ruby
[07:38:43] Rodya_: has joined #ruby
[07:41:52] hutch34: has joined #ruby
[07:42:44] antgel: has joined #ruby
[07:43:51] mathys: has joined #ruby
[07:45:38] marlinc: has left #ruby: ("Leaving")
[07:45:51] Jameser: has joined #ruby
[07:48:13] linduxed: has joined #ruby
[07:49:13] hs366: has joined #ruby
[07:50:02] jakk: has joined #ruby
[07:53:29] yeticry: has joined #ruby
[07:54:27] ar1a: there's an api that you can GET and it redirects you to an image. how can i chuck that into some ruby code and grab the url it redirects me to?
[07:54:57] matthewd: ar1a: What have you come up with so far?
[07:55:16] ar1a: looking at httprb, that's about it
[07:57:25] ar1a: ah ok. got it
[07:57:29] ar1a: easier than i thought
[07:59:09] duderonomy: has joined #ruby
[08:00:39] ar1a: easy question, in some cases a method on this object does not exist, and if so i want to call a different method
[08:00:47] ar1a: author = cmd.message.author.display_name || cmd.message.author.username
[08:00:52] ar1a: i thought that would be it, but it's not
[08:01:06] ar1a: is there an easier way of doing it other than rescuing the exception?
[08:01:14] ljarvis: ar1a: you should check if author.respond_to?(:display_name)
[08:01:23] ljarvis: or build a better system into your author object
[08:01:27] ar1a: not my library
[08:01:40] ljarvis: then respond_to?
[08:01:49] charliesome: has joined #ruby
[08:05:57] mikecmpbll: has joined #ruby
[08:06:59] bjmllr: has joined #ruby
[08:07:18] patarr: has joined #ruby
[08:09:55] ketan: has joined #ruby
[08:10:08] pandaant: has joined #ruby
[08:13:03] hs366: has joined #ruby
[08:16:10] MrBusiness: has joined #ruby
[08:17:47] jenrzzz: has joined #ruby
[08:18:53] ar1a: https://gist.github.com/Snorflake/04264ec1ec4b8cea592669ec6ef81352 how can I DRY this?
[08:19:50] Klumben: has joined #ruby
[08:22:24] charliesome: has joined #ruby
[08:22:40] vondruch: has joined #ruby
[08:23:53] xall: has joined #ruby
[08:24:58] ljarvis: https://gist.github.com/leejarvis/cfcd131fc586c31d233871785de293f9
[08:25:07] mim1k: has joined #ruby
[08:25:34] ar1a: oh wow :) thanks
[08:26:05] cschneid: has joined #ruby
[08:26:46] harfangk: has joined #ruby
[08:27:43] ar1a: it works! it seems faster too :)
[08:28:14] ljarvis: the bottleneck is the http request anyway, so it's probably not faster, just nicer looking
[08:28:54] ar1a: maybe so, i would think the regex is slower than .include?
[08:29:06] ar1a: appreciate it, im still learning ruby :)
[08:30:56] ljarvis: actually the regexp is probably faster, but that doesn't mean it's better :)
[08:31:19] ar1a: fair enough. it's a chat bot anyways, it doesn't have to be idiomatic :p
[08:31:28] jenrzzz: has joined #ruby
[08:32:15] Beams: has joined #ruby
[08:34:05] ljarvis: cool, but yeah, include? would be faster, but File.extname will slow it down. So I imagine if you benchmarked, "foo.jpg" =~ /.jpg/ would be slower than SUFFIXES.include?(".jpg") but much faster than SUFFIXES.include?(File.extname("foo.jpg"))
[08:35:07] elomatreb: Also, your regex isn't anchored, it would accept .jpg.exe just fine
[08:35:32] ar1a: oooh true
[08:35:47] ljarvis: yep, you want a \z
[08:36:27] alem0lars: has joined #ruby
[08:36:29] herwin: and \. instead of .
[08:36:49] herwin: and probably require something before the dot
[08:36:52] ljarvis: yep, and then throw the regexp away and use File.extname
[08:37:08] herwin: exactly my idea ;)
[08:37:41] ar1a: don't you mean $?
[08:38:15] elomatreb: ^ and $ match lines, \A and \z match the entire string
[08:39:25] ljarvis: ^ so using $ would match "foo.jpg\nomg hax"
[08:39:38] lxsameer: has joined #ruby
[08:40:11] ljarvis: >> ["foo.jpg\nomghax" =~ /\.jpg$/, "foo.jpg\nomghax" =~ /\.jpg\z/]
[08:40:12] ruby[bot]: ljarvis: # => [3, nil] (https://eval.in/827073)
[08:40:23] xMopxShell: has joined #ruby
[08:40:38] ljarvis: but still.. File.extname ;)
[08:43:23] marr: has joined #ruby
[08:45:17] zapata: has joined #ruby
[08:49:53] Paraxial: has joined #ruby
[08:52:01] Sp4rKy: has joined #ruby
[08:55:05] ketan: has joined #ruby
[08:59:19] ferr: has joined #ruby
[09:04:19] alem0lars: has joined #ruby
[09:05:16] moei: has joined #ruby
[09:13:02] jakk: has joined #ruby
[09:22:51] dasher00: has joined #ruby
[09:24:52] nofxx: has joined #ruby
[09:25:17] Mia: has joined #ruby
[09:25:17] Mia: has joined #ruby
[09:25:23] mim1k: has joined #ruby
[09:26:24] CrazyEddy: has joined #ruby
[09:27:00] sekmo: has joined #ruby
[09:28:11] cschneid: has joined #ruby
[09:30:20] InfinityFye: has joined #ruby
[09:30:53] theod: has joined #ruby
[09:33:37] mim1k_: has joined #ruby
[09:33:58] antgel: has joined #ruby
[09:42:04] charliesome: has joined #ruby
[09:45:53] patarr: has joined #ruby
[09:54:36] vondruch: has joined #ruby
[09:56:23] doublemalt_: has joined #ruby
[09:57:39] charliesome: has joined #ruby
[10:04:39] charliesome: has joined #ruby
[10:14:51] nicesignal: has joined #ruby
[10:15:54] psychicist__: has joined #ruby
[10:26:46] cschneid: has joined #ruby
[10:28:27] TheBloke: has joined #ruby
[10:30:44] im0nde: has joined #ruby
[10:33:26] zapata: has joined #ruby
[10:37:37] jenrzzz: has joined #ruby
[10:38:24] rapha: jesus christ, not only debian, now also ruby. what is it with those pesky spammers.
[10:51:33] quobo: has joined #ruby
[10:54:12] oskurot: has joined #ruby
[11:04:39] bkxd: has joined #ruby
[11:04:41] bkxd_: has joined #ruby
[11:11:05] romankapitonov: has joined #ruby
[11:13:01] jakk: has joined #ruby
[11:13:13] workmad3: has joined #ruby
[11:15:46] pandaant: has joined #ruby
[11:24:24] bkxd: has joined #ruby
[11:25:46] bkxd_: has joined #ruby
[11:25:55] abhi56rai: has joined #ruby
[11:26:23] kke_: has joined #ruby
[11:30:21] ChilledOut: has joined #ruby
[11:31:13] ar1a: rapha: huh?
[11:31:13] xall: has joined #ruby
[11:31:17] ar1a: also what an OG name
[11:31:32] ChilledOut: Hi Team..I am new to Ruby and reading this book "Learn to Program"...I am trying to understand an exercise "Integer to Roman number Converter" can someone please help me how to write this?
[11:31:32] ar1a: shane hendrixson must hate you :P
[11:32:22] ledestin: ChilledOut the answer is 42
[11:33:22] ChilledOut: ledestin how buddy..I am trying to understand the Ruby code .Wait let me post what I have found so far
[11:33:51] herwin: ledestin: no, it's XLI
[11:34:14] ledestin: herwin that's good too
[11:34:18] ChilledOut: ROMAN_NUMS = { "M" => 1000, "CM" => 900, "D" => 500, "CD" => 400, "C" => 100, "XC" => 90, "L" => 50, "XL" => 40, "X" => 10, "IX" => 9, "V" => 5, "IV" => 4, "I" => 1 }
[11:34:27] ChilledOut: def romanize(num)
[11:34:30] hightower2: has joined #ruby
[11:34:35] ChilledOut: ROMAN_NUMS.map do |ltr, val|
[11:34:38] ar1a: Paste >3 lines of text to: https://gist.github.com
[11:34:41] ChilledOut: amt, num = num.divmod(val)
[11:35:12] ChilledOut: I am not understanding this romanize method
[11:36:26] tobiasvl: ChilledOut: please use https://gist.github.com for long pastes
[11:36:27] adaedra: Please don't paste code directly in the channel, use something like gist.github.com and paste the link
[11:36:39] tobiasvl: ChilledOut: what are you not understanding exactly though
[11:36:54] ar1a: https://ruby-doc.org/core-2.3.0/Numeric.html#method-i-divmod
[11:37:36] ldnunes: has joined #ruby
[11:38:01] ar1a: ChilledOut: if you would rather an easier method i found this on google https://codereview.stackexchange.com/questions/7937/roman-numeral-converter
[11:38:05] ar1a: with info
[11:38:11] rapha: What's an "OG" name?
[11:38:20] ar1a: its a 1 not an l
[11:38:21] rapha: ar1a, sorry
[11:38:27] ar1a: original
[11:38:30] rapha: yeah, messed my brain up :)
[11:38:36] ar1a: pro quake player
[11:38:37] rapha: it's my name
[11:38:47] rapha: and it's been my handle since around 1995
[11:38:56] ar1a: https://www.youtube.com/watch?v=ojR_qedzzK8
[11:38:59] ar1a: what a coinkidink :p
[11:39:05] rapha: that dude was probably not even out of his nappies by that time
[11:39:14] rapha: ar1a: what's a coinkidink?
[11:39:19] rapha: (sorry, not a native speaker)
[11:39:25] ar1a: my dumb way of saying coincidence
[11:39:32] ar1a: well in 95 he was 6
[11:39:46] rapha: well, okay, prolly barely out of them then
[11:40:15] rapha: anyways, one of my given names is Raphael so i don't feel like there's anything wrong with my handle
[11:40:49] rapha: and to add to that, i did play Quake 1 and 2 and also 3 in a clan for quite a while
[11:41:02] ar1a: im not saying anything is wrong with it
[11:41:05] ar1a: i was just commenting
[11:41:20] nadir: has joined #ruby
[11:45:30] mr_foto: has joined #ruby
[11:47:32] skweek: has joined #ruby
[11:49:28] alex``: has joined #ruby
[11:52:16] petruff: has joined #ruby
[11:56:43] mim1k: has joined #ruby
[12:00:25] DaveTabo_: has joined #ruby
[12:02:28] DaveTabo_: has joined #ruby
[12:10:32] ketan: has joined #ruby
[12:16:13] mtkd: has joined #ruby
[12:19:40] ChilledOut: Hey Thanks guys...Will check it out...
[12:21:58] nicesignal: has joined #ruby
[12:27:06] ketan: has joined #ruby
[12:30:34] uZiel: has joined #ruby
[12:35:50] ChilledOut: https://gist.github.com/anonymous/700205983834d083efd41fd29e7f9355
[12:36:11] ChilledOut: can someone explain me the logic in the def method
[12:37:42] mim1k: has joined #ruby
[12:39:30] canton7: ChilledOut, which bit specifically do you have trouble with?
[12:40:32] jenrzzz: has joined #ruby
[12:40:32] jenrzzz: has joined #ruby
[12:41:06] vifino: has joined #ruby
[12:42:59] jakk: has joined #ruby
[12:45:30] ChilledOut: canton7 the romanize method bit mate.Thank you
[12:45:41] adaedra: What part of it?
[12:45:47] canton7: ChilledOut, it calls a bunch of methods. Which method don't you understand?
[12:50:35] belmoussaoui_: has joined #ruby
[12:53:03] mwlang: has joined #ruby
[12:56:57] ChilledOut: @adaedra & @canton7 = The "def romanize (num)" part ..not understanding whats happening inside that and how its able to produce Roman numbers given an Integer
[12:56:58] alex``: has joined #ruby
[12:57:17] canton7: ChilledOut, go through it line by line. Make sure you understand what each line does
[12:57:18] adaedra: What did you understand of it so far?
[12:58:50] ChilledOut: ROMAN_NUMS.map do |ltr, val| takes one array at a time and assigns ltr="M" and val=1000
[12:59:14] DaveTaboola: has joined #ruby
[13:00:07] sepp2k: has joined #ruby
[13:00:33] truenito: has joined #ruby
[13:00:57] truenito: has joined #ruby
[13:01:57] ChilledOut: we passed a parameter num ,say 24.. now amt,num=24.divmod(1000) ..so amt=0 and num=24
[13:02:39] ChilledOut: ltr*amt="M" * 0 =0
[13:03:26] canton7: just check what "M" * 0 is
[13:03:31] adaedra: well try it in a irb, what does "M" * 0 gives you
[13:04:29] ChilledOut: like I don't get an Output
[13:04:36] canton7: irb gives me "" as the output
[13:05:26] ChilledOut: yup in IRB ""
[13:05:37] canton7: right. What does irb show you for nil?
[13:05:45] canton7: type 'nil' in irb, see what the output is
[13:06:17] canton7: right, so irb shows 'nil' for a nil value
[13:06:21] canton7: what do you think "" could be?
[13:06:36] cgfbee: has joined #ruby
[13:06:39] ChilledOut: "" could be empty string
[13:06:51] canton7: cool. Test that theory: "".class
[13:07:28] ChilledOut: haha...string ..
[13:07:40] canton7: great, so "M" * 0 gives you an empty string
[13:07:56] canton7: (what does "M" * 5 give you?)
[13:07:59] ChilledOut: wow.makes sense now
[13:08:32] ChilledOut: string multiplication
[13:10:31] adaedra: Still have problems with this method?
[13:10:39] ChilledOut: canton7 and adaedra thanks guys...I will try and understand now with each iteration and get back
[13:11:08] adaedra: Don't hesitate to test things in irb, it's here for that
[13:11:37] ChilledOut: Copy that Sir!
[13:12:31] elsevero: has joined #ruby
[13:13:31] catphish: has joined #ruby
[13:14:02] chmurifree: has joined #ruby
[13:15:54] jyaworski: has joined #ruby
[13:16:07] petruff: has joined #ruby
[13:16:40] jak: has joined #ruby
[13:17:34] anisha: has joined #ruby
[13:20:51] jyaworski: has joined #ruby
[13:27:39] workmad3: has joined #ruby
[13:31:53] kryptoz: has joined #ruby
[13:33:34] Sembei: has joined #ruby
[13:35:21] ddddddd: has joined #ruby
[13:39:01] GodFather_: has joined #ruby
[13:43:27] oleo: has joined #ruby
[13:48:11] _whitelogger: has joined #ruby
[13:48:41] chouhoulis: has joined #ruby
[13:50:24] Jameser: has joined #ruby
[13:52:12] Tagami[m]: has joined #ruby
[13:56:04] GodFather_: has joined #ruby
[13:57:29] jakk: has joined #ruby
[14:01:51] Jameser: has joined #ruby
[14:04:11] err_ok: has joined #ruby
[14:06:21] ujjain: has joined #ruby
[14:06:21] ujjain: has joined #ruby
[14:07:01] Tagami[m]: has joined #ruby
[14:07:04] bkxd: has joined #ruby
[14:07:06] bkxd_: has joined #ruby
[14:09:30] mim1k: has joined #ruby
[14:10:49] oscurochu: has joined #ruby
[14:11:51] oscurochu: how do i get apache to execute my ruby files? i dont know where to locate my apache module for passenger. i installed it using "gem install passenger"
[14:13:16] dminuoso: oscurochu: passenger has grown out of style largely.
[14:13:23] catphish: i believe passenger has a CLI tool that guides you through the process
[14:13:23] Tau: has joined #ruby
[14:14:01] catphish: but there are more popular rack servers, i'd way most people run a separate server and proxy to it, no reason *not* to use passenger though
[14:14:58] dminuoso: oscurochu: Unless you really need that apache, it's probably easiest if you just use a plain and simple sinatra application.
[14:15:06] dminuoso: (or ramaze if you're into that)
[14:15:28] dminuoso: It avoid that big fat http server with that awkward custom compiled passenger plugin.
[14:16:10] bweston92-: has joined #ruby
[14:16:31] DLSteve: has joined #ruby
[14:16:37] oscurochu: i dont need apache i suppose, its just the only web server ive ever known.
[14:16:45] cam27: has joined #ruby
[14:17:14] catphish: oscurochu: consider puma + nginx, there are many other options though, and good tutorials
[14:17:23] dminuoso: oscurochu: In the modern age, you usually avoid apache/nginx (and only use them for things like TLS termination, SNI, proxying) and directly use some rack application.
[14:17:35] catphish: i'm assuming your app is rack compatible and you're not trying to do something unusual
[14:18:14] dminuoso: oscurochu: rack like through sinatra, ramaze. puma is not exactly best suited, since it has a slightly different purpose
[14:18:19] oscurochu: i have a spreadsheet that i use and it would just very useful to me to turn it into an application
[14:18:31] dminuoso: (puma itself is rather used to run rack applications)
[14:19:21] oscurochu: i want to possibly sell it or give it away as a web or mobile app. im really not sure where to start, so i think developing web apps with ruby is a good start, until im ready to go mobile
[14:23:03] torarne: has joined #ruby
[14:23:03] aviraldg: has joined #ruby
[14:23:03] jonjits[m]: has joined #ruby
[14:23:03] aidalgol: has joined #ruby
[14:23:03] johnson[m]: has joined #ruby
[14:23:04] turt2live: has joined #ruby
[14:23:04] heftig: has joined #ruby
[14:23:04] voltai[m]: has joined #ruby
[14:23:04] intermo[m]: has joined #ruby
[14:23:04] kp666[m]: has joined #ruby
[14:23:04] M107262[m]: has joined #ruby
[14:23:04] Giphy[m]: has joined #ruby
[14:23:04] KevinMGranger: has joined #ruby
[14:23:04] dman[m]: has joined #ruby
[14:23:10] testnick[m]: has joined #ruby
[14:23:11] velu_aon[m]: has joined #ruby
[14:23:11] el_ocho[m]: has joined #ruby
[14:24:37] oscurochu: i eventually will need to create graphs and just perform mostly mathmetical calculations with the help of a user interface that can be accessed from multiple devices.
[14:25:15] Jameser: has joined #ruby
[14:25:19] oscurochu: storing the data that will be analyzed into a mysql database
[14:25:23] oscurochu: sounds pretty simple, right?
[14:26:18] catphish: that's what we do here :)
[14:26:29] catphish: UI + math + database
[14:32:04] afisher: has joined #ruby
[14:33:41] mikecmpbll: has joined #ruby
[14:33:52] Jameser: has joined #ruby
[14:33:53] jphase: has joined #ruby
[14:43:16] chmuri: Hi there what is best ide for start in ruby?
[14:44:35] adaedra: just use a basic text editor, vim, emacs, atom, sublime text, visual studio code, notepad++, whatever
[14:45:52] minimalism: has joined #ruby
[14:45:57] dminuoso: adaedra: but in that list there is one best, and the other ones are just for inferior developers.
[14:46:12] dminuoso: But at least you listed them in order of importance.
[14:47:08] adaedra: just use what you're used to
[14:49:04] S007: has joined #ruby
[14:49:44] ShekharReddy: has joined #ruby
[14:49:46] ar1a: has left #ruby: ("WeeChat 1.9")
[14:58:21] ascarter: has joined #ruby
[15:02:56] abhi56ra1: has joined #ruby
[15:04:57] swills: has joined #ruby
[15:08:24] alex``: has joined #ruby
[15:13:56] leah2: is there a trick to match a union of regexp, and see which one matched?
[15:14:08] leah2: matching the match again could fail due to anchors etc
[15:14:40] apeiros: put them into capturing groups
[15:14:46] apeiros: either numbered or named
[15:14:57] leah2: then i cant use numbered matches in the regexp...
[15:15:00] mim1k: has joined #ruby
[15:15:12] leah2: they dont mix afaiu
[15:15:36] apeiros: too little information
[15:15:41] leah2: > /(?<foo>ba(r)\1)/
[15:15:43] leah2: > /(?<foo>ba(r)\1)/
[15:15:46] leah2: >> /(?<foo>ba(r)\1)/
[15:15:47] ruby[bot]: leah2: # => /tmp/execpad-87e5cc3fc1e0/source-87e5cc3fc1e0:2: numbered backref/call is not allowed. (use name): / ...check link for more (https://eval.in/827401)
[15:15:52] leah2: the input regexp can contain backreferences
[15:16:03] apeiros: ah, yes, you need to stick to one choice.
[15:16:14] elomatreb: You can have named backreferences, \k IIRC?
[15:16:21] apeiros: oh well, if you have uncontrollable input, this problem will be hard
[15:16:31] apeiros: that is, uncontrollable regex as input
[15:16:34] leah2: the posix ere subset is good enough
[15:16:59] mikecmpbll: has joined #ruby
[15:17:00] leah2: i'll match them one by one and use the leftmost matching...
[15:17:06] apeiros: and "uncontrollable regex input" is relevant context btw., which you should not have left out when asking.
[15:17:15] leah2: yeah, sorry
[15:19:10] Sembei: has joined #ruby
[15:24:50] PaulCapestany: has joined #ruby
[15:25:46] __Yiota: has joined #ruby
[15:27:07] JustTheDoctor: has joined #ruby
[15:32:33] uZiel: has joined #ruby
[15:34:34] kvant: has joined #ruby
[15:34:46] kvant: has left #ruby: ()
[15:35:29] oscurochu: has joined #ruby
[15:38:25] nanoz: has joined #ruby
[15:40:51] abhi56rai: has joined #ruby
[15:42:06] ltem: has joined #ruby
[15:42:47] mlehrer: has joined #ruby
[15:43:01] jakk: has joined #ruby
[15:43:07] jenrzzz: has joined #ruby
[15:43:07] jenrzzz: has joined #ruby
[15:43:36] LukyCZ: has joined #ruby
[15:44:07] LukyCZ: Is there a way to get Ruboto working on Nougat ?
[15:45:40] kobain: has joined #ruby
[15:46:33] elsevero: has joined #ruby
[15:47:34] catphish: has left #ruby: ("Leaving")
[15:49:56] conta1: has joined #ruby
[15:52:34] workmad3: has joined #ruby
[15:57:12] BSaboia: has joined #ruby
[15:59:22] ascarter: has joined #ruby
[16:01:13] chouhoulis: has joined #ruby
[16:05:14] cadillac_: has joined #ruby
[16:06:31] catphish: has joined #ruby
[16:10:05] catphish: i have an event driven application and i need to do DNS lookups, i'm struggling to find an off the shelf way to do this, right now DNS lookups are hanging my app
[16:10:34] TheBloke: has joined #ruby
[16:12:20] spastorino: has joined #ruby
[16:13:15] GodFather_: has joined #ruby
[16:13:41] catphish: all the solutions are associated with existing frameworks, i'm sure i can put something together
[16:16:12] mwlang: has joined #ruby
[16:16:23] ledestin: has joined #ruby
[16:16:27] perniciouscaffei: has joined #ruby
[16:17:48] Tau: has joined #ruby
[16:17:53] jak: has joined #ruby
[16:18:08] chouhoulis: has joined #ruby
[16:20:01] therealGent: has joined #ruby
[16:20:06] therealGent: Hello. Does anyone know why writing to an array with FFI and then reading it returns different results for the first element? https://pastebin.com/vXPKdp3e
[16:20:08] ruby[bot]: theRealGent: we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/9fff102fee24c52b1519d72b64d28d70
[16:20:08] ruby[bot]: theRealGent: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[16:22:19] Joufflu: has joined #ruby
[16:23:51] jaruga: has joined #ruby
[16:28:01] skweek: has joined #ruby
[16:29:46] Rodya_: has joined #ruby
[16:31:35] Wando: has joined #ruby
[16:41:57] mtkd: has joined #ruby
[16:42:05] therealGent: Kinda look like a bug in FFI
[16:43:52] leah2: https://bugs.ruby-lang.org/issues/11258 2 years open and not merged :(
[16:45:06] hutch34: has joined #ruby
[16:45:29] p0p0pr37: has joined #ruby
[16:46:03] mwlang: has joined #ruby
[16:48:53] workmad3: has joined #ruby
[16:49:39] vuoto: has joined #ruby
[16:51:13] arup_r: has joined #ruby
[16:54:33] meshsmith: has joined #ruby
[17:00:05] ascarter: has joined #ruby
[17:00:58] muelleme_: has joined #ruby
[17:09:58] solocshaw: has joined #ruby
[17:10:16] kies: has joined #ruby
[17:13:08] __g_k__1_w_m__s_: has joined #ruby
[17:15:16] __g_k__1_w_m__s_: has left #ruby: ()
[17:19:46] Rodya_: has joined #ruby
[17:23:57] tAn: has joined #ruby
[17:25:21] Sylario: has joined #ruby
[17:26:26] __g_k__1_w_m__s_: has joined #ruby
[17:27:57] ketan: has joined #ruby
[17:32:00] chouhoulis: has joined #ruby
[17:37:03] t-recx: has joined #ruby
[17:38:50] nowhere_man: has joined #ruby
[17:39:19] duderonomy: has joined #ruby
[17:42:10] Cohedrin_: has joined #ruby
[17:43:02] jak: has joined #ruby
[17:44:22] gothicsouth: has joined #ruby
[17:46:11] alamar: has joined #ruby
[17:48:16] dionysus69: has joined #ruby
[17:50:24] mathys: has joined #ruby
[17:51:19] uZiel: has joined #ruby
[17:51:20] pankaj: has joined #ruby
[17:51:51] AckZ: has left #ruby: ()
[17:54:21] duderonomy: has joined #ruby
[18:01:27] t-recx: has joined #ruby
[18:02:16] petruff1: has joined #ruby
[18:05:09] xzhao: has joined #ruby
[18:06:12] Joufflu: has joined #ruby
[18:09:04] SeepingN: has joined #ruby
[18:15:10] cam27: has joined #ruby
[18:16:07] __Yiota: has joined #ruby
[18:18:56] uZiel: has joined #ruby
[18:20:17] oscurochu: has joined #ruby
[18:20:52] sagax: has joined #ruby
[18:22:15] tAn: has joined #ruby
[18:31:10] muelleme_: has joined #ruby
[18:34:44] blackwind_123: has joined #ruby
[18:41:44] pankaj: has joined #ruby
[18:45:27] raul782: has joined #ruby
[18:45:31] jenrzzz: has joined #ruby
[18:48:11] romankapitonov: has joined #ruby
[18:48:40] uZiel_: has joined #ruby
[18:49:23] xMopxShell: has joined #ruby
[18:50:53] belmoussaoui: has joined #ruby
[18:57:25] npgm: has joined #ruby
[19:00:00] snowda: has joined #ruby
[19:01:29] ascarter: has joined #ruby
[19:01:37] snowda: does ruby provides any string escape when accessing bash? I mean variable = "ABC", so puts `echo "#{variable}"`
[19:01:49] romankapitonov: has joined #ruby
[19:01:51] snowda: is it possible to inject a rm -rf /?
[19:07:08] jordanm: snowda: yes, if "variable" is built using external data, but you are not executing it in your example
[19:07:46] andrzejku: has joined #ruby
[19:09:04] elsevero: has joined #ruby
[19:09:25] jordanm: you can also use popen to execute external commands without a shell
[19:10:58] havenwood: snowda: Your example will print: rm -rf /
[19:12:14] havenwood: snowda: You can use Shellwords.escape
[19:13:40] havenwood: snowda: If your payload was "`rm -rf /`" or "$(rm -rf /)" it'd be a problem
[19:13:54] havenwood: snowda: But it's a problem that Shellwords.escape fixes.
[19:14:52] manveru: snowda: use system instead
[19:15:35] jordanm: I am pretty sure system() still uses a shell
[19:15:47] havenwood: jordanm: It can, or not.
[19:15:54] jordanm: IO.popen does not
[19:16:24] jordanm: ah, right I see the no-shell syntax in the docs
[19:17:02] manveru: popen i'd use if i care about the output
[19:17:05] jordanm: bit odd since the libc function system() you would expect it uses is always shell
[19:17:15] manveru: but system is perfectly safe for stuff you don't :)
[19:17:33] manveru: (just make sure you pass as separate arguments, not a long string)
[19:19:07] jenrzzz: has joined #ruby
[19:22:11] snowda: thank you all
[19:22:59] pankaj: has joined #ruby
[19:23:04] snowda: I'll go with shellwords
[19:25:03] therealGent: has joined #ruby
[19:26:28] oscurochu: has joined #ruby
[19:28:25] antgel: has joined #ruby
[19:29:38] podlech: has joined #ruby
[19:31:22] guardian: has joined #ruby
[19:38:09] podlech: has joined #ruby
[19:43:00] jak: has joined #ruby
[19:43:21] oscurochu: has joined #ruby
[19:45:53] ketan: has joined #ruby
[19:47:46] alex``: has joined #ruby
[19:48:06] xrlk: has joined #ruby
[19:48:19] naprimer3: has joined #ruby
[19:53:14] N0ATN: has joined #ruby
[19:56:54] Nahra: has joined #ruby
[20:01:13] mtkd: has joined #ruby
[20:02:23] freeman42: has joined #ruby
[20:02:56] freeman42: is there a function that takes another function from string to string and pipes input/output through it?
[20:03:07] kobain: has joined #ruby
[20:09:41] Nahra: has joined #ruby
[20:09:46] knight33: has joined #ruby
[20:10:38] sepp2k: has joined #ruby
[20:12:42] Papierkorb: freeman42: What are you trying to do?
[20:12:47] Papierkorb: freeman42: And, what have you tried yet?
[20:14:31] montanonic: has joined #ruby
[20:14:35] freeman42: trying to find a Ruby standard function that does the following: "The interact function takes a function of type String->String as its argument. The entire input from the standard input device is passed to this function as its argument, and the resulting string is output on the standard output device."
[20:14:53] freeman42: what I tried? google-ing for it :p
[20:15:33] SCHAPiE: has joined #ruby
[20:15:56] Papierkorb: What do you need? Really, the moment you read the string from anywhere, it's a string you can do things with you like, and then later print out again. Nothing special needed.
[20:18:50] adam12: IO.copy_stream maybe? but it would be nice to know what your doing, and if this is homework.
[20:19:34] Papierkorb: It sure sounds like homework :)
[20:21:32] freeman42: it is not homework, but here it sure smells like... attitude, bad attitude
[20:21:55] kculpic: has joined #ruby
[20:22:28] adam12: freeman42: Let's not forget you came here. We didn't seek you out.
[20:22:41] freeman42: I asked a very clear question, and people are asking "is it homework" and "what are you trying to accomplish", I just said what I am trying to accomplish
[20:22:55] freeman42: adam12, that is not excuse for being rude to newcomers
[20:23:09] adam12: freeman42: If you can't handle a) people wanting to suggest the best solution for you and b) people not wanting to give away homework answers, but rather help you come up with the solution
[20:23:50] adam12: I think you'll need to change your tune.
[20:23:53] freeman42: adam12, this is not a "think through it type of question", it was a simple, is there a function that does that question? yes or no
[20:23:53] Papierkorb: freeman42: It would be rude to give bad suggestions. Your question is not really clear, and thus required clarifications from our end.
[20:24:10] adam12: freeman42: I gave you the method you wanted. Enjoy.
[20:24:22] freeman42: Papierkorb, what was unclear about this? "The interact function takes a function of type String->String as its argument. The entire input from the standard input device is passed to this function as its argument, and the resulting string is output on the standard output device."
[20:25:40] ur5us: has joined #ruby
[20:26:29] freeman42: adam12, might be mistaken, but IO.copy_stream does not seem to take a string to string function as argument
[20:27:43] umaaji: has joined #ruby
[20:31:10] shinnya: has joined #ruby
[20:34:42] ddddddd: has joined #ruby
[20:35:28] abstr0n: has joined #ruby
[20:35:35] patteh: has joined #ruby
[20:37:35] mim1k: has joined #ruby
[20:38:33] konsolebox: has joined #ruby
[20:39:20] dasher00: has joined #ruby
[20:42:54] xMopxShell: has joined #ruby
[20:50:10] HoierM_: has joined #ruby
[20:50:24] podlech: has joined #ruby
[20:53:11] quobo: has joined #ruby
[20:53:33] mim1k: has joined #ruby
[20:53:49] hangelo: has joined #ruby
[20:57:24] blackwind_123: has joined #ruby
[20:59:59] abstr0n: has joined #ruby
[21:05:37] ncthom91: has joined #ruby
[21:09:56] brent__: has joined #ruby
[21:10:40] enterprisey: has joined #ruby
[21:11:27] trac3r_: has joined #ruby
[21:13:01] jak: has joined #ruby
[21:20:09] mim1k: has joined #ruby
[21:20:47] pankaj: has joined #ruby
[21:22:01] hutch34: has joined #ruby
[21:26:24] wilbert: has joined #ruby
[21:26:39] helpa-bot: has joined #ruby
[21:26:54] matled-: has joined #ruby
[21:28:20] helpa: has joined #ruby
[21:28:36] mozzarella: has joined #ruby
[21:30:53] ineb: freeman42: i have an answer to your initial question: no.
[21:30:55] lucas: has joined #ruby
[21:30:59] mrconfused: has joined #ruby
[21:32:09] freeman42: ineb, thank you, I thought the same since it should have been relatively easy to find if it was in the base libraries
[21:33:11] romankapitonov: has joined #ruby
[21:34:49] xMopxShell: has joined #ruby
[21:39:28] therealGent: has joined #ruby
[21:43:19] orobor: has joined #ruby
[21:46:45] ketan: has joined #ruby
[21:51:25] ahrs: has joined #ruby
[21:51:58] BlkDynmt: has joined #ruby
[21:52:08] romankapitonov: has joined #ruby
[21:58:24] zenspider: freeman42: try not to be a dick. people here are trying to help... but we won't help you cheat on homework and we WILL ask questions for context.
[22:01:08] zenspider: looks like that's a haskell function and is awkward at best in ruby
[22:02:57] InfinityFye: has joined #ruby
[22:03:44] freeman42: what do you mean by: `awkward at best in ruby`? either it exists or not in base libraries
[22:04:17] zenspider: freeman42: intentional or not, you are coming off as a complete jackass
[22:04:39] knight33: has joined #ruby
[22:04:52] zenspider: could it occur to you that OO and lazy functional are completely different beasts and that some ideas don't translate cleanly?
[22:05:22] biox: has joined #ruby
[22:06:54] zenspider: "string to string function" doesn't really translate in ruby. Ruby is OO. So it'd be a "nothing to string" method in the first place (the receiver of the message is the "input" string)
[22:08:14] bougyman: there are plenty of high-order FP type methods and methodologies possible in ruby
[22:08:21] bougyman: I just don't think he's expressing his need well.
[22:08:46] bougyman: what the fuck do you want this method to do?
[22:08:49] zenspider: it sounds like map to me
[22:08:49] bougyman: That'd be my ask.
[22:09:02] zenspider: >> io = StringIO.new "blah\nblah\nblah"; def io.interact name; self.map &name; end; io.interact :upcase
[22:09:03] ruby[bot]: zenspider: # => ["BLAH\n", "BLAH\n", "BLAH"] (https://eval.in/827587)
[22:09:49] zenspider: but map doen't take a function... the function isn't string->string... etc... but this whole "just give me a yes/no" attitude needs to stop now
[22:10:12] bougyman: StringIO.new("blah\nblah\nblah").map { |w| w.upcase }
[22:10:12] bougyman: => ["BLAH\n", "BLAH\n", "BLAH"]
[22:10:22] bougyman: the block is the function.
[22:10:27] zenspider: yeah. I was just trying to make it look more like the spec
[22:10:31] zenspider: I found this: https://github.com/lgastako/elm-interact
[22:10:40] zenspider: which quotes haskell doco
[22:11:31] zenspider: I don't know haskell's type signatures enough... but "-> IO ()" says outputs an IO to me, but the doco says "the resulting string is output on the standard output device"
[22:11:42] zenspider: that seems wrong? maybe it is the '()' part?
[22:11:46] bougyman: that should need a monad, shouldn't it?
[22:11:49] bougyman: It's side effect.
[22:11:56] Papierkorb: IO is *magic*
[22:14:19] zenspider: I know more ML than haskell at this point. dunno. just seems wierd. I would kinda expect no result... maybe it outputs AND returns the IO
[22:15:15] zenspider: it doesn't say it is lazy IO either... unlike getContents, for example
[22:15:17] zenspider: https://hackage.haskell.org/package/base-4.9.0.0/docs/Prelude.html#v:interact
[22:15:34] zenspider: reads like "slurp all of stdin, map, print the whole thing"
[22:16:57] fumk: has joined #ruby
[22:17:34] biox: has joined #ruby
[22:18:00] brent__: has joined #ruby
[22:18:42] biox: has joined #ruby
[22:19:51] zenspider: also seems misnamed or at least a violation of responsibilities to me
[22:21:19] spiette: has joined #ruby
[22:29:36] oleo: has joined #ruby
[22:33:32] br0d1n: has joined #ruby
[22:35:56] oleo: has joined #ruby
[22:37:11] boombox_: has joined #ruby
[22:38:31] ascarter: has joined #ruby
[22:38:59] zenspider: has left #ruby: ("ERC (IRC client for Emacs 25.1.1)")
[22:47:53] oleo: has joined #ruby
[22:50:23] zenspider: has joined #ruby
[22:50:59] barx: has joined #ruby
[22:51:21] barx: hello… I’m learning Ruby. May I ask, what’s going on here:
[22:51:26] barx: >> Symbol.is_a?(Module)
[22:51:28] barx: >> module Symbol
[22:51:31] barx: TypeError: Symbol is not a module
[22:51:32] barx: from (irb):137
[22:51:33] barx: from /usr/local/bin/irb:11:in `<main>'
[22:51:37] zenspider: do not paste in here
[22:51:40] zenspider: please use gist
[22:51:53] barx: I’m sorry. What is the correct way to ask that question, zenspider ?
[22:52:04] zenspider: ask the question, in English. Provide code via gist
[22:52:04] darix: barx: https://gist.github.com/
[22:52:08] zenspider: unless it is 1-2 lines long
[22:52:09] async_prince: has joined #ruby
[22:52:11] barx: okay. got it.
[22:52:37] barx: redo: is Symbol a module? If so, why can I not extend it as such?
[22:52:38] zenspider: Symbol is a Class. Class is a subclass of Module. is_a? answers true for subclasses
[22:52:45] barx: ahhhh cool.
[22:52:47] zenspider: >> Symbol.class
[22:52:48] ruby[bot]: zenspider: # => Class (https://eval.in/827594)
[22:52:54] zenspider: >> Class.class
[22:52:55] ruby[bot]: zenspider: # => Class (https://eval.in/827595)
[22:53:00] xrlk: has joined #ruby
[22:53:00] zenspider: >> Class.superclass
[22:53:01] ruby[bot]: zenspider: # => Module (https://eval.in/827596)
[22:56:08] barx: so why doesn’t this work? https://is.gd/GCmHZ8
[22:56:39] zenspider: because symbols aren't modules
[22:56:48] zenspider: Symbol is a module. instances of Symbol are symbols
[22:57:25] zenspider: >> class Symbol; def + o; "#{self}#{o}"; end; end; :a + :b
[22:57:26] ruby[bot]: zenspider: # => "ab" (https://eval.in/827597)
[22:58:04] soLucien: has joined #ruby
[22:58:28] soLucien: hi guys ! Is it possible to somehoe access ENV[] variables inside a instance_eval() ?
[22:58:50] barx: ah, duh, thanks zenspider
[22:59:06] Papierkorb: soLucien: What do you mean? You can just use it in the eval'd code like normal
[22:59:26] soLucien: it didn't work for me , but i can try again
[22:59:34] __Yiota: has joined #ruby
[23:00:16] zenspider: soLucien: can you show us what you tried?
[23:00:49] bkxd: has joined #ruby
[23:00:51] bkxd_: has joined #ruby
[23:02:18] kobain: has joined #ruby
[23:05:10] oleo: has joined #ruby
[23:06:03] soLucien: zenspider here it is https://gist.github.com/s0lucien/931ad095baaec716c70560af013b0f61
[23:06:23] soLucien: i checked the value of ENV in pry and it does contain the variables i am referring to
[23:06:53] soLucien: maybe i'm not quoting them properly or something
[23:07:52] zenspider: you're doing ENV[USERNAME]... the error says that ::USERNAME is not defined... it isn't.
[23:08:04] zenspider: where is that supposed to come from?
[23:08:46] zenspider: ENV is a magic hash and the keys are strings. Maybe you mean "USERNAME" ?
[23:08:55] soLucien: zenspider i fixed it
[23:09:00] soLucien: it was quoting indeed
[23:09:10] soLucien: ENV is my environment variables
[23:09:30] soLucien: and magically this makes the git client authenticate against a password-protected git repo
[23:09:54] soLucien: Good Guy Ruby
[23:13:05] barx: Another rando beginner question… Why are nonexistent symbols saved when they are searched for? https://eval.in/827603
[23:13:40] barx: I’m coming from Scala, so a lot of things astonish me about Ruby.
[23:14:35] barx: ..and what are those list three global vars...
[23:15:06] zenspider: barx: searched for?
[23:15:37] barx: yeah see the snippet - I typed What.foo but there’s no such thing. the symbol table was checked for them, and then added.
[23:15:38] zenspider: you defined the symbol :foo by compiling it into your code
[23:15:55] zenspider: they were added to the symbol table the second the code was parsed
[23:16:22] barx: that makes sense, I guess.
[23:17:09] zenspider: What.foo compiles to something looking like: s(:call, s(:const, :What), :foo)
[23:17:15] barx: but it does throw a NameError. so it’s also non-existent.
[23:17:27] zenspider: so :What gets looked up as a const, then :foo gets sent to it... but you raise on the first part
[23:17:36] barx: right, okay.
[23:18:07] barx: but - if it were a class, would it be looked up in the same manner?
[23:18:11] zenspider: roughly: Object.const_get(:What).send(:foo)
[23:18:47] zenspider: wouldn't matter if it were a class or some random object...
[23:18:48] barx: ahhh okay - same error.
[23:18:57] barx: thanks. :)
[23:19:04] zenspider: >> What = 42; What.foo
[23:19:05] ruby[bot]: zenspider: # => undefined method `foo' for 42:Fixnum ...check link for more (https://eval.in/827604)
[23:19:18] zenspider: that's a failure at the send level
[23:23:12] alveric4: has joined #ruby
[23:33:33] PaulCapestany: has joined #ruby
[23:46:39] mostlybadfly: has joined #ruby
[23:47:37] ketan: has joined #ruby
[23:48:31] raul782: has joined #ruby
[23:55:22] AnoHito_: has joined #ruby
[23:57:42] __Yiota: has joined #ruby