« Back to channel list

#ruby - 19 October 2018

« Back 1 day Forward 1 day »
[00:01:43] johnny56: has joined #ruby
[00:05:55] stooj: has joined #ruby
[00:09:34] tdy: has joined #ruby
[00:12:16] ur5us: has joined #ruby
[00:18:27] marmotini_: has joined #ruby
[00:19:14] timeless: ACTION bangs head against ::Rack::Rewrite :-(
[00:20:33] timeless: I found https://stackoverflow.com/questions/15303112/middleman-dynamic-page-url-rewrite-with-wildcard and used it more or less as is (I had to add `::` before `Rack::Rewrite`)
[00:21:51] timeless: ACTION gets it
[00:32:30] timeless: ACTION really doesn't understand why the `::` was necessary as the examples all omit it
[00:35:18] wolfshappen: has joined #ruby
[00:35:56] ivanskie: has joined #ruby
[00:42:38] uplime: has joined #ruby
[00:46:40] ivanskie: has joined #ruby
[00:59:23] kurko_: has joined #ruby
[01:08:13] timeless: did I do something spectacularly wrong? https://www.irccloud.com/pastebin/Hh663xI3/
[01:08:14] ruby[bot]: timeless: we in #ruby do not like irccloud.com, it has no syntax highlighting, distracting formatting and loads slowly for most. Please use https://gist.github.com
[01:09:48] timeless: -- i'll accept that it's slow, and may have distracting formatting, and probably loads slowly and that the channel has decided that they hate it, but is it really true that it does't have syntax highlighting? (it sure seems to, to my naive eye)
[01:10:07] lxsameer: has joined #ruby
[01:10:52] timeless: https://dpaste.de/DACT
[01:27:01] qolq3: has joined #ruby
[01:29:30] meinside: has joined #ruby
[01:36:27] AJA4350: has joined #ruby
[01:45:13] cagomez: has joined #ruby
[02:26:45] ivanskie: has joined #ruby
[02:33:42] michael_mbp: has joined #ruby
[02:38:19] za1b1tsu_: has joined #ruby
[02:46:23] esrse: has joined #ruby
[02:49:36] tAn: has joined #ruby
[03:03:07] timeless: baweaver: is this line valid ruby? https://github.com/jsoref/middleman/blob/master/middleman-cli/lib/middleman-cli/templates/extension/Rakefile#L7
[03:03:44] timeless: (it certainly doesn't seem to be, when i use that line as is, `rake` screams)
[03:10:34] braincrash: has joined #ruby
[03:13:39] arescorpio: has joined #ruby
[03:23:00] nadir: has joined #ruby
[03:23:32] JusticeFries: has joined #ruby
[03:26:59] nicesignal: has joined #ruby
[03:35:42] marmotini_: has joined #ruby
[03:56:23] kurko_: has joined #ruby
[03:56:28] orbyt_: has joined #ruby
[03:57:04] kurko_: has joined #ruby
[03:57:19] baweaver: timeless: Gimme a sec, just logged back on.
[03:57:53] kurko_: has joined #ruby
[03:58:12] baweaver: Take a look at the syntax highlighting on L7
[03:58:20] baweaver: Notice how not is red?
[03:58:24] kurko_: has joined #ruby
[03:58:28] baweaver: Quotes don't quite work like that
[03:58:49] baweaver: This: '--fail-fast --color --tags 'not @wip' --strict'
[03:58:52] baweaver: is two strings
[03:59:02] baweaver: '--fail-fast --color --tags ' and ' --strict'
[03:59:16] kurko_: has joined #ruby
[03:59:28] timeless: Yeah, I didn't write that code
[03:59:30] baweaver: This just looks like the literal 'not' in Ruby and a variable reference: not @wip
[04:00:02] timeless: ACTION naively assumed stuff might "just work"
[04:00:10] baweaver: Na, that's broken.
[04:00:29] timeless: Thanks, that's reassuring
[04:01:44] timeless: I have, what I thought was, a simple task... Replace `href="foo.html.md"` with `href="foo.html"`
[04:01:45] baweaver: Creating an issue for it, one sec.
[04:01:58] timeless: There's already a PR for it
[04:02:10] ivanskie: has joined #ruby
[04:03:20] timeless: ACTION heads out for a bit
[04:05:38] marmotini_: has joined #ruby
[04:06:10] cagomez: has joined #ruby
[04:07:02] baweaver: Well now there are two.
[04:09:25] baweaver: Someone got lint happy and replaced a ton of double quotes with single quotes without checking the integrity of all the files.
[04:13:01] timeless: ACTION nods
[04:13:37] timeless: Actually, in this case, I think it was in response to a deprecation warning
[04:17:53] arescorpio: has joined #ruby
[04:26:39] kapil____: has joined #ruby
[04:28:21] dviola: has joined #ruby
[04:29:37] MoritaShinobu: has joined #ruby
[04:42:26] LiftLeft: has joined #ruby
[04:54:28] lxsameer: has joined #ruby
[05:00:03] Pisuke: has joined #ruby
[05:01:29] marmotini_: has joined #ruby
[05:02:28] marmotini_: has joined #ruby
[05:02:38] sauvin: has joined #ruby
[05:02:45] ansraliant: has joined #ruby
[05:06:47] marmotini_: has joined #ruby
[05:10:28] marmotini: has joined #ruby
[05:32:51] reber: has joined #ruby
[05:45:41] apeiros: has joined #ruby
[05:57:29] aufi: has joined #ruby
[06:07:04] LiftLeft: has joined #ruby
[06:12:08] armyriad: has joined #ruby
[06:30:14] _whitelogger: has joined #ruby
[07:14:24] lytol_: has joined #ruby
[07:26:36] bsrd: has left #ruby: ("WeeChat 2.2")
[07:27:28] clemens3_: has joined #ruby
[07:28:23] vondruch: has joined #ruby
[07:31:37] alem0lars: has joined #ruby
[07:56:15] GodFather: has joined #ruby
[08:00:14] kurko_: has joined #ruby
[08:01:00] kurko_: has joined #ruby
[08:01:41] kurko_: has joined #ruby
[08:02:35] kurko_: has joined #ruby
[08:03:24] kurko_: has joined #ruby
[08:04:01] kurko_: has joined #ruby
[08:06:28] mikecmpbll: has joined #ruby
[08:15:34] lxsameer: has joined #ruby
[08:15:41] kapil____: has joined #ruby
[08:21:53] venmx: has joined #ruby
[08:29:36] cesario: has joined #ruby
[08:33:45] mikecmpb_: has joined #ruby
[09:04:24] leitz: has joined #ruby
[09:05:43] konsolebox: has joined #ruby
[09:17:33] phaul: has joined #ruby
[09:21:39] mikecmpbll: has joined #ruby
[09:44:03] xfbs: has joined #ruby
[09:51:18] clemens3: has joined #ruby
[09:54:27] wojnar: has joined #ruby
[10:09:44] themsay: has joined #ruby
[10:21:42] datazoo: has joined #ruby
[10:38:12] mangold: has joined #ruby
[10:39:14] mangold: has joined #ruby
[10:39:36] whysthatso: has joined #ruby
[10:42:03] Cthulu201: has joined #ruby
[10:43:57] FernandoBasso: has joined #ruby
[10:50:18] themsay: has joined #ruby
[11:05:04] AJA4350: has joined #ruby
[11:13:16] DTZUZO_: has joined #ruby
[11:17:24] za1b1tsu_: has joined #ruby
[11:23:07] tuor: has joined #ruby
[11:33:36] infernix: has joined #ruby
[11:33:39] Nicmavr: has joined #ruby
[11:38:36] egourlao: has joined #ruby
[12:00:36] JusticeFries: has joined #ruby
[12:01:17] reber: has joined #ruby
[12:04:45] kurko_: has joined #ruby
[12:07:07] cd: has joined #ruby
[12:07:41] whysthatso: has joined #ruby
[12:11:53] whysthatso: has joined #ruby
[12:35:22] troulouliou_div2: has joined #ruby
[12:37:27] clemens3: has joined #ruby
[12:46:35] qolq3: has joined #ruby
[12:52:36] themsay: has joined #ruby
[12:53:31] xfbs: has joined #ruby
[12:56:09] vonfry: has joined #ruby
[13:14:54] mangold: has joined #ruby
[13:20:56] Azure: has joined #ruby
[13:21:38] apeiros: has joined #ruby
[13:22:12] phaul: has joined #ruby
[13:22:13] apeiros__: has joined #ruby
[13:23:13] za1b1tsu_: has joined #ruby
[13:26:53] discopatrick: has joined #ruby
[13:43:51] SeepingN: has joined #ruby
[13:48:10] rwb: has joined #ruby
[13:48:37] rippa: has joined #ruby
[14:05:22] sidx64: has joined #ruby
[14:14:24] marmotini_: has joined #ruby
[14:26:06] Inline: has joined #ruby
[14:33:28] al2o3-cr: has joined #ruby
[14:39:57] beefjoe: has joined #ruby
[14:40:44] uplime: has joined #ruby
[14:45:31] ivanskie: has joined #ruby
[14:52:52] orbyt_: has joined #ruby
[14:55:40] veloutin: has joined #ruby
[14:55:47] za1b1tsu: has joined #ruby
[15:07:03] chouhoulis: has joined #ruby
[15:13:28] whysthatso: has joined #ruby
[15:23:20] Dbugger: has joined #ruby
[15:26:32] marmotini_: has joined #ruby
[15:31:43] za1b1tsu: has joined #ruby
[15:45:43] leafyleong: has joined #ruby
[15:46:01] Rapture: has joined #ruby
[15:46:11] moei: has joined #ruby
[15:47:33] queip: has joined #ruby
[15:48:34] cthulchu_: has joined #ruby
[15:50:21] za1b1tsu: has joined #ruby
[15:54:49] ivanskie: has joined #ruby
[15:59:31] jcarl43: has joined #ruby
[16:04:38] beowuff: has joined #ruby
[16:09:41] mangold: has joined #ruby
[16:17:12] tdy: has joined #ruby
[16:27:20] JusticeFries: has joined #ruby
[16:31:28] apeiros_: has joined #ruby
[16:43:43] sameerynho: has joined #ruby
[16:53:30] Azure: has joined #ruby
[16:57:40] hightower2: has joined #ruby
[16:58:27] hightower2: Hey, regarding formatting with ( "This is %s" % ["a string"] ), is there a version of it which does named replacements, instead of just positional?
[17:01:12] phaul: hightower2: not really an answer to your question, but is there any reason you are avoiding string interpolation with #{} ?
[17:01:26] phaul: http://ruby-for-beginners.rubymonstas.org/bonus/string_interpolation.html
[17:01:26] hightower2: yeah I'll use that, thanks
[17:05:03] al2o3-cr: >> "this is %{string}".% string: "a string"
[17:05:09] ruby[bot]: al2o3-cr: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[17:07:16] phaul: doesn't look like eval.in is going to be fixed any time soon.. Anything you click is just 500 Internal Server Error..
[17:07:49] al2o3-cr: phaul: no, doesn't look like it :(
[17:08:08] planigan: has joined #ruby
[17:09:37] phaul: on the bright side, rubydoc will link the full stdlib pretty soon... almost there..
[17:11:57] al2o3-cr: phaul: oh cool, you making something similar to derpy?
[17:12:14] phaul: &ri Array
[17:12:14] rubydoc: https://ruby-doc.org/core-2.5.1/Array.html
[17:12:30] phaul: list Array#s%
[17:12:44] phaul: oh, cc'mon..
[17:12:57] phaul: &list Array#s%
[17:12:57] rubydoc: Array#sample, Array#select, Array#select!, Array#shift, Array#shuffle, Array#shuffle!, Array#size, Array#slice, Array#slice!, Array#sort, Array#sort!,...
[17:13:06] phaul: nah. & was missing, my fault
[17:13:17] al2o3-cr: ah right :P
[17:15:07] hightower2: Is there a built-in class or methods for converting strings to camel case and back?
[17:15:54] hightower2: oh yes, camelize and underscore on String. nice
[17:16:18] hightower2: (in Rails, but OK)
[17:23:16] baweaver: 'how_about_this'.gsub(/_\w/) { |cs| cs[1].upcase }
[17:23:47] hightower2: yeah I need more variations, and also various combinations of changing back and forth
[17:24:00] hightower2: so I just added active_support/core_ext/string/inflections
[17:24:51] baweaver: 'howAboutThis'.gsub(/[A-Z]/) { |c| "_#{c.downcase}" }
[17:43:58] al2o3-cr: "%3$s %2$s %1$s" % %w{you love i}
[17:45:43] fredlinhares: has joined #ruby
[17:47:20] cats: has joined #ruby
[17:50:41] ged: has joined #ruby
[17:51:31] segy: has joined #ruby
[17:51:54] c0ncealed3: has joined #ruby
[17:52:17] knight33: has joined #ruby
[17:53:33] schneider: has joined #ruby
[17:58:36] Eiam: has joined #ruby
[18:04:17] fredlinhares: has joined #ruby
[18:06:06] kapil____: has joined #ruby
[18:07:47] akem: has joined #ruby
[18:07:57] JusticeFries: has joined #ruby
[18:12:08] leafyleong: has joined #ruby
[18:26:38] wojnar: has joined #ruby
[18:28:45] anoob: has joined #ruby
[18:30:43] anoob: Is it possible to read an ENV var within a .env file: `DATABASE_URL=postgres://username:passwd@localhost:5432/db_name<%= ENV['TEST_ENV_NUMBER'] %>` ?
[18:31:32] xfbs: has joined #ruby
[18:31:43] ruby[bot]: Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
[18:32:13] mikecmpbll: has joined #ruby
[18:33:28] phaul: anoob: I was too fast. Ignore that ^^. Sorry ....
[18:34:13] anoob: No problem, phaul
[18:36:04] ged: anoob: I think it depends on what is reading the .env file. If whatever is reading it does ERb expansion before assigning, then that looks like it should work.
[18:37:24] anoob: I receive an error: "URI::InvalidURIError: bad URI(is not URI?)" with the `<%= ENV['TEST_ENV_NUMBER'] %>` part ...
[18:37:28] anoob: But it does work without it ...
[18:37:47] Junaos: has joined #ruby
[18:39:16] snickers: has joined #ruby
[18:43:44] Azure: has joined #ruby
[18:47:17] onkelhotte: has joined #ruby
[18:47:57] im0nde: has joined #ruby
[18:54:30] SeepingN: has joined #ruby
[18:54:33] tdy: has joined #ruby
[19:08:28] RougeR: has joined #ruby
[19:10:39] tdy: has joined #ruby
[19:15:03] fredlinhares: has joined #ruby
[19:16:14] segy: has joined #ruby
[19:19:46] Bacteria: has joined #ruby
[19:27:54] segy: has joined #ruby
[19:36:29] apeiros: has joined #ruby
[19:40:52] tycoon177: hello, i am currently working on a sinatra app and was wondering what gems people are using to send emails from ruby since actionmailer isn't available without rails
[19:41:34] apeiros_: has joined #ruby
[19:44:49] tycoon177: i did find this gem that seems like it'd be a good fit and isn't abandoned :p https://github.com/mikel/mail
[19:58:31] granttrec: has joined #ruby
[20:00:50] granttrec: hey all, trying to understand binary, and alus, I tried writing the code (https://ideone.com/aPn2ed) for a division on N show here https://imgur.com/a/3yGZnLL It looks to me that there is an extra iteration, but it doesnt work without, any ideas?
[20:01:44] eckhardt: has joined #ruby
[20:09:56] phaul: doesn't the flowchart also repeats 65 times not 64?
[20:11:38] phaul: I mean if # iteration < 65 you iterate one last time...
[20:11:46] granttrec: it exits on 65 repetion so should be less than 65
[20:11:57] granttrec: so 64 iterations
[20:12:36] phaul: but when # iterations == 64 it goes back to the top...
[20:14:09] xfbs: has joined #ruby
[20:16:24] phaul: I guess it depends if the test is part of the iteration :) ie very first time is # iteration 0, or 1..
[20:16:39] granttrec: phaul: ok so are these equivalent c loop: for (int i = 0; i < 65; i++) ruby loop: for i in 1..65 ?
[20:16:51] granttrec: i would say no
[20:17:09] phaul: I agree. they aren't
[20:17:58] fredlinhares: has joined #ruby
[20:19:30] phaul: does this algo work in C with for (int i = 0; i < 65; i++) ?
[20:19:49] granttrec: yeah it does, but ill check
[20:20:02] granttrec: the book is "c" based examples
[20:20:16] phaul: btw besides the point, but most rubiists would write 64.times do ...end
[20:20:26] phaul: rather than for loop
[20:20:44] granttrec: didnt no that existed tbh im new to ruby
[20:20:47] ivanskie: has joined #ruby
[20:23:28] phaul: np. It shouldn't make a difference but much easier/nicer to read
[20:25:48] venmx: has joined #ruby
[20:27:16] kurko_: has joined #ruby
[20:28:25] kurko_: has joined #ruby
[20:29:10] kurko_: has joined #ruby
[20:29:37] kurko_: has joined #ruby
[20:30:29] kurko_: has joined #ruby
[20:31:07] kurko_: has joined #ruby
[20:32:07] kurko_: has joined #ruby
[20:32:45] granttrec: phaul: so turns out the same range is needed https://ideone.com/8p1zes
[20:32:54] granttrec: im even more intrigued
[20:33:02] kurko_: has joined #ruby
[20:33:33] phaul: I think the flowchart can be interpreted two ways..
[20:33:43] kurko_: has joined #ruby
[20:33:53] phaul: #iterations is too vague
[20:34:28] kurko_: has joined #ruby
[20:34:34] granttrec: well 64 makes sense since thats the number of binary places in the register but now idk
[20:35:20] kurko_: has joined #ruby
[20:36:37] patr0clus: has joined #ruby
[20:36:51] kurko_: has joined #ruby
[20:37:19] kurko_: has joined #ruby
[20:44:21] patr0clus: has joined #ruby
[20:47:30] tycoon177: for anyone wondering, the mail gem that i sent earlier is working poifectly
[20:51:13] granttrec: has left #ruby: ("ERC (IRC client for Emacs 24.5.1)")
[21:06:18] rwb: has joined #ruby
[21:11:10] rubydoc: has joined #ruby
[21:11:29] phaul: &list Array
[21:11:29] rubydoc: Array, Array (abbrev), Array (mkmf), Array (rexml), Array (shellwords)
[21:11:40] phaul: &ri Tempfile
[21:11:40] rubydoc: https://ruby-doc.org/stdlib-2.5.1/libdoc/tempfile/rdoc/Tempfile.html
[21:12:14] phaul: stdlib + core except io & net... the rest is there
[21:14:26] DTZUZO_: has joined #ruby
[21:15:02] nicesignal: has joined #ruby
[21:21:15] fredlinhares: has joined #ruby
[21:23:42] ellcs: has joined #ruby
[21:25:14] rwb: has joined #ruby
[21:46:10] nowhere_man: has joined #ruby
[21:50:33] troulouliou_dev: has joined #ruby
[22:01:04] phaul: rubydoc.info is down..
[22:01:19] phaul: Error 503 Backend fetch failed
[22:02:05] phaul: works again
[22:13:53] Nicmavr: has joined #ruby
[22:14:44] luffy: has joined #ruby
[22:18:31] patr0clus: has joined #ruby
[22:18:39] Azure|dc: has joined #ruby
[22:24:25] Azure: has joined #ruby
[22:27:06] patr0clus: has joined #ruby
[22:27:41] Azure|dc: has joined #ruby
[22:33:41] nine_milli_: has joined #ruby
[22:34:05] nine_milli_: how come 6 >= 43.49 in ruby?
[22:34:35] havenwood: nine_milli_: #=> false
[22:35:47] patr0clus: has joined #ruby
[22:35:48] nine_milli_: php so much better, numbers are way more accurate
[22:36:05] havenwood: nine_milli_: Trolling isn't allowed here. Please stop or you'll be banned.
[22:36:41] havenwood: Rational ftw.
[22:36:42] nine_milli_: havenwood, you can not stifle the voice of truth, youll get punched in the face sooner or later
[22:37:21] havenwood: nine_milli_: So you don't have any actual Ruby questions or code to share?
[22:37:38] nine_milli_: lol, what kinda loser actually writes ruby code
[22:37:41] havenwood: I'll take that as a "no."
[22:37:43] nine_milli_: i use php like a normal person
[22:37:45] havenwood: !troll nine_milli_
[22:37:45] ruby[bot]: +bbbb $a:nine_milli$#ruby-banned nine_milli!*@*$#ruby-banned nine_milli_!*@*$#ruby-banned *!*@c-76-23-234-152.hsd1.ct.comcast.net$#ruby-banned
[22:37:47] ruby[bot]: ruby[bot] kicked nine_milli_: is a bannable offense, see http://ruby-community.com/pages/user_rules
[22:37:51] rewaant: has joined #ruby
[22:38:05] rewaant: has left #ruby: ()
[22:44:47] akem: has joined #ruby
[22:51:44] marmotini_: has joined #ruby
[22:57:40] DTZUZO_: has joined #ruby
[23:04:09] ivanskie: i'm not sure how to formulate my question.
[23:04:51] ivanskie: Config.profiles returns an array of ruby objects
[23:05:18] ivanskie: Config.applications is also an array of ruby objects.
[23:06:06] ivanskie: Config.applications.first.profile returns a name of a profile. But I'd like it to return that particular ruby object from Config.profiles
[23:06:52] ivanskie: I already have to_s method in Profile class. im not sure how to find one profile?
[23:08:53] ivanskie: i guess i need to search an array of ruby objects
[23:12:35] ivanskie: by ruby objects i mean... classes
[23:12:42] nowhere_man: has joined #ruby
[23:13:22] ivanskie: Config.profiles => [#<Profile:0x00007fba7b1baef8 ...>, #<Profile:0x00007fba7b1bae08 ...>, etc]
[23:13:36] ivanskie: im not in rails.
[23:13:45] ivanskie: so how do i search array of classes?
[23:35:01] venmx: has joined #ruby
[23:36:00] hightower2: has joined #ruby
[23:44:00] uplime: has joined #ruby