« Back to channel list

#ruby - 26 June 2017

« Back 1 day Forward 1 day »
[00:00:57] frustrum: has joined #ruby
[00:02:12] jenrzzz: has joined #ruby
[00:02:12] jenrzzz: has joined #ruby
[00:09:48] eljimmy: has joined #ruby
[00:14:52] eljimmy: has joined #ruby
[00:20:00] umaaji: has joined #ruby
[00:28:30] nacsurte: has joined #ruby
[00:28:35] hutch34: has joined #ruby
[00:29:11] charliesome: has joined #ruby
[00:32:16] burgestrand: has joined #ruby
[00:36:16] millerti: has joined #ruby
[00:42:07] cschneid_: has joined #ruby
[00:42:22] chouhoulis: has joined #ruby
[00:42:45] eightlimbs: any idea why method B runs faster than method A for big numbers? (https://gist.github.com/eightlimbed/addcd01398088d76df9ad6fda62f8cac)
[00:43:07] eightlimbs: method A runs faster than method B **
[00:44:20] Kug3lis: has joined #ruby
[00:44:32] rfoust: has joined #ruby
[00:45:22] adam12: eightlimbs: naive answer but the conditional in method A might short-circuit where method B continues through the full range.
[00:45:45] adam12: eightlimbs: I didn't look too closely so I could be wrong.
[00:45:50] boombox_: has joined #ruby
[00:46:57] Rodya_: has joined #ruby
[00:47:01] hndk: has joined #ruby
[00:48:25] eightlimbs: just looking at it again, i see that A decrements by division, why B decrements by subtraction
[00:49:29] insanedreamer: has joined #ruby
[00:58:09] FastJack_: has joined #ruby
[01:00:54] ketan: has joined #ruby
[01:01:08] insanedreamer: has joined #ruby
[01:01:17] Bock: has joined #ruby
[01:02:25] jenrzzz: has joined #ruby
[01:02:25] jenrzzz: has joined #ruby
[01:05:16] Bock: has joined #ruby
[01:07:33] ascarter: has joined #ruby
[01:11:53] apparition: has joined #ruby
[01:13:35] Nahra: has joined #ruby
[01:21:13] arescorpio: has joined #ruby
[01:27:09] _whitelogger: has joined #ruby
[01:29:44] nacsurte: has joined #ruby
[01:30:11] AndBobsYourUncle: has joined #ruby
[01:32:22] burgestrand: has joined #ruby
[01:39:34] elcontrastador: has joined #ruby
[01:40:40] hutch34: has joined #ruby
[01:42:54] dannyh: has joined #ruby
[01:44:24] insanedreamer: has joined #ruby
[01:44:32] insanedreamer: has left #ruby: ()
[01:45:21] jenrzzz: has joined #ruby
[01:45:21] jenrzzz: has joined #ruby
[01:47:13] d^sh_: has joined #ruby
[01:51:19] eightlimbs: has joined #ruby
[01:56:10] gizmore|2: has joined #ruby
[01:57:33] Jameser: has joined #ruby
[01:59:35] QpQ4: has joined #ruby
[02:02:14] cschneid_: has joined #ruby
[02:11:07] dasher00: has joined #ruby
[02:15:15] rkazak: has joined #ruby
[02:15:41] ascarter: has joined #ruby
[02:16:18] ishahnaz: has joined #ruby
[02:17:45] QpQ4: has joined #ruby
[02:24:36] hutch34: has joined #ruby
[02:27:18] bkxd: has joined #ruby
[02:27:20] bkxd_: has joined #ruby
[02:29:17] jackjackdripper: has joined #ruby
[02:30:28] nacsurte: has joined #ruby
[02:32:40] bkxd: has joined #ruby
[02:32:42] bkxd_: has joined #ruby
[02:37:10] Rodya_: has joined #ruby
[02:42:37] insanedreamer: has joined #ruby
[02:52:28] Jameser: has joined #ruby
[02:57:34] rivalomega: has joined #ruby
[03:01:45] ketan: has joined #ruby
[03:02:12] QpQ4: has joined #ruby
[03:06:02] creshiem: has joined #ruby
[03:06:46] runescape07rsps: has joined #ruby
[03:08:00] rivalomega: has joined #ruby
[03:09:06] N0ATN: has joined #ruby
[03:20:48] ascarter: has joined #ruby
[03:23:14] Trynemjoel: has joined #ruby
[03:31:17] nacsurte: has joined #ruby
[03:35:25] gix: has joined #ruby
[03:36:00] enterprisey: has joined #ruby
[03:38:25] Trynemjoel: has joined #ruby
[03:41:05] cschneid_: has joined #ruby
[03:48:56] harfangk: has joined #ruby
[03:57:36] hutch34: has joined #ruby
[03:58:54] astrobunny: has joined #ruby
[04:03:11] carterdea: has joined #ruby
[04:05:46] beilabs__: has joined #ruby
[04:17:35] eljimmy: has joined #ruby
[04:25:14] ascarter: has joined #ruby
[04:31:16] ledestin: In the Rails itself, how do I enable output via puts?
[04:31:26] ledestin: Rails framework code
[04:31:57] nacsurte: has joined #ruby
[04:32:38] mim1k: has joined #ruby
[04:33:44] jnollette: has joined #ruby
[04:34:59] Trynemjoel: has joined #ruby
[04:35:26] nicesignal: has joined #ruby
[04:39:07] Coldblackice_: has joined #ruby
[04:39:08] danny__: has joined #ruby
[04:43:43] havenwood: ledestin: Rails.logger.info
[04:43:53] Coldblackice_: has joined #ruby
[04:43:56] ledestin: havenwood no luck witht hat
[04:44:03] havenwood: ledestin: There's a #RubyOnRails channel for Rails-specific questions.
[04:44:17] ledestin: that's a dump
[04:44:20] havenwood: ledestin: No luck in that it's not logging to stdout?
[04:44:24] ledestin: but thanks anyway
[04:44:29] havenwood: ledestin: A dump?
[04:44:32] ledestin: not logging anywhere
[04:44:39] havenwood: ledestin: In dev or prod?
[04:44:42] ledestin: havenwood that's a crappy channel
[04:44:49] havenwood: ledestin: How so?
[04:45:09] havenwood: ledestin: Which environment, development, test, production?
[04:45:21] ledestin: havenwood Rails framework itself
[04:45:25] rippa: has joined #ruby
[04:45:34] ledestin: I'm debugging some Rails framework code
[04:46:06] havenwood: ledestin: How about a `binding.pry` instead of stdout?
[04:46:16] nofxxxx: has joined #ruby
[04:46:20] havenwood: Or `binding.irb` these days if you prefer.
[04:46:49] ledestin: havenwood people that were unhappy with that channel made RoR slack, and that's great. But that channel I hoped I'd never go to again. Not friendly, rude, not helpful.
[04:47:31] havenwood: It's nice that Ruby 2.4 got `binding.irb`.
[04:48:12] r3vDev: has joined #ruby
[04:48:34] havenwood: ledestin: If you're not seeing Kernel#puts and don't know why, you might look at what STDOUT is.
[04:48:52] havenwood: ledestin: Then sanity check that it works: STDOUT.puts
[04:49:20] havenwood: Or check `$stdout` and : $stdout.puts
[04:49:57] havenwood: ledestin: I don't get from what you've said why you're not seeing the output you expect.
[04:50:23] havenwood: I'm curious if you see STDERR output. How about: warn
[04:51:05] havenwood: Or STDERR.puts, $stderr.puts, however.
[04:51:13] ledestin: havenwood it's my fault. it was using source code from a gem
[04:51:22] havenwood: ledestin: aha
[04:51:41] ledestin: let me try it the proper way
[04:52:21] govg: has joined #ruby
[04:53:51] comet23: has joined #ruby
[04:54:15] comet23: i started reading the rails 4 book, it's well written :)
[04:54:19] comet23: rails 4 in action
[04:54:28] Ropeney: has joined #ruby
[04:54:33] comet23: i have a quick question for real life development.... this is my function https://repl.it/JBqN/0
[04:54:58] comet23: should i delegate error checking to a different function or is it okay to keep it there as-is?
[04:56:05] havenwood: comet23: There are a few problems with that method. The first is it doesn't get my age right!
[04:56:15] comet23: no, this assumes the year is 2003
[04:56:18] yogg-saron: has joined #ruby
[04:56:31] havenwood: comet23: When in the year?
[04:56:42] comet23: it's on line 2 i think
[04:56:48] havenwood: comet23: Birthdays don't wait 'till the end of the year then all happen at once!
[04:56:50] comet23: yes, line 2
[04:57:00] havenwood: People born in the same year might be different ages.
[04:57:02] comet23: i don't celebrate birthdays
[04:57:07] havenwood: Nonetheless.
[04:57:14] comet23: but that's besides the point haha
[04:57:42] comet23: so how can two people being born... oh i get it
[04:57:44] havenwood: If it's beside the point then the method is missnamed. ;-P
[04:58:38] comet23: well, i am taking a course from flatironschool, they were nice enough to offer a 1 month free trial of their entire bootcamp (normally $149, but free for a month if you link to github education)
[04:58:48] havenwood: comet23: Do you count someone as a day older the second the clock strikes midnight?
[04:59:02] havenwood: comet23: Have they covered tests at all yet?
[04:59:08] comet23: a lot of people surprisingly don't know the time they were born
[04:59:14] comet23: my code passes the tests
[04:59:50] comet23: i don't think their bootcamp is worth $149, but that's my opinion, but i am going to finish it in a week :)
[05:00:08] comet23: it's $149 a month to be clear and they say it takes 6 months to complete on average
[05:00:12] havenwood: comet23: Normally you'd `raise` if something exceptional happened.
[05:00:20] comet23: oh, thank you
[05:00:31] havenwood: comet23: If you just want to warn about it use `warn` instead of `puts` so it goes to STDERR.
[05:00:48] havenwood: Kernel#warn also respects disabling warnings.
[05:01:18] havenwood: If you want to warn then exit with a nonzero status there's `abort 'flee at once!'`.
[05:01:57] havenwood: comet23: Are negative ages forbidden?
[05:02:09] comet23: no, i just added that extra thought
[05:02:18] havenwood: When I was -5 the programming scene was just heating up.
[05:02:34] comet23: negative age doesn't make sense, hopefully one day people will figure out how to solve that problem and make it a thing
[05:02:37] ketan: has joined #ruby
[05:03:05] havenwood: comet23: I think we just say it as "five years before I was born" instead of "when I was negative five".
[05:03:05] comet23: i don't like the docs.... what is this? https://ruby-doc.org/core-2.4.0/Warning.html
[05:03:52] havenwood: comet23: https://ruby-doc.org/core-2.4.0/Kernel.html#method-i-warn
[05:04:04] comet23: what was i looking at?
[05:05:33] havenwood: The Warning module rather than the Kernel module.
[05:05:59] comet23: ruby is so complicated
[05:06:10] havenwood: It should probably redirect you in the docs.
[05:06:21] havenwood: comet23: https://bugs.ruby-lang.org/issues/12944
[05:06:22] comet23: it looks so easy and beautiful though
[05:07:35] havenwood: comet23: Ruby's complex grammar provides for some lovely code.
[05:08:58] kruppm: has joined #ruby
[05:10:13] comet23: okay, i am guessing raise is a keyword... these ruby docs are so bad
[05:10:13] comet23: https://repl.it/JBqN/1
[05:11:41] comet23: warn isn't working on repl
[05:13:13] kruppm: I want to overwrite a method `find`, defined in a module inside a class definition: https://goo.gl/Q4FVEn
[05:13:32] kruppm: I usually monkey-patch stuff like this with `prepend`, but that does not seem to work here, with modules inside classes
[05:14:01] kruppm: is there a way to monkey-patch this method without re-opening the class?
[05:14:16] comet23: i read that monkey-patching is a horrible, horrible, idea and you should never ever do it
[05:14:50] havenwood: comet23: That's not true.
[05:15:09] kruppm: comet23: ye, but it is how it is. i cannot rewrite a ~50k LoC project just to fix raisl 5 compatibility :)
[05:15:31] havenwood: comet23: Freedom patching is sometimes okay, though it's fair to say you can't just monkey patch core classes in libraries.
[05:15:56] comet23: oh, now that makes sense
[05:16:19] kruppm: So, is there a reason why `ActionView::LookupContext::ViewPaths.prepend` does not seem to work as (I) expected?
[05:16:33] comet23: what does it output?
[05:16:43] kruppm: .ancestors shows the patch, but a call to .find() still calls the original method
[05:16:48] havenwood: comet23: There're refinements these days, which actually do end up being handy. They let you monkeypatch just within the file and class you're in.
[05:16:49] havenwood: comet23: https://ruby-doc.org/core-2.4.1/doc/syntax/refinements_rdoc.html
[05:17:17] yogg-saron: has joined #ruby
[05:17:20] comet23: it sounds like find's return value might be the culprit
[05:19:16] kruppm: comet23: no, i need to extend the function, to handle some edge-cases (specifically, different lookup paths, in certain cases)
[05:20:14] kruppm: but the "prepended" method never gets called, ActionView still calls the original method for some reason, altough, ActionView::LookupContext::ViewPaths.ancestors DOES show the patch
[05:20:23] havenwood: kruppm: I'm curious why prepend isn't working. You might try the #RubyOnRails channel as well.
[05:21:04] kruppm: thought there might be some scoping general issues with modules defined inside classes.
[05:21:12] kruppm: that's why i asked here :)
[05:21:31] havenwood: kruppm: Nothing that I'm aware of. Let me sanity check real quick.
[05:23:52] havenwood: kruppm: Works for me.
[05:24:02] xall: has joined #ruby
[05:25:25] havenwood: >> class X; module Y; def foo; :foo end end end; module Z; def foo; :bar end end; X::Y.prepend Z; include X::Y; foo
[05:25:26] ruby[bot]: havenwood: # => :bar (https://eval.in/822169)
[05:26:34] comet23: havenwood: how do you read all that?
[05:26:48] havenwood: comet23: It's easier on multiple lines.
[05:26:51] comet23: that's super confusing for me
[05:27:03] comet23: but can you read it on one line?
[05:27:15] comet23: i want to learn how to do that
[05:27:22] kruppm: does not work: https://pastebin.com/e0ycFnqe | does work: https://pastebin.com/1bYWhxjF
[05:27:24] ruby[bot]: kruppm: we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/fa0c46b950e17ff2d191f3ba89ec00ed
[05:27:24] ruby[bot]: kruppm: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[05:28:04] comet23: ruby[bot]: that's not a nice thing to say about people's hard work
[05:28:33] kruppm: I might miss something obvious (maybe specific to that class) there, but why does the 1st example not work, while the 2nd does?
[05:28:48] Radar: comet23: pastebin is a tire fire.
[05:29:04] comet23: that's what you need at burning man!
[05:29:07] havenwood: kruppm: self.method(:find).owner #=>
[05:29:08] comet23: a nice tire fire =)
[05:29:37] Radar: I always forget about Method#owner.
[05:30:02] havenwood: kruppm: ActionView::LookupContext != ActionView::LookupContext::ViewPaths
[05:30:22] kruppm: havenwood: internally, LookupContext just calls ViewPaths.find
[05:30:44] kruppm: see 2nd example for that, there it fires the exception
[05:31:21] biberu: has joined #ruby
[05:32:28] burgestrand: has joined #ruby
[05:32:29] kruppm: havenwood: btw, self.method(:find).owner # => ActionView::LookupContext::ViewPaths
[05:32:43] nacsurte: has joined #ruby
[05:37:05] xall: has joined #ruby
[05:37:54] kanye_vest: has joined #ruby
[05:38:07] kruppm: I'm so stupid... line 218: include ViewPaths - ofc it does not work, when the module has already been included before applying the patch :)
[05:45:39] havenwood: kruppm: Aha!
[05:45:43] havenwood: Mystery solved.
[05:46:23] nowhere_man: has joined #ruby
[05:46:55] kruppm: ye, thanks for the hint on ActionView::LookupContext earlier. made me check that class even one more time... :)
[05:48:26] comet23: i'm glad you found your error
[05:48:49] comet23: i hope i can learn something from your error, probably not because i'm not at your level yet... maybe it'll stick in the back of my head :)
[05:49:14] herbmillerjr: has joined #ruby
[05:51:00] ddffg: has joined #ruby
[06:00:06] aupadhye: has joined #ruby
[06:00:06] hutch34: has joined #ruby
[06:02:06] aufi: has joined #ruby
[06:03:44] danny__: has joined #ruby
[06:04:59] enterprisey: has joined #ruby
[06:05:47] QpQ4: has joined #ruby
[06:08:32] roshanavand: has joined #ruby
[06:18:58] alex``: has joined #ruby
[06:19:44] mim1k: has joined #ruby
[06:20:09] conta: has joined #ruby
[06:25:38] Silthias: has joined #ruby
[06:30:21] sekmo: has joined #ruby
[06:31:07] ascarter: has joined #ruby
[06:33:19] nacsurte: has joined #ruby
[06:33:44] djbkd: has joined #ruby
[06:35:02] Ropeney: has joined #ruby
[06:35:15] xall: has joined #ruby
[06:36:22] comet23: why is x being printed 1 more times than it's supposed to? https://repl.it/JBtR/0
[06:38:10] bigkevmcd: has joined #ruby
[06:39:48] yogg-saron: has joined #ruby
[06:42:34] judofyr: has joined #ruby
[06:43:10] judofyr: has joined #ruby
[06:45:54] judofyr: has joined #ruby
[06:53:02] DoubleMalt: has joined #ruby
[06:53:06] baweaver: comet23: step through your code.
[06:53:19] comet23: i'm bad at that, but i figured it out :)
[06:53:23] comet23: here's my code
[06:53:23] comet23: https://repl.it/JBtR/1
[06:53:28] comet23: what can i do to improve it?
[06:54:41] jenrzzz: has joined #ruby
[06:54:54] baweaver: >> ["x"," "," "," ","o"," ","x"," "," "].each_slice(3).map { |slice| slice.join(' | ') }.join("\n-----------\n")
[06:54:55] ruby[bot]: baweaver: # => "x | | \n-----------\n | o | \n-----------\nx | | " (https://eval.in/822250)
[06:55:08] Mortomes|Work: has joined #ruby
[06:55:15] comet23: baweaver: that's so confusing
[06:55:17] solocshaw: has joined #ruby
[06:55:22] comet23: how do you people write one lines of code like that
[06:55:24] baweaver: what's confusing about it.
[06:55:32] dminuoso: comet23: You dont.
[06:55:46] baweaver: typically, unless demonstrating on IRC.
[06:55:49] comet23: dminuoso: baweaver just did
[06:56:07] comet23: i don't understand how you understand what to write, it's amazing
[06:56:16] baweaver: &ri Enumerable
[06:56:16] `derpy: http://ruby-doc.org/core-2.4.1/Enumerable.html
[06:56:18] comet23: i'm more than impressed and i would like to learn how you do that :)
[06:56:25] baweaver: Basically reading through that a lot.
[06:56:45] dminuoso: comet23: baweaver does not qualify as people.
[06:56:50] dminuoso: baweaver is... something else.
[06:57:31] sekmo: I think that it could be improved with some object oriented programming
[06:57:44] baweaver: Basically it reads: Take each 3 elements, transform them to join them with ' | ' ('x | | o' for instance), then join that with the line delimiters.
[06:58:09] dminuoso: sekmo: This is actually pure functional programming mixed in with Smalltalk.
[06:58:24] baweaver: dminuoso's not much of one for smalltalk
[06:58:41] dminuoso: That was puntastic.
[06:58:42] baweaver: ACTION rolls laughing
[06:59:05] baweaver: Anyways, as far as OO, baby steps
[06:59:35] comet23: but what you just did and what radar did with those one lines of confusing code is just so impressive
[06:59:38] comet23: i want to learn that
[06:59:40] baweaver: In this specific instance an object isn't needed yet. It only requires outputting of the board.
[07:00:00] dminuoso: comet23: It's actually fairly easy to write once you wrap your head around it.
[07:00:05] baweaver: Read the documentation for Enumerable, Array, and String.
[07:00:20] baweaver: To be fair me and Radar and others have been at this game for more than a few years.
[07:00:22] comet23: i can't wrap my head around it
[07:00:36] baweaver: you've been at it for maybe a few weeks
[07:00:50] jaruga_________: has joined #ruby
[07:00:51] dminuoso: Long enough to be able to write better than baweaver.
[07:00:56] comet23: no, more than that but i had health problems that made it extremely difficult for me to learn
[07:01:26] mim1k: has joined #ruby
[07:01:59] dminuoso: comet23: Do you have any other previous programming experience?
[07:02:17] comet23: yes, but because of my health problems it's like it's sort of irrelevant
[07:02:27] comet23: i've been trying to learn since 2013
[07:02:52] comet23: i'm still stuck at this level, i just had 4 surgeries and now i'm understanding everything and i can actually think clearly
[07:03:11] comet23: i know that in a month i will be able to be pretty good
[07:03:29] ketan: has joined #ruby
[07:04:32] danny__: has joined #ruby
[07:05:23] TomyWork: has joined #ruby
[07:06:05] tAn: has joined #ruby
[07:12:48] dionysus69: has joined #ruby
[07:15:29] NeutronStarr: has joined #ruby
[07:23:08] sysvalve: has joined #ruby
[07:24:46] andikr: has joined #ruby
[07:27:59] jaruga_________: has joined #ruby
[07:28:18] ferr: has joined #ruby
[07:29:17] solocshaw1: has joined #ruby
[07:30:39] jaruga________: has joined #ruby
[07:34:01] antgel: has joined #ruby
[07:34:05] nacsurte: has joined #ruby
[07:38:15] jenrzzz: has joined #ruby
[07:39:25] ascarter: has joined #ruby
[07:39:51] Jameser`: has joined #ruby
[07:41:53] konsolebox: has joined #ruby
[07:44:42] dionysus69: has joined #ruby
[07:52:15] charliesome: has joined #ruby
[07:52:58] jaruga_________: has joined #ruby
[07:53:58] savoir-faire: has joined #ruby
[07:54:06] Mia: has joined #ruby
[07:54:29] marr: has joined #ruby
[07:57:41] konsolebox: has joined #ruby
[07:58:33] bkxd: has joined #ruby
[07:58:35] bkxd_: has joined #ruby
[07:59:25] mikecmpbll: has joined #ruby
[07:59:26] tvw: has joined #ruby
[08:00:46] jzigmund: has joined #ruby
[08:01:32] Stan: has joined #ruby
[08:01:48] hutch34: has joined #ruby
[08:03:45] Jameser: has joined #ruby
[08:03:54] bkxd: has joined #ruby
[08:05:59] dannyh: has joined #ruby
[08:06:27] savoir-faire: has joined #ruby
[08:10:51] TvL: has joined #ruby
[08:11:53] burgestrand: has joined #ruby
[08:19:10] pankaj_: has joined #ruby
[08:21:10] yeticry: has joined #ruby
[08:21:23] quobo: has joined #ruby
[08:25:25] mim1k: has joined #ruby
[08:32:03] jaruga_________: has joined #ruby
[08:32:34] yeticry_: has joined #ruby
[08:35:00] nacsurte: has joined #ruby
[08:39:05] DoubleMalt: has joined #ruby
[08:40:11] jenrzzz: has joined #ruby
[08:45:23] vondruch: has joined #ruby
[08:45:57] ascarter: has joined #ruby
[08:49:08] vondruch: has joined #ruby
[08:52:01] konsolebox: has joined #ruby
[08:55:49] im0nde: has joined #ruby
[08:56:58] milardovich: has joined #ruby
[09:00:56] Stan: has joined #ruby
[09:02:40] lxsameer: has joined #ruby
[09:04:21] ketan: has joined #ruby
[09:06:07] pandaant: has joined #ruby
[09:07:01] kruppm: has joined #ruby
[09:17:29] Tau: has joined #ruby
[09:17:54] astrobunny: has joined #ruby
[09:23:07] astrobunny: has joined #ruby
[09:24:29] nobitanobi: has joined #ruby
[09:26:22] ferr: has joined #ruby
[09:28:25] blackwind_123: has joined #ruby
[09:28:28] iomotoko: has joined #ruby
[09:30:04] Tau: has left #ruby: ()
[09:34:15] hutch34: has joined #ruby
[09:35:31] rohitpaulk: has joined #ruby
[09:35:43] nacsurte: has joined #ruby
[09:36:17] umaaji: has joined #ruby
[09:38:04] dionysus69: has joined #ruby
[09:41:21] astrobunny: has joined #ruby
[09:41:47] PeterJones: has joined #ruby
[09:43:36] vali: has joined #ruby
[09:44:57] kruppm: has joined #ruby
[09:47:57] montanonic: has joined #ruby
[09:49:05] rfoust: has joined #ruby
[09:50:42] ski7777: has joined #ruby
[09:51:47] blackwind_123: has joined #ruby
[09:52:47] balo: has joined #ruby
[10:02:35] conta: has joined #ruby
[10:05:16] blackwind_123: has joined #ruby
[10:07:11] ur5us: has joined #ruby
[10:07:22] PeterJones: has joined #ruby
[10:07:34] dannyh: has joined #ruby
[10:08:54] Tau: has joined #ruby
[10:09:05] Tau: hi guys. i have an odd behavior here. it shows the problem http://codepad.org/y1tckwpH
[10:10:11] bkxd: has joined #ruby
[10:10:14] rikkipitt: has joined #ruby
[10:11:24] milardovich: has joined #ruby
[10:15:13] bkxd_: has joined #ruby
[10:18:26] ruby[bot]: dminuoso: I have disassembled your code, the result is at https://eval.in/822397
[10:18:32] PeterJones: has left #ruby: ("Leaving...")
[10:18:48] dminuoso: Was about time someone asked an interesting question.
[10:19:10] foxxx0: has joined #ruby
[10:19:42] dminuoso: tau: My guess is you are trying this in pry?
[10:20:05] Tau: dminuoso in irb.
[10:20:13] dminuoso: tau: Same story.
[10:20:20] dminuoso: tau: irb is a big fat ruby program.
[10:20:29] dminuoso: it does things, apparently it sometimes substracts things. :-)
[10:20:29] Tau: dminuoso hmm, i see.
[10:20:33] Mon_Ouie: puts caller to see where each call comes from
[10:20:45] Tau: i got it.
[10:21:06] Tau: dminuoso isnt there some ruby irb-like that is not going to mess around it?
[10:21:25] dminuoso: tau: Not that I am aware of.
[10:21:52] dminuoso: tau: In the end you should not monkey patch core classes anyway.
[10:22:07] dminuoso: Because of exactly this thing. Libraries and tools make assumptions about ruby core and stdlib.
[10:23:00] zenspider: tau: YOU are messing around with Integer#-@, not IRB
[10:23:11] zenspider: it's just using it
[10:24:39] rohitpaulk: has joined #ruby
[10:24:51] DoubleMalt: has joined #ruby
[10:25:25] zenspider: tau: curious... what are you actually trying to do?
[10:25:41] Mon_Ouie: has joined #ruby
[10:25:53] Tau: zenspider i'm trying to rewrite (lax) https://github.com/iogf/lax in ruby.
[10:25:54] dminuoso: tau: There is however a Ruby feature almost nobody uses..
[10:25:59] Tau: i thought it would gain some benefits.
[10:26:54] Tau: dminuoso whats it?
[10:27:13] dminuoso: tau: Refinements.
[10:27:35] Tau: dminuoso more strictly speaking, what would it be reinements?
[10:27:43] Tau: refinements*
[10:27:47] Tau: in the context.
[10:27:58] dminuoso: tau: More strictly speaking it's a feature you will have to consult the Ruby documentation for.
[10:28:24] dminuoso: &ri refinements
[10:28:24] `derpy: No results
[10:28:31] dminuoso: ACTION kicks `derpy with adaedra
[10:29:36] Fernando-Basso: has joined #ruby
[10:36:15] zenspider: tau: if you look at the code for lax, I highly doubt the're extending their own built in types... they have a parser of some sort, and that's gonna make a model of the input, and then you'll do something with it to generate output.
[10:36:20] nacsurte: has joined #ruby
[10:36:59] cschneid_: has joined #ruby
[10:38:41] _joes_: has joined #ruby
[10:39:14] jaruga_________: has joined #ruby
[10:41:31] Tau: zenspider yes. i know.
[10:41:56] Tau: zenspider i was wondering if it were possible to avoid parsing in ruby(i was the one who wrote lax).
[10:43:01] dminuoso: Parsing ruby with ruby.
[10:46:17] Tau: zenspider it seems it can be done but it wouldnt be possible to be used in irb.
[10:46:25] Tau: i just need to overload the + for Integer.
[10:46:42] Tau: then ask for a string then build the ast then eval it.
[10:47:42] zenspider: "i just need"... no, that's not just what you need.
[10:48:29] ur5us: has joined #ruby
[10:48:48] ur5us: has joined #ruby
[10:49:14] Tau: zenspider yea, i meant 'sort of'.
[10:50:08] zenspider: tau: you're just parsing straight algebraic expressions?
[10:50:22] Tau: zenspider yea.
[10:50:51] Tau: i believe that if i implement lax in ruby then i could better extend it with functionalities.
[10:50:54] Tau: although i'm not sure yet.
[10:51:07] Tau: i have to think more of the gains in rewriting it in ruby.
[10:51:07] zenspider: meaning handling more maths?
[10:51:15] Tau: zenspider exact.
[10:51:15] zenspider: or just easier to write the impl in?
[10:51:24] Tau: handling more maths.
[10:51:25] ascarter: has joined #ruby
[10:52:29] Tau: and turning the implementation easier somehow too i guess.
[10:52:30] zenspider: you're gonna need a parser
[10:52:37] zenspider: example: lax -c '(x-3)(x+y)'
[10:53:11] zenspider: seems like a simple lexer & parser for this shouldn't be hard...
[10:54:46] jzigmund: has joined #ruby
[10:54:47] Tau: zenspider yea
[10:55:22] zenspider: >> "(x-3)(x+y)".scan(%r%[()+*/^-]|\b\w+\b%)
[10:55:23] ruby[bot]: zenspider: # => ["(", "x", "-", "3", ")", "(", "x", "+", "y", ")"] (https://eval.in/822408)
[10:55:25] Tau: thats possible in python because we have __call__.
[10:55:36] Tau: i mean with no parsing.
[10:56:16] zenspider: I don't know what tokenize does... but it's at least lexing everything out and creating you nodes for those types...
[10:56:16] herwin: I'm not sure if it is intended to be able to parse ruby math expression, but in that case you could just use Ripper to create the AST
[10:56:32] zenspider: no, don't think you can
[10:56:57] zenspider: or, even if you can, you shouldn't
[10:58:07] Papierkorb: tau: So I get it correctly, that you intend to parse some math expression, and then "compile" that into LaTex?
[10:58:19] Tau: papierkorb yea.
[10:58:55] zenspider: yeah... the mathier you get, the less ruby you get: #<Racc::ParseError: env:1 :: parse error on value "(" (tLPAREN2)>
[10:59:14] Papierkorb: tau: In that case, I also want to recommend writing a custom parser for it, you'll most likely end up writing a recursive-descent LL parser. it's not too hard once you got the hang of it, and is great to know for projects to come
[10:59:17] alex``: has joined #ruby
[11:00:12] Tau: papierkorb yea, nice.
[11:02:54] Papierkorb: tau: write a simple calculator first. this is also a really common introductory example parser, so you're actually lucky here. And once that works correctly, make it emit LaTeX code instead of calculating
[11:03:11] Tau: thats a good approach.
[11:03:41] Tau: to start it :D
[11:03:46] Tau: okay guys, thank you for the insight.
[11:03:50] Tau: i gotta be off now.
[11:05:18] vondruch: has joined #ruby
[11:06:02] jaruga_________: has joined #ruby
[11:09:08] vondruch: has joined #ruby
[11:17:50] dasher00: has joined #ruby
[11:18:23] DoubleMalt: has joined #ruby
[11:18:43] vondruch: has joined #ruby
[11:19:08] vondruch: has joined #ruby
[11:25:48] mim1k: has joined #ruby
[11:31:53] apparition: has joined #ruby
[11:33:05] dannyh: has joined #ruby
[11:33:41] ponzii: has joined #ruby
[11:34:36] ponzii: has left #ruby: ()
[11:37:14] vondruch: has joined #ruby
[11:37:33] dannyh: has joined #ruby
[11:39:05] vondruch: has joined #ruby
[11:42:17] jaruga_________: has joined #ruby
[11:42:55] dannyh: has joined #ruby
[11:43:39] jenrzzz: has joined #ruby
[11:43:39] jenrzzz: has joined #ruby
[11:44:12] ldnunes: has joined #ruby
[11:46:10] __urux__: has joined #ruby
[11:47:44] swills: has joined #ruby
[11:48:38] ur5us: has joined #ruby
[11:49:35] mathys: has joined #ruby
[11:50:06] psychicist__: has joined #ruby
[11:50:56] urux: has joined #ruby
[11:51:58] PatrikasZvaigzde: has joined #ruby
[11:52:26] ur5us: has joined #ruby
[11:53:48] vuoto: has joined #ruby
[11:56:44] ascarter: has joined #ruby
[11:57:02] milardovich: has joined #ruby
[11:58:19] govg: has joined #ruby
[12:00:09] ur5us: has joined #ruby
[12:06:32] synthroid: has joined #ruby
[12:06:56] GinoMan: has joined #ruby
[12:07:40] jaruga________: has joined #ruby
[12:09:07] Vel_: has joined #ruby
[12:10:27] GinoMan2440: has joined #ruby
[12:12:55] Vel_: In my app i am passing the params object to model class. But to test the model in rpsec i am not sure how to create params. is there a way to create params in model spec
[12:13:07] milardovich: has joined #ruby
[12:13:47] sepp2k: has joined #ruby
[12:13:53] vali: has joined #ruby
[12:16:19] simmaniac: has joined #ruby
[12:16:59] Silthias1: has joined #ruby
[12:21:43] dminuoso: ?rails Vel_
[12:21:43] ruby[bot]: Vel_: Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
[12:24:35] alex``: has joined #ruby
[12:26:04] nobitanobi: has joined #ruby
[12:28:13] ldnunes: has joined #ruby
[12:29:33] Jameser: has joined #ruby
[12:31:50] dropsh0t: has joined #ruby
[12:33:49] DoubleMalt: has joined #ruby
[12:34:17] minimalism: has joined #ruby
[12:35:17] Jameser: has joined #ruby
[12:36:03] rohitpaulk: has joined #ruby
[12:37:31] nacsurte: has joined #ruby
[12:45:22] mim1k: has joined #ruby
[12:47:04] bmurt: has joined #ruby
[12:49:37] jokke: has joined #ruby
[12:53:48] shinnya: has joined #ruby
[12:58:32] haylon: has joined #ruby
[12:58:41] workmad3: has joined #ruby
[12:59:48] lxsameer: has joined #ruby
[13:02:35] ascarter: has joined #ruby
[13:06:58] TheBrayn: has joined #ruby
[13:11:06] dionysus69: has joined #ruby
[13:11:09] psychicist__: has joined #ruby
[13:11:14] TheBrayn: has joined #ruby
[13:11:39] milardovich: has joined #ruby
[13:12:03] r3vDev: has joined #ruby
[13:12:47] TheBrayn: has joined #ruby
[13:18:43] uZiel: has joined #ruby
[13:22:00] rohitpaulk: has joined #ruby
[13:23:23] eljimmy: has joined #ruby
[13:24:34] fergal: has joined #ruby
[13:25:17] dminuoso: >> instance_eval &->(){}
[13:25:18] ruby[bot]: dminuoso: # => wrong number of arguments (given 1, expected 0) (ArgumentError) ...check link for more (https://eval.in/822461)
[13:25:21] dminuoso: Can someone explain this to me?
[13:25:26] dminuoso: What the heck? Is this a bug?
[13:25:41] dminuoso: It clearly must be a bug.
[13:26:15] DoubleMalt: has joined #ruby
[13:26:59] tgragnato: has joined #ruby
[13:27:28] gnufied: has joined #ruby
[13:28:48] chimkan: has joined #ruby
[13:28:52] chimkan: has left #ruby: ()
[13:29:24] futilegames: has joined #ruby
[13:29:29] DLSteve: has joined #ruby
[13:29:35] patarr: has joined #ruby
[13:30:23] chimkan: has joined #ruby
[13:31:39] Silthias1: has left #ruby: ()
[13:33:39] uZiel: has joined #ruby
[13:37:41] oleo: has joined #ruby
[13:38:51] nacsurte: has joined #ruby
[13:42:34] judofyr: has joined #ruby
[13:42:35] chouhoulis: has joined #ruby
[13:44:35] gizmore: has joined #ruby
[13:45:34] jenrzzz: has joined #ruby
[13:45:34] jenrzzz: has joined #ruby
[13:46:19] sanguisdex: has joined #ruby
[13:47:22] sanguisdex: hi there low hanging question for yall. How can I install a gem from a repo/branch with the cli `gem install` command?
[13:47:43] ljarvis: sanguisdex: you can't
[13:48:02] sanguisdex: ljarvis: thanks that was easy.
[13:48:04] ljarvis: you should download the repo, `gem build foo.gemspec` and then gem install the resulting .gem file
[13:48:32] apparition: has joined #ruby
[13:51:06] Silthias: has joined #ruby
[13:51:21] zapata: has joined #ruby
[13:56:36] chouhoulis: has joined #ruby
[13:59:41] chalkmonster: has joined #ruby
[13:59:47] my123: has joined #ruby
[13:59:47] my123: has joined #ruby
[14:04:06] burgestrand: dminuoso I assume the issue was that `instance_eval` passes the object as the first parameter to the given block (if given a block), and that `->() { }` lambdas are strict in their arguments?
[14:05:30] burgestrand: i.e. it should be:
[14:05:42] burgestrand: >> instance_eval &->(x){ x }
[14:05:43] ruby[bot]: Burgestrand: # => main (https://eval.in/822484)
[14:06:10] ascarter: has joined #ruby
[14:08:28] rfoust: has joined #ruby
[14:09:01] jphase: has joined #ruby
[14:11:27] Rodya_: has joined #ruby
[14:12:33] fergal: has left #ruby: ()
[14:13:14] nimzooooo: has joined #ruby
[14:15:10] dh64: has joined #ruby
[14:17:45] hutch34: has joined #ruby
[14:17:53] vondruch: has joined #ruby
[14:19:18] travisgrib: has joined #ruby
[14:19:49] Silthias: has joined #ruby
[14:20:38] travisgrib: /msg NickServ VERIFY REGISTER travisgrib nysrwruhdvsr
[14:20:41] nobitanobi: has joined #ruby
[14:21:23] Mon_Ouie: Well at least I imagine that's just the verification code and not a password
[14:22:38] rfoust: has joined #ruby
[14:24:09] rivalomega: has joined #ruby
[14:27:34] dionysus69: has joined #ruby
[14:27:52] mim1k: has joined #ruby
[14:28:47] rfoust: has joined #ruby
[14:29:53] mathys: has joined #ruby
[14:30:26] travisgrib: has joined #ruby
[14:30:59] djbjd: has joined #ruby
[14:31:14] chouhoul_: has joined #ruby
[14:32:26] travisgrib: guys, in my project’s gemspec, i specify development and runtime dependencies. is there an equivalent fo specifying these types of dependencies in a Gemfile?
[14:32:50] dionysus69: has joined #ruby
[14:35:53] canton7: travisgrib, http://bundler.io/groups.html
[14:36:54] agimenez: has joined #ruby
[14:37:07] GodFather: has joined #ruby
[14:37:41] jaruga________: has joined #ruby
[14:37:47] travisgrib: canton7: so would the omission of a group correlate to a runtime dependency?
[14:38:47] canton7: not sure what you're asking
[14:39:25] canton7: oh, defining a dependency outside of any groups, rather than using 'bundle install --without'. Yes. Dependencies not in a group are always required
[14:39:29] nacsurte: has joined #ruby
[14:42:09] runescape07rsps: has joined #ruby
[14:42:28] lolzorplox: has joined #ruby
[14:43:51] isBEKaml: has joined #ruby
[14:44:32] rfoust: has joined #ruby
[14:44:58] dionysus69: has joined #ruby
[14:45:41] catphish: has joined #ruby
[14:46:10] rohitpaulk: has joined #ruby
[14:48:11] ResidentBiscuit: has joined #ruby
[14:48:38] ResidentBiscuit: has joined #ruby
[14:50:44] cam27: has joined #ruby
[14:51:12] travisgrib: canton7: cool, thanks!
[14:53:01] burgestrand: has joined #ruby
[14:54:04] theunraveler: has joined #ruby
[14:59:05] rivalomega: has joined #ruby
[15:00:26] catphish: is there going to be an efficient way to unpack a 6 byte string into a 64 bit number? ie: "\0\0\0\0\0\1".unpack('Q>')
[15:00:56] catphish: i'm going to be doing this a lot, except the code above won't work, because it's expecting 8 bytes
[15:02:22] rfoust: has joined #ruby
[15:02:51] matthewd: catphish: Seems pretty easy to benchmark
[15:03:04] enterprisey: has joined #ruby
[15:03:49] catphish: that's true, 2 options occur to me: #bytes and math, or #rjust and unpack
[15:04:00] cschneid_: has joined #ruby
[15:04:02] catphish: my money's on the first
[15:04:18] d10n-work: has joined #ruby
[15:04:31] matthewd: or unpack as 16 & 32, then math
[15:04:37] cschneid_: has joined #ruby
[15:04:39] cadillac_: has joined #ruby
[15:09:13] [Butch]: has joined #ruby
[15:10:26] xlov: has joined #ruby
[15:10:40] ascarter: has joined #ruby
[15:10:52] Tau: has joined #ruby
[15:13:07] catphish: performance aside, i like this: https://paste.ubuntu.com/24956607/
[15:13:58] im314ous: has joined #ruby
[15:14:37] canton7: catphish, why are you using an array there, out of curiosity?
[15:14:54] catphish: canton7: because you can't modify an integer
[15:15:12] canton7: why not use inject?
[15:15:29] catphish: actually that's a much better idea
[15:15:53] canton7: str.bytes.inject(0){ |s,x| (s << 8) | x }
[15:16:28] catphish: much better https://paste.ubuntu.com/24956623/
[15:17:14] im314ous: just out of curiosity but what are you programming, catphish? :)
[15:18:17] catphish: well it's a very small part of a large project, but i have a file, the file contains pointers to other parts of the file, due to the size of the file, these pointers want to be 6 bytes long
[15:18:31] matthewd: Omitting the (0) would save a couple of cycles, though I don't know it'd even be measurable
[15:18:36] im314ous: hm, sounds interesting!
[15:19:26] catphish: so: position = file.read(6); file.seek(unpack(position))
[15:20:01] catphish: done: https://paste.ubuntu.com/24956645/
[15:20:05] catphish: works great
[15:20:57] catphish: this is why: http://i.imgur.com/6Zplf90.jpg
[15:21:02] catphish: but, never mind that :)
[15:22:14] nacsurte: has joined #ruby
[15:22:59] matthewd: catphish: Are you inventing your own file format? :/
[15:23:05] elsevero: has joined #ruby
[15:23:11] mim1k: has joined #ruby
[15:23:48] catphish: couldn't find anything off the shelf for version block storage :)
[15:23:51] GodFather: has joined #ruby
[15:24:16] im314ous: that's pretty cool. fucking difficult, but cool
[15:25:32] matthewd: It sounds suspiciously similar to a filesystem, at a glance
[15:26:10] catphish: it is distressingly like a filesystem, sadly it's not a filesyste, else i'd love to just use a filesystem :)
[15:26:27] rfoust: has joined #ruby
[15:26:44] catphish: it's versioned
[15:26:59] catphish: and only has one file
[15:27:23] catphish: the idea is to track changes to that "file"
[15:28:15] catphish: and the inverse: [int].pack('Q>')[2,6]
[15:28:21] catphish: not sure there's a better way to do that
[15:29:26] catphish: in any case, both work so will stick with it unless they become a bottleneck
[15:29:30] dionysus69: has joined #ruby
[15:32:01] rfoust: has joined #ruby
[15:34:13] synthroid: has joined #ruby
[15:35:19] cpruitt: has joined #ruby
[15:36:05] ltem: has joined #ruby
[15:39:47] plujon: has joined #ruby
[15:45:44] synthroid: has joined #ruby
[15:47:10] rohitpaulk: has joined #ruby
[15:47:30] jenrzzz: has joined #ruby
[15:47:30] jenrzzz: has joined #ruby
[15:47:53] plujon: I'm curious why a particular ruby process is using 140MB of memory. Is it possible for me to inspect the object state of this already-running process?
[15:48:59] lupine: sure, although it's easier if you throw in a debug console from the start
[15:49:11] matthewd: plujon: Yes, though there are limits to what you can learn
[15:50:02] plujon: The machine is linux, so I can find some things in /proc . But the more I can learn, the better.
[15:50:08] matthewd: plujon: You can attach to it with gdb, and [carefully] execute ruby from there
[15:51:10] catphish: it tends to be much saner to add some memory debugging code and wait for it to happen again
[15:51:53] matthewd: You'll then be able to look at ObjectSpace, for example -- which will tell you what objects are allocated, but not *where* they got allocated; you need allocation tracing turned on at allocation time to get that
[15:52:08] matthewd: It's pretty straightforward to get a heap dump, at least
[15:52:37] yogg-saron: has joined #ruby
[15:52:49] plujon: I guess I should collect what information I can now to see if there are any clues as to where most of the memory is used, then add some debugging hooks for the future.
[15:52:58] dviola: has joined #ruby
[15:53:10] plujon: How do you execute ruby from within gdb?
[15:53:28] plujon: (and/or get a heap dump)
[15:53:51] antgel: has joined #ruby
[15:54:02] matthewd: I'm sure Google can do a better job of answering either of those than I could off the top of my head
[15:55:47] plujon: ACTION nods
[15:56:15] gil_: has joined #ruby
[15:56:15] gil_: has joined #ruby
[15:57:06] brent__: has joined #ruby
[15:57:46] amclain: has joined #ruby
[15:57:49] elcontrastador: has joined #ruby
[15:58:23] SuperLag: has joined #ruby
[15:59:08] vondruch: has joined #ruby
[15:59:36] hutch34: has joined #ruby
[16:01:21] Rodya_: has joined #ruby
[16:02:33] ivanskie: has joined #ruby
[16:02:43] judofyr: has joined #ruby
[16:04:00] jzigmund: has joined #ruby
[16:06:04] marxarelli: has joined #ruby
[16:06:28] im314ous: has joined #ruby
[16:07:41] troys: has joined #ruby
[16:07:51] Eiam: has joined #ruby
[16:08:23] montanonic: has joined #ruby
[16:10:12] Guest41957: has left #ruby: ("Textual IRC Client: www.textualapp.com")
[16:10:22] ruby-lang801: has joined #ruby
[16:15:46] blaisebool: has joined #ruby
[16:19:12] chouhoulis: has joined #ruby
[16:22:14] N0ATN: has joined #ruby
[16:22:16] dionysus69: has joined #ruby
[16:22:50] TinkerTyper_: has joined #ruby
[16:23:01] nacsurte: has joined #ruby
[16:26:32] cdg: has joined #ruby
[16:27:11] cdg_: has joined #ruby
[16:30:27] cadillac__: has joined #ruby
[16:31:14] gusrub: has joined #ruby
[16:31:43] agimenez: has joined #ruby
[16:31:51] conta1: has joined #ruby
[16:33:48] TomyLobo: has joined #ruby
[16:36:53] rohitpaulk: has joined #ruby
[16:38:52] judofyr: has joined #ruby
[16:46:01] im314ous: has joined #ruby
[16:48:43] gusrub: has joined #ruby
[16:49:00] dionysus69: has joined #ruby
[16:50:45] dionysus69: has joined #ruby
[16:53:57] xlov: has left #ruby: ()
[16:55:29] chouhoulis: has joined #ruby
[16:56:40] S1kx: has joined #ruby
[16:57:11] hutch34: has joined #ruby
[16:57:37] S1kx: has joined #ruby
[16:58:23] dionysus69: has joined #ruby
[16:58:49] S1kx: has joined #ruby
[17:01:49] patarr1: has joined #ruby
[17:02:31] chalkmonster: has joined #ruby
[17:02:31] dionysus69: has joined #ruby
[17:05:06] mwlang: has joined #ruby
[17:06:45] jphase: has joined #ruby
[17:06:45] vondruch: has joined #ruby
[17:06:47] muelleme_: has joined #ruby
[17:09:09] vondruch: has joined #ruby
[17:09:10] judofyr: has joined #ruby
[17:11:40] rkazak__: has joined #ruby
[17:12:03] jphase: has joined #ruby
[17:12:13] jzigmund: has joined #ruby
[17:14:10] nofxx: has joined #ruby
[17:18:07] Tempesta: has joined #ruby
[17:19:42] dionysus69: has joined #ruby
[17:21:49] dionysus69: has joined #ruby
[17:25:28] patarr: has joined #ruby
[17:27:04] Cohedrin_: has joined #ruby
[17:31:50] dviola: has joined #ruby
[17:32:35] dviola: has joined #ruby
[17:33:30] tAn: has joined #ruby
[17:33:53] davidmichaelkarr: has joined #ruby
[17:35:55] tgragnato: has joined #ruby
[17:36:43] dionysus69: has joined #ruby
[17:38:12] gusrub: has joined #ruby
[17:39:19] wiki-ruby-1: has joined #ruby
[17:39:37] BSaboia: has joined #ruby
[17:39:46] tAn: has joined #ruby
[17:41:08] gusrub_: has joined #ruby
[17:41:58] dionysus69: has joined #ruby
[17:42:20] postmodern: has joined #ruby
[17:46:08] enterprisey: has joined #ruby
[17:48:01] vondruch: has joined #ruby
[17:49:23] jenrzzz: has joined #ruby
[17:49:24] jenrzzz: has joined #ruby
[17:49:35] patarr: has joined #ruby
[17:51:39] judofyr: has joined #ruby
[17:52:46] montanonic: has joined #ruby
[17:53:17] dionysus69: has joined #ruby
[17:53:18] eljimmy: has joined #ruby
[17:54:30] travisgrib: has joined #ruby
[17:56:07] weathermaker: has joined #ruby
[17:56:15] elsevero_: has joined #ruby
[17:57:27] dionysus69: has joined #ruby
[17:57:30] xall: has joined #ruby
[17:58:06] gusrub: has joined #ruby
[17:58:43] judofyr: has joined #ruby
[17:58:46] Tau: in case of you guys trying to check https://github.com/iogf/rubtex
[17:58:59] Tau: thats how i have done the compile ruby expression into latex thing.
[17:59:09] vondruch: has joined #ruby
[17:59:46] judofyr: has joined #ruby
[18:01:54] gusrub: has joined #ruby
[18:02:37] judofyr_: has joined #ruby
[18:03:43] chouhoul_: has joined #ruby
[18:03:47] travisgrib: has joined #ruby
[18:04:39] vondruch: has joined #ruby
[18:05:17] jenrzzz: has joined #ruby
[18:05:17] jenrzzz: has joined #ruby
[18:06:59] wiki-ruby-1: has joined #ruby
[18:07:15] wiki-ruby-1: I can never get into RubyonRails
[18:07:46] wiki-ruby-1: Anyways any1 heere have any Best practice methods in terms of Automated Testing
[18:08:27] wiki-ruby-1: I really need like a default stack ... GOTO stack, that basically works for almost anything... Any Tips ...would be great ty
[18:09:11] vondruch: has joined #ruby
[18:09:17] ALoneNoMad: has joined #ruby
[18:09:20] havenwood: wiki-ruby-1: You'll need to register and identify your nick for #rubyonrails.
[18:09:43] roshanavand: has joined #ruby
[18:12:23] scorphus: has joined #ruby
[18:13:49] bmurt: has joined #ruby
[18:14:08] wiki-ruby-1: I m in now ty ravewood.
[18:16:27] rkazak: has joined #ruby
[18:17:17] beilabs__: has joined #ruby
[18:17:49] ivanskie: ravewood lol
[18:18:34] ascarter: has joined #ruby
[18:19:08] patarr: has joined #ruby
[18:19:41] havenwood: ACTION caws
[18:21:33] havenwood: oh, no "n" - I should be raving not cawing
[18:21:37] havenwood: I misread as well. Coffeetime!
[18:22:49] montanonic: has joined #ruby
[18:23:43] guest223: has joined #ruby
[18:24:10] guest223: Python or Ruby?
[18:25:39] sonOfRa: has joined #ruby
[18:27:32] jenrzzz: has joined #ruby
[18:31:49] muelleme_: has joined #ruby
[18:34:28] patarr: has joined #ruby
[18:36:25] rohitpaulk: has joined #ruby
[18:36:42] ALoneNoMad: what goes best for ios native and a backend would ruby be good?
[18:36:43] judofyr: has joined #ruby
[18:37:21] havenwood: ALoneNoMad: You can make very nice APIs with Roda or Sinatra. There're lots of options.
[18:37:35] ALoneNoMad: what would work best with the apple platform
[18:37:49] havenwood: I do really like Roda. It's just a routing tree on top of Rack and then you compose a framework by selecting which plugins to enabled.
[18:37:51] ALoneNoMad: with the most features and a good look that would blend in
[18:38:22] ALoneNoMad: have you personally worked with that as a backend?
[18:38:48] havenwood: ALoneNoMad: There are many ways to make mobile apps. Some Ruby-related mentions might be RubyMotion, Ruboto and MobiRby.
[18:39:14] havenwood: ALoneNoMad: Yes, I've created various Rack APIs for iOS mobile apps.
[18:39:19] ALoneNoMad: well im making my app in swift however for a goo backend is what iam talking about
[18:39:41] havenwood: ALoneNoMad: Give Roda a look: http://roda.jeremyevans.net/
[18:39:58] havenwood: ALoneNoMad: And for auth: http://rodauth.jeremyevans.net/
[18:40:02] ALoneNoMad: if you tried others outside of ruby?
[18:43:08] montanonic: has joined #ruby
[18:43:17] nobitanobi: has joined #ruby
[18:43:19] haylon: has joined #ruby
[18:43:31] havenwood: ALoneNoMad: Yeah. There are lots of options.
[18:43:51] jackjackdripper: has joined #ruby
[18:44:17] havenwood: ALoneNoMad: I really do like Elixir's Phoenix framework.
[18:45:08] havenwood: ALoneNoMad: http://www.phoenixframework.org/
[18:46:19] cschneid: has joined #ruby
[18:48:14] patarr: has joined #ruby
[18:48:47] dionysus69: has joined #ruby
[18:52:30] simmaniac: has joined #ruby
[18:53:30] dionysus69: has joined #ruby
[18:53:50] darix: ALoneNoMad: the question also is ... with all the js based stuff you can do already do you need a native app or just a well written web app with mobile in mind
[18:55:13] graft: has joined #ruby
[18:55:13] graft: has joined #ruby
[18:56:39] mikecmpbll: has joined #ruby
[18:57:46] muelleme_: has joined #ruby
[18:59:51] guest223: Ybur si dab.
[19:00:28] shinnya: has joined #ruby
[19:00:31] hahuang65: has joined #ruby
[19:00:36] qguv: has left #ruby: ("WeeChat 1.8")
[19:04:51] gusrub: has joined #ruby
[19:05:23] chouhoulis: has joined #ruby
[19:09:28] guest223: Why should i learn ruby?
[19:12:23] antgel: has joined #ruby
[19:12:23] guest223: I have no interest in web. Is ruby good as a general purpose language?
[19:13:28] Fernando-Basso: has joined #ruby
[19:15:14] jackjackdripper: has joined #ruby
[19:19:56] ascarter: has joined #ruby
[19:22:33] agimenez: has joined #ruby
[19:24:21] sysvalve: has joined #ruby
[19:27:56] dasher00: has joined #ruby
[19:30:38] t-recx: has joined #ruby
[19:32:58] kmhn: has joined #ruby
[19:38:33] P-NuT: has joined #ruby
[19:39:38] jolamb: Any faraday wizards here?
[19:40:01] jolamb: I'm trying to figure out how to e.g. skip a specific middleware in the stack for just one request
[19:40:17] burgestrand: has joined #ruby
[19:40:21] Rodya_: has joined #ruby
[19:40:45] hahuang65: has joined #ruby
[19:47:02] Rodya_: has joined #ruby
[19:49:11] rivalomega: has joined #ruby
[19:49:29] eljimmy: has joined #ruby
[19:50:07] simmaniac: has joined #ruby
[20:01:56] plujon: To answer my own question: rbtrace -p PID -e '...' is the easiest way to get a heap dump of a running ruby process.
[20:02:33] P-NuT: has left #ruby: ("Leaving")
[20:02:42] kruppm: has joined #ruby
[20:04:28] itachi: has joined #ruby
[20:05:54] raspado: has joined #ruby
[20:06:55] itachi: has left #ruby: ()
[20:19:06] nacsurte: has joined #ruby
[20:20:21] Dimik: has joined #ruby
[20:20:58] ascarter: has joined #ruby
[20:21:20] hahuang65: has joined #ruby
[20:21:59] Silthias1: has joined #ruby
[20:22:24] Cohedrin_: has joined #ruby
[20:24:57] montanonic: has joined #ruby
[20:33:47] jenrzzz: has joined #ruby
[20:33:47] jenrzzz: has joined #ruby
[20:34:02] wiki-ruby-1: has joined #ruby
[20:35:49] enterprisey: has joined #ruby
[20:36:07] hahuang65: has joined #ruby
[20:38:56] ALoneNoMad: has left #ruby: ()
[20:39:44] cadillac_: has joined #ruby
[20:43:50] nobitanobi: has joined #ruby
[20:48:12] graft: has joined #ruby
[20:48:12] graft: has joined #ruby
[20:49:04] cadillac__: has joined #ruby
[20:49:46] Cohedrin_: has joined #ruby
[20:53:09] cadillac_: has joined #ruby
[20:56:51] cjohnson: Does implied return work inside if?
[20:58:49] adam12: cjohnson: Kinda? The last value of the if statement is the value.
[20:59:06] cjohnson: Yeah that's what I mean
[20:59:11] cjohnson: so if I have def foo; if bar; something; end; end
[20:59:14] cjohnson: something is returned from foo
[20:59:31] cjohnson: well, not perfect, that means the problem is not what I hoped :(
[20:59:50] adam12: Paste the method. Maybe it's something obvious.
[21:00:29] jgpawletko: has joined #ruby
[21:01:00] jphase: has joined #ruby
[21:01:33] mikkel-: has joined #ruby
[21:02:48] brent__: has joined #ruby
[21:03:49] brent__: has joined #ruby
[21:05:09] Cohedrin_: has joined #ruby
[21:05:14] ineb: has joined #ruby
[21:08:02] cjohnson: adam12: https://gist.github.com/chrisjohnson/229999dd94a8336cbb1e547f87b63c4e#file-validatable_spec-rb-L42-L48
[21:08:32] cjohnson: Added a comment with the error I'm getting
[21:08:51] cjohnson: It only happens for that context
[21:09:04] cjohnson: I added a binding.pry inside the validate method and it seems to run through how I'm expecting
[21:09:34] Cohedrin_: has joined #ruby
[21:09:57] cjohnson: I guess this is more of a rails question
[21:10:57] cjohnson: I thought it had to do with how I wrote my validate method
[21:12:43] Bock: has joined #ruby
[21:14:57] perniciouscaffei: has joined #ruby
[21:15:53] Bock: has joined #ruby
[21:16:07] meshsmith: has joined #ruby
[21:16:07] meshsmith: has joined #ruby
[21:20:49] im314ous: has joined #ruby
[21:22:45] urux: has joined #ruby
[21:23:25] GodFather: has joined #ruby
[21:24:49] jackjackdripper: has joined #ruby
[21:26:58] cjohnson: Nevermind I'm an idiot
[21:27:03] cjohnson: in that context I needed to switch the subject
[21:27:05] tAn: has joined #ruby
[21:27:20] baweaver: what madness did you subject yourself to?
[21:27:23] cjohnson: So iow I just needed to split that case into its own describe
[21:27:33] cjohnson: all fixed and tests passing
[21:28:09] cjohnson: above gist baweaver
[21:28:38] baweaver: just wanted the pun
[21:29:43] ineb: umm what would be the ruby equivalent of the following php line: echo pack( "H*", 'deadbeef'); deadbeef is hex as in 0xdeadbeef
[21:30:05] baweaver: &ri String#pack
[21:30:06] `derpy: No results
[21:30:12] baweaver: &ri Array#pack
[21:30:12] `derpy: http://ruby-doc.org/core-2.4.1/Array.html#method-i-pack
[21:30:27] ur5us: has joined #ruby
[21:30:35] ineb: i do know Array#pack but i have a string 'deadbeef' here
[21:30:50] baweaver: http://blog.bigbinary.com/2011/07/20/ruby-pack-unpack.html
[21:31:41] baweaver: >> 'deadbeef'.to_i(16).to_s
[21:31:42] cjohnson: BAWEAVER DAMN YOU
[21:31:43] ruby[bot]: baweaver: # => "3735928559" (https://eval.in/822743)
[21:31:49] baweaver: cjohnson XD
[21:31:51] cjohnson: you're too good for me
[21:31:55] baweaver: >> 'deadbeef'.to_i(16).to_s(16)
[21:31:56] ruby[bot]: baweaver: # => "deadbeef" (https://eval.in/822744)
[21:32:10] ineb: echo pack( "H*", 'deadbeef'); in php does return ¾ï
[21:32:13] baweaver: Array it is. Odd.
[21:32:23] ineb: iam not even sure what representation that is, but i need it aswell
[21:32:30] mim1k: has joined #ruby
[21:33:45] troulouliou_div2: has joined #ruby
[21:33:58] baweaver: >>["deadbeef"].pack('H*')
[21:33:59] ruby[bot]: baweaver: # => "\xDE\xAD\xBE\xEF" (https://eval.in/822745)
[21:34:43] LightStalker: has joined #ruby
[21:36:37] Bock: has joined #ruby
[21:37:20] jenrzzz: has joined #ruby
[21:37:20] jenrzzz: has joined #ruby
[21:38:59] ineb: baweaver: yes, this is it. thanks
[21:43:23] ozcanesen: has joined #ruby
[21:43:48] sepp2k: has joined #ruby
[21:43:53] Bock: has joined #ruby
[21:55:30] lxsameer: has joined #ruby
[22:06:15] blackwind_123: has joined #ruby
[22:10:28] my123: has joined #ruby
[22:10:29] my123: has joined #ruby
[22:12:53] ahrs: has joined #ruby
[22:23:44] ascarter: has joined #ruby
[22:25:14] rivalomega: has joined #ruby
[22:25:18] hkdsun: has joined #ruby
[22:25:23] rivalomega: has joined #ruby
[22:29:36] Tau: has joined #ruby
[22:31:19] centrx: has joined #ruby
[22:31:19] centrx: has joined #ruby
[22:31:28] mim1k: has joined #ruby
[22:36:03] gusrub_: has joined #ruby
[22:40:13] graft: hey, is there an equivalent for String#strip where i can pass in a char?
[22:40:27] graft: e.g. my_string.strip('_') to remove leading and trailing _ ?
[22:40:46] graft: or am i stuck doing sub(/^_/,'').sub(/_$/,'')
[22:41:08] elomatreb: String#tr is faster for simple character substitutions, but yeah
[22:41:38] graft: tr would sub intermediate _s, wouldn't it?
[22:41:40] havenwood: graft: use \A instead of ^ unless you really mean beginning of each line
[22:41:46] elomatreb: Oh, right, nvm
[22:42:09] graft: havenwood: doesn't matter in this case, but sure
[22:42:22] baweaver: &ri String#sub
[22:42:22] `derpy: http://ruby-doc.org/core-2.4.1/String.html#method-i-sub
[22:42:42] havenwood: graft: If you don't want to remove from each line don't check each line.
[22:43:05] graft: havenwood: i don't have lines here, it's not an issue
[22:43:26] havenwood: graft: My point is the regexp doesn't know what you know. It has to look and see if there are.
[22:43:35] havenwood: Fraeon: Use \A explicitly.
[22:43:44] havenwood: Fraeon: Sorry, MT.
[22:43:46] baweaver: capture groups, match block
[22:44:01] Rodya_: has joined #ruby
[22:44:07] elomatreb: Also, if it's user input sneaky newlines can mess things up
[22:44:17] elomatreb: You can use that for XSS in some Ruby applications
[22:45:09] havenwood: Anchored, of course would be better.
[22:48:05] jnollette: has joined #ruby
[22:48:17] enterprisey: has joined #ruby
[22:50:30] baweaver: &ri String#lstrip
[22:50:30] `derpy: http://ruby-doc.org/core-2.4.1/String.html#method-i-lstrip
[22:50:34] baweaver: &ri String#rstrip
[22:50:34] `derpy: http://ruby-doc.org/core-2.4.1/String.html#method-i-rstrip
[22:51:44] matthewd: baweaver: How do those help? :/
[22:52:21] havenwood: Ruby 2.5 will have String#delete_suffix and String#delete_prefix.
[22:52:35] havenwood: I guess suffix isn't approved yet.
[22:52:48] havenwood: https://github.com/ruby/ruby/pull/1661
[22:52:58] elomatreb: Why add new methods instead of giving strip an optional argument?
[22:53:02] graft: seems like it would be better to just add an ar... yeah
[22:53:23] havenwood: https://bugs.ruby-lang.org/issues/12694
[22:53:59] havenwood: elomatreb: TL;DR: "Python lstrip http://www.tutorialspoint.com/python/string_lstrip.htm takes character classes as an argument, so providing a substring as an argument will introduce confusion."
[22:54:33] havenwood: elomatreb: So Matz chose a different name.
[22:54:53] elomatreb: I guess that makes some sense (not a Python programmer)
[22:55:24] elomatreb: delete_suffix/prefix just seems like a very clunky name
[22:55:42] havenwood: There's still time for a better name.
[22:55:43] graft: decreasing confusion with python seems like a lower priority to me than having a simpler interface
[22:56:04] graft: especially given the diverse behavior of other languages
[22:57:01] besfort: has joined #ruby
[22:57:02] graft: "python did it wrong first" is not a reasonable method for defining ruby language
[22:58:45] Jayson_Virissimo: has joined #ruby
[23:02:14] jhack: has joined #ruby
[23:02:15] jhack: has joined #ruby
[23:02:28] havenwood: Currently the nightly only deletes one character as well.
[23:02:34] impi0us: has joined #ruby
[23:02:38] havenwood: '__dunder__'.delete_prefix('_') #=> "_dunder__"
[23:07:36] havenwood: Unlike Elixir's String#trip_leading/2: "__dunder__" |> String.trim_leading("_") #=> "dunder_
[23:07:54] havenwood: graft: It's really a different thing than #lstrip though.
[23:08:20] havenwood: graft: #trim_leading is like lstrip with argument
[23:09:49] zenspider: havenwood: I would hope that delete_prefix deletes any leading matching string, not a repeated char
[23:10:05] zenspider: "abcdef".delete_prefix "abc" => "def"
[23:10:45] zenspider: I find String#delete to be absolutely useless.
[23:10:58] zenspider: (and usually want it for a prefix/suffix)
[23:14:50] alex``: has joined #ruby
[23:14:55] mydog2: hey.. is this where the ruby guys hang out!
[23:15:26] elomatreb: Not just guys
[23:15:46] mydog2: there's a kickstarter "clone" in github.. from lockitron
[23:16:13] mydog2: hey elomatreb -- ok.. guys/gals/and anyone else i missed!
[23:17:18] mydog2: looking for someone that might want a project for $$
[23:17:42] mydog2: i'm not a ruby/rails guy
[23:17:53] mydog2: figured there might be someone here..
[23:23:36] impi0us: has left #ruby: ()
[23:28:22] cdg: has joined #ruby
[23:30:06] besforto: has joined #ruby
[23:30:33] br0d1n: has joined #ruby
[23:31:00] Radar: mydog2: what kind of project?
[23:32:55] jphase: has joined #ruby
[23:40:11] gusrub: has joined #ruby
[23:41:53] diego1: has joined #ruby
[23:42:05] diego1: has joined #ruby
[23:43:19] cam27: has joined #ruby
[23:46:55] gusrub: has joined #ruby
[23:49:39] ozcanesen: has joined #ruby
[23:51:02] havenwood: zenspider: good point
[23:55:53] KillerFox: has joined #ruby
[23:56:20] cseder: has joined #ruby
[23:58:58] DLSteve: has joined #ruby