havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.7.1, 2.6.6, 2.5.8: https://www.ruby-lang.org | Paste 4+ lines of text to https://dpaste.de/ and select Ruby as the language | Rails questions? Ask in #RubyOnRails | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby | Can't talk? Register/identify with Nickserv first!
rmnull has joined #ruby
codefriar has joined #ruby
troulouliou_div2 has quit [Ping timeout: 264 seconds]
ur5us has joined #ruby
troulouliou_div2 has joined #ruby
<desnudopenguino> success, thanks havenwood
Swyper has joined #ruby
<Swyper> hi1
akem has quit [Quit: Leaving]
<Swyper> halp pls =D
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<adam12> Swyper: If you use a Gemfile, your dependencies must be in it. I don't see sqlite3 listed.
<Swyper> ahh I see
NODE has quit []
<adam12> Swyper: I'm not sure if this was always true but lately I've noticed it more. `bundle exec` or `bundler/setup` will manipulate $LOAD_PATH and I'm not sure the default gem path will be there.
Benett has quit [Remote host closed the connection]
<Swyper> adding sqlite3 and singleton to my Gemfile fixed that error
<Swyper> thank you adam12
cd has joined #ruby
<adam12> Swyper: Probably remove singleton. It's built into Ruby.
Benett has joined #ruby
<Swyper> sweet
TCZ has quit [Quit: Leaving]
Esa__ has quit []
davispuh has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
d3bug has joined #ruby
plutes has quit [Quit: See ya around!]
chalkmonster has quit [Quit: WeeChat 2.8]
imode has quit [Ping timeout: 265 seconds]
dinfuehr has quit [Ping timeout: 256 seconds]
dinfuehr has joined #ruby
codefriar has quit [Quit: Textual IRC Client: www.textualapp.com]
alfiemax has joined #ruby
deimos_ has quit [Remote host closed the connection]
axe has joined #ruby
gitter1234 has quit [Quit: Connection closed for inactivity]
deimos_ has joined #ruby
jingjinghack has joined #ruby
deimos_ has quit [Quit: leaving]
deimos_ has joined #ruby
Benett has quit [Remote host closed the connection]
Benett has joined #ruby
DTZUZU has joined #ruby
DTZUZU2 has quit [Ping timeout: 250 seconds]
siery has joined #ruby
cthulchu_ has quit [Ping timeout: 264 seconds]
ur5us has quit [Remote host closed the connection]
ur5us has joined #ruby
<siery> Hey, how do I make a word optional in a regular expression? I thought /\w?/ will work, but it reads only a single character
alfiemax has quit [Ping timeout: 264 seconds]
<mozzarella> /\w+/
_whitelogger has joined #ruby
Tempesta has quit [Quit: See ya!]
rmnull has quit [Quit: WeeChat 2.8]
<siery> @mozzarella: then it is not optional
axe has quit [Ping timeout: 265 seconds]
<siery> I used `(expr)(\w+)?` in stead, but it looks like a overkill with the array it produces
polishdub has joined #ruby
polishdub has quit [Client Quit]
advorak has quit [Quit: Leaving]
cliluw has quit [Ping timeout: 260 seconds]
sergioro has quit [Quit: leaving]
sergioro has joined #ruby
Tempesta has joined #ruby
sauvin has joined #ruby
alfiemax has joined #ruby
Swyper has quit [Read error: Connection reset by peer]
sergioro has quit [Quit: leaving]
sergioro has joined #ruby
dinfuehr has quit [Ping timeout: 256 seconds]
dinfuehr has joined #ruby
ChmEarl has quit [Quit: Leaving]
<tankf33der> morning
<tankf33der> http://ix.io/2i76
<tankf33der> i can easily repeat this when my laptop without connection to power supply :)
alfiemax has quit [Remote host closed the connection]
rmnull has joined #ruby
alfiemax has joined #ruby
ur5us has quit [Ping timeout: 256 seconds]
alfiemax has quit [Ping timeout: 250 seconds]
zacts has quit [Quit: WeeChat 2.7.1]
ellcs has joined #ruby
markopasha has joined #ruby
markopasha has quit [Max SendQ exceeded]
markopasha has joined #ruby
donofrio has quit [Remote host closed the connection]
ur5us has joined #ruby
helpa has quit [Remote host closed the connection]
ellcs has quit [Ping timeout: 252 seconds]
fercell has joined #ruby
helpa has joined #ruby
chalkmonster has joined #ruby
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
jingjinghack has quit [Ping timeout: 256 seconds]
jingjinghack has joined #ruby
SeepingN has quit [Quit: The system is going down for reboot NOW!]
chalkmonster has quit [Quit: WeeChat 2.8]
rmnull has quit [Quit: WeeChat 2.8]
postmodern has quit [Quit: Leaving]
rmnull has joined #ruby
schne1der has joined #ruby
nofxx_ has joined #ruby
tdy has joined #ruby
nofxx__ has quit [Ping timeout: 264 seconds]
rmnull has quit [Quit: WeeChat 2.8]
d3bug has quit [Quit: Connection closed for inactivity]
xco has joined #ruby
sergioro has quit [Quit: leaving]
akem has joined #ruby
akem has quit [Max SendQ exceeded]
akem has joined #ruby
al2o3-cr has quit [Quit: WeeChat 2.8]
dionysus69 has joined #ruby
al2o3-cr has joined #ruby
<siery> morning, can someone tell me why the `each` loop turns out destructive in this example? The second `puts "STATUS:\#{Prog.get_file_log}"` returns an empty array..
<jhass> given Prog is not a standard type, no we cannot
<jhass> also I suppose load is not Kernel#load in that context
<jhass> btw to the earlier question, \w* or \w? ought to do it, * is zero or more, ? is one or none
gix has joined #ruby
<siery> @jhass it is
<jhass> anyhow there's not enough context
<siery> @jhass: get_file_log simply gets an array from `@@file_log = FileLog.new` object, like this
<siery> def self.get_file_log n = nil
<siery> n.is_a?(Integer) ? @@file_log.log[n] : @@file_log.log
<siery> endy
<jhass> FileLog too isn't a standard type
<siery> @jhass: Here is FileLog definition: https://paste.debian.net/1140507/
<jhass> and if you say load is indeed Kernel#load, whatever files tmp_file points at might do god knows what
<siery> yep
<jhass> maybe one of them does @@file_log.log.clear? 🤷‍♀️
<jhass> maybe one of them reassigns @@file_log to a new FileLog?
<siery> Ya man.. hard morning, ty c:
Emmanuel_Chanel has quit [Ping timeout: 264 seconds]
rainer_tm has quit [Read error: Connection reset by peer]
rainer_t1 has joined #ruby
madhatter has quit [Ping timeout: 258 seconds]
ablackack has quit [Ping timeout: 258 seconds]
madhatter has joined #ruby
ablackack has joined #ruby
Emmanuel_Chanel has joined #ruby
markopasha has quit [Ping timeout: 265 seconds]
markopasha has joined #ruby
markopasha has quit [Max SendQ exceeded]
markopasha has joined #ruby
ur5us has quit [Ping timeout: 252 seconds]
alfiemax has joined #ruby
ur5us has joined #ruby
alfiemax has quit [Ping timeout: 258 seconds]
vondruch_ has joined #ruby
vondruch has quit [Ping timeout: 256 seconds]
vondruch_ is now known as vondruch
Ai9zO5AP has quit [Quit: WeeChat 2.7.1]
akem has quit [Quit: Leaving]
akem has joined #ruby
akem has quit [Max SendQ exceeded]
akem has joined #ruby
Mikaela has joined #ruby
oneeggeach has joined #ruby
troulouliou_dev has joined #ruby
oneeggeach has quit [Client Quit]
Emmanuel_Chanel has quit [Quit: Leaving]
jeromelanteri has quit [Quit: Leaving]
Emmanuel_Chanel has joined #ruby
Ai9zO5AP has joined #ruby
ur5us has quit [Ping timeout: 240 seconds]
ryzokuken has quit [Excess Flood]
ryzokuken has joined #ruby
ryzokuken has quit [Max SendQ exceeded]
ryzokuken has joined #ruby
ldepandis has joined #ruby
vondruch has quit [Remote host closed the connection]
sirecote has quit [Ping timeout: 258 seconds]
c0san0stra has quit [Ping timeout: 258 seconds]
MuffinPimp has quit [Quit: Goodbye.]
lypsis has quit [Quit: ZNC - https://znc.in]
darris has quit [Quit: Bye bye!]
MuffinPimp_ has joined #ruby
camilasan has quit [Remote host closed the connection]
lypsis has joined #ruby
MuffinPimp_ is now known as MuffinPimp
Technodrome has quit [Ping timeout: 258 seconds]
darris has joined #ruby
camilasan has joined #ruby
sirecote has joined #ruby
c0san0stra has joined #ruby
vondruch has joined #ruby
markopasha has quit [Remote host closed the connection]
markopasha has joined #ruby
markopasha has quit [Max SendQ exceeded]
markopasha has joined #ruby
markopasha has quit [Max SendQ exceeded]
caterfxo has joined #ruby
burningserenity has joined #ruby
gitter1234 has joined #ruby
conta has joined #ruby
ellcs has joined #ruby
burningserenity has quit [Ping timeout: 256 seconds]
Mikaela has quit [Quit: Mikaela]
burningserenity has joined #ruby
TCZ has joined #ruby
TCZ has left #ruby [#ruby]
burningserenity has quit [Ping timeout: 252 seconds]
<al2o3-cr> &>> def foo=(arg) fail("failed.") unless arg.is_a?(String) end; foo = 42
<rubydoc> # => 42 (https://carc.in/#/r/8w8d)
<al2o3-cr> &>> def foo=(arg) fail("failed.") unless arg.is_a?(String) end; send(:foo=, 42)
<rubydoc> stderr: -e:4:in `foo=': failed. (RuntimeError)... check link for more (https://carc.in/#/r/8w8e)
kristofferR has joined #ruby
<al2o3-cr> why does the former not raise?
burningserenity has joined #ruby
<jhass> because it assigns a local variable
<jhass> the method is never called
<al2o3-cr> jhass: oh, of course.
<al2o3-cr> cheers jhass.
<al2o3-cr> i was missing self.
<jhass> :)
Swyper has joined #ruby
ellcs has quit [Ping timeout: 252 seconds]
Swyper has quit [Remote host closed the connection]
jingjing1 has joined #ruby
jingjinghack has quit [Ping timeout: 240 seconds]
burningserenity has quit [Ping timeout: 240 seconds]
kristofferR has quit [Quit: Textual IRC Client: www.textualapp.com]
roadie has quit [Ping timeout: 256 seconds]
burningserenity has joined #ruby
burningserenity has quit [Ping timeout: 272 seconds]
openstruct has joined #ruby
burningserenity has joined #ruby
openstruct has quit [Client Quit]
conta has quit [Quit: conta]
fercell has quit [Quit: WeeChat 2.8]
donofrio has joined #ruby
jingjing1 has quit [Quit: WeeChat 2.1]
Bounga has joined #ruby
roadie has joined #ruby
burningserenity has quit [Ping timeout: 252 seconds]
conta has joined #ruby
vlouvet has quit [Read error: Connection reset by peer]
burningserenity has joined #ruby
conta has quit [Quit: conta]
burningserenity has quit [Ping timeout: 258 seconds]
d3bug has joined #ruby
zacts has joined #ruby
rippa has joined #ruby
akem has quit [Quit: Leaving]
old_relik has joined #ruby
<old_relik> I have a query like this
<old_relik> sorry, wrong channel
leitz has joined #ruby
akem has joined #ruby
burningserenity has joined #ruby
old_relik has left #ruby [#ruby]
ellcs has joined #ruby
TCZ has joined #ruby
cthulchu_ has joined #ruby
cthulchu_ has quit [Read error: Connection reset by peer]
sergioro has joined #ruby
Ai9zO5AP has quit [Remote host closed the connection]
Ai9zO5AP has joined #ruby
TCZ has quit [Quit: Leaving]
TCZ has joined #ruby
TCZ has quit [Client Quit]
john2496 has joined #ruby
john2496 has quit [Client Quit]
john2496 has joined #ruby
john2496 has quit [Client Quit]
reber_ has joined #ruby
tankf33der has left #ruby [#ruby]
ChmEarl has joined #ruby
gitter1234 has quit [Quit: Connection closed for inactivity]
dinfuehr has quit [Ping timeout: 240 seconds]
dinfuehr has joined #ruby
Mikaela has joined #ruby
alfiemax has joined #ruby
alfiemax has quit [Read error: Connection reset by peer]
burningserenity has quit [Quit: Leaving.]
zacts has quit [Ping timeout: 258 seconds]
zacts has joined #ruby
roadie has quit [Remote host closed the connection]
roadie has joined #ruby
schne1der has quit [Ping timeout: 240 seconds]
Bounga has quit [Ping timeout: 258 seconds]
nebiros has joined #ruby
davor_ has joined #ruby
davor has quit [Read error: Connection reset by peer]
davor_ is now known as davor
howdoi has joined #ruby
<leitz> How is everyone holding up?
<apotheon> pretty well
chalkmonster has joined #ruby
<apotheon> listening to Front Line Assembly in honor of 2020 being the Year of Cyberpunk
<apotheon> working
<leitz> Working is good.
mikecmpbll has joined #ruby
cliluw has joined #ruby
cliluw has quit [Ping timeout: 240 seconds]
cliluw has joined #ruby
schne1der has joined #ruby
gigetoo has quit [Ping timeout: 240 seconds]
gigetoo has joined #ruby
sauvin has quit [Read error: Connection reset by peer]
vondruch has quit [Ping timeout: 250 seconds]
<xco> leitz most of the introverts in us are doing perfectly fine
<apotheon> indeed
<xco> hopefully you are too
<xco> like me and apotheon, we don't feel heavily/directly affected
<havenwood> us hermits are good too 👍🏽
<xco> hahaha i was about to mention havenwood too :D
<xco> he replied himself
<apotheon> I'm a hermitous introvert! Whee!
<apotheon> The introverted will inherit the earth, or something.
DTZUZU has quit [Read error: Connection reset by peer]
DTZUZU has joined #ruby
<havenwood> apotheon: I'm an unfortunate hermitic extrovert.
akem_ has joined #ruby
akem_ has quit [Max SendQ exceeded]
<havenwood> I don't believe in vertism.
bodgix has joined #ruby
<havenwood> Endless right assignment. The features merge. https://github.com/ruby/ruby/commit/67bcac879a2e0ddfb4e7bbd7cb5e5401422de76a
<havenwood> private def obj.inc(x) = x + 1 => @x
akem has quit [Ping timeout: 256 seconds]
<leitz> I was having a pretty good "work anger session" these past couple of days. I was hired for my experience, and then my experience is ignored for pretty much everything.
<leitz> Talked (via FB chat) to a friend of mine yesterday afternoon. His family suffered an unthinkable loss last year, and the isolation has kept them in the house where the loss occured.
<leitz> Today is the anniversary.
<leitz> I guess my life isn't so bad, after all.
<xco> damn
<xco> hard times
<xco> it'll help if you shift focus to things you can control directly though
<apotheon> havenwood: If by "vertism" you mean the classification as introvert or extravert, it's about as valid as biological taxonomy and nationality, I suppose -- just a convenient way to group things together to think about them for specific purposes, often abused and misapplied.
<apotheon> leitz: Sorry to hear it. That's rough.
<apotheon> (all of it, including the experience thing)
<apotheon> "first-world problems", as they say, but . . .
<apotheon> still problems
<havenwood> apotheon: Yeah, I'm skeptical about the {in,ex}trovertism classifications, but muddy things are muddy.
zapata has quit [Read error: Connection reset by peer]
zapata has joined #ruby
<apotheon> There are times it's a useful abstraction, such as when I'm working on figuring out communication problems.
<apotheon> . . . kinda like how MVC is a useful abstraction sometimes, but useless for a simple console based countdown timer utility I wrote in C last night.
akem has joined #ruby
akem has quit [Max SendQ exceeded]
akem has joined #ruby
<havenwood> apotheon: How I feel personally, in Ruby 3 terms: module Vertism; COIN = %w[in ex]; def COIN.flip = COIN.sample; module_function def whatami = COIN.flip end; puts Vertism.whatami + 'trovert'
<apotheon> har
<havenwood> I feel bad for not freezing my constant and I should use alias.
* havenwood tries to resist refactoring joke code.
kinduff has quit [Read error: Connection reset by peer]
<apotheon> Write a whole new, cool, generally useful utility program instead.
kinduff has joined #ruby
<havenwood> apotheon: I have one of those open in my editor, but it's inexplicably blowing up with a syntax error inside a module_eval.
<havenwood> SyntaxError ((eval):1: syntax error, unexpected end-of-input)
<leitz> havenwood, it's an end-of-inputvert.
<leitz> I'm actually pretty convinced on the intro/extro vert thing, it's how the energy transfer goes.
<apotheon> I think part of the problem people have with the introvert/extravert thing is of course the fact that people are more complex than that, and we're kind mashing square pegs into round holes, but another part of it is that the usual definition is overly simplistic.
<apotheon> It's not so much that extraverts are energized by being around people and introverts are drained by it, though there's some heuristic tendency along those lines.
<leitz> Seems like it works, for me.
<apotheon> I think it's more that extraverts are energized by the social aspects of interaction, and introverts are energized by the examination of ideas that fit their interests.
<leitz> I assume there's a lot more to it. However, when talking, we tend to be general.
<leitz> I'm seriously drained by social interaction.
<apotheon> That's why, for instance, people think I'm an extravert when I'm having an interesting discussion about programming languages, but think I'm an introvert when I get frustrated that people always seem inclined to interpret everything I say through the lens of a bad acid trip.
<leitz> The more cues there are, the more trained i feel.
<apotheon> When I can just focus on the *idea*, and explore it with someone, I'm fine. When I have to observe cultural traditions of mutual validation for half an hour, it kills my ability to function.
anujmore has joined #ruby
<leitz> Hmm...interesting point. Discussing topics of interest might bypass the normal attention to social convention.
<apotheon> Intellectual extraverts, by that theory of operation, can use social interactions as a way to develop innovative technical solutions for problems in their areas of expertise with great facility, while non-intellectual and non-introspective introverts might be able to babble for hours about a favorite pop music star but collapse under socialization pressure when the mentioned introvert brings up
<apotheon> the reason they were supposed to have a discussion in the first place.
<apotheon> I find that evident introverts can often trace problems with social interaction back to a difficulty dealing with the heuristic, indefinable protocols of extraverted communication norms.
<apotheon> . . . or "the secret language of extraverts", as I sometimes call it.
<apotheon> (not actually secret, just specified in ever-shifting protocols)
<leitz> I guess the question that comes to mind is, "nature or nurture"? Is introversion just a step on the autism (or whatever) spectrum?
<apotheon> One of the key advantages of humans over most other species on earth is superior pattern-matching facility, but (broadly speaking) there seems to be a couple of major approaches to it that could be described as intro- or extraverted: pattern recognition (extraverted) and pattern discerning (introverted).
mikecmpb_ has joined #ruby
<leitz> I assume extraverts can think as deeply as introverts seem to.
mikecmpbll has quit [Read error: No route to host]
<apotheon> I think brain structure probably has something to do with it, but to some degree brain structure is affected by both "nurture" and "nature", so . . . there's that.
<leitz> rue.
<leitz> True.
<apotheon> It's all very fuzzy around the edges. The concept of "human" is actually a complex system with emergent properties that we label for the sake of convenience.
Bounga has joined #ruby
<leitz> I'm not sure those properties are emergent, as much as there's little we truly understand, and culture is a diverse influencer.
<apotheon> There's nothing that says, to me, extraverts and introverts are any more or less intelligent overall, but in which side one might find oneself there will tend to be strong proclivities toward applying that intelligence differently, and as such I think there's a stereotypical assumptionthat someone showing introverted tendencies is "more intelligent" just because of a leaning toward outwardly
<apotheon> "nerdy" pursuits.
miskatonic has joined #ruby
mikecmpbll has joined #ruby
<leitz> True. Which is cool, when extraverts with intelligence apply it to bringing diverse groups together. I've found that fascinating to observe, even though I have little talent in it.
mikecmpb_ has quit [Ping timeout: 264 seconds]
<apotheon> I'm curious about how trending chemical arrangements and interactions in myriad multi-relationship co-dependency ultimately giving rise to something like a personality trait (ignoring for the moment the ghost in the machine) isn't describable as emergence.
naught-fowl has joined #ruby
<leitz> Is emergence even a thing, in human behavior? Yes, people will have new thought processes based on getting through this pandemic, but it will likely be similar to how an earlier generation had their habits changed during the depression.
<apotheon> Both will likely have paved the way for a significant increase in authoritarian control by the time this is over.
<leitz> If something transformative comes around, and is signficantly different than anything ever before, then maybe it's emergent. Otherwise, it just seems like an aspect that was already there, but unused.
troulouliou_div2 has quit [Quit: Leaving]
<apotheon> erm
<leitz> Yeah, can recall a lot of laws being taken OFF the books...
<apotheon> I think you're using a different definition of "emergent" than me.
<leitz> apotheon, quite likely.
<leitz> I looked it up on wikipedia, so it's fresh in my mind.
<leitz> Not necessarily correct, but fresh. :)
<apotheon> "emergence occurs when an entity is observed to have properties its parts do not have on their own"
<apotheon> pretty rough, but roughly useful
<apotheon> A thing doesn't have to be *new*, just not a quality of the parts that, taken together, give rise to it.
<apotheon> In other words, a property emerges from the interactions between parts of the whole, rather than being inherent in the parts.
<apotheon> . . . like bugs that wouldn't exist in a piece of software that didn't need to do *both* of the things that, together, interact in a buggy way.
<leitz> My thought is that much of human behavior has already emerged, at some point in the past. New software is new, human behavior is boringly the same.
en10n has joined #ruby
banisterfiend has joined #ruby
<apotheon> Yeah, you're still not thinking of the same thing as me.
<banisterfiend> anyone have a regular expression for parsing ipv4 subnets?
<banisterfiend> including short-hand syntax, like 192.168/16
<apotheon> alas, no, not off the top of my head
<leitz> Oh good grief, who does actual computer stuff here?!?!
<apotheon> I wrote C last night.
<leitz> banisterfiend, there's a gem somewhere, I used it some time back.
<banisterfiend> apotheon: cool what did you write, i mainly do C++/C these days too
<banisterfiend> leitz: nice, any idea what it's called?
alfiemax has joined #ruby
<apotheon> banisterfiend: I wrote a console-based countdown timer, just for fun.
<leitz> banisterfiend, maybe this one: ipaddress https://github.com/ipaddress-gem/ipaddress
<apotheon> Yesterday, someone said something like "Do you know a command line countdown timer, preferably with a beep at the end, that I could use?"
<leitz> banisterfiend, a former co-worker felt a 1,000+ character regex beat using modular code. :(
<apotheon> No, I did not, but I briefly described off the top of my head how I'd write it in C (in part because he said he didn't really want to use a shell script), then I went ahead and wrote it.
<leitz> Back in a bit.
<banisterfiend> leitz: doesn't work for me
<banisterfiend> that only supports 192.168.0.0/16 syntax
<banisterfiend> i need 192.168/16
<leitz> banisterfiend, most folks don't write 192.168/16 syntax. Is there a reason for doing so?
<banisterfiend> apotheon: i only use C when i hvae to :) Such as writing kernel extensions and device drivers
<apotheon> C programming is my favorite video game.
<banisterfiend> leitz: they do in the firewall world :)
miskatonic has quit [Quit: ERC (IRC client for Emacs 24.5.1)]
<banisterfiend> and it's for defining firewall rules
<leitz> banisterfiend, are they using CIDR?
<banisterfiend> leitz: of course, that's what this is homie
eindoofus has joined #ruby
<en10n> Hello. I'm trying to write a block that utilizes sort_by to reorder an array of currency values [2.04, 3.02, 4.03, 5.01].
<en10n> I'd like it to be ordered by the amount of cents (low to high). Running into a bit of a wall because the methods I had in mind weren't available for floats.
<eindoofus> does anyone know why the "API documentation" link is down in Capybara?: https://teamcapybara.github.io/capybara/
<eindoofus> saw that error last week as well when i last checked
<naught-fowl> oi oi banisterfiend
<banisterfiend> naught-fowl: hey what's up
<naught-fowl> trying to get fired so I can make more money on unemployment hbu
<eindoofus> looks like "https://rubydoc.info/" is down
<eindoofus> naught-fowl, i thought you can only claim if you're laid off or furloughed
<eindoofus> either way it doesn't seem like a good time to lose a job if you can hold onto one
<naught-fowl> I'm putting together a proposal for my boss to furlough me and let me work under the table for 50% that way I'll get 40% of my salary in unemployment plus the extra $600/wk
<anujmore> @en10n: x.sort_by { |m| m - m.floor } not good enough?
<naught-fowl> everybody wins
<banisterfiend> naught-fowl: i thought you wre a serious career oriented family man now ;)
<eindoofus> should i be concerned that rubydoc.info is down. it seems like an important site. beginning to learn ruby because of my job
vlouvet has joined #ruby
<en10n> anujmore: This is exactly what I was looking for. Thank you.
<banisterfiend> naught-fowl: congrats on the bb btw
fluxAeon has joined #ruby
<naught-fowl> banisterfiend: thanks, I don't recommend it at all
<banisterfiend> lol
<naught-fowl> when people talk about what a blessing kids are, they're fucking lying they're trying to make you as miserable as they are. I would never do that to someone
<banisterfiend> careful, this channel has publicly available logs and your kid might google your IRC nickname once they turn 18 ;)
<banisterfiend> naught-fowl: can you write me an ipv4 cidr regex
<banisterfiend> i'll adopt your kid
<eindoofus> naught-fowl, that's a bit shortsighted. every age range is different. i grew up without much of a family here in america so i'm biased
yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
yxhuvud has joined #ruby
<naught-fowl> banisterfiend \d+\.\d+\.\d+\.\d+(?:/\d+) ?
<banisterfiend> that would allow: 001.999.0912931239129312939123912931293/999999999999999999999999
<banisterfiend> well iwth an extra . field
<naught-fowl> I don't know how to do a range of numbers
<banisterfiend> regexes are not fun
Swyper has joined #ruby
<havenwood> &>> [2.04, 3.02, 4.03, 5.01].sort_by { _1.remainder 1 } # en10n
<rubydoc> # => [5.01, 3.02, 4.03, 2.04] (https://carc.in/#/r/8wbr)
<banisterfiend> that _1 syntax is horrible
<havenwood> &>> [2.04, 3.02, 4.03, 5.01].sort_by { _1 % 1 } # en10n
<rubydoc> # => [5.01, 3.02, 4.03, 2.04] (https://carc.in/#/r/8wbs)
<naught-fowl> banisterfiend: https://ihateregex.io/expr/ip just needs the /block
<banisterfiend> ruby has really jumped the shark
<havenwood> &>> [2.04, 3.02, 4.03, 5.01].sort_by { |n| n % 1 } # en10n
<rubydoc> # => [5.01, 3.02, 4.03, 2.04] (https://carc.in/#/r/8wbt)
<havenwood> banisterfiend: Have you seen endless range and righthand assignment?
<havenwood> banisterfiend: err, I mean endless method*
<banisterfiend> havenwood: what's righthand assignment?
<havenwood> banisterfiend: private def obj.inc(x) = x + 1 => @x
<havenwood> banisterfiend: That's ^ now valid syntax.
<banisterfiend> i don't undsan it
<banisterfiend> understand it
<naught-fowl> thats offensive
<havenwood> banisterfiend: The `=>` is righthand assignment. The `meth =` is endless method.
<havenwood> naught-fowl: 1 + 1 => two
<banisterfiend> ugh
<banisterfiend> thankgod i don't write ruby anymore
<banisterfiend> C++20 is shaping up to have a lot of the ruby conveniences i like, but without the revolting syntax
<banisterfiend> C++20*
<banisterfiend> naught-fowl: have you seen C++20 ranges?
<havenwood> I like entangling things by name rather than position, in general.
<havenwood> But I don't mind `_1` if it's going to be `n` or some other one-letter variable otherwise.
<banisterfiend> they should have just went with 'it'
<naught-fowl> banisterfiend: I'll probably never use that
<havenwood> banisterfiend: Probably.
<havenwood> banisterfiend: I argued for `itself`.
<banisterfiend> naught-fowl: one thing i hate about the STL is the lack of composability and the requirement of begin(x) and end(x), c++20 ranges fix all of that
<havenwood> this
<banisterfiend> havenwood: i thought 'itself' was already accepted as an identify method
<banisterfiend> identity*
<banisterfiend> 6.itself => 6
<havenwood> banisterfiend: Yeah, it is now.
<havenwood> banisterfiend: Some odd cases with it, like:
<havenwood> &>> -2 ** 2
<rubydoc> # => -4 (https://carc.in/#/r/8wbu)
<havenwood> &>> -2.itself ** 2
<rubydoc> # => 4 (https://carc.in/#/r/8wbv)
<havenwood> When a thing seems to not be itself...
<banisterfiend> -2 ** 2 should be 4 no?
<banisterfiend> or does ** bind more tightly than - ?
<naught-fowl> so -2 ** 2 is parsed as -(2**2)?
<havenwood> Yeah, ** binds tighter than unary -.
<banisterfiend> -2.itself ** 2 = 4 makes sense, IMO -2 ** 2 is the one that's weird
<naught-fowl> clearly operators were a mistake
<banisterfiend> naught-fowl: you mostly code in C++ at work?
<naught-fowl> no I do devops so I mostly write in ruby, python, groovy for jenkins, bash etc. I hardly ever write code for real. I guess we have a project in go too
<banisterfiend> naught-fowl: do you mess much with iproute2 and firewalling?
<banisterfiend> and ipv6 ?
<banisterfiend> iproute2 is just incredible
<naught-fowl> no, I don't go lower than whatever AWS offers
<Swyper> hi hi
<Swyper> halp pls :P
<banisterfiend> i play a lot with routing policies and cgroups
<banisterfiend> hopefully starting some BPF stuff soon too
kristian_on_linu has joined #ruby
<naught-fowl> Swyper: expect(Play.find_by_title('All My Sons').year).to eq(1947) ## here find_by_title is used as a class method of Play, but its defined as an instance method
troulouliou_dev has quit [Remote host closed the connection]
<Swyper> oo
<Swyper> hm
troulouliou_dev has joined #ruby
<naught-fowl> banisterfiend: glad I don't have to do futz with that stuff, I'm not a network engineer so its mostly over my head
<phaul> Swyper: you also created a subject that you are not using, that would be an instance the way it's created
<Swyper> so I should be using :list_of_plays.find_by_title('All My Sons').year ?
<phaul> lose the colon, it's not a symbol. list_of_plays.find_by...
<phaul> it's actully a method that subject defines by that name (that you give as a symbol)
ur5us has joined #ruby
reber_ has quit [Read error: Connection reset by peer]
Swyper has quit [Remote host closed the connection]
roadie has quit [Quit: ERC (IRC client for Emacs 25.3.50.1)]
Swyper has joined #ruby
<banisterfiend> naught-fowl: it's pretty fun, you can do some crazy stuff, like split tunneling
<Swyper> I randomly keep getting disconnected
leitz has quit [Quit: Leaving]
<Swyper> ArgumentError:
<Swyper> wrong number of arguments (given 0, expected 1)
<Swyper> hmm
dviola has joined #ruby
<Swyper> whats the simple way to define a class method?
<eindoofus> as a newb, is it wrong for me to be troubled by rubydoc.info being down? this seems like a critical site?
<Swyper> write def self.method name ... end ?
<eindoofus> grrr
<eindoofus> anyone!?
<eindoofus> i'm about to make a bot to spam this question all day
Xiti` is now known as Xiti
<Swyper> expect(Play.new.find_by_title('All My Sons').year).to eq(1947)
<Swyper> is this syntax wrong?
<Swyper> for an rspec test
<eindoofus> i'm transitioning from a patient/rational "well, maybe it's not important or no one knows attitude" to a "why the FUCK can't someone remotely answer my god damn question" attitude
<eindoofus> your g'damn doc site is down rubyists!
<eindoofus> or am i wrong? please explain. i'm new to this and never encountered such a black hole in another language
ellcs has quit [Ping timeout: 256 seconds]
<phaul> eindoofus: you asked the question at 21:40 and gone hostile and and impatient about it at 21:41.
<havenwood> eindoofus: Use docs.ruby-lang.org.
<eindoofus> i asked earlier in the day. i'm just surprised no one is bothered by this
<eindoofus> i need these docs: https://teamcapybara.github.io/capybara/
<eindoofus> this language doesn't exactly help with intellisense. docs are critical
<eindoofus> can i get them somewhere else?
zacts has quit [Quit: WeeChat 2.7.1]
<havenwood> eindoofus: Yes, of course.
<havenwood> eindoofus: Type `gem server` then navigate your browser to: http://localhost:8808/
<phaul> Swyper: syntax is fine. You need to decide if find_by_title is an instance method or a class method, and that is purely a design decision.
lightstalker has quit [Remote host closed the connection]
<Swyper> its a class method phaul, I updated it to be such (I think)
<havenwood> eindoofus: Looks like the GitHub readme is pretty nice: https://github.com/teamcapybara/capybara
naught-fowl has quit [Remote host closed the connection]
<phaul> Swyper: you call new on Play without arguments but initialize expects options
<havenwood> eindoofus: The site you linked isn't an official Ruby site and we don't provide support here. The reason I imagine nobody responded is that nobody here is affiliated with that site and can't help bring it back up.
<Swyper> phaul: so I guess the fix would be making a no argument constructor ?
<havenwood> eindoofus: Reach out to the maintainers.
<phaul> Swyper: or pass it the arguments when you call new
<Swyper> I don't have arguments to pass though
<havenwood> Swyper: options
Ven`` has joined #ruby
<Swyper> and logically we should be able to use the search_for method to search for an existing play without initiailizing a play itself, right ?
<Swyper> excuse my bad spelling xD
<phaul> If you want to call find_by_title on Play then just do Play.find_by_tite. not Play.new.find_by_tite
<Swyper> ahh
<havenwood> Swyper: You're right it doesn't make sense to instantiate at all in this case.
<Swyper> I changed that line to this: expect(Play.find_by_title('All My Sons').year).to eq(1947)
<Swyper> NoMethodError:
<Swyper> undefined method `find_by_title' for Play:Class
<phaul> then it's not a class method yet. Post your latest, as the gist versions are getting a bit confusing
<havenwood> Swyper: Look at your self.all class method as a reference.
<havenwood> Swyper: Consider: class << self
<Swyper> is updated
<havenwood> &>> class Play; p self end
<rubydoc> # => Play... check link for more (https://carc.in/#/r/8wbx)
<havenwood> Swyper: When you `def Play.all` you can call: Play.all
dhollinger has quit [Ping timeout: 265 seconds]
<Swyper> havenwood: I'm not exactly sure,what I'm doing is following an online bootcamp and this code was given to use
<Swyper> oh cool
<Swyper> that is the way I am calling it in plays_spec.rb now
<Swyper> and the method I defined it as def self.find_by_title(name)
<Swyper> which is why I am quite lost now
dhollinger has joined #ruby
<phaul> end is missing to close the class on this file https://github.com/RickArora/Postgres/blob/master/Plays-Playwrights%20ORM/plays.rb
<havenwood> Swyper: Since you have multiple `def self.` methods, it'd be common to use a `class << self` block to define them.
<Swyper> ah would it make any difference in how I could the methods then havenwood?
<havenwood> Swyper: Those are different ways of defining the same class methods.
Esa__ has joined #ruby
<Swyper> ah
<Swyper> phaul: I added an end at the end, thank you
<Swyper> but the same error is still there in my tests
<havenwood> Swyper: Consider in your case which don't need to be instantiated and put them in a `class << self` block?
<havenwood> Swyper: Show your latest code and the error?
<Swyper> do you want me throw them all into a gist or the github repo is fine?
<havenwood> Swyper: Either, just code and corresponding error and folk here can help you resolve it.
<havenwood> Swyper: Or alternatively we can help with exercises for enlightenment in this area.
<havenwood> Swyper: undefined method `find_by_title' for Play:Class
alfiemax has quit [Remote host closed the connection]
<havenwood> Swyper: Which of the ways in this gist did you choose to make your class method?: https://gist.github.com/havenwood/304ef78eb7e6204020d62b7527eff9fd
<phaul> oh dang. there are 2 plays.rb in the repo :D
<havenwood> haha
mikecmpbll has quit [Ping timeout: 260 seconds]
<phaul> one in lib one outside
<havenwood> tricky!
<Swyper> ohh
mikecmpbll has joined #ruby
<Swyper> ok I removed the extra copy of it that I did not even reliaze was there lol
<Swyper> and updated the code, to
mikecmpbll has quit [Read error: Connection reset by peer]
mikecmpbll has joined #ruby
Xiti has quit [Quit: Leaving]
Swyper has quit [Remote host closed the connection]
<eindoofus> about my last question. i'm surprised no one on here mentioned "rdoc"
<eindoofus> i did mention i'm a newb
Swyper has joined #ruby
Xiti has joined #ruby
Esa__ has quit []
mikecmpbll has quit [Quit: inabit.]
<havenwood> eindoofus: I assumed you'd learn about it when you ran: gem server
<havenwood> eindoofus: Read about `gem server` with `gem server --help` or `gem help server`.
banisterfiend_ has joined #ruby
banisterfiend has quit [Ping timeout: 252 seconds]
banisterfiend_ is now known as banisterfiend
banisterfiend_ has joined #ruby
schne1der has quit [Ping timeout: 240 seconds]
banisterfiend has quit [Ping timeout: 240 seconds]
banisterfiend_ is now known as banisterfiend
eindoofus has quit []
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
rmnull has joined #ruby
d3bug has quit [Quit: Connection closed for inactivity]
Bounga has quit [Ping timeout: 260 seconds]
kristian_on_linu has quit [Remote host closed the connection]
banisterfiend has quit [Remote host closed the connection]
SeepingN has joined #ruby
banisterfiend has joined #ruby
kinduff has quit [Read error: Connection reset by peer]
kinduff has joined #ruby
mistym has quit [Quit: ZNC - http://znc.in]
troulouliou_dev has quit [Remote host closed the connection]
rmnull has quit [Quit: WeeChat 2.8]
chalkmonster has quit [Quit: WeeChat 2.8]
dionysus69 has quit [Ping timeout: 260 seconds]
infernix has quit [Ping timeout: 272 seconds]
chalkmonster has joined #ruby
troulouliou_dev has joined #ruby
d3bug has joined #ruby
troulouliou_dev has quit [Remote host closed the connection]
plutes has joined #ruby
plutes has quit [Max SendQ exceeded]
segy has quit [Ping timeout: 260 seconds]
segy has joined #ruby
plutes has joined #ruby
plutes has quit [Remote host closed the connection]
chalkmonster has quit [Quit: WeeChat 2.8]
plutes has joined #ruby
TCZ has joined #ruby
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
TCZ has quit [Quit: Leaving]
TCZ has joined #ruby