<banisterfiend>
all that stuff is great fun, they're both kernel modules that intercept socket operations system-wide to rebind sockets to a different interface
<banisterfiend>
Linux didn't need any of that jazz though, it has cgroups and multiple routing tables that are powerful enough
alfiemax has quit [Remote host closed the connection]
SeepingN has joined #ruby
<rickhull>
ha, interesting. my biggest complaint is that when I look at the code, it looks like a lot of incidental fiddling with the machine, rather than modeling -- describing the problem and solution. I like higher level languages and working closer to the problem domain.
sergioro has joined #ruby
<banisterfiend>
well the problem domain i enjoy is low-level bit fiddling :)
<rickhull>
that said, I love tailor-making a solution that rips \m/
<banisterfiend>
i was a "full stack web developer' for 5 yearrs and i fucking hated every second of it
<rickhull>
I agree, there is something satisfying about manipulating the machine in an elegant and systematic way, optimizing for efficiency
<banisterfiend>
product based development with "stakeholders" and endless meetings to figure out requirements is just mind numbing tedium to bring the bland vision of some cloying american to life
<banisterfiend>
im more interested in the machine, and the low level apis, than what some douchebag thinks would be a great app to 'empower people' or whatever ;)
<rickhull>
the machine is a lot more predictable than the users xD
<rickhull>
or the stakeholders or w/e
<banisterfiend>
(i'm still bitter :P)
Ai9zO5AP has quit [Ping timeout: 240 seconds]
<rickhull>
it's the ozzies that brought to us the wonders of JIRA
Chris__ has joined #ruby
<banisterfiend>
interesting
<banisterfiend>
rickhull you used to be nwallins right?
<rickhull>
side note, Atlassian is very good at a good couple things
<rickhull>
yep
Chris__ is now known as tf2ftw_
buckworst has quit [Quit: WeeChat 2.8]
<banisterfiend>
rickhull what's the panedemic like in NO?
Ai9zO5AP has joined #ruby
<banisterfiend>
it's pretty bad here (in NL) we have a > 10% death rate, a few people on my street already died
<rickhull>
I still have some friends there, haven't heard too much recently. I think it was spiked for Mardi Gras (Feb 20th or so)
sergioro has quit [Quit: leaving]
<rickhull>
I'm in Atlanta now, and have been pretty sheltered for 5 weeks or so
<rickhull>
maybe 6 or 7 :|
<rickhull>
generally things are quiet here, with low traffic (BLESS) but still more traffic than you might expect
<rickhull>
essentials stores are busy, parking lots generally rather full
<banisterfiend>
it's old already
<banisterfiend>
it was a weeny bit int4resting in the first few weeks
<banisterfiend>
but now i really want to travel again, and that probably wont be allowed for a good few months i'd say
<rickhull>
yes, it's very concerning for old folks though
<banisterfiend>
i had a ticket booked to spain and a nice airbnb for 4 weeks just beforer the pandemic struck
<rickhull>
like my parents, etc
<banisterfiend>
yea
<banisterfiend>
that's true
<banisterfiend>
old peope here are pretty terrified
<banisterfiend>
you see them in the supermarket wrarpped up in masks + gloves
<rickhull>
I was going to go to a wedding in Puerto Rico, and now the poor couple is in a legal battle over the costs
<banisterfiend>
brb have to test something real quick
<banisterfiend>
stupid thing about worrking on VPNs is your internet connection breaks anytime you test anything :P
<rickhull>
no one I know has died, but I know of deaths via 2 degrees or so
<rickhull>
have you tried turning it off and then back on again?
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
banisterfiend has quit [Ping timeout: 244 seconds]
alfiemax has joined #ruby
cliluw has quit [Ping timeout: 260 seconds]
sergioro has joined #ruby
alfiemax has quit [Remote host closed the connection]
banisterfiend has joined #ruby
sergioro has quit [Client Quit]
sergioro has joined #ruby
buckworst has joined #ruby
buckworst has quit [Quit: WeeChat 2.8]
SeepingN has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gix has quit [Disconnected by services]
banisterfiend has quit [Ping timeout: 240 seconds]
tf2ftw_ has quit [Quit: Leaving]
null____ has joined #ruby
null__ has quit [Ping timeout: 240 seconds]
null____ is now known as null__
Garb0 has quit [Ping timeout: 244 seconds]
SeepingN has joined #ruby
finchfiler has quit [Ping timeout: 260 seconds]
rickhull has quit [Ping timeout: 240 seconds]
sergioro has quit [Ping timeout: 265 seconds]
SeepingN has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<havenwood>
I guess I should say: Array.new(8) { 10 ** _1.div(3) * _1.modulo(3).abs2.succ }
sparr has joined #ruby
<sparr>
anyone here use vscode and willing to help me figure out how to get IDE-like features going for ruby? I'd prefer not to switch editors just to get "go to definition" and such.
<havenwood>
sparr: gem install solargraph
<sparr>
havenwood: I have the solargraph gem installed
<havenwood>
sparr: Are you also using the extension?
<sparr>
yes
<sparr>
it has no visible effect
<sparr>
nor any errors I can find in the Output panels
<havenwood>
sparr: Does it do autocompletion? Can you right click and go to definition? Or is none of that working?
<havenwood>
Or go to references.
<sparr>
no autocompletion
<sparr>
no "go to " anything in the right click menu
<sparr>
it's like I'm editing plain text files
<sparr>
syntax highlighting works, but that worked with stock vscode
<sparr>
ok, after messing with my PATH and reloading the vscode window, now the extension appears to be trying to run the binary, and I have some errors in the output
<havenwood>
sparr: Does the Solargraph extension seem to be enabled? No errors?
<sparr>
Error: Cannot find module 'semver'
Furai has quit [Quit: WeeChat 2.8]
<sparr>
semver was not one of the modules installed as a dependency of solargraph
<havenwood>
sparr: If you open a Ruby file with VSCode from the terminal, does Solargraph load succesfully?
<havenwood>
sparr: Like: code foo.rb
<sparr>
no, it does not. looks like this node module dependency problem is blocking it from running
<sparr>
I will investigate from here. Thanks!
<havenwood>
np! good luck
banisterfiend has joined #ruby
<sparr>
seems like a vscode problem, the dependency is there in the relevant node module
<havenwood>
xissburg: Is it not a fresh RVM install then? It should be HTTPS.
<havenwood>
xissburg: Ruby 2.4 is past end of life.
<xissburg>
I just did `rvm get stable`
<xissburg>
hmm I don't know what version I should install
<havenwood>
xissburg: rvm get head && rvm install ruby
<xissburg>
it's just that this gem required >=2.4 so...
<xissburg>
let me try...
jinmiaol2 has quit [Ping timeout: 260 seconds]
arcaos has quit [Ping timeout: 244 seconds]
gzc has quit [Quit: WeeChat 2.8]
arcaos has joined #ruby
Rakko has quit [Quit: Leaving]
Xiti` has joined #ruby
dfucci___ has joined #ruby
d3bug has joined #ruby
dfucci__ has quit [Ping timeout: 264 seconds]
Xiti has quit [Ping timeout: 246 seconds]
Rakko has joined #ruby
TomyWork has quit [Remote host closed the connection]
Rakko has quit [Quit: Leaving]
burgestrand has joined #ruby
vondruch_ has joined #ruby
vondruch has quit [Ping timeout: 260 seconds]
vondruch_ is now known as vondruch
cthu| has joined #ruby
<xissburg>
that works... thanks :)
Xiti` has quit [Quit: Leaving]
Xiti has joined #ruby
imode has quit [Ping timeout: 256 seconds]
lxsameer has joined #ruby
greypack has quit [Ping timeout: 260 seconds]
greypack has joined #ruby
<apotheon>
08:27 < sparr> how can I determine the type/class of an object in ruby that does not have a .class or .methods method?
<apotheon>
sparr: You could try #to_s I suppose.
<apotheon>
sparr: p foo # That can do the same thing, but as printed output from a program, for an object instance foo.
<apotheon>
sparr: That'll give you the class of the object.
<apotheon>
sparr: Unless you're building a new object hierarchy off of BasicObject, though, I'm not sure how you'd end up with an object that doesn't have #class or #methods.
<havenwood>
sparr: #class and #method are defined on Kernel, which is mixed into Object, so they're *always* available.
<havenwood>
apotheon: Yeah, BasicObject is the exception.
TCZ has quit [Quit: Leaving]
<havenwood>
So not absolutely *always*, but practically pretty much everything is an object so #class and #method are rightly presumed to be defined.
<havenwood>
kaleido: Stay tuned for the Ruby Kaigi keynote by Soutaro on Ruby::Signature.
<apotheon>
havenwood: Is #class implemented in C or in Ruby?
<havenwood>
apotheon: C
<apotheon>
I had a feeling . . .
<havenwood>
apotheon: A trick to find out is to check its #source_location, since methods in C don't have one.
<kaleido>
oh wow the scheduler stuff seems intriguing
<havenwood>
apotheon: Or show-source in Pry.
<apotheon>
Ah, #source_location is a good one. Thanks.
<havenwood>
kaleido: It's already showing great promise with Falcon and libs like async-http and async-websockets.
<apotheon>
havenwood: Do you know when BasicObject became a thing? I seem to recall in (now really old) previous versions of Ruby there wasn't a BasicObject.
<apotheon>
Maybe I just never noticed it way back when.
<apotheon>
s/way back when/way-back-when/
<havenwood>
apotheon: 1.9
<apotheon>
Okay. That seemed like the obvious time for that to appear, but I didn't want to just assume.
<apotheon>
Was it actually in 1.9.0, or was it in something like 1.9.2 (the same time as the license change)?
<havenwood>
apotheon: Yeah, the 1.8 to 1.9 change from an interpreter to a VM was just a huge amount of breaking changes.
<apotheon>
I remember that.
<havenwood>
apotheon: 1.9.1 is the ABI number for 1.9.
<apotheon>
ah
<havenwood>
apotheon: All of 1.9 was basically a 2.0-pre with some strange versioning.
<apotheon>
I remember that, too.
<havenwood>
Things thereafter ironed out into roughly semantic versioning.
<havenwood>
And patch numbers got dropped from versions.
<apotheon>
Yeah, that was one of the changes I liked about it.
<apotheon>
I didn't get around to doing anything with 1.9.x until 1.9.2, which coincidentally seemed to be where some things stabilized, too.
<apotheon>
(judging by what I was reading about it at the time)
<havenwood>
apotheon: 1.9 coincided with when I decided to become a Rubist, so I just had a few years of turbulence with 1.8 lingering but mostly learned on 1.9 and tried to avoid 1.8.
<apotheon>
That seems like it was a good way to get in.
<havenwood>
The changes since then have been fairly easy to track.
chouhoulis has joined #ruby
<apotheon>
I don't follow breaking news about pretty much *anything*, so I don't track changes as well as you.
<kaleido>
i bought a book years back and on the cover in big bold type read "Now using Ruby 1.9!"
<havenwood>
\o
<apotheon>
Anything important enough that I absolutely *must* know it, the missus will tell me (e.g. she told me about when the local quarantine lockdown would start).
<apotheon>
I wonder if I have any Ruby book editions that say that about 1.9 . . .
<havenwood>
kaleido: Soon that'll happen again with, "Now with Ruby 3.0!"
<apotheon>
yep
<apotheon>
I'm looking forward to fixing breakage in my code.
<havenwood>
"Parallel, Non-blocking Typed I/O with Ruby 3.0 For Dummies" book coming soon.
<apotheon>
I just recently realized that I already have breakage in my code, in one project, between 2.4.5 and 2.6.5 somewhere (I don't recall the exact versions on either side of the break), so I've gotta fix that now.
<MadLamb>
havenwood, thanks but I was looking for tools similar to those.
<MadLamb>
havenwood, and visualvm is a java tool
<MadLamb>
havenwood, :D
<MadLamb>
havenwood, the first one you recommended kinda works but i would like this constant running profilers
tau has quit [Read error: Connection reset by peer]
<MadLamb>
havenwood, its nice to know its called flamegraph
ldepandis has joined #ruby
kristian_on_linu has joined #ruby
Ai9zO5AP has quit [Ping timeout: 240 seconds]
Xiti` has joined #ruby
Pixi__ has joined #ruby
Ai9zO5AP has joined #ruby
Xiti has quit [Ping timeout: 258 seconds]
Xiti` has quit [Ping timeout: 246 seconds]
Xiti` has joined #ruby
imode has joined #ruby
Xiti has joined #ruby
Pixi__ has quit [Ping timeout: 240 seconds]
Garb0 has quit [Read error: Connection reset by peer]
Garb0 has joined #ruby
Xiti has quit [Client Quit]
Bounga has joined #ruby
Xiti` has quit [Ping timeout: 256 seconds]
burningserenity has quit [Remote host closed the connection]
Xiti has joined #ruby
Garb0 has quit [Read error: Connection reset by peer]
Garb0 has joined #ruby
Garb0 has quit [Max SendQ exceeded]
Garb0 has joined #ruby
MadLamb has quit [Remote host closed the connection]
CrazyEddy has quit [Ping timeout: 240 seconds]
alexherbo2 has joined #ruby
CrazyEddy has joined #ruby
entel has quit [Quit: Connection closed for inactivity]
davispuh has joined #ruby
robotmay has quit [Remote host closed the connection]
robotmay has joined #ruby
tau has joined #ruby
<havenwood>
I meant VisualVM for JRuby. :)
xissburg has quit [Quit: ZZZzzz…]
dionysus69 has quit [Quit: dionysus69]
dhollinger has quit [Ping timeout: 258 seconds]
dhollinger has joined #ruby
tau has quit [Remote host closed the connection]
alfiemax has joined #ruby
greengriminal has joined #ruby
troulouliou_div2 has joined #ruby
<greengriminal>
Hey Rubyist, if you have method that is defined with a `!` this denotes that it is intended to have a side-affect. What are your thoughts on having a predicate method defined inside of this. My question is which would you consider correct. https://gist.github.com/davidpatters0n/f690e6450ca3f0e0c5e65a911233cf24
alfiemax has quit [Ping timeout: 260 seconds]
Xiti has quit [Quit: Leaving]
<adam12>
greengriminal: I probably wouldn't care if it was either way, but I'd probably mostly care about the public API. If `operations!` is the only publicly exposed method, then I'd probably prefer the first.
<jhass>
First of all I wouldn't put the notion of ! as strictly side effect vs no side effect. IMO a non-bang method having a side effect is perfectly normal and reasonable. Ruby stdlib uses ! methods for methods that modify the receiver rather than returning a modified copy of the receiver. Rails uses to denote variants of methods that raise where the non-bang version maybe just returns nil, think create vs
<jhass>
create!. In either case you can see that most people don't define a bang method when there's no sense to a non-bang counterpart
<adam12>
and +1 for jhass's comment.
<jhass>
in other words foo is normal, foo! is a special variant
<jhass>
it doesn't tell how it's special, just a general notion of "more dangerous"
<jhass>
now mentally removing all the ! from your examples, I think it's a bit hard to judge because it's too generified
<jhass>
I can't quite make out the distinction between operations and send_message, especially if both are public API
<jhass>
and also whether send_message? is computing based on the API consumer or library internal state
<jhass>
so it's a bit hard to judge
<jhass>
and yeah, whether both are public or not is quite important to the question
<jhass>
public in the sense of meant to be called by the user of the API
dfucci_ has joined #ruby
felix_221986 has quit [Quit: Connection closed]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
kinduff has quit [Read error: Connection reset by peer]
<apotheon>
greengriminal: I'd prefer a verb as the method name for something that changes things so, for instance, send_message! seems a better name than operations!. On the other hand, I'm not really sure what operations! does other than call send_message!, so it's difficult to be sure it isn't a somewhat reasonable name.
dfucci_ is now known as dfucci
kinduff has joined #ruby
<apotheon>
greengriminal: If the only way send_message will ever be used is if send_message? returns a truthy value, the conditional execution should be in send_message! as in the second example.
<greengriminal>
I should've mentioned whether this was a public API or not. It is not this is all private internal logic that isn't exposed publicly.
<apotheon>
Even so, I'd name things according to the idea that if your method is *doing* something it should be a verb method name.
<apotheon>
I'm less insistent on something that just returns the value of a variable being a verb, though.
cliluw has quit [Ping timeout: 246 seconds]
<apotheon>
My take on how to write this doesn't seem to change regardless of whether it's public or private API stuff.
cliluw has joined #ruby
<greengriminal>
Got it.
<greengriminal>
cheers for the input all.
<apotheon>
jhass: "Ruby stdlib uses ! methods for methods that modify the receiver rather than returning a modified copy of the receiver." <- That's basically just the standard case of a side effect method.
<apotheon>
. . . but yeah, Rails has its own way of doing things.
<jhass>
apotheon: yes. yet we got File.write and not File.write!
<jhass>
it's to disambiguate the side effect if necesssary
<apotheon>
greengriminal: I think jhass and adam12 are pretty much on the money with the idea that something that is naturally only going to have a side-effect version doesn't need to be a bang method, though.
<jhass>
it just so happens stdlib basically has no usecases beyond the "modify receiver" mechanic
<apotheon>
The more generalized description of it that I've seen is something like "a bang method is the 'dangerous' version of a non-bang method".
<greengriminal>
Yeah I do agree with that too.
<apotheon>
Operator-style methods don't follow that rule of thumb at all, though (e.g. + vs. << for arrays).
golevka has joined #ruby
<apotheon>
Also . . . more indentation might have helped make that gist more readable.
Xiti has joined #ruby
mikecmpbll has quit [Ping timeout: 260 seconds]
dfucci has quit [Ping timeout: 264 seconds]
mikecmpbll has joined #ruby
<havenwood>
Plenty of non-bang methods modify the receiver. Matz says it means more "dangerous." In the Ruby stdlib, it's often used where a "safer" version doesn't modify the receiver and a more "dangerous" one does. It doesn't make sense to have a bang version without a safer non-bang one. I've seen a bang method defined without counterpart but that's off the rails.
g0tcha has joined #ruby
<havenwood>
alternatively end your method names in a more expressive emoji.
<havenwood>
def grocery_shopping😷
<g0tcha>
hey guys, quick question, i installed ruby 2.7.0 on ubuntu 20.04 to run redmine, redmine requires ruby between 2.3.0 and > 2.7.0 .. i installed ruby 2.6.3 but redmine is still complaining about 2.7.0
<g0tcha>
how can i make it so it uses 2.6.3 instead of 2.7.0?
<bhaak>
now I have an urge to add a method ending in lighting to the production code