havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com || Ruby 2.4.1, 2.3.4 & 2.2.7: https://www.ruby-lang.org || Paste >3 lines of text to: https://gist.github.com || Rails questions? Ask in: #RubyOnRails || Logs: https://irclog.whitequark.org/ruby || Books: https://goo.gl/wpGhoQ
AndBobsYourUncle has quit [Client Quit]
frustrum has joined #ruby
bocobit has quit []
frustrum has quit [Client Quit]
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has quit [Ping timeout: 240 seconds]
Rodya_ has quit [Remote host closed the connection]
eljimmy has joined #ruby
t-recx has quit [Ping timeout: 240 seconds]
beilabs__ has quit [Ping timeout: 268 seconds]
eljimmy has quit [Client Quit]
eljimmy has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mistergibson has quit [Quit: Leaving]
umaaji has joined #ruby
nacsurte has joined #ruby
hutch34 has joined #ruby
charliesome has joined #ruby
Burgestrand has joined #ruby
hutch34 has quit [Ping timeout: 276 seconds]
nacsurte has quit [Ping timeout: 276 seconds]
minimalism has quit [Quit: minimalism]
millerti has joined #ruby
Burgestrand has quit [Ping timeout: 260 seconds]
cschneid_ has joined #ruby
chouhoulis has joined #ruby
<eightlimbs> any idea why method B runs faster than method A for big numbers? (https://gist.github.com/eightlimbed/addcd01398088d76df9ad6fda62f8cac)
<eightlimbs> method A runs faster than method B **
Kug3lis has joined #ruby
rfoust has joined #ruby
<adam12> eightlimbs: naive answer but the conditional in method A might short-circuit where method B continues through the full range.
<adam12> eightlimbs: I didn't look too closely so I could be wrong.
boombox_ has joined #ruby
Rodya_ has joined #ruby
hndk has joined #ruby
<eightlimbs> just looking at it again, i see that A decrements by division, why B decrements by subtraction
Kug3lis is now known as Kug3lis_off
lxsameer has quit [Quit: WeeChat 1.8]
<adam12> lol yep
insanedreamer has joined #ruby
FastJack_ has joined #ruby
FastJack has quit [Read error: Connection reset by peer]
insanedreamer has quit [Quit: insanedreamer]
ketan has joined #ruby
insanedreamer has joined #ruby
Bock has joined #ruby
Bock has quit [Max SendQ exceeded]
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
ketan has quit [Ping timeout: 240 seconds]
Bock has joined #ruby
ascarter has joined #ruby
cschneid_ has quit [Remote host closed the connection]
apparition has joined #ruby
nahra has quit [Remote host closed the connection]
nahra has joined #ruby
ascarter has quit [Ping timeout: 255 seconds]
mikecmpbll has quit [Quit: inabit. zz.]
arescorpio has joined #ruby
_whitelogger has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
nacsurte has joined #ruby
AndBobsYourUncle has joined #ruby
Burgestrand has joined #ruby
nacsurte has quit [Ping timeout: 276 seconds]
dh64 has quit [Quit: Konversation terminated!]
Burgestrand has quit [Ping timeout: 268 seconds]
AndBobsYourUncle has quit [Quit: Textual IRC Client: www.textualapp.com]
elcontrastador has joined #ruby
hutch34 has joined #ruby
insanedreamer has quit [Quit: insanedreamer]
eightlimbs has quit [Ping timeout: 255 seconds]
Danny_ has joined #ruby
Mia has quit [Ping timeout: 240 seconds]
insanedreamer has joined #ruby
insanedreamer has left #ruby [#ruby]
hutch34 has quit [Ping timeout: 240 seconds]
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
shinnya has quit [Ping timeout: 240 seconds]
d^sh_ has joined #ruby
d^sh has quit [Ping timeout: 240 seconds]
eightlimbs has joined #ruby
QpQ4 has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
gizmore|2 has joined #ruby
jameser has joined #ruby
im0nde has quit [Ping timeout: 255 seconds]
QpQ4 has joined #ruby
gizmore has quit [Ping timeout: 260 seconds]
cschneid_ has joined #ruby
dasher00 has quit [Ping timeout: 240 seconds]
QpQ4 has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
dasher00 has joined #ruby
zautomata1 has quit [Quit: WeeChat 1.7]
rkazak has joined #ruby
ascarter has joined #ruby
ishahnaz has joined #ruby
ishahnaz has quit [Client Quit]
QpQ4 has joined #ruby
Rodya_ has quit [Remote host closed the connection]
elcontrastador has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ascarter has quit [Ping timeout: 260 seconds]
hutch34 has joined #ruby
govg has quit [Ping timeout: 240 seconds]
bkxd has joined #ruby
bkxd_ has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
jackjackdripper has joined #ruby
nacsurte has joined #ruby
hutch34 has quit [Ping timeout: 255 seconds]
bkxd_ has quit [Ping timeout: 240 seconds]
bkxd has quit [Ping timeout: 240 seconds]
bkxd has joined #ruby
bkxd_ has joined #ruby
FastJack_ is now known as FastJack
nacsurte has quit [Ping timeout: 240 seconds]
Rodya_ has joined #ruby
bkxd_ has quit [Ping timeout: 246 seconds]
bkxd has quit [Ping timeout: 246 seconds]
QpQ4 has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
insanedreamer has joined #ruby
insanedreamer has quit [Client Quit]
jameser has quit [Ping timeout: 240 seconds]
jameser has joined #ruby
rivalomega has joined #ruby
comet23 has quit [Ping timeout: 240 seconds]
ketan has joined #ruby
QpQ4 has joined #ruby
creshiem has joined #ruby
ketan has quit [Ping timeout: 240 seconds]
runescape07rsps has joined #ruby
rivalomega has quit []
rivalomega has joined #ruby
N0ATN has joined #ruby
Ka has quit [Ping timeout: 240 seconds]
N0ATN is now known as Ka
dasher00 has quit [Ping timeout: 255 seconds]
Trynemjoel has quit [Ping timeout: 264 seconds]
ascarter has joined #ruby
eightlimbs has quit [Quit: Leaving]
Trynemjoel has joined #ruby
ascarter has quit [Ping timeout: 255 seconds]
millerti has quit [Quit: Textual IRC Client: www.textualapp.com]
gix has quit [Ping timeout: 240 seconds]
nacsurte has joined #ruby
Trynemjoel has quit [Ping timeout: 276 seconds]
Guest69 has quit [Quit: Textual IRC Client: www.textualapp.com]
railswebdev has quit [Quit: Textual IRC Client: www.textualapp.com]
gix has joined #ruby
cschneid_ has quit [Remote host closed the connection]
nacsurte has quit [Ping timeout: 260 seconds]
enterprisey has joined #ruby
Trynemjoel has joined #ruby
Danny_ has quit [Remote host closed the connection]
cschneid_ has joined #ruby
cschneid_ has quit [Ping timeout: 260 seconds]
yeticry_ has quit [Ping timeout: 268 seconds]
harfangk has joined #ruby
aarwine has quit [Ping timeout: 276 seconds]
rkazak has quit [Quit: Sleep.....ing....]
creshiem has quit [Quit: WeeChat 1.8]
hutch34 has joined #ruby
astrobunny has joined #ruby
carterdea has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
carterdea has joined #ruby
hutch34 has quit [Ping timeout: 276 seconds]
beilabs__ has joined #ruby
eljimmy has quit [Quit: This computer has gone to sleep]
eljimmy has joined #ruby
enterprisey has quit [Remote host closed the connection]
ascarter has joined #ruby
nicesignal has quit [Ping timeout: 240 seconds]
<ledestin> In the Rails itself, how do I enable output via puts?
<ledestin> Rails framework code
nacsurte has joined #ruby
Trynemjoel has quit [Ping timeout: 276 seconds]
ascarter has quit [Ping timeout: 268 seconds]
mim1k has joined #ruby
jnollette has joined #ruby
Trynemjoel has joined #ruby
nicesignal has joined #ruby
nacsurte has quit [Ping timeout: 240 seconds]
mim1k has quit [Ping timeout: 240 seconds]
Coldblackice_ has joined #ruby
Danny__ has joined #ruby
chouhoulis has quit [Remote host closed the connection]
Coldblackice has quit [Ping timeout: 260 seconds]
Danny__ has quit [Ping timeout: 240 seconds]
Coldblackice_ has quit [Max SendQ exceeded]
<havenwood> ledestin: Rails.logger.info
Coldblackice_ has joined #ruby
<ledestin> havenwood no luck witht hat
<havenwood> ledestin: There's a #RubyOnRails channel for Rails-specific questions.
<ledestin> that's a dump
<havenwood> ledestin: No luck in that it's not logging to stdout?
<ledestin> but thanks anyway
<havenwood> ledestin: A dump?
<ledestin> not logging anywhere
<havenwood> ledestin: In dev or prod?
<ledestin> havenwood that's a crappy channel
<havenwood> ledestin: How so?
<havenwood> ledestin: Which environment, development, test, production?
<ledestin> havenwood Rails framework itself
rippa has joined #ruby
<ledestin> I'm debugging some Rails framework code
boombox_ has quit [Remote host closed the connection]
<havenwood> ledestin: How about a `binding.pry` instead of stdout?
nofxxxx has joined #ruby
<havenwood> Or `binding.irb` these days if you prefer.
<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.
<havenwood> It's nice that Ruby 2.4 got `binding.irb`.
r3vDev has joined #ruby
<havenwood> ledestin: If you're not seeing Kernel#puts and don't know why, you might look at what STDOUT is.
<havenwood> ledestin: Then sanity check that it works: STDOUT.puts
<havenwood> Or check `$stdout` and : $stdout.puts
<havenwood> ledestin: I don't get from what you've said why you're not seeing the output you expect.
nofxxx has quit [Ping timeout: 260 seconds]
<havenwood> I'm curious if you see STDERR output. How about: warn
<havenwood> Or STDERR.puts, $stderr.puts, however.
<ledestin> havenwood it's my fault. it was using source code from a gem
<havenwood> ledestin: aha
<ledestin> let me try it the proper way
govg has joined #ruby
comet23 has joined #ruby
<comet23> i started reading the rails 4 book, it's well written :)
<comet23> rails 4 in action
Ropeney has joined #ruby
<comet23> i have a quick question for real life development.... this is my function https://repl.it/JBqN/0
<comet23> should i delegate error checking to a different function or is it okay to keep it there as-is?
<havenwood> comet23: There are a few problems with that method. The first is it doesn't get my age right!
<comet23> no, this assumes the year is 2003
yogg-saron has joined #ruby
<havenwood> comet23: When in the year?
<comet23> it's on line 2 i think
<havenwood> comet23: Birthdays don't wait 'till the end of the year then all happen at once!
<comet23> yes, line 2
<havenwood> People born in the same year might be different ages.
<comet23> i don't celebrate birthdays
<havenwood> Nonetheless.
<comet23> but that's besides the point haha
<comet23> so how can two people being born... oh i get it
<havenwood> If it's beside the point then the method is missnamed. ;-P
<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)
<havenwood> comet23: Do you count someone as a day older the second the clock strikes midnight?
<havenwood> comet23: Have they covered tests at all yet?
<comet23> a lot of people surprisingly don't know the time they were born
<comet23> my code passes the tests
<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 :)
<comet23> it's $149 a month to be clear and they say it takes 6 months to complete on average
<havenwood> comet23: Normally you'd `raise` if something exceptional happened.
<comet23> oh, thank you
<havenwood> comet23: If you just want to warn about it use `warn` instead of `puts` so it goes to STDERR.
<havenwood> Kernel#warn also respects disabling warnings.
<havenwood> If you want to warn then exit with a nonzero status there's `abort 'flee at once!'`.
<havenwood> comet23: Are negative ages forbidden?
<comet23> no, i just added that extra thought
<havenwood> When I was -5 the programming scene was just heating up.
<comet23> negative age doesn't make sense, hopefully one day people will figure out how to solve that problem and make it a thing
ketan has joined #ruby
<havenwood> comet23: I think we just say it as "five years before I was born" instead of "when I was negative five".
<comet23> i don't like the docs.... what is this? https://ruby-doc.org/core-2.4.0/Warning.html
<comet23> what was i looking at?
carterdea has quit [Ping timeout: 240 seconds]
<havenwood> The Warning module rather than the Kernel module.
<comet23> ruby is so complicated
<havenwood> It should probably redirect you in the docs.
dviola has quit [Quit: WeeChat 1.8]
<comet23> it looks so easy and beautiful though
arescorpio has quit [Quit: Leaving.]
ketan has quit [Ping timeout: 240 seconds]
<havenwood> comet23: Ruby's complex grammar provides for some lovely code.
kruppm has joined #ruby
<comet23> okay, i am guessing raise is a keyword... these ruby docs are so bad
yogg-saron has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<comet23> warn isn't working on repl
<kruppm> I want to overwrite a method `find`, defined in a module inside a class definition: https://goo.gl/Q4FVEn
<kruppm> I usually monkey-patch stuff like this with `prepend`, but that does not seem to work here, with modules inside classes
eb0t_ has quit [Ping timeout: 255 seconds]
<kruppm> is there a way to monkey-patch this method without re-opening the class?
def_jam has quit [Ping timeout: 240 seconds]
<comet23> i read that monkey-patching is a horrible, horrible, idea and you should never ever do it
<havenwood> comet23: That's not true.
<kruppm> comet23: ye, but it is how it is. i cannot rewrite a ~50k LoC project just to fix raisl 5 compatibility :)
<kruppm> rails*
<havenwood> comet23: Freedom patching is sometimes okay, though it's fair to say you can't just monkey patch core classes in libraries.
<comet23> oh, now that makes sense
<kruppm> So, is there a reason why `ActionView::LookupContext::ViewPaths.prepend` does not seem to work as (I) expected?
<comet23> what does it output?
<kruppm> .ancestors shows the patch, but a call to .find() still calls the original method
<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.
yogg-saron has joined #ruby
<comet23> it sounds like find's return value might be the culprit
<kruppm> comet23: no, i need to extend the function, to handle some edge-cases (specifically, different lookup paths, in certain cases)
<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
<havenwood> kruppm: I'm curious why prepend isn't working. You might try the #RubyOnRails channel as well.
<kruppm> thought there might be some scoping general issues with modules defined inside classes.
<kruppm> that's why i asked here :)
<havenwood> kruppm: Nothing that I'm aware of. Let me sanity check real quick.
<havenwood> kruppm: Works for me.
xall has joined #ruby
<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
<ruby[bot]> havenwood: # => :bar (https://eval.in/822169)
<comet23> havenwood: how do you read all that?
<havenwood> comet23: It's easier on multiple lines.
<comet23> that's super confusing for me
<comet23> but can you read it on one line?
<havenwood> sure
<comet23> whoa
<comet23> i want to learn how to do that
<ruby[bot]> kruppm: we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/fa0c46b950e17ff2d191f3ba89ec00ed
<ruby[bot]> kruppm: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
<comet23> ruby[bot]: that's not a nice thing to say about people's hard work
<kruppm> I might miss something obvious (maybe specific to that class) there, but why does the 1st example not work, while the 2nd does?
<Radar> comet23: pastebin is a tire fire.
<comet23> that's what you need at burning man!
<havenwood> kruppm: self.method(:find).owner #=>
<comet23> a nice tire fire =)
<Radar> I always forget about Method#owner.
<havenwood> kruppm: ActionView::LookupContext != ActionView::LookupContext::ViewPaths
<kruppm> havenwood: internally, LookupContext just calls ViewPaths.find
<kruppm> see 2nd example for that, there it fires the exception
<havenwood> kruppm: ah
biberu has joined #ruby
Burgestrand has joined #ruby
<kruppm> havenwood: btw, self.method(:find).owner # => ActionView::LookupContext::ViewPaths
nacsurte has joined #ruby
_sfiguser has quit [Remote host closed the connection]
xall has quit [Quit: xall]
xall has joined #ruby
Burgestrand has quit [Ping timeout: 260 seconds]
nacsurte has quit [Ping timeout: 268 seconds]
kanye_vest has joined #ruby
oleo has quit [Quit: irc client terminated!]
<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 :)
yogg-saron has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<havenwood> kruppm: Aha!
<havenwood> Mystery solved.
nowhere_man has joined #ruby
<kruppm> ye, thanks for the hint on ActionView::LookupContext earlier. made me check that class even one more time... :)
<comet23> i'm glad you found your error
herbmillerjr has quit [Excess Flood]
<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 :)
herbmillerjr has joined #ruby
ddffg has joined #ruby
ta_ has quit [Remote host closed the connection]
QpQ4 has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
aupadhye has joined #ruby
hutch34 has joined #ruby
aufi has joined #ruby
hndk has quit [Quit: Leaving]
eljimmy has quit [Quit: This computer has gone to sleep]
Danny__ has joined #ruby
hutch34 has quit [Ping timeout: 255 seconds]
enterprisey has joined #ruby
QpQ4 has joined #ruby
QpQ4 has quit [Client Quit]
roshanavand has joined #ruby
Danny__ has quit [Ping timeout: 260 seconds]
gizmore|2 has quit [Quit: KVIrc 4.9.2 Aria http://www.kvirc.net/]
xall has quit [Ping timeout: 240 seconds]
Rodya_ has quit [Remote host closed the connection]
alex`` has joined #ruby
mim1k has joined #ruby
conta has joined #ruby
enterprisey has quit [Remote host closed the connection]
mim1k has quit [Ping timeout: 260 seconds]
Silthias has joined #ruby
umaaji has quit [Quit: Leaving...]
Silthias1 has quit [Ping timeout: 255 seconds]
sekmo has joined #ruby
ascarter has joined #ruby
nacsurte has joined #ruby
djbkd has quit [Remote host closed the connection]
djbkd has joined #ruby
Ropeney has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Ropeney has joined #ruby
xall has joined #ruby
Ropeney has quit [Client Quit]
<comet23> why is x being printed 1 more times than it's supposed to? https://repl.it/JBtR/0
nacsurte has quit [Ping timeout: 240 seconds]
bigkevmcd has joined #ruby
yogg-saron has joined #ruby
ascarter has quit [Ping timeout: 240 seconds]
judofyr has joined #ruby
judofyr has quit [Remote host closed the connection]
judofyr has joined #ruby
judofyr has quit [Read error: Connection reset by peer]
judofyr has joined #ruby
xall has quit [Quit: xall]
DoubleMalt has joined #ruby
<baweaver> comet23: step through your code.
<comet23> i'm bad at that, but i figured it out :)
<comet23> here's my code
<comet23> what can i do to improve it?
jenrzzz has joined #ruby
<baweaver> >> ["x"," "," "," ","o"," ","x"," "," "].each_slice(3).map { |slice| slice.join(' | ') }.join("\n-----------\n")
<ruby[bot]> baweaver: # => "x | | \n-----------\n | o | \n-----------\nx | | " (https://eval.in/822250)
Mortomes|Work has joined #ruby
ur5us has quit [Remote host closed the connection]
<comet23> baweaver: that's so confusing
solocshaw has joined #ruby
<comet23> how do you people write one lines of code like that
<baweaver> what's confusing about it.
<dminuoso> comet23: You dont.
<baweaver> typically, unless demonstrating on IRC.
<comet23> dminuoso: baweaver just did
<comet23> i don't understand how you understand what to write, it's amazing
<baweaver> &ri Enumerable
<comet23> i'm more than impressed and i would like to learn how you do that :)
<baweaver> Basically reading through that a lot.
<dminuoso> comet23: baweaver does not qualify as people.
<dminuoso> baweaver is... something else.
<sekmo> I think that it could be improved with some object oriented programming
<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.
<dminuoso> sekmo: This is actually pure functional programming mixed in with Smalltalk.
<baweaver> dminuoso's not much of one for smalltalk
<dminuoso> That was puntastic.
* baweaver rolls laughing
<baweaver> Anyways, as far as OO, baby steps
<comet23> but what you just did and what radar did with those one lines of confusing code is just so impressive
<comet23> i want to learn that
<baweaver> In this specific instance an object isn't needed yet. It only requires outputting of the board.
sekmo has quit [Quit: Textual IRC Client: www.textualapp.com]
<dminuoso> comet23: It's actually fairly easy to write once you wrap your head around it.
<baweaver> Read the documentation for Enumerable, Array, and String.
cam27 has quit [Quit: cam27]
<baweaver> To be fair me and Radar and others have been at this game for more than a few years.
<comet23> i can't wrap my head around it
<baweaver> you've been at it for maybe a few weeks
jaruga_________ has joined #ruby
<dminuoso> Long enough to be able to write better than baweaver.
Kug3lis_off is now known as Kug3lis
<comet23> no, more than that but i had health problems that made it extremely difficult for me to learn
Kug3lis is now known as Kug3lis_off
mim1k has joined #ruby
<dminuoso> comet23: Do you have any other previous programming experience?
<comet23> yes, but because of my health problems it's like it's sort of irrelevant
<comet23> i've been trying to learn since 2013
<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
<comet23> i know that in a month i will be able to be pretty good
ketan has joined #ruby
Danny__ has joined #ruby
TomyWork has joined #ruby
ta_ has joined #ruby
ketan has quit [Ping timeout: 260 seconds]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Danny__ has quit [Ping timeout: 255 seconds]
comet23 has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
dionysus69 has joined #ruby
dionysus69 has quit [Client Quit]
rivalomega has quit [Remote host closed the connection]
NeutronStarr has joined #ruby
pwnd_nsfw` is now known as pwnd_nsfw
djbkd has quit []
jenrzzz has quit [Ping timeout: 246 seconds]
sysvalve has joined #ruby
andikr has joined #ruby
jaruga_________ has quit [Quit: jaruga_________]
jaruga_________ has joined #ruby
ferr has joined #ruby
solocshaw has quit [Read error: Connection reset by peer]
solocshaw1 has joined #ruby
jaruga________ has joined #ruby
solocshaw1 is now known as solocshaw
antgel has joined #ruby
jaruga_________ has quit [Ping timeout: 276 seconds]
nacsurte has joined #ruby
tobiasvl has quit [Quit: CVE-2017-1000364]
jenrzzz has joined #ruby
nacsurte has quit [Ping timeout: 260 seconds]
ascarter has joined #ruby
jameser_ has joined #ruby
konsolebox has quit [Ping timeout: 260 seconds]
konsolebox has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
jameser has quit [Ping timeout: 260 seconds]
dionysus69 has joined #ruby
ascarter has quit [Ping timeout: 260 seconds]
solocshaw has quit [Ping timeout: 276 seconds]
konsolebox has quit [Ping timeout: 240 seconds]
charliesome has joined #ruby
jaruga_________ has joined #ruby
savoir-faire has joined #ruby
Mia has joined #ruby
jaruga________ has quit [Ping timeout: 240 seconds]
marr has joined #ruby
konsolebox has joined #ruby
bkxd has joined #ruby
bkxd_ has joined #ruby
jzigmund has quit [Ping timeout: 255 seconds]
mikecmpbll has joined #ruby
tvw has joined #ruby
jzigmund has joined #ruby
stan has joined #ruby
hutch34 has joined #ruby
charliesome has quit [Quit: Textual IRC Client: www.textualapp.com]
jameser_ has quit [Read error: Connection reset by peer]
bkxd_ has quit [Ping timeout: 246 seconds]
bkxd has quit [Ping timeout: 246 seconds]
jameser has joined #ruby
bkxd has joined #ruby
quobo has quit [Quit: Connection closed for inactivity]
firstdayonthejob has quit [Quit: WeeChat 1.8]
Danny_ has joined #ruby
savoir-faire has quit [Quit: ZNC - http://znc.in]
hutch34 has quit [Ping timeout: 255 seconds]
savoir-faire has joined #ruby
bkxd has quit [Ping timeout: 276 seconds]
mim1k has quit [Ping timeout: 240 seconds]
Danny_ has quit [Ping timeout: 240 seconds]
tvl has joined #ruby
tvl is now known as tobiasvl
Burgestrand has joined #ruby
dionysus69 has quit [Remote host closed the connection]
pankaj_ has joined #ruby
yeticry has joined #ruby
quobo has joined #ruby
mim1k has joined #ruby
r3vDev has quit [Quit: Leaving.]
kruppm has quit [Ping timeout: 260 seconds]
jaruga_________ has quit [Quit: jaruga_________]
jaruga_________ has joined #ruby
yeticry_ has joined #ruby
yeticry has quit [Read error: Connection reset by peer]
nacsurte has joined #ruby
nofxxxx has quit [Ping timeout: 260 seconds]
DoubleMalt has quit [Read error: Connection reset by peer]
DoubleMalt has joined #ruby
DoubleMalt has quit [Client Quit]
nacsurte has quit [Ping timeout: 260 seconds]
jenrzzz has joined #ruby
konsolebox has quit [Ping timeout: 268 seconds]
Cohedrin_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
vondruch has joined #ruby
ascarter has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
vondruch has quit [Client Quit]
vondruch has joined #ruby
konsolebox has joined #ruby
ascarter has quit [Ping timeout: 260 seconds]
im0nde has joined #ruby
milardovich has joined #ruby
stan has quit [Read error: Connection reset by peer]
stan has joined #ruby
konsolebox has quit [Ping timeout: 240 seconds]
lxsameer has joined #ruby
ketan has joined #ruby
pandaant has joined #ruby
kruppm has joined #ruby
ketan has quit [Ping timeout: 255 seconds]
vali has quit [Ping timeout: 240 seconds]
astrobunny has quit [Remote host closed the connection]
tau has joined #ruby
astrobunny has joined #ruby
_joes_ has quit []
conta has quit [Ping timeout: 255 seconds]
astrobunny has quit [Ping timeout: 240 seconds]
pankaj_ has quit [Quit: Leaving]
astrobunny has joined #ruby
nobitanobi has joined #ruby
ferr has quit [Quit: WeeChat 1.8]
ferr has joined #ruby
iomotoko has quit [Ping timeout: 260 seconds]
blackwind_123 has quit [Ping timeout: 260 seconds]
blackwind_123 has joined #ruby
iomotoko has joined #ruby
tau has left #ruby [#ruby]
milardovich has quit [Remote host closed the connection]
hutch34 has joined #ruby
astrobunny has quit [Remote host closed the connection]
rohitpaulk has joined #ruby
nacsurte has joined #ruby
umaaji has joined #ruby
dionysus69 has joined #ruby
hutch34 has quit [Ping timeout: 255 seconds]
nacsurte has quit [Ping timeout: 268 seconds]
astrobunny has joined #ruby
PeterJones has joined #ruby
ski7777 has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
blackwind_123 has quit [Ping timeout: 255 seconds]
vali has joined #ruby
kruppm has quit [Ping timeout: 240 seconds]
kruppm has joined #ruby
jackjackdripper has quit [Quit: Leaving.]
montanonic has joined #ruby
rfoust has quit [Remote host closed the connection]
rfoust has joined #ruby
ski7777 has joined #ruby
balo has quit [Quit: leaving]
blackwind_123 has joined #ruby
balo has joined #ruby
blackwind_123 has quit [Ping timeout: 240 seconds]
tvw has quit []
conta has joined #ruby
blackwind_123 has joined #ruby
montanonic has quit [Ping timeout: 240 seconds]
im0nde has quit [Ping timeout: 246 seconds]
PeterJones has quit [Quit: Leaving...]
ur5us has joined #ruby
PeterJones has joined #ruby
Danny_ has joined #ruby
tau has joined #ruby
<tau> hi guys. i have an odd behavior here. it shows the problem http://codepad.org/y1tckwpH
bkxd has joined #ruby
rikkipitt has joined #ruby
milardovich has joined #ruby
Danny_ has quit [Ping timeout: 258 seconds]
foxxx0 has quit [Quit: WeeChat 1.8]
bkxd_ has joined #ruby
pandaant has quit [Remote host closed the connection]
<dminuoso> asm>> 2-3
<ruby[bot]> dminuoso: I have disassembled your code, the result is at https://eval.in/822397
PeterJones has left #ruby ["Leaving..."]
<dminuoso> Was about time someone asked an interesting question.
foxxx0 has joined #ruby
<dminuoso> tau: My guess is you are trying this in pry?
<tau> dminuoso in irb.
rohitpaulk has quit [Ping timeout: 246 seconds]
<dminuoso> tau: Same story.
<dminuoso> tau: irb is a big fat ruby program.
<dminuoso> it does things, apparently it sometimes substracts things. :-)
<tau> dminuoso hmm, i see.
<Mon_Ouie> puts caller to see where each call comes from
<tau> yea.
<tau> hmm
<tau> i got it.
<tau> dminuoso isnt there some ruby irb-like that is not going to mess around it?
<dminuoso> tau: Not that I am aware of.
<tau> i see.
<dminuoso> tau: In the end you should not monkey patch core classes anyway.
<dminuoso> Because of exactly this thing. Libraries and tools make assumptions about ruby core and stdlib.
bkxd_ has quit [Ping timeout: 240 seconds]
<tau> i see.
<tau> yea.
<zenspider> tau: YOU are messing around with Integer#-@, not IRB
<zenspider> it's just using it
<tau> yes
bkxd has quit [Ping timeout: 258 seconds]
rohitpaulk has joined #ruby
DoubleMalt has joined #ruby
Mon_Ouie has quit [Read error: Connection reset by peer]
DoubleMalt has quit [Client Quit]
<zenspider> tau: curious... what are you actually trying to do?
Mon_Ouie has joined #ruby
milardovich has quit [Remote host closed the connection]
<tau> zenspider i'm trying to rewrite (lax) https://github.com/iogf/lax in ruby.
<dminuoso> tau: There is however a Ruby feature almost nobody uses..
<tau> i thought it would gain some benefits.
<tau> dminuoso whats it?
<dminuoso> tau: Refinements.
<tau> dminuoso more strictly speaking, what would it be reinements?
<tau> refinements*
<tau> in the context.
<dminuoso> tau: More strictly speaking it's a feature you will have to consult the Ruby documentation for.
<tau> i see.
<dminuoso> &ri refinements
<`derpy> No results
* dminuoso kicks `derpy with adaedra
Fernando-Basso has joined #ruby
rohitpaulk has quit [Ping timeout: 255 seconds]
jameser has quit [Ping timeout: 240 seconds]
apparition has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<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.
nacsurte has joined #ruby
cschneid_ has joined #ruby
jaruga_________ has quit [Ping timeout: 260 seconds]
_joes_ has joined #ruby
jaruga_________ has joined #ruby
cschneid_ has quit [Ping timeout: 246 seconds]
nacsurte has quit [Ping timeout: 276 seconds]
<tau> zenspider yes. i know.
<tau> zenspider i was wondering if it were possible to avoid parsing in ruby(i was the one who wrote lax).
<dminuoso> Parsing ruby with ruby.
<tau> zenspider it seems it can be done but it wouldnt be possible to be used in irb.
<tau> i just need to overload the + for Integer.
<tau> then ask for a string then build the ast then eval it.
astrobunny has quit [Remote host closed the connection]
<zenspider> "i just need"... no, that's not just what you need.
ur5us has quit [Remote host closed the connection]
ur5us has joined #ruby
ur5us has quit [Read error: Connection reset by peer]
ur5us has joined #ruby
<tau> zenspider yea, i meant 'sort of'.
<zenspider> tau: you're just parsing straight algebraic expressions?
<tau> zenspider yea.
<tau> i believe that if i implement lax in ruby then i could better extend it with functionalities.
<tau> although i'm not sure yet.
<tau> i have to think more of the gains in rewriting it in ruby.
<zenspider> meaning handling more maths?
<tau> zenspider exact.
<zenspider> or just easier to write the impl in?
<tau> handling more maths.
ascarter has joined #ruby
<tau> and turning the implementation easier somehow too i guess.
<zenspider> you're gonna need a parser
<zenspider> example: lax -c '(x-3)(x+y)'
<tau> hmm
<tau> well..
<zenspider> seems like a simple lexer & parser for this shouldn't be hard...
vondruch has quit [Ping timeout: 258 seconds]
jzigmund has quit [Ping timeout: 246 seconds]
jaruga_________ has quit [Ping timeout: 260 seconds]
jzigmund has joined #ruby
<tau> zenspider yea
alex`` has quit [Quit: WeeChat 1.8]
<zenspider> >> "(x-3)(x+y)".scan(%r%[()+*/^-]|\b\w+\b%)
<ruby[bot]> zenspider: # => ["(", "x", "-", "3", ")", "(", "x", "+", "y", ")"] (https://eval.in/822408)
<tau> thats possible in python because we have __call__.
<tau> i mean with no parsing.
<zenspider> I don't know what tokenize does... but it's at least lexing everything out and creating you nodes for those types...
<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
<zenspider> no, don't think you can
<zenspider> or, even if you can, you shouldn't
<Papierkorb> tau: So I get it correctly, that you intend to parse some math expression, and then "compile" that into LaTex?
<tau> papierkorb yea.
ascarter has quit [Ping timeout: 276 seconds]
<zenspider> yeah... the mathier you get, the less ruby you get: #<Racc::ParseError: env:1 :: parse error on value "(" (tLPAREN2)>
<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
alex`` has joined #ruby
<tau> papierkorb yea, nice.
nobitanobi has quit [Remote host closed the connection]
<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
<tau> thats a good approach.
<tau> to start it :D
<tau> okay guys, thank you for the insight.
<tau> i gotta be off now.
vondruch has joined #ruby
jaruga_________ has joined #ruby
dionysus69 has quit [Remote host closed the connection]
vondruch has quit [Client Quit]
vondruch has joined #ruby
jaruga_________ has quit [Quit: jaruga_________]
lxsameer has quit [Read error: Connection reset by peer]
vondruch has quit [Quit: vondruch]
dasher00 has joined #ruby
DoubleMalt has joined #ruby
DoubleMalt has quit [Client Quit]
vondruch has joined #ruby
vondruch has quit [Remote host closed the connection]
vondruch has joined #ruby
vondruch has quit [Quit: vondruch]
mim1k has quit [Ping timeout: 260 seconds]
mim1k has joined #ruby
apparition has joined #ruby
Danny_ has joined #ruby
ponzii has joined #ruby
ponzii has left #ruby [#ruby]
vondruch has joined #ruby
Danny_ has quit [Remote host closed the connection]
Danny_ has joined #ruby
vondruch has quit [Client Quit]
vondruch has joined #ruby
Danny_ has quit [Remote host closed the connection]
PatrikasZvaigzde has quit [Ping timeout: 240 seconds]
jaruga_________ has joined #ruby
Danny_ has joined #ruby
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
ldnunes has joined #ruby
Danny_ has quit [Client Quit]
__urux__ has joined #ruby
swills has joined #ruby
ur5us has quit [Remote host closed the connection]
jenrzzz has quit [Ping timeout: 268 seconds]
ur5us has joined #ruby
jphase_ has quit [Remote host closed the connection]
mim1k has quit [Ping timeout: 240 seconds]
mathys has joined #ruby
psychicist__ has joined #ruby
GinoMan has quit [Ping timeout: 276 seconds]
urux has joined #ruby
PatrikasZvaigzde has joined #ruby
ur5us has quit [Read error: No route to host]
ur5us has joined #ruby
runescape07rsps has quit [Quit: Leaving]
vuoto has joined #ruby
hkdsun has quit [Quit: ZNC 1.6.5 - http://znc.in]
ascarter has joined #ruby
vali has quit [Quit: vali]
milardovich has joined #ruby
govg has quit [Ping timeout: 268 seconds]
govg has joined #ruby
ur5us has quit [Remote host closed the connection]
ur5us has joined #ruby
ascarter has quit [Ping timeout: 240 seconds]
ur5us has quit [Ping timeout: 240 seconds]
synthroid has joined #ruby
GinoMan has joined #ruby
jaruga________ has joined #ruby
jaruga_________ has quit [Quit: jaruga_________]
Vel_ has joined #ruby
psychicist__ has quit [Ping timeout: 260 seconds]
GinoMan2440 has joined #ruby
vuoto has quit [Quit: Lost terminal]
milardovich has quit [Remote host closed the connection]
<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
milardovich has joined #ruby
sepp2k has joined #ruby
vali has joined #ruby
alex`` has quit [Quit: WeeChat 1.8]
milardovich has quit [Remote host closed the connection]
GinoMan has quit [Ping timeout: 276 seconds]
tau has quit [Ping timeout: 276 seconds]
ldnunes has quit [Ping timeout: 255 seconds]
simmaniac has joined #ruby
ledestin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Silthias1 has joined #ruby
Silthias has quit [Ping timeout: 260 seconds]
sysvalve has quit [Ping timeout: 240 seconds]
<dminuoso> ?rails Vel_
<ruby[bot]> Vel_: Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
alex`` has joined #ruby
Vel_ has quit [Ping timeout: 260 seconds]
nobitanobi has joined #ruby
ldnunes has joined #ruby
jameser has joined #ruby
dropsh0t has joined #ruby
jameser has quit [Client Quit]
DoubleMalt has joined #ruby
minimalism has joined #ruby
roshanavand has quit [Remote host closed the connection]
jameser has joined #ruby
rohitpaulk has joined #ruby
Kug3lis_off is now known as Kug3lis
nacsurte has joined #ruby
DoubleMalt has quit [Ping timeout: 240 seconds]
nacsurte has quit [Ping timeout: 255 seconds]
zapata has quit [Ping timeout: 255 seconds]
mim1k has joined #ruby
bmurt has joined #ruby
jokke has quit [Quit: WeeChat 1.7.1]
Mortomes|Work has quit [Ping timeout: 260 seconds]
jokke has joined #ruby
shinnya has joined #ruby
umaaji has quit [Quit: Leaving...]
rikkipitt has quit [Quit: Leaving...]
DLSteve has quit [Quit: All rise, the honorable DLSteve has left the channel.]
haylon has joined #ruby
workmad3 has joined #ruby
Kug3lis is now known as Kug3lis_off
Kug3lis_off is now known as Kug3lis
lxsameer has joined #ruby
rohitpaulk has quit [Ping timeout: 255 seconds]
apparition has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
TheBrayn has quit [Quit: WeeChat 1.8]
ascarter has joined #ruby
TheBrayn has joined #ruby
ascarter has quit [Ping timeout: 255 seconds]
TheBrayn has quit [Client Quit]
dionysus69 has joined #ruby
psychicist__ has joined #ruby
TheBrayn has joined #ruby
TheBrayn has quit [Client Quit]
milardovich has joined #ruby
r3vDev has joined #ruby
TheBrayn has joined #ruby
iomotoko has quit [Quit: leaving]
uZiel has joined #ruby
vali has quit [Quit: vali]
rohitpaulk has joined #ruby
eljimmy has joined #ruby
uZiel has quit [Ping timeout: 248 seconds]
workmad3 has quit [Ping timeout: 240 seconds]
fergal has joined #ruby
<dminuoso> >> instance_eval &->(){}
<ruby[bot]> dminuoso: # => wrong number of arguments (given 1, expected 0) (ArgumentError) ...check link for more (https://eval.in/822461)
<dminuoso> Can someone explain this to me?
<dminuoso> What the heck? Is this a bug?
<dminuoso> It clearly must be a bug.
DoubleMalt has joined #ruby
tgragnato has joined #ruby
gnufied has joined #ruby
gnufied has quit [Client Quit]
chimkan has joined #ruby
chimkan has left #ruby [#ruby]
futilegames has joined #ruby
DLSteve has joined #ruby
patarr has joined #ruby
chimkan has joined #ruby
Silthias1 has left #ruby [#ruby]
uZiel has joined #ruby
<dminuoso> Oh. Haha.
<dminuoso> Shoot me.
rfoust has quit [Ping timeout: 240 seconds]
milardovich has quit [Read error: Connection reset by peer]
oleo has joined #ruby
nacsurte has joined #ruby
__urux__ has quit [Quit: __urux__]
judofyr has quit [Remote host closed the connection]
judofyr has joined #ruby
chouhoulis has joined #ruby
nacsurte has quit [Ping timeout: 240 seconds]
gizmore has joined #ruby
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
sanguisdex has joined #ruby
judofyr has quit [Ping timeout: 240 seconds]
<sanguisdex> hi there low hanging question for yall. How can I install a gem from a repo/branch with the cli `gem install` command?
<ljarvis> sanguisdex: you can't
<sanguisdex> ljarvis: thanks that was easy.
<ljarvis> you should download the repo, `gem build foo.gemspec` and then gem install the resulting .gem file
apparition has joined #ruby
beilabs__ has quit [Read error: Connection timed out]
apparition has quit [Client Quit]
jenrzzz has quit [Ping timeout: 240 seconds]
Silthias has joined #ruby
zapata has joined #ruby
yogg-saron has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
chouhoulis has quit [Remote host closed the connection]
chouhoulis has joined #ruby
my123_ has quit [Ping timeout: 255 seconds]
chalkmonster has joined #ruby
my123 has joined #ruby
my123 has joined #ruby
swills has quit [Quit: Leaving]
DoubleMalt has quit [Ping timeout: 276 seconds]
mradmacher has quit [Quit: WeeChat 1.4]
<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?
<Burgestrand> i.e. it should be:
<Burgestrand> >> instance_eval &->(x){ x }
<ruby[bot]> Burgestrand: # => main (https://eval.in/822484)
ascarter has joined #ruby
jaruga________ has quit [Quit: jaruga________]
rfoust has joined #ruby
mim1k has quit [Ping timeout: 258 seconds]
jphase has joined #ruby
Rodya_ has joined #ruby
ascarter has quit [Ping timeout: 246 seconds]
futilegames has quit [Quit: futilegames]
fergal has left #ruby [#ruby]
nimzooooo has joined #ruby
dh64 has joined #ruby
rfoust has quit [Ping timeout: 240 seconds]
ta_ has quit [Remote host closed the connection]
vondruch has quit [Quit: vondruch]
Silthias has quit [Ping timeout: 260 seconds]
hutch34 has joined #ruby
vondruch has joined #ruby
travisgrib has joined #ruby
Silthias has joined #ruby
nobitanobi has quit []
<travisgrib> /msg NickServ VERIFY REGISTER travisgrib nysrwruhdvsr
nobitanobi has joined #ruby
<ljarvis> oh dear
<Mon_Ouie> Well at least I imagine that's just the verification code and not a password
<ljarvis> ya
<Burgestrand> hunter2!
rfoust has joined #ruby
<travisgrib> haha yes
rivalomega has joined #ruby
travisgrib has quit [Quit: Page closed]
dionysus69 has quit [Remote host closed the connection]
Kug3lis has quit [Ping timeout: 240 seconds]
rfoust has quit [Ping timeout: 246 seconds]
dionysus69 has joined #ruby
mim1k has joined #ruby
mathys has quit [Remote host closed the connection]
rivalomega has quit [Ping timeout: 240 seconds]
rfoust has joined #ruby
rohitpaulk has quit [Ping timeout: 246 seconds]
mathys has joined #ruby
travisgrib has joined #ruby
djbjd has joined #ruby
chouhoul_ has joined #ruby
dionysus69 has quit [Remote host closed the connection]
<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?
dionysus69 has joined #ruby
urux has quit [Ping timeout: 260 seconds]
dionysus69 has quit [Remote host closed the connection]
chouhoulis has quit [Ping timeout: 268 seconds]
<canton7> travisgrib, http://bundler.io/groups.html
rfoust has quit [Ping timeout: 276 seconds]
agimenez has joined #ruby
GodFather has joined #ruby
jaruga________ has joined #ruby
<travisgrib> canton7: so would the omission of a group correlate to a runtime dependency?
<canton7> not sure what you're asking
<canton7> oh, defining a dependency outside of any groups, rather than using 'bundle install --without'. Yes. Dependencies not in a group are always required
nacsurte has joined #ruby
simmaniac has quit [Ping timeout: 268 seconds]
runescape07rsps has joined #ruby
lolzorplox has joined #ruby
lolzorplox has quit [Client Quit]
isBEKaml has joined #ruby
nacsurte has quit [Ping timeout: 276 seconds]
rfoust has joined #ruby
dionysus69 has joined #ruby
catphish has joined #ruby
rohitpaulk has joined #ruby
ResidentBiscuit has joined #ruby
ResidentBiscuit has quit [Max SendQ exceeded]
ResidentBiscuit has joined #ruby
cam27 has joined #ruby
<travisgrib> canton7: cool, thanks!
Burgestrand has quit [Quit: Closing time!]
Burgestrand has joined #ruby
ferr has quit [Quit: WeeChat 1.8]
Burgestrand has quit [Client Quit]
theunraveler has joined #ruby
rivalomega has joined #ruby
<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>')
rfoust has quit [Ping timeout: 246 seconds]
djbjd has quit [Quit: djbjd]
<catphish> i'm going to be doing this a lot, except the code above won't work, because it's expecting 8 bytes
rfoust has joined #ruby
<matthewd> catphish: Seems pretty easy to benchmark
enterprisey has joined #ruby
<catphish> that's true, 2 options occur to me: #bytes and math, or #rjust and unpack
cschneid_ has joined #ruby
<catphish> my money's on the first
d10n-work has joined #ruby
cschneid_ has quit [Remote host closed the connection]
<matthewd> or unpack as 16 & 32, then math
cschneid_ has joined #ruby
cadillac_ has joined #ruby
<catphish> oh yeah :)
nimzooooo has quit [Quit: Page closed]
[Butch] has joined #ruby
xlov has joined #ruby
ascarter has joined #ruby
tau has joined #ruby
antgel has quit [Ping timeout: 260 seconds]
<catphish> performance aside, i like this: https://paste.ubuntu.com/24956607/
sanguisdex has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
im314ous has joined #ruby
<canton7> catphish, why are you using an array there, out of curiosity?
<catphish> canton7: because you can't modify an integer
<canton7> why not use inject?
<catphish> actually that's a much better idea
<canton7> str.bytes.inject(0){ |s,x| (s << 8) | x }
<catphish> much better https://paste.ubuntu.com/24956623/
<catphish> err, yeah
<im314ous> just out of curiosity but what are you programming, catphish? :)
ascarter has quit [Ping timeout: 255 seconds]
<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
<matthewd> Omitting the (0) would save a couple of cycles, though I don't know it'd even be measurable
<im314ous> hm, sounds interesting!
<catphish> so: position = file.read(6); file.seek(unpack(position))
<catphish> works great
<catphish> this is why: http://i.imgur.com/6Zplf90.jpg
<catphish> but, never mind that :)
mim1k has quit [Ping timeout: 240 seconds]
nacsurte has joined #ruby
GodFather has quit [Remote host closed the connection]
rfoust has quit [Ping timeout: 240 seconds]
<matthewd> catphish: Are you inventing your own file format? :/
elsevero has joined #ruby
<catphish> i am
mim1k has joined #ruby
<catphish> couldn't find anything off the shelf for version block storage :)
GodFather has joined #ruby
<im314ous> that's pretty cool. fucking difficult, but cool
andikr has quit [Remote host closed the connection]
_joes_ has quit []
<matthewd> It sounds suspiciously similar to a filesystem, at a glance
aupadhye has quit [Ping timeout: 240 seconds]
<catphish> it is distressingly like a filesystem, sadly it's not a filesyste, else i'd love to just use a filesystem :)
nacsurte has quit [Ping timeout: 240 seconds]
rfoust has joined #ruby
dionysus69 has quit [Remote host closed the connection]
<catphish> it's versioned
<catphish> and only has one file
<catphish> the idea is to track changes to that "file"
ptx0 is now known as kash
<catphish> and the inverse: [int].pack('Q>')[2,6]
<catphish> not sure there's a better way to do that
<catphish> in any case, both work so will stick with it unless they become a bottleneck
<catphish> thanks
dionysus69 has joined #ruby
Rodya_ has quit [Remote host closed the connection]
chalkmonster has quit [Ping timeout: 240 seconds]
rfoust has quit [Read error: Connection reset by peer]
rfoust has joined #ruby
synthroid has quit [Remote host closed the connection]
chouhoul_ has quit [Remote host closed the connection]
synthroid has joined #ruby
cpruitt has joined #ruby
ltem has joined #ruby
rohitpaulk has quit [Ping timeout: 240 seconds]
synthroid has quit [Ping timeout: 240 seconds]
plujon has joined #ruby
im314ous has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dionysus69 has quit [Ping timeout: 240 seconds]
DLSteve has quit [Quit: All rise, the honorable DLSteve has left the channel.]
synthroid has joined #ruby
hutch34 has quit [Ping timeout: 255 seconds]
rohitpaulk has joined #ruby
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
<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?
cschneid_ has quit []
vondruch has quit [Remote host closed the connection]
<lupine> sure, although it's easier if you throw in a debug console from the start
<matthewd> plujon: Yes, though there are limits to what you can learn
<plujon> The machine is linux, so I can find some things in /proc . But the more I can learn, the better.
<matthewd> plujon: You can attach to it with gdb, and [carefully] execute ruby from there
<catphish> it tends to be much saner to add some memory debugging code and wait for it to happen again
<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
jenrzzz has quit [Ping timeout: 255 seconds]
<matthewd> It's pretty straightforward to get a heap dump, at least
yogg-saron has joined #ruby
<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.
dviola has joined #ruby
<plujon> How do you execute ruby from within gdb?
conta has quit [Ping timeout: 240 seconds]
<plujon> (and/or get a heap dump)
mathys has quit [Quit: Leaving]
antgel has joined #ruby
<matthewd> I'm sure Google can do a better job of answering either of those than I could off the top of my head
* plujon nods
gil_ has joined #ruby
gil_ has joined #ruby
gil_ has quit [Changing host]
brent__ has joined #ruby
amclain has joined #ruby
elcontrastador has joined #ruby
SuperLag has joined #ruby
vondruch has joined #ruby
hutch34 has joined #ruby
Rodya_ has joined #ruby
ivanskie has joined #ruby
judofyr has joined #ruby
jzigmund has quit [Ping timeout: 240 seconds]
eljimmy has quit [Quit: This computer has gone to sleep]
jzigmund has joined #ruby
marxarelli|afk has quit [Quit: Textual IRC Client: www.textualapp.com]
TomyWork has quit [Ping timeout: 240 seconds]
marxarelli has joined #ruby
im314ous has joined #ruby
troys has joined #ruby
Eiam has joined #ruby
montanonic has joined #ruby
Guest41957 has left #ruby ["Textual IRC Client: www.textualapp.com"]
ruby-lang801 has joined #ruby
ruby-lang801 has quit [Client Quit]
rohitpaulk has quit [Ping timeout: 255 seconds]
im314ous has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
blaisebool has joined #ruby
chouhoulis has joined #ruby
Ka has quit [Remote host closed the connection]
N0ATN has joined #ruby
dionysus69 has joined #ruby
TinkerTyper_ has joined #ruby
nacsurte has joined #ruby
TinkerTyper has quit [Ping timeout: 276 seconds]
N0ATN is now known as ka
ka is now known as Ka
cdg has joined #ruby
cdg_ has joined #ruby
catphish has quit [Quit: Leaving]
cadillac__ has joined #ruby
chouhoulis has quit [Remote host closed the connection]
cdg has quit [Ping timeout: 260 seconds]
gusrub has joined #ruby
agimenez has quit [Read error: Connection reset by peer]
agimenez has joined #ruby
cadillac_ has quit [Read error: Connection reset by peer]
cadillac__ is now known as cadillac_
conta1 has joined #ruby
mim1k has quit [Ping timeout: 240 seconds]
mikecmpbll has quit [Quit: inabit. zz.]
TomyLobo has joined #ruby
hutch34 has quit [Ping timeout: 255 seconds]
rohitpaulk has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
judofyr has quit [Remote host closed the connection]
judofyr has joined #ruby
nobitanobi has quit [Remote host closed the connection]
judofyr has quit [Ping timeout: 260 seconds]
im314ous has joined #ruby
gusrub has quit [Remote host closed the connection]
dionysus69 has quit [Quit: dionysus69]
vondruch has quit [Remote host closed the connection]
jaruga________ has quit [Quit: jaruga________]
gusrub has joined #ruby
dionysus69 has joined #ruby
dionysus69 has quit [Remote host closed the connection]
yogg-saron has quit [Quit: Textual IRC Client: www.textualapp.com]
dionysus69 has joined #ruby
gusrub has quit [Ping timeout: 276 seconds]
xlov has left #ruby [#ruby]
chouhoulis has joined #ruby
s1kx has joined #ruby
s1kx has quit [Max SendQ exceeded]
hutch34 has joined #ruby
dionysus69 has quit [Remote host closed the connection]
s1kx has joined #ruby
s1kx has quit [Max SendQ exceeded]
dionysus69 has joined #ruby
s1kx has joined #ruby
s1kx has quit [Max SendQ exceeded]
dionysus69 has quit [Remote host closed the connection]
patarr_ has joined #ruby
montanonic has quit [Ping timeout: 240 seconds]
chalkmonster has joined #ruby
dionysus69 has joined #ruby
lxsameer has quit [Quit: WeeChat 1.7]
patarr has quit [Ping timeout: 276 seconds]
mwlang has joined #ruby
jphase has quit [Remote host closed the connection]
jphase has joined #ruby
vondruch has joined #ruby
muelleme_ has joined #ruby
r3vDev has quit [Quit: Leaving.]
vondruch has quit [Client Quit]
vondruch has joined #ruby
judofyr has joined #ruby
patarr_ has quit [Ping timeout: 255 seconds]
jzigmund has quit [Ping timeout: 260 seconds]
jphase has quit [Ping timeout: 255 seconds]
rkazak__ has joined #ruby
jphase has joined #ruby
jzigmund has joined #ruby
nofxx has joined #ruby
conta1 has quit [Ping timeout: 260 seconds]
shinnya has quit [Ping timeout: 258 seconds]
Tempesta has quit [Quit: AdiIRC is updating to v2.9 Beta Build (2017/06/26) 64 Bit]
Tempesta has joined #ruby
tgragnato has quit [Ping timeout: 276 seconds]
dionysus69 has quit [Remote host closed the connection]
dionysus69 has joined #ruby
dionysus69 has quit [Remote host closed the connection]
dionysus69 has joined #ruby
vondruch has quit [Quit: vondruch]
travisgrib has quit [Quit: travisgrib]
patarr has joined #ruby
Cohedrin_ has joined #ruby
dviola has quit [Read error: Connection reset by peer]
dviola has joined #ruby
enterprisey has quit [Ping timeout: 268 seconds]
dviola has quit [Changing host]
dviola has joined #ruby
ta_ has joined #ruby
davidmichaelkarr has joined #ruby
patarr has quit [Ping timeout: 276 seconds]
muelleme_ has quit [Ping timeout: 260 seconds]
tgragnato has joined #ruby
dionysus69 has quit [Remote host closed the connection]
dionysus69 has joined #ruby
gusrub has joined #ruby
wiki-ruby-1 has joined #ruby
rkazak__ has quit [Quit: Sleep.....ing....]
ta_ has quit [Remote host closed the connection]
BSaboia has joined #ruby
ta_ has joined #ruby
gusrub has quit [Read error: No route to host]
gusrub_ has joined #ruby
dionysus69 has quit [Remote host closed the connection]
zapata has quit [Quit: WeeChat 1.8]
dionysus69 has joined #ruby
postmodern has joined #ruby
enterprisey has joined #ruby
vondruch has joined #ruby
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
patarr has joined #ruby
judofyr has quit [Remote host closed the connection]
judofyr has joined #ruby
dionysus69 has quit [Remote host closed the connection]
montanonic has joined #ruby
runescape07rsps has quit [Quit: Leaving]
dionysus69 has joined #ruby
eljimmy has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
travisgrib has joined #ruby
weathermaker has joined #ruby
elsevero_ has joined #ruby
dionysus69 has quit [Remote host closed the connection]
judofyr has quit [Ping timeout: 276 seconds]
dionysus69 has joined #ruby
xall has joined #ruby
gusrub_ has quit [Read error: Connection reset by peer]
gusrub has joined #ruby
haylon has quit [Ping timeout: 255 seconds]
<tau> hi.
judofyr has joined #ruby
<tau> in case of you guys trying to check https://github.com/iogf/rubtex
vondruch has quit [Quit: vondruch]
<tau> thats how i have done the compile ruby expression into latex thing.
troys is now known as troys_
vondruch has joined #ruby
judofyr has quit [Remote host closed the connection]
elsevero has quit [Ping timeout: 240 seconds]
elsevero_ is now known as elsevero
judofyr has joined #ruby
montanonic has quit [Ping timeout: 255 seconds]
travisgrib has quit [Quit: travisgrib]
gusrub has quit [Remote host closed the connection]
gusrub has joined #ruby
judofyr_ has joined #ruby
chouhoul_ has joined #ruby
travisgrib has joined #ruby
travisgrib has quit [Client Quit]
judofyr has quit [Read error: Connection reset by peer]
vondruch has quit [Quit: vondruch]
wiki-ruby-1 has quit [Quit: Ex-Chat]
vondruch has joined #ruby
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
antgel has quit [Ping timeout: 260 seconds]
wiki-ruby-1 has joined #ruby
chouhoulis has quit [Ping timeout: 268 seconds]
patarr has quit [Ping timeout: 276 seconds]
<wiki-ruby-1> I can never get into RubyonRails
<wiki-ruby-1> Anyways any1 heere have any Best practice methods in terms of Automated Testing
<wiki-ruby-1> I really need like a default stack ... GOTO stack, that basically works for almost anything... Any Tips ...would be great ty
vondruch has quit [Client Quit]
vondruch has joined #ruby
ALoneNoMad has joined #ruby
<havenwood> wiki-ruby-1: You'll need to register and identify your nick for #rubyonrails.
roshanavand has joined #ruby
jenrzzz has quit [Ping timeout: 246 seconds]
aufi has quit [Quit: Leaving]
xall has quit [Quit: xall]
scorphus has quit [Changing host]
scorphus has joined #ruby
bmurt has joined #ruby
<wiki-ruby-1> I m in now ty ravewood.
<wiki-ruby-1> "Havenwood"
troys_ is now known as troys
rkazak has joined #ruby
chalkmonster has quit [Quit: Daddy's flown, 'cross the ocean.]
beilabs__ has joined #ruby
<ivanskie> ravewood lol
ascarter has joined #ruby
patarr has joined #ruby
* havenwood caws
<havenwood> oh, no "n" - I should be raving not cawing
<havenwood> I misread as well. Coffeetime!
montanonic has joined #ruby
sonOfRa has quit [Remote host closed the connection]
ascarter has quit [Ping timeout: 255 seconds]
guest223 has joined #ruby
<guest223> Python or Ruby?
ivanskie has quit [Ping timeout: 260 seconds]
sonOfRa has joined #ruby
jenrzzz has joined #ruby
patarr has quit [Ping timeout: 240 seconds]
kruppm has quit [Ping timeout: 240 seconds]
enterprisey has quit [Ping timeout: 276 seconds]
montanonic has quit [Ping timeout: 246 seconds]
BSaboia has quit [Quit: Leaving]
muelleme_ has joined #ruby
Bock has quit [Ping timeout: 260 seconds]
<TheBrayn> Intercal
patarr has joined #ruby
rohitpaulk has quit [Ping timeout: 240 seconds]
judofyr_ has quit [Remote host closed the connection]
rohitpaulk has joined #ruby
muelleme_ has quit [Ping timeout: 240 seconds]
<ALoneNoMad> what goes best for ios native and a backend would ruby be good?
judofyr has joined #ruby
<havenwood> ALoneNoMad: You can make very nice APIs with Roda or Sinatra. There're lots of options.
<ALoneNoMad> what would work best with the apple platform
<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.
<ALoneNoMad> with the most features and a good look that would blend in
<havenwood> enable*
<ALoneNoMad> have you personally worked with that as a backend?
<havenwood> ALoneNoMad: There are many ways to make mobile apps. Some Ruby-related mentions might be RubyMotion, Ruboto and MobiRby.
<havenwood> ALoneNoMad: Yes, I've created various Rack APIs for iOS mobile apps.
<ALoneNoMad> well im making my app in swift however for a goo backend is what iam talking about
Rodya_ has quit [Remote host closed the connection]
<havenwood> ALoneNoMad: Give Roda a look: http://roda.jeremyevans.net/
<havenwood> ALoneNoMad: And for auth: http://rodauth.jeremyevans.net/
<ALoneNoMad> if you tried others outside of ruby?
patarr has quit [Ping timeout: 260 seconds]
rkazak has quit [Quit: Sleep.....ing....]
judofyr has quit [Ping timeout: 255 seconds]
montanonic has joined #ruby
nobitanobi has joined #ruby
haylon has joined #ruby
<havenwood> ALoneNoMad: Yeah. There are lots of options.
jackjackdripper has joined #ruby
cschneid has quit [Ping timeout: 246 seconds]
<havenwood> ALoneNoMad: I really do like Elixir's Phoenix framework.
<havenwood> ALoneNoMad: http://www.phoenixframework.org/
tau is now known as sexycode
cschneid has joined #ruby
mjuhl has quit [Ping timeout: 240 seconds]
dionysus69 has quit [Remote host closed the connection]
patarr has joined #ruby
nobitanobi has quit [Ping timeout: 268 seconds]
dionysus69 has joined #ruby
simmaniac has joined #ruby
dionysus69 has quit [Remote host closed the connection]
graft has quit [Ping timeout: 258 seconds]
dionysus69 has joined #ruby
<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
graft has joined #ruby
graft has joined #ruby
graft has quit [Changing host]
agimenez has quit [Ping timeout: 246 seconds]
mikecmpbll has joined #ruby
muelleme_ has joined #ruby
<guest223> Ybur si dab.
shinnya has joined #ruby
hahuang65 has joined #ruby
qguv has left #ruby ["WeeChat 1.8"]
mwlang has quit [Quit: mwlang]
rohitpaulk has quit [Ping timeout: 240 seconds]
gusrub has quit [Read error: Connection reset by peer]
chouhoul_ has quit [Remote host closed the connection]
gusrub has joined #ruby
chouhoulis has joined #ruby
weathermaker has quit [Quit: weathermaker]
jenrzzz has quit [Ping timeout: 255 seconds]
rivalomega has quit [Remote host closed the connection]
<guest223> Why should i learn ruby?
<guest223> ?
<guest223> ?
<guest223> ?
<Zarthus> why not
antgel has joined #ruby
<guest223> I have no interest in web. Is ruby good as a general purpose language?
Fernando-Basso has quit [Quit: WeeChat 1.8]
<apeiros> yes it is
Fernando-Basso has joined #ruby
uZiel has quit [Ping timeout: 248 seconds]
jackjackdripper has quit [Read error: Connection reset by peer]
jackjackdripper has joined #ruby
kmhn has quit [Remote host closed the connection]
ascarter has joined #ruby
dionysus69 has quit [Quit: dionysus69]
agimenez has joined #ruby
dasher00 has quit [Ping timeout: 268 seconds]
sysvalve has joined #ruby
ascarter has quit [Ping timeout: 255 seconds]
montanonic has quit [Ping timeout: 258 seconds]
im314ous has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
simmaniac has quit [Ping timeout: 240 seconds]
elsevero has quit [Quit: elsevero]
agimenez has quit [Ping timeout: 240 seconds]
dasher00 has joined #ruby
t-recx has joined #ruby
guest223 has quit [Remote host closed the connection]
kmhn has joined #ruby
kmhn has quit [Remote host closed the connection]
nacsurte has quit [Ping timeout: 260 seconds]
eljimmy has quit [Quit: This computer has gone to sleep]
P-NuT has joined #ruby
cadillac_ has quit [Quit: Quit]
<jolamb> Any faraday wizards here?
<jolamb> I'm trying to figure out how to e.g. skip a specific middleware in the stack for just one request
Burgestrand has joined #ruby
Rodya_ has joined #ruby
hahuang65 has quit [Quit: WeeChat 1.8]
hahuang65 has joined #ruby
Burgestrand has quit [Ping timeout: 246 seconds]
Rodya_ has quit [Ping timeout: 246 seconds]
Rodya_ has joined #ruby
rivalomega has joined #ruby
eljimmy has joined #ruby
simmaniac has joined #ruby
sysvalve has quit [Ping timeout: 240 seconds]
hahuang65 has quit [Ping timeout: 246 seconds]
harfangk has quit [Quit: Textual IRC Client: www.textualapp.com]
<plujon> To answer my own question: rbtrace -p PID -e '...' is the easiest way to get a heap dump of a running ruby process.
P-NuT has left #ruby ["Leaving"]
kruppm has joined #ruby
itachi has joined #ruby
hutch34 has quit [Quit: WeeChat 1.5]
DTZUZU has quit [Quit: WeeChat 1.5]
raspado has joined #ruby
itachi has left #ruby [#ruby]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
troys is now known as troys_
kaspergr1bbe is now known as kaspergrubbe
sexycode has quit [Ping timeout: 255 seconds]
Mon_Ouie has quit [Quit: WeeChat 1.7.1]
Cohedrin_ has quit [Read error: Connection reset by peer]
nacsurte has joined #ruby
Dimik has joined #ruby
ascarter has joined #ruby
hahuang65 has joined #ruby
simmaniac has quit [Read error: Connection reset by peer]
Silthias1 has joined #ruby
muelleme_ has quit [Ping timeout: 240 seconds]
Cohedrin_ has joined #ruby
Silthias has quit [Ping timeout: 255 seconds]
montanonic has joined #ruby
ascarter has quit [Ping timeout: 240 seconds]
GodFather has quit [Ping timeout: 240 seconds]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
wiki-ruby-1 has quit [Quit: Ex-Chat]
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
wiki-ruby-1 has joined #ruby
enterprisey has joined #ruby
hahuang65 has quit [Quit: WeeChat 1.9]
hahuang65 has joined #ruby
brent__ has quit [Remote host closed the connection]
ALoneNoMad has left #ruby [#ruby]
cadillac_ has joined #ruby
cadillac_ is now known as Guest34218
enterprisey has quit [Remote host closed the connection]
nobitanobi has joined #ruby
graft has quit [Ping timeout: 240 seconds]
Guest34218 has quit [Quit: I quit]
nobitanobi has quit [Ping timeout: 240 seconds]
graft has joined #ruby
graft has joined #ruby
graft has quit [Changing host]
Cohedrin_ has quit [Read error: Connection reset by peer]
cadillac__ has joined #ruby
Cohedrin_ has joined #ruby
cadillac__ is now known as Guest62023
synthroid has quit []
Guest62023 has quit [Client Quit]
kanye_vest has quit [Quit: Leaving]
cadillac_ has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
biberu has quit []
<cjohnson> Does implied return work inside if?
eljimmy has quit [Quit: This computer has gone to sleep]
<adam12> cjohnson: Kinda? The last value of the if statement is the value.
<cjohnson> Yeah that's what I mean
<adam12> Yeah :)
<cjohnson> so if I have def foo; if bar; something; end; end
<cjohnson> something is returned from foo
<adam12> Yep.
<cjohnson> perfect
<cjohnson> well, not perfect, that means the problem is not what I hoped :(
<cjohnson> lol
<adam12> Paste the method. Maybe it's something obvious.
jphase has quit [Remote host closed the connection]
jgpawletko has joined #ruby
jphase has joined #ruby
mikkel- has joined #ruby
mikkel- is now known as mjuhl
Cohedrin_ has quit [Read error: Connection reset by peer]
brent__ has joined #ruby
brent__ has quit [Remote host closed the connection]
brent__ has joined #ruby
Cohedrin_ has joined #ruby
ineb has joined #ruby
jphase has quit [Ping timeout: 246 seconds]
Cohedrin_ has quit [Read error: Connection reset by peer]
Fernando-Basso has quit [Quit: WeeChat 1.8]
<cjohnson> Added a comment with the error I'm getting
<cjohnson> It only happens for that context
<cjohnson> I added a binding.pry inside the validate method and it seems to run through how I'm expecting
Cohedrin_ has joined #ruby
<cjohnson> I guess this is more of a rails question
<cjohnson> I thought it had to do with how I wrote my validate method
Bock has joined #ruby
Bock has quit [Max SendQ exceeded]
perniciouscaffei has joined #ruby
ldnunes has quit [Quit: Leaving]
Bock has joined #ruby
jgpawletko has quit [Quit: jgpawletko]
meshsmith has joined #ruby
meshsmith has joined #ruby
meshsmith has quit [Changing host]
GinoMan2440 has quit [Ping timeout: 240 seconds]
jackjackdripper has quit [Quit: Leaving.]
ta_ has quit [Ping timeout: 240 seconds]
im314ous has joined #ruby
ltem has quit [Quit: Leaving]
urux has joined #ruby
GodFather has joined #ruby
jackjackdripper has joined #ruby
<cjohnson> Nevermind I'm an idiot
<cjohnson> in that context I needed to switch the subject
ta_ has joined #ruby
<baweaver> what madness did you subject yourself to?
<cjohnson> So iow I just needed to split that case into its own describe
<cjohnson> all fixed and tests passing
<cjohnson> above gist baweaver
<baweaver> Oh I saw
<baweaver> just wanted the pun
<baweaver> carry on
<ineb> umm what would be the ruby equivalent of the following php line: echo pack( "H*", 'deadbeef'); deadbeef is hex as in 0xdeadbeef
<baweaver> &ri String#pack
<`derpy> No results
<baweaver> &ri Array#pack
ur5us has joined #ruby
<ineb> i do know Array#pack but i have a string 'deadbeef' here
theunraveler has quit []
<baweaver> Hrm.
<baweaver> >> 'deadbeef'.to_i(16).to_s
<cjohnson> BAWEAVER DAMN YOU
<ruby[bot]> baweaver: # => "3735928559" (https://eval.in/822743)
<baweaver> cjohnson XD
<cjohnson> you're too good for me
<baweaver> >> 'deadbeef'.to_i(16).to_s(16)
<ruby[bot]> baweaver: # => "deadbeef" (https://eval.in/822744)
lightstalker has quit [Ping timeout: 240 seconds]
<ineb> echo pack( "H*", 'deadbeef'); in php does return ¾ï
<baweaver> Array it is. Odd.
<ineb> iam not even sure what representation that is, but i need it aswell
mim1k has joined #ruby
dropsh0t has quit [Quit: Leaving]
troulouliou_div2 has joined #ruby
<baweaver> >>["deadbeef"].pack('H*')
<ruby[bot]> baweaver: # => "\xDE\xAD\xBE\xEF" (https://eval.in/822745)
lightstalker has joined #ruby
Bock has quit [Ping timeout: 240 seconds]
Bock has joined #ruby
Bock has quit [Max SendQ exceeded]
[Butch] has quit [Quit: I'm out . . .]
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
mim1k has quit [Ping timeout: 268 seconds]
TomyLobo has quit [Ping timeout: 246 seconds]
<ineb> baweaver: yes, this is it. thanks
GodFather has quit [Ping timeout: 240 seconds]
alex`` has quit [Quit: WeeChat 1.8]
ozcanesen has joined #ruby
sepp2k has quit [Read error: Connection reset by peer]
sepp2k has joined #ruby
Bock has joined #ruby
haylon has quit [Remote host closed the connection]
jenrzzz has quit [Ping timeout: 240 seconds]
nchambers is now known as telnet
troulouliou_div2 has quit [Quit: Leaving]
lxsameer has joined #ruby
Dimik has quit [Ping timeout: 260 seconds]
my123 has quit [Ping timeout: 240 seconds]
blackwind_123 has quit [Ping timeout: 240 seconds]
marxarelli is now known as marxarelli|afk
telnet is now known as nchambers
blackwind_123 has joined #ruby
ResidentBiscuit has quit [Quit: Critical Miss]
my123 has joined #ruby
my123 has joined #ruby
ahrs has quit [Remote host closed the connection]
ahrs has joined #ruby
psychicist__ has quit [Ping timeout: 240 seconds]
chimkan has quit [Quit: chimkan]
al2o3-cr_ is now known as al2o3-cr
mikecmpbll has quit [Quit: inabit. zz.]
rivalomega has quit [Remote host closed the connection]
ascarter has joined #ruby
roshanavand has quit [Ping timeout: 240 seconds]
rivalomega has joined #ruby
rivalomega has quit [Remote host closed the connection]
hkdsun has joined #ruby
rivalomega has joined #ruby
ascarter has quit [Ping timeout: 240 seconds]
tau has joined #ruby
centrx has joined #ruby
centrx has joined #ruby
centrx has quit [Changing host]
mim1k has joined #ruby
troys_ is now known as troys
chouhoulis has quit [Ping timeout: 260 seconds]
gusrub_ has joined #ruby
jnollette has quit [Ping timeout: 260 seconds]
gusrub has quit [Ping timeout: 246 seconds]
<graft> hey, is there an equivalent for String#strip where i can pass in a char?
<graft> e.g. my_string.strip('_') to remove leading and trailing _ ?
<graft> or am i stuck doing sub(/^_/,'').sub(/_$/,'')
<elomatreb> String#tr is faster for simple character substitutions, but yeah
<graft> tr would sub intermediate _s, wouldn't it?
<havenwood> graft: use \A instead of ^ unless you really mean beginning of each line
<elomatreb> Oh, right, nvm
Rodya_ has quit [Remote host closed the connection]
<graft> havenwood: doesn't matter in this case, but sure
<baweaver> &ri String#sub
<havenwood> graft: If you don't want to remove from each line don't check each line.
<graft> havenwood: i don't have lines here, it's not an issue
<havenwood> graft: My point is the regexp doesn't know what you know. It has to look and see if there are.
<havenwood> Fraeon: Use \A explicitly.
<havenwood> Fraeon: Sorry, MT.
<baweaver> capture groups, match block
Rodya_ has joined #ruby
<elomatreb> Also, if it's user input sneaky newlines can mess things up
<elomatreb> You can use that for XSS in some Ruby applications
<havenwood> [/[^_]+/]
<havenwood> Anchored, of course would be better.
jnollette has joined #ruby
enterprisey has joined #ruby
<baweaver> &ri String#lstrip
<baweaver> &ri String#rstrip
<baweaver> Those two.
urux has quit [Remote host closed the connection]
<matthewd> baweaver: How do those help? :/
<havenwood> Ruby 2.5 will have String#delete_suffix and String#delete_prefix.
<havenwood> I guess suffix isn't approved yet.
marxarelli|afk is now known as marxarelli
<elomatreb> Why add new methods instead of giving strip an optional argument?
<graft> seems like it would be better to just add an ar... yeah
<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."
<havenwood> elomatreb: So Matz chose a different name.
<elomatreb> I guess that makes some sense (not a Python programmer)
<elomatreb> delete_suffix/prefix just seems like a very clunky name
<havenwood> There's still time for a better name.
<graft> decreasing confusion with python seems like a lower priority to me than having a simpler interface
<graft> especially given the diverse behavior of other languages
besfort has joined #ruby
<graft> "python did it wrong first" is not a reasonable method for defining ruby language
Jayson_Virissimo has joined #ruby
cam27 has quit [Quit: cam27]
montanonic has quit [Remote host closed the connection]
jhack has joined #ruby
jhack has joined #ruby
jhack has quit [Changing host]
jhack has quit [Remote host closed the connection]
<havenwood> Currently the nightly only deletes one character as well.
impi0us has joined #ruby
<havenwood> '__dunder__'.delete_prefix('_') #=> "_dunder__"
KillerFox has quit [Ping timeout: 258 seconds]
antgel has quit [Ping timeout: 260 seconds]
tgragnato has quit [Quit: Sto andando via]
lxsameer has quit [Quit: WeeChat 1.8]
<havenwood> Unlike Elixir's String#trip_leading/2: "__dunder__" |> String.trim_leading("_") #=> "dunder_
<havenwood> graft: It's really a different thing than #lstrip though.
wiki-ruby-1 has quit [Quit: Ex-Chat]
<havenwood> graft: #trim_leading is like lstrip with argument
<zenspider> havenwood: I would hope that delete_prefix deletes any leading matching string, not a repeated char
<zenspider> "abcdef".delete_prefix "abc" => "def"
<zenspider> I find String#delete to be absolutely useless.
<zenspider> (and usually want it for a prefix/suffix)
tau has quit [Remote host closed the connection]
alex`` has joined #ruby
<mydog2> hey.. is this where the ruby guys hang out!
<elomatreb> Not just guys
<mydog2> there's a kickstarter "clone" in github.. from lockitron
<mydog2> hey elomatreb -- ok.. guys/gals/and anyone else i missed!
<mydog2> looking for someone that might want a project for $$
<mydog2> i'm not a ruby/rails guy
<mydog2> figured there might be someone here..
patarr has quit [Ping timeout: 255 seconds]
ozcanesen has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
impi0us has left #ruby [#ruby]
cdg has joined #ruby
besforto has joined #ruby
br0d1n has joined #ruby
<Radar> mydog2: what kind of project?
cdg_ has quit [Ping timeout: 240 seconds]
besfort has quit [Ping timeout: 240 seconds]
cdg has quit [Ping timeout: 260 seconds]
jphase has joined #ruby
besforto has quit [Quit: Leaving]
gusrub_ has quit [Remote host closed the connection]
gusrub has joined #ruby
dviola has quit [Quit: WeeChat 1.8]
diego1 has joined #ruby
diego1 has quit [Changing host]
diego1 has joined #ruby
diego1 is now known as dviola
cam27 has joined #ruby
alex`` has quit [Ping timeout: 240 seconds]
gusrub has quit [Remote host closed the connection]
centrx has quit [Remote host closed the connection]
gusrub has joined #ruby
ozcanesen has joined #ruby
perniciouscaffei has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<havenwood> zenspider: good point
KillerFox has joined #ruby
cseder has joined #ruby
rivalomega has quit []
DLSteve has joined #ruby