baweaver changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.7.2, 2.6.6, 3.0.0-preview1: 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!
janemba has left #ruby ["WeeChat 2.9-dev"]
hogetarog has quit [Quit: WeeChat 2.8]
alfiemax has joined #ruby
Swyper has quit [Remote host closed the connection]
<al2o3-cr> like nakilon said, why you'd even hash something this size is questionable
leitz has quit [Remote host closed the connection]
roshanavand_ has joined #ruby
roshanavand has quit [Ping timeout: 264 seconds]
roshanavand_ is now known as roshanavand
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<al2o3-cr> Tuor: without knowing the optimisations of this lib, here's digest-blake3: https://imgur.com/a/kmGAs4z
<al2o3-cr> All i know is that monocypher is highly optimised, that being compiler and mathematically.
_aeris has joined #ruby
_aeris_ has quit [Ping timeout: 240 seconds]
_aeris is now known as _aeris_
davispuh has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
roshanavand_ has joined #ruby
ged has joined #ruby
roshanavand has quit [Ping timeout: 272 seconds]
roshanavand_ is now known as roshanavand
roshanavand_ has joined #ruby
roshanavand has quit [Ping timeout: 265 seconds]
roshanavand_ is now known as roshanavand
alfiemax has quit [Ping timeout: 260 seconds]
Emmanuel_ChanelW has quit [Quit: Leaving]
_whitelogger has joined #ruby
jenrzzz has joined #ruby
orbyt has joined #ruby
ramfjord has quit [Ping timeout: 240 seconds]
coniptor has quit [Ping timeout: 256 seconds]
<MeVegan[m]> Is there a live streaming platform dedicated to programming and related streams, preferably based on Free Software? I don't want to use Amazon's Twitch or Google's YouTube.
Rudd0 has quit [Ping timeout: 272 seconds]
alexherbo2 has quit [Ping timeout: 264 seconds]
wallace_mu has quit [Ping timeout: 258 seconds]
<al2o3-cr> MeVegan[m]: TwitchTV?
<al2o3-cr> MeVegan[m]: ah, never mind.
<al2o3-cr> MeVegan[m]: i'm still looking for a 4k monitor IPS 1ms rt 120 hz variable gsync/freesync
dionysus69 has quit [Ping timeout: 260 seconds]
goepsilongo has joined #ruby
<al2o3-cr> i'd get this but, i've never heard of them; https://evedevices.com/pages/order
<al2o3-cr> got hdmi 2.1, i might just reserve. but it's a lot of money for a unknown.
coniptor has joined #ruby
kain_ has joined #ruby
kain_ has quit [Client Quit]
TCZ has quit [Quit: Leaving]
bhaak has quit [Ping timeout: 264 seconds]
yasumi2136_ has joined #ruby
alfiemax has joined #ruby
yasumi2136 has quit [Ping timeout: 256 seconds]
Fusl has quit [Ping timeout: 240 seconds]
rose_nd_ash has joined #ruby
dfucci_ has joined #ruby
dfucci has quit [Ping timeout: 256 seconds]
rose_nd_ash has quit [Ping timeout: 260 seconds]
roshanavand_ has joined #ruby
rose_nd_ash has joined #ruby
roshanavand has quit [Ping timeout: 260 seconds]
roshanavand_ is now known as roshanavand
rose_nd_ash has quit [Client Quit]
ChmEarl has quit [Quit: Leaving]
ur5us has quit [Ping timeout: 260 seconds]
ur5us has joined #ruby
Technodrome has joined #ruby
Fusl has joined #ruby
alfiemax has quit [Ping timeout: 264 seconds]
wallace_mu has joined #ruby
Emmanuel_Chanel has quit [Ping timeout: 240 seconds]
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
goepsilongo has quit [Quit: Textual IRC Client: www.textualapp.com]
wallace_mu has quit [Remote host closed the connection]
Emmanuel_Chanel has joined #ruby
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
jenrzzz has quit [Read error: Connection reset by peer]
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
drincruz has joined #ruby
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
drincruz has quit [Ping timeout: 240 seconds]
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
djellemah has quit [Ping timeout: 240 seconds]
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
<impermanence> anyone around :)
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
donofrio_ has quit [Remote host closed the connection]
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
<havenwood> impermanence: always :)
wallace_mu has quit [Remote host closed the connection]
<impermanence> long time no speak
<impermanence> anyway
<impermanence> one sec here
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
<impermanence> havenwood: https://bpa.st/UD4Q
<impermanence> so right I'm now exiting this whole rake task script
wallace_mu has quit [Remote host closed the connection]
<impermanence> which I don't want to do actually
wallace_mu has joined #ruby
<impermanence> but I need to skip this task, effectively
<impermanence> make it benign
<impermanence> I think what I can do is comment out `handle_missing_puppet_env(puppet_env)`
<impermanence> and simply add next
wallace_mu has quit [Remote host closed the connection]
<impermanence> I guess that's nowhere near enough context
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
<havenwood> impermanence: next
<impermanence> going to try
wallace_mu has joined #ruby
<havenwood> impermanence: P.S. The default for #exit is 0, so no need to specify that.
<impermanence> thanks
<havenwood> np
<impermanence> the installer I'm running takes forever so...we'll see what next gets me.
wallace_mu has quit [Remote host closed the connection]
<havenwood> impermanence: should skip the task
wallace_mu has joined #ruby
<impermanence> makes sense
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
mattfly has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
mnathani has joined #ruby
wallace_mu has joined #ruby
Swyper has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
Swyper has quit [Remote host closed the connection]
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
alfiemax has joined #ruby
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
alfiemax has quit [Remote host closed the connection]
wallace_mu has joined #ruby
Rudd0 has joined #ruby
alfiemax has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
<impermanence> havenwood: so... https://bpa.st/4NWQ
wallace_mu has joined #ruby
<impermanence> this is the whole rake task file
<impermanence> and here's what I'm seeing
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
<impermanence> firstly, and this is not a guess, whatever the issue is, it is in the task with desc `desc "Correct missing pulp repositories for puppet environments.`
SeepingN has quit [Quit: The system is going down for reboot NOW!]
<impermanence> I have tried numerous approaches to "skipping" this particular task
wallace_mu has quit [Remote host closed the connection]
<impermanence> it seems like it should be thoroughly straightforward
wallace_mu has joined #ruby
<impermanence> `exit` is too nuclear
<impermanence> commenting out the task, and this I cannot wrap my head around, unless something else is importing it, breaks the previous task.
wallace_mu has quit [Remote host closed the connection]
<impermanence> well I suppose something could be looking for it
wallace_mu has joined #ruby
alfiemax has quit [Ping timeout: 246 seconds]
<impermanence> I have also tried simply commenting out lines:
wallace_mu has quit [Remote host closed the connection]
<impermanence> 83 - 86
postmodern has joined #ruby
<impermanence> which also breaks the previous task!
<havenwood> impermanence: Did you try `next`?
<havenwood> impermanence: Or you're saying this is the problem with `next`?
<impermanence> immediately and it fails identically to when I have made no changes
wallace_mu has joined #ruby
<impermanence> ^
<impermanence> all of the other tasks will work lol
<impermanence> my last solution: commenting out lines 83 - 86...why this does not work is somewhat baffling to me
<impermanence> and in doing so the script breaks in the middle of this step
<impermanence> in other words it doesn't break the previous task or the next task!
<havenwood> impermanence: I don't follow. Commenting 83-86 is the `unless` statement with `next`?
<impermanence> yep
<impermanence> so I figured: I'll just print and do nothing
<impermanence> and it *still* breaks in the middle of the task...
<havenwood> impermanence: How about extracting methods?
<impermanence> waz dat?
<havenwood> so like: def handle_missing_puppet_env(puppet_env); return; ...; end
<impermanence> k one sec let me look at the code
<havenwood> impermanence: extract method refactor then call the method
wallace_mu has quit [Ping timeout: 258 seconds]
<havenwood> impermanence: haven't read this article, but this sort of thing https://medium.com/@jonlunsford/refactoring-ruby-extract-method-36ead060efb7
<impermanence> I was just looking at this
<havenwood> impermanence: organizing methods in a module can be nice. if there's state between methods that's convenient to not pass around, consider a class instead of a module.
<impermanence> I don't see that would help at all.
<havenwood> impermanence: Maybe I'm not understanding what you're trying to do. I thought it was to "skip" some portions of certain tasks.
<impermanence> yeah there's something wrong with this loop: `puppet_envs.find_each.with_index do |puppet_env, index|`
<impermanence> the corresponding block always breaks
<havenwood> impermanence: How can you tell something is wrong? Breaks how?
<impermanence> STDOUT just stops
<impermanence> permanently
<impermanence> well: freezes
cthulchu_ has quit [Ping timeout: 272 seconds]
<havenwood> impermanence: So is the code that freezes the part you're not showing?
<havenwood> impermanence: You want to skip everything inside an `unless` statement?
<impermanence> code that freezes is the block we've been discussing the entire time
<impermanence> well I had wanted to but...for whatever reason...when I use next to skip within unless it breaks on the previous task lol. Even though that task has no related methods (seemingly).
<havenwood> impermanence: Just `unless false`?
<havenwood> impermanence: unless true
<impermanence> for this attempt I added next just above the unless
<havenwood> impermanence: You can short circuit the unless statement. Or my suggestion to extract a method let's you call this part or not. I don't really follow from what you're showing. It seems you're showing a comment for the portion that breaks. I'm super confused because I don't get why you can't just not run that code by 1) commenting it out, 2) short circuiting the unless statement by commenting out the part after `unless ...` line and adding a
<havenwood> `true`, or 3) extract the portion you don't want to run into a single method so you can call it or not or return at the top of the method.
<impermanence> mmkay
<impermanence> sorry
<impermanence> we're not even quite on the same page
<havenwood> impermanence: very long day for me and I'm distracted so someone else may just get what you mean from what you've said. :)
<impermanence> no it's not that at all; firstly we're discussing lines 72 - 88
<impermanence> which I guess you know
<impermanence> the comments ultimately mean nothing
<havenwood> impermanence: Okay, I'll look at those lines.
<impermanence> they're only there because they're some attempts I tried
<impermanence> but they don't ultimately mean anything because I've tried commenting out a ton of stuff
<impermanence> exit 0 means nothing
ur5us has quit [Ping timeout: 260 seconds]
<havenwood> impermanence: Okay, let me zoom out. If you comment out the entire content of this task does it still hang?
<impermanence> that's the thing...
<havenwood> impermanence: Or say delete the contents so it's empty.
<impermanence> I kid you not *then* the previous task breaks
<impermanence> okay yeah
<impermanence> what's the keyword to delete? del?
<havenwood> impermanence: So you have some cascading breakage? Presumably something common to all tasks?
<impermanence> I guess...
<havenwood> impermanence: If you keep removing tasks, does it continue to hang in the exact same way?
<impermanence> all I know is when I comment out the block we're discussing the previous task freezes
<havenwood> haha
<havenwood> impermanence: And when you comment out the previous task?
<impermanence> *that* I have not tried yet
<impermanence> I will do that next
<apotheon> =begin
<apotheon> puts 'The center cannot hold.'
<apotheon> =end
<impermanence> havenwood: alright so now I'm trying `unless false`
<impermanence> after that I will try commenting out the previous task
<havenwood> impermanence: err, it's be "unless true" to *not* do the statement
<impermanence> makes sense
orbyt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<impermanence> havenwood: basically it always freezes at this line:
<impermanence> `puts "Processing Puppet Environment #{index + 1}/#{puppet_envs.count}: #{puppet_env.pulp_id} (#{puppet_env.id})"`
<impermanence> line 82
<impermanence> STDOUT just stops
<impermanence> and it isn't processing anything, it's just hanging
<havenwood> impermanence: Which part of that line? The `puppet_envs.count`?
<impermanence> which part? hm. not sure. it STDOUTs that whole line obviously
<havenwood> impermanence: Is there a lazily calculated #size method and #count is what's freezing?
<impermanence> I'm not sure
<impermanence> the last line of STDOUT is complete in comparison
<impermanence> i.e. it does not look any different than any other STDOUT line before it
<havenwood> impermanence: puppet_envs.respond_to?(:size)
<impermanence> are you asking if that is present somewhere?
<havenwood> impermanence: Put a `binding.irb` in there and see if there's a `puppet_envs.size` then try `puppet_envs.count` and see if that's what freezes?
alfiemax has joined #ruby
<impermanence> that sounds good
<impermanence> what exactly do I need to do to do that :) ?
<havenwood> impermanence: Add this line: binding.irb
<havenwood> impermanence: Then run it. :)
<impermanence> at line 81, effectively?
<havenwood> impermanence: At whatever line you want a REPL for interactive debugging.
<impermanence> i.e. add `binding.irb` just above the interpolated put statement
<havenwood> impermanence: (Before the offending line.)
<impermanence> ah
<impermanence> so what will that do?
<havenwood> impermanence: It'll jump you into irb for interactive Ruby at the point you put it.
<havenwood> impermanence: Then you can type `puppet_envs.class` or `puppet_env.public_methods(false)` or whatever else you want to try.
<havenwood> impermanence: My suspicion is the #count method but I'm not familiar with Puppet internals to know what this class is.
<impermanence> there're like 200 entries in the iterable...
<impermanence> is that going to be an issue?
<havenwood> impermanence: You can check in irb or with "puts-based debugging" like: p puppet_envs.public_methods(false)
<havenwood> impermanence: Or: p puppet_envs.size
<impermanence> alright one sec here
<havenwood> impermanence: irb is really nice though to try multiple things
<impermanence> yeah that I get it
<havenwood> REPL-driven development is nice
<havenwood> Use the REPL!
<impermanence> give me 3 - 4 minutes the installer that is ultimately calling this takes a bit
mattfly has left #ruby [#ruby]
<impermanence> I always use my REPL; I just haven't written *any* Ruby in uh...4 - 5 years?
<impermanence> and when I was I was *juuuuust* starting to teach myself how to program lol.
<impermanence> but yeah I was down with irb
<impermanence> I just never learned anything beyond basic control flow and builtins; the very basics
<impermanence> so what makes you think that count/size whatever is an issue?
<impermanence> yeah I didn't realize count was a method
<impermanence> well: I hadn't ever really closely examined that puts statement
<impermanence> but I still don't get how calling a count method could cause a problem
<havenwood> impermanence: By convention, a #size method is usually "lazy" so it tries to lazily get the size of the collection—meaning a known, precalculated size.
jenrzzz has joined #ruby
<impermanence> and?
<havenwood> impermanence: By convention, a #count method actually iterates a collection, which for a large or infinite collection can hang.
<havenwood> impermanence: For example: 0.step.size #=> Infinity
<impermanence> I mean...200 small objects?
<havenwood> impermanence: But: 0.step.count #!> hangs
<impermanence> about to enter irb
<impermanence> I hope
<havenwood> impermanence: I have don't have context. I didn't know the size. Try the different parts of the line that hangs and see. :)
<impermanence> I should just remove the count part
<impermanence> it's only standard out
<impermanence> shit now the previous task is frozen
<impermanence> yep
<impermanence> so I added binding.irb at line 81 and now the previous task is frozen
<impermanence> incredible
<havenwood> impermanence: Keep deleting code and adding binding.irb until you can isolate what's hanging.
<havenwood> impermanence: Reproduce the hang.
<impermanence> word
<impermanence> I duped the hanging puts line and just removed the count part.
<impermanence> I could care less about that
jenrzzz has quit [Ping timeout: 256 seconds]
<impermanence> it probably is the count part because the stuff in the task is iterating over a data structure with a couple hundred entries
<impermanence> and it never freezes until like...entry 170...
<impermanence> so 169 entries complete without issue
<havenwood> impermanence: Did you check if there's a #size method alternative to #count?
<impermanence> not yet no
<impermanence> I wouldn't have known to even do that
<impermanence> hm
<impermanence> still frozen even after removing count
<impermanence> dang I was hopeful
<impermanence> yeah it is just freezing
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nofxx has quit [Remote host closed the connection]
nofxx has joined #ruby
mikecmpbll has quit [Ping timeout: 260 seconds]
mikecmpbll has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
lightstalker has quit [Ping timeout: 264 seconds]
ur5us has joined #ruby
bhaak has joined #ruby
lightstalker has joined #ruby
alfiemax has quit [Remote host closed the connection]
ur5us has quit [Ping timeout: 260 seconds]
alfiemax has joined #ruby
zacts has joined #ruby
bocaneri has joined #ruby
zacts has quit [Client Quit]
detectiveaoi has joined #ruby
detectiveaoi has quit []
howdoi has quit [Quit: Connection closed for inactivity]
zacts has joined #ruby
Mikaela has quit [Ping timeout: 256 seconds]
a-l-e has joined #ruby
weaksauce has quit [Ping timeout: 240 seconds]
zacts has quit [Quit: leaving]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 264 seconds]
vondruch has joined #ruby
teclator has joined #ruby
<Tuor> al2o3-cr: I have to work until late today. Maybe tomorrow or next week, I'll try things out and see. I try to remember to let you know how it went and what I ended up with.
ur5us has joined #ruby
xco has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 272 seconds]
brendan- has quit [Read error: Connection reset by peer]
brendan- has joined #ruby
cd has quit [Quit: cd]
brendan- has quit [Ping timeout: 256 seconds]
jenrzzz has joined #ruby
duderonomy has joined #ruby
a-l-e--- has joined #ruby
jenrzzz has quit [Ping timeout: 246 seconds]
a-l-e has quit [Ping timeout: 272 seconds]
zacts has joined #ruby
Fridtjof has quit [Quit: ZNC - http://znc.in]
Fridtjof has joined #ruby
cnsvc has quit [Ping timeout: 240 seconds]
tsujp93 has joined #ruby
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
tsujp93 has quit [Remote host closed the connection]
cnsvc has joined #ruby
a-l-e--- is now known as a-l-e
mikecmpbll has quit [Quit: inabit.]
burgestrand has joined #ruby
ellcs1 has joined #ruby
cnsvc has quit [Ping timeout: 240 seconds]
jenrzzz has joined #ruby
infinityfye has joined #ruby
<Tuor> Working on some ruby at work now. :) How is this called? %x{} ?
<Tuor> (I want to find documentation about it and when to use `` or when to use %x{} or if it even matters....)
<jhass> Tuor: that's a percent literal, specifically this one is an alternative syntax to backticks `
<jhass> handy if you need to use backticks in your backticks
<jhass> backticks run a shell command and capture the output
<jhass> so careful with user input in there
ramfjord has joined #ruby
<Tuor> jhass: ah ok. Good to know. thx!
jenrzzz has quit [Ping timeout: 256 seconds]
<Tuor> What I came up with after following https://i.stack.imgur.com/1Vuvp.png: `#{['file', '-b', path].shelljoin}` (thx nakilon I have usage for this module already :) )
<Tuor> just continued reading, I like <<~EOF...EOF :)
<Tuor> or even <<~`EOF`; shell stuff; EOF :)
<jhass> at that point you might as well write a shell script that occasionally calls ruby though :P
ellcs has quit [Quit: Leaving.]
ruurd has quit [Ping timeout: 256 seconds]
ap4y has quit [Ping timeout: 264 seconds]
zacts has quit [Quit: leaving]
Mikaela has joined #ruby
yasumi2136_ has quit [Remote host closed the connection]
yasumi2136 has joined #ruby
aesthe has joined #ruby
DaRock has joined #ruby
alfiemax has quit [Remote host closed the connection]
Rudd0 has quit [Ping timeout: 240 seconds]
dionysus69 has joined #ruby
alfiemax has joined #ruby
ur5us has quit [Ping timeout: 244 seconds]
zacts has joined #ruby
Rudd0 has joined #ruby
<Tuor> How can I know if revision 93df3010 is already in any ruby release?
<jhass> https://github.com/ruby/ruby/commit/93df3010 github shows it nicely
TCZ has joined #ruby
<Tuor> ah I was on some other site... Thank you!
<Tuor> will only be in 3.0. :( Have to find a different way...
<jhass> https://bugs.ruby-lang.org/issues/16965?tab=changesets is also a good checking point, backports to other branches usually appear there
<jhass> but yeah, looks like no plans for htat
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
alexherbo2 has joined #ruby
GGMethos has quit [Ping timeout: 256 seconds]
<al2o3-cr> Tuor: cool, appreciate it! 👍
tsujp90 has joined #ruby
<Tuor> jhass: :-/ shell out again. :(
<jhass> Tuor: happens :P
<jhass> I would recommend you to use def self.foo (makes it easier to rename the module) or even module Utils; class << self; def foo; ...
<jhass> also you can drop the self. in front of calling run_command
<Tuor> self.foo - ah that's even easier to write. :) will change.
<Tuor> class << self ?
<jhass> for now consider it magic :P Just think of it as module A; class << self; def a; end; def b; end; end; being the same as module A; def self.a; end; def self.b; end; end;
<jhass> (which it really is, why it is is a bit of a more involved story though)
<Tuor> if it is the same, i take it. even easier to write. :)
<jhass> right, hence the hint :D
Emmanuel_ChanelW has joined #ruby
<jhass> exactly :)
jenrzzz has joined #ruby
vondruch has quit [Ping timeout: 258 seconds]
jenrzzz has quit [Ping timeout: 256 seconds]
donofrio has joined #ruby
stryek has joined #ruby
Swyper has joined #ruby
finn[m] has quit [Changing host]
finn[m] has joined #ruby
finn[m] has joined #ruby
Swyper has quit [Remote host closed the connection]
GGMethos has joined #ruby
Swyper has joined #ruby
postmodern has quit [Quit: Leaving]
bloodshot has joined #ruby
<EdwardIII> trying to decide on whether to have a runner in cron that saves some details, or make a daemon. i guess cron is less to think about and less to go wrong
<bloodshot> "string".gsub(/.*/, 'a') returns 'aa'. Is this expected behaviour? I'm guessing it's matching the empty string once at the end. sed behaves differently.
jenrzzz has joined #ruby
<jhass> EdwardIII: my major decision point would be the ratio between run interval and run time. If that gets near 1 it easily might surpass 1 (run time getting longer than run interval) and then cron is getting you in trouble, whereas as a daemon you have more control over it
<EdwardIII> jhass: it's like a website status monitoring thing, so i was thinking about 5 mins intervals. can't be too fast or it'll be DoSing the sites :)
<EdwardIII> jhass: how would you handle updating cron on the host system? would you just have a hacky script that greps / adds an entry to the crontab? or is that the time to start thinking about packing it up for specific distros?
<jhass> so just make sure your timeout is like 60 seconds or so (resolve, connect, read each) and you should be fine :)
burgestrand has quit [Quit: burgestrand]
<jhass> if your software is not deployed by you, then yeah, packages that install to /etc/cron.d/ are a good idea (or for systemd system you can also ship a .timer unit)
<jhass> &>> "a".scan(/.*/) # indeed bloodshot
jenrzzz has quit [Ping timeout: 264 seconds]
<rubydoc> # => ["a", ""] (https://carc.in/#/r/9u39)
<EdwardIII> hmm cook, thanks jhass!
Technodrome has joined #ruby
<EdwardIII> that's a pretty elegant solution
<TheBrayn> Interesting, I didn't know about this either
<jhass> tbf it's a pretty silly regex :P
<TheBrayn> &>> "string".gsub(/.*?/)
<rubydoc> # => #<Enumerator: "string":gsub(/.*?/)> (https://carc.in/#/r/9u3a)
drincruz has joined #ruby
<TheBrayn> &>> "string".gsub(/.*?/, 'a')
<rubydoc> # => "asataraianaga" (https://carc.in/#/r/9u3b)
vondruch has joined #ruby
<jhass> EdwardIII: though I have to wonder, for a simple usecase like this, why not use telegraf/collectd/prometheus or such :P
<bloodshot> TheBrayn: Thank you for the link. I'm aware of the options to make this not happened, I was just surprised since most tools I use will not match an empty string there. I'm not sure if this is documented on ruby-doc; I didn't see anything in String or Regexp
<jhass> Tuor: any question? :)
djellemah has joined #ruby
<EdwardIII> jhass: well, it's mostly for fun :)
<EdwardIII> i use nagios at work
drincruz has quit [Ping timeout: 264 seconds]
<Tuor> jhass: no, just wanted to show the result of your recommandation.
<jhass> 👍
alexherbo2 has quit [Ping timeout: 260 seconds]
<isene> How can I get the pixel size of the terminal in ruby (not the lines and columns - but the actual size in pixels)?
<jhass> is that even part of any terminfo protocol?
<bhaak> the PIXEL size? I don't think that's in any way standardized
<bhaak> possibly a terminal that has sixel support allows for that somehow
<jhass> isene: looking at http://www.delorie.com/djgpp/doc/libc/libc_495.html it seems like there's indeed a way. I would hack up https://github.com/rking/terminal-size/blob/master/lib/terminal-size.rb to access those latter struct members
<bhaak> but when I look at ioctl's TIOCGWINSZ and winsize, it says here https://manpages.ubuntu.com/manpages/xenial/man4/tty_ioctl.4.html that ws_(xpixel it is unused
drincruz has joined #ruby
<jhass> 🤷‍♀️ can't hurt to try and see if it returns something anyhow
<bhaak> and the results are interesting.
braincrash has joined #ruby
aandrew has joined #ruby
<bhaak> on OSX, everything works fine. iterm2, terminal, being ssh'ed into linux machine on iterm2, that works fine
aandrew has left #ruby [#ruby]
<bhaak> on an arch linux, it returns 0x0. ssh'ing from that machine into another linux machine running tmux returns something huge (not completely non-sensical but obviously wrong). running it without tmux returns 12
<jhass> haha
<bhaak> 12 for the x pixel size and nothing(?) for the y pixel size
<jhass> oh, it's not zero'd in the example you linked!
<jhass> so just garbage data
<bhaak> oh, that would make sense
<jhass> you can verify with memset(&wsz, sizeof(wsz)); or so (my C's bad, sorry)
<jhass> eh, plus a 0 in the middle of course
<MeVegan[m]> Anyone know of a live streaming platform that's dedicated to programming and related streams? I don't want to use Amazon's Twitch or Google's YouTube.
<jhass> media.ccc.de? :D
<bhaak> you are right. my last example returns 0 0 then.
wallace_mu has joined #ruby
flak has joined #ruby
rippa has joined #ruby
<bhaak> with C this side of the 80s, you don't need memset anymore. "struct winsize wsz = {0};" works
Swyper has quit [Remote host closed the connection]
<jhass> ah, cool :)
flak has quit [Read error: Connection reset by peer]
rippa has quit [Read error: Connection reset by peer]
<MeVegan[m]> jhass Thanks! I'm using Archive.org to host videos. I'm happy with that part. CCC looks more like video hosting than live streaming, unless I missed something.
<jhass> it's mostly conference content but when there's one going it's usually streamed live too :)
burgestrand has joined #ruby
<MeVegan[m]> So you're saying I should live code for a conference presentation. 😃
<tsujp90> so you know how rubymine has their debugger are their similar tools that aren't IDE specific for say Sublime Text?
<jhass> MeVegan[m]: happens more often than you'd think!
<MeVegan[m]> I guess I wasn't clear in my question about looking for a platform where I (and others) can stream live coding that's not Twitch or YouTube.
<jhass> tsujp90: I just use pry + pry-byebug, it's all I need :)
<jhass> ?pry
<jhass> !pry
<jhass> mmh
* jhass slaps ruby[bot]
<bhaak> MeVegan[m]: why do you think that twitch is not suitable?
<MeVegan[m]> bhaak It's owned by Amazon, not Free Software, and I don't want to support its gamification economic model.
<jhass> MeVegan[m]: https://github.com/Chocobozzz/PeerTube/issues/151 "soon" apparently
alfiemax has quit [Remote host closed the connection]
<MeVegan[m]> jhass: Thank you. That may work when it's ready. I wish the folks at Dev.to, freeCodeCamp, or other popular programming communities would put something together.
<jhass> honestly it's a pretty hard problem that requires quite a bit of infrastructure to scale properly (= cash) and most people are just not as die hard. You can watch this stuff on YT and Twitch without an account, so why not
<bhaak> having an account doesn't give Google or Amazon money already, too.
<bhaak> but you are contributing to the network effect
<MeVegan[m]> The communities I mention also have the potential for discoverability that could rival YouTube and Twitch, for programmers and software engineers at least.
<MeVegan[m]> jhass: yeah, you're right about this in terms of what's easiest for those communities. Linking to YT or Twitch is probably better for them resource-wise than creating or hosting their own system.
<jhass> and let's be honest, the FSF cult is a minority even among software engineers :)
<MeVegan[m]> bhaak: exactly!
<EdwardIII> even linus uses a mac right which im sure uses plenty of propritary firmware and so on
bmurt has joined #ruby
<jhass> Afaik Linus got talked over by RMS to use GPL, it wasn't his idea :)
<MeVegan[m]> I think it's more important to not support the YT and Twitch economic models ... gamification (addiction) and advertising than it is to work about FSF politics.
<jhass> true. I wish AP would be a better standard, we could be much further :(
Swyper has joined #ruby
roshanavand_ has joined #ruby
<jhass> but then, disregarding network effect, you do are able to disable monetization on YT, which also then earns them nothing
roshanavand has quit [Ping timeout: 246 seconds]
roshanavand_ is now known as roshanavand
Swyper has quit [Remote host closed the connection]
<MeVegan[m]> jhass What's that saying, if you're not paying for a product than you are the product, or something like that. In the case you mention, one would be helping YT do the advertising for their service and ultimately helping to grow their network, as bhaak mentioned earlier.
<jhass> maybe it's not hard to write a little microsite serving YT embeds, that could also limit the network effect somewhat
Swyper has joined #ruby
<MeVegan[m]> Maybe, but I'm looking for a streaming service that would need something like the full YT interface for chat, discoverability, etc..
roshanavand has quit [Ping timeout: 246 seconds]
<MeVegan[m]> Anyway, if anyone ever comes across someone like, please let me know. Thanks!
<EdwardIII> what's AP?
<jhass> ActivityPub
roshanavand has joined #ruby
<isene> Sorry for the afk; Diving into https://github.com/rking/terminal-size/blob/master/lib/terminal-size.rb gives me height and width in characters, not in pixels. Is there any simple linux util that can simply return the pixel size of the current window?
<jhass> isene: please read the discussion that followed :)
<jhass> according to bhaak's investigation, the answer is no
bloodshot has quit [Ping timeout: 256 seconds]
KrzaQ has quit [Remote host closed the connection]
burgestrand has quit [Quit: burgestrand]
drincruz has quit [Ping timeout: 240 seconds]
drincruz has joined #ruby
burgestrand has joined #ruby
burgestrand has quit [Quit: burgestrand]
jenrzzz has joined #ruby
<EdwardIII> jhass: interesting, not heard of it. although just seeing that also reminds me of the drama behind RSS :)
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<jhass> RSS is a much better standard than ActivityPub :P
<EdwardIII> :D
<bhaak> isene: depending on your needs (does it need to work on all platforms or not?) the answer would be "maybe". see the C code I linked earlier
mensvaga has joined #ruby
<mensvaga> A while back somebody posted a link to how to write a gemspec file that doesn't depend on "git ls" or something.
<mensvaga> I've lost the link.
jenrzzz has quit [Ping timeout: 246 seconds]
<mensvaga> That's it.
<mensvaga> OK. So, to build a gem, these 3 documents are what I have:
yasumi2136_ has joined #ruby
burgestrand has joined #ruby
yasumi2136 has quit [Ping timeout: 264 seconds]
alexherbo2 has joined #ruby
<jhass> sounds good!
<EdwardIII> hey if you guys have things that you want to keep moderatatly separate, say your business logic, but you want to use a web framework like hanami or rails, how do you handle that? just make a dir in lib? like lib/my-particular-area-of-business-logic? having a separate gem that has to be packaged and installed every time seems way too overkill
Emmanuel_ChanelW has quit [Quit: Leaving]
alexherbo2 has quit [Ping timeout: 258 seconds]
<mensvaga> EdwardIII: How you accomplish such a thing, and how "reasonable" you are about it, according to your idea of "reasonable" very much is what you're going to fight with for all programming languages in all environments.
alexherbo2 has joined #ruby
<EdwardIII> i think really all i want is something self contained, code, tests, Rakefile all self-contained
<mensvaga> The solution is to do it in such a way that allows you to decouple the logic from the application once the logic has "matured".
<mensvaga> Many times you don't know what the form of the business logic will take (organizationally, and what should handle what), until you've written a part of it.
<EdwardIII> so it's easy to extract it out into a gem later and it's super clearly separated. but so i can still hack on the code when i need to without packaging it up and having to build install a new game every time
<EdwardIII> maybe this is dumb? and it's better to just use namespaces carefully and not worry about it until later?
<mensvaga> Using namespaces correctly is basically what prevents some of these issues.
<EdwardIII> thanks :) i think i probably would benefit from just reading the rubygems guides from a to z
<mensvaga> In this day and age, the fact that you need to piece together how to organize a source repo from reference material (as opposed to from example) is a bit underwhelming.
<mensvaga> But, the situation is not unique.
<EdwardIII> well there is bundle gem i guess :)
<EdwardIII> still a million times better than trying to do the same thing in node.js eh
<mensvaga> I've found issues with bundler.
alexherbo2 has quit [Ping timeout: 265 seconds]
<mensvaga> Well, at least on ubuntu 18.04
<mensvaga> I don't know how much better things have gotten.
DaRock has quit [Ping timeout: 260 seconds]
<mensvaga> If it still uses 'git ls' to get the list of files to be included in the gem, that's considered wrong now.
Technodrome has joined #ruby
ChmEarl has joined #ruby
<mensvaga> Looks like it no longer uses git, but it calls the bin dir "exe"
<mensvaga> no... wait
KrzaQ has joined #ruby
<EdwardIII> when i tried it on macosx it called the bin dir 'bin'
<mensvaga> it still uses `git ls-files -z`
<mensvaga> (This is on ubuntu 20.04)
<mensvaga> if it uses `git ls-files ...` on whatever you're using, that's very wrong.
<mensvaga> (package build systems should be "version control system agnostic")
lucasb has joined #ruby
TomyWork has joined #ruby
ellcs1 has quit [Ping timeout: 240 seconds]
<Tuor> it's working and ready for the restore part: https://gitlab.com/nod0n/backup-the-backup :)
alexherbo2 has joined #ruby
PimarSimil has joined #ruby
<burgestrand> EdwardIII in the past I've made gems of these things (`bundle new …`) in a subdirectory, and in the main app I've referred to that gem by path `gem …, path: "./whatever/…"`
<burgestrand> EdwardIII however, you do lose out on e.g. reload functionality in console/web server, so usually more hassle than it's worth to separate it by that much :D
xall has joined #ruby
braincrash has quit [Ping timeout: 240 seconds]
BTRE has quit [Quit: Leaving]
BTRE has joined #ruby
alexherbo2 has quit [Ping timeout: 256 seconds]
<EdwardIII> burgestrand: hmm ok, interesting, thanks!
alexherbo2 has joined #ruby
PimarSimil has quit [Quit: Leaving.]
jenrzzz has joined #ruby
dfucci_ has quit [Ping timeout: 260 seconds]
alexherbo2 has quit [Ping timeout: 272 seconds]
burgestrand has quit [Quit: burgestrand]
<jhass> EdwardIII: fwiw putting "self-contained" libs into lib/ is quite standard in the rails projects I've seen
jenrzzz has quit [Ping timeout: 256 seconds]
alexherbo2 has joined #ruby
djellemah has quit [Ping timeout: 240 seconds]
akem has quit [Quit: Leaving]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
davispuh has joined #ruby
tsujp has quit [Ping timeout: 246 seconds]
tsujp90 has quit [Ping timeout: 245 seconds]
alexherbo2 has quit [Ping timeout: 258 seconds]
tsujp has joined #ruby
djellemah has joined #ruby
alexherbo2 has joined #ruby
TCZ has quit [Quit: Leaving]
pwl has joined #ruby
pxl_ has joined #ruby
georgie has joined #ruby
adu has joined #ruby
crimisok has joined #ruby
<EdwardIII> jhass: ah ok. and where would they put the tests? would it be like lib/mything, then test/mything ? or somhow lib/mything/test ?
markong has quit [Ping timeout: 260 seconds]
<jhass> test/mything usually
alexherbo2 has quit [Ping timeout: 265 seconds]
<jhass> rarely I see (test|spec)/lib/thingy
alfiemax has joined #ruby
markong has joined #ruby
<EdwardIII> got it, thanks!
zxq2 has joined #ruby
claudiuinberlin has joined #ruby
BH23 has quit [Ping timeout: 240 seconds]
georgie has quit []
alexherbo2 has joined #ruby
doctypo has joined #ruby
pxl_ has quit [Quit: Leaving]
akem has joined #ruby
<doctypo> hello guys!
TCZ has joined #ruby
alfiemax has quit [Ping timeout: 272 seconds]
<aesthe> I have a ruby method that returns a hash when a request is successful but returns a nil value when it is not. Is it better to return an empty hash?
alfiemax has joined #ruby
cthulchu_ has joined #ruby
mensvaga has left #ruby [#ruby]
<adam12> aesthe: Maybe it should return a Response object?
doctypo has quit [Quit: leaving]
<adam12> aesthe: Be hard to say one way or another without seeing the semantics of how the method is used and maybe parts of the class.
cthulchu_ has quit [Read error: Connection reset by peer]
<aesthe> its a script that im editing. so there are no classes. The script talks to anoter service api
cthulchu_ has joined #ruby
alexherbo2 has quit [Ping timeout: 240 seconds]
<havenwood> aesthe: How about a Hash that has top level keys for :headers and :body, with a successful body deserialized under :body?
BH23 has joined #ruby
<havenwood> aesthe: {headers: {'Status' => '200 OK'}, body: {foo: ['bar']}}
<aesthe> ooh that sounds goog
<aesthe> good
crimisok has left #ruby ["Leaving"]
<EdwardIII> :D wait a minute THAT looks familiar....
alfiemax_ has joined #ruby
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
alfiemax has quit [Ping timeout: 272 seconds]
xco has joined #ruby
ellcs has joined #ruby
alexherbo2 has joined #ruby
alfiemax has joined #ruby
alfiemax_ has quit [Ping timeout: 264 seconds]
<EdwardIII> havenwood: have you played with dry-rb and dry-monads success/failure at all?
bmurt has joined #ruby
<havenwood> EdwardIII: I'm familiar with it but have never used it in any project.
Swyper has quit [Remote host closed the connection]
<EdwardIII> looks kinda nice. once a year i try to start learning haskell then give up. it's a bit of a ritual
<jhass> I used dry-schema and dry-struct for a toy project the other day, I liked those, maybe a bit redundant but I see the point. I still think all the "monad emulation" stuff is a terrible idea in general
<havenwood> jhass: Yeah, I have hte same inclination.
alfiemax_ has joined #ruby
<EdwardIII> jhass: why do you say so?
<havenwood> EdwardIII: Check out my Optional monad implementation ^
Swyper has joined #ruby
<EdwardIII> one thing that bothers me a bit is all these classes with a "call" method... that sounds like a function to me heh
alexherbo2 has quit [Ping timeout: 265 seconds]
<jhass> EdwardIII: it's verbose and fighting with the language rather than looking for its native and idiomatic tools to tackle these problems
<havenwood> A solution in search of a problem
akem has quit [Ping timeout: 240 seconds]
<EdwardIII> well isn't the problem 'undefined method `do_thing' for nil:NilClass' at runtime?
<EdwardIII> not being argumentative, i kind of agree
alfiemax has quit [Ping timeout: 246 seconds]
roshanavand_ has joined #ruby
<jhass> the solution in Ruby is ?.
<EdwardIII> jhass: and good edge validation. which you still need even with static types
<jhass> in Ruby 3 the types analyzer stuff will likely help you with knowing where to put these
<jhass> yeah
<EdwardIII> havenwood: you mean "look how verbose it is"?
<EdwardIII> or just "hey check it out!"? :D
roshanavand has quit [Ping timeout: 258 seconds]
roshanavand_ is now known as roshanavand
Swyper has quit [Remote host closed the connection]
<EdwardIII> looks quite neat
Swyper has joined #ruby
<havenwood> EdwardIII: I just meant check it out. :) I tried to keep it tiny and the "fun" thing is using Optional#then interchangeably with Ruby's #then.
<EdwardIII> hah i forgot ruby has then now
<havenwood> now and then
<havenwood> now then
<jhass> good riddance, just forget it exists :P
<EdwardIII> haha good riddance? you mean it's gone already!?
<havenwood> EdwardIII: gone from jhass's mind
<havenwood> EdwardIII: still in Ruby
<EdwardIII> hahaha ok
Swyper has quit [Remote host closed the connection]
<havenwood> pickle.then(&:jar).then(&:label).then(&:words) #=> "BUBBIES!"
<havenwood> pickle.label.words #=> "sad not-a-monad pickle"
<EdwardIII> i've just been playing with ruby for a fun personal project. i've still used it over the years (and we have one project in rails, but it's kind of getting wound down). most of my day-to-day is typescript/node. writing ruby has been so lovely
<jhass> (same thing as with monads, look at this shiny feature (pipe operator) other languages have to solve a class of problems you don't even have with idiomatic ruby designs)
<havenwood> jhass: I like pipe operator, personally
<havenwood> jhass: I didn't care for the proposed Ruby one, since it was the wrong direction
<jhass> it's great, monads are great too. Does Ruby need either? I'm not convinced
<havenwood> Apparently impossible to implement a proper pipe operator
alexherbo2 has joined #ruby
<havenwood> jhass: Elixir convinced me that I'd like a pipeline operator to reverse the call order of methods when convenient for the reader. Unfortunately the one proposed was the same order, hence not at all useful to me so I didn't cry when it was removed.
<jhass> it's a solution to not having method chaining from languages that lack it
<havenwood> words(label(pickle_jar))) :is nicer to me as: pickle_jar |> label |> words
<havenwood> alternatively pickle_jar.label.words but... Ruby doesn't have parity between that and words(label(pickle_jar))) by default
<EdwardIII> one area that's a bit grey for me, i found types were really good for when i needed to pass in stubs. because i could make a stub and say "be sure it conforms to this type". gave a nice layer of extra protection to ensure the unit tests didn't come uncoupled from reality
<havenwood> it just varies which way it's done, and you can't go defining methods on everything
alexherbo25 has joined #ruby
<jhass> I'd argue that's just not desgning your stuff to be idiomatic
alexherbo2 has quit [Ping timeout: 260 seconds]
alexherbo25 is now known as alexherbo2
<jhass> Ruby is an OO language, buy into that
<EdwardIII> i feel like mocks with expects are a bit of an antipattern so only use them when 100% unavoidable
<jhass> having PickleJar being a little delegator around whatever it is you're passing around there is just fine
<EdwardIII> but i guess small classes with 1-2 methods with very clear interfaces and good TDD will help here
leitz has joined #ruby
alfiemax has joined #ruby
<EdwardIII> like... is this kind of thing OK? https://gist.github.com/EdwardIII/9f12381e61d3352c3961df48560c99db
BH23 has quit [Ping timeout: 240 seconds]
<leitz> A question for those "in the know"; are all standard library things going to become gems? Specifically, not included with Ruby?
<havenwood> leitz: Yes, they'll become gems. No, they won't all be removed from Ruby.
alfiemax_ has quit [Ping timeout: 246 seconds]
<EdwardIII> :o
<EdwardIII> what's this?
<jhass> I understood that a large motivation for the gemification of stdlib is updatability
<havenwood> EdwardIII: The stdlib is in the process of "gemification" where stdlib is cut into gems and shipped with Ruby.
<havenwood> See https://stdgems.org/
<jhass> so they come with ruby but can be updated independently
<havenwood> In the process, many gems are being dropped from stdlib.
<havenwood> "As of Ruby 3.0 preview, 82% (92 of 112) standard libraries have been gemified."
<EdwardIII> wow, interesting
<leitz> Can we drop bundler? :)
<havenwood> leitz: Bundler was the most recent addition to the stdlib.
<EdwardIII> think we're on track for seeing ruby 3.0 at xmas?
<leitz> havenwood, another good reason to drop it! Low hanging fruit, and all that.
<havenwood> leitz: Well, rbs is now the most recent.
<havenwood> leitz: In preview2, typeprof will be most recent.
<havenwood> One notable stdlib being removed is datetime.
alexherbo2 has quit [Ping timeout: 256 seconds]
<leitz> I've been hoping to move to just Ruby and it's stdlib, except for a few small things.
<leitz> havenwood, rbs is the type system?
<havenwood> leitz: It's the type signature lib, yeah.
<havenwood> leitz: It's the type signatures for Steep, which isn't in the sdtlib yet.
<leitz> havenwood, gotcha. I'm not a "type" guy.
<havenwood> leitz: types aren't your type?
<leitz> Took me years to learn to type, and...
<havenwood> leitz: your signature style is to be the type that doesn't like type signatures?
<havenwood> oh, typing, like keyboards...
<havenwood> I'm better at that than cursive, for sure.
alexherbo2 has joined #ruby
<havenwood> You outta see me sign my name. It's a squiggly line with a dot.
<leitz> havenwood, I'm all for letting object self-identify as they like.
<havenwood> Ooops, gave away my signature...
<leitz> Mine is an "L" and a big line.
<leitz> havenwood, but yeah, I want to move away from a lot of the dependencies that so many Ruby projects seem to depend on. It seems so fragile.
<leitz> havenwood, hence my desire to focus on stdlib stuff.
<EdwardIII> leitz: what kind of stuff are you making?
alexherbo2 has quit [Ping timeout: 272 seconds]
BH23 has joined #ruby
akem has joined #ruby
orbyt has joined #ruby
dasher00 has joined #ruby
<leitz> EdwardIII, small tools for stuff I use. BookBot collates my fiction (in text) into a book, with some slight mark-up. I'm going to learn LaTeX eventually. FTLTools are CLI things for playing a Traveller RPG, and FreeTrader will be a web based sci-fi merchant game.
<EdwardIII> cool stuff
<adam12> havenwood: any idea on where typeprof and rbs stand? They seem to overlap quite a bit.
<adam12> havenwood: rbs ala rbs prototype
<havenwood> adam12: ruby signature
<leitz> EdwardIII, yup. I enjoy it. I may melt my brain in November though. I have the "data" for a novel in a series of forum posts; thinking about writing something to extract all the story material and remove the HTML markup.
<havenwood> r(u)b(y)s(ignature) heh
TomyWork has quit [Remote host closed the connection]
<adam12> havenwood: but is that not what typeprof does? generate signatures?
<EdwardIII> leitz: sounds like a good exercise
<EdwardIII> i think your brain will remain solid :)
<leitz> EdwardIII, I'm hoping...
<havenwood> adam12: RBS is both the signature language and it has a simpler tool than typeprof for generating signatures.
<leitz> EdwardIII, how about you?
<havenwood> adam12: RBS will for example ship signatures for the stdlib.
<havenwood> And for gems.
<adam12> havenwood: Ah. I wonder if typeprof will replace `rbs prototype`.
<EdwardIII> leitz: just plauing with making a silly little site monitoring tool at the moment
<havenwood> adam12: If it got mature enough, it seems it could.
<EdwardIII> leitz: but i've made a hotel booking engine and a few similar things in the past in RoR
<leitz> EdwardIII, cool!
aesthe has quit [Quit: Leaving]
<leitz> Back in a Bit.
alexherbo2 has joined #ruby
TCZ has quit [Quit: Leaving]
xall has quit [Remote host closed the connection]
ellcs has quit [Read error: Connection reset by peer]
ellcs has joined #ruby
alfiemax has quit [Remote host closed the connection]
akem has quit [Ping timeout: 260 seconds]
akem_ has joined #ruby
mistergibson has joined #ruby
shortdudey123 has quit [Ping timeout: 260 seconds]
cd has joined #ruby
shortdudey123 has joined #ruby
dfucci has joined #ruby
vondruch has quit [Ping timeout: 264 seconds]
<leitz> EdwardIII, I need to polish and document it, but I did an RSPec based URI checker.
vondruch has joined #ruby
Swyper has joined #ruby
Swyper has quit [Read error: Connection reset by peer]
Swyper has joined #ruby
weaksauce has joined #ruby
Swyper has quit [Ping timeout: 244 seconds]
dfucci has quit [Ping timeout: 260 seconds]
axsuul has quit [Write error: Connection reset by peer]
axsuul has joined #ruby
<Tuor> IO.popen has to know the encoding when it's not US_ASCII... :(
quintasan has quit [Write error: Connection reset by peer]
quintasan has joined #ruby
quintasan has joined #ruby
quintasan has quit [Changing host]
Ven`` has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cnsvc has joined #ruby
bocaneri has quit [Read error: Connection reset by peer]
weaksauce has quit [Ping timeout: 265 seconds]
<havenwood> Tuor: How is it burning you? Windows?
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
weaksauce has joined #ruby
<havenwood> utf-8 everywhere \o/
<havenwood> Tuor: Curious where you're running into problems with Encoding set to UTF-8?
adu has quit [Ping timeout: 256 seconds]
a-l-e has quit [Ping timeout: 240 seconds]
adu has joined #ruby
jenrzzz has joined #ruby
rubydubdub has joined #ruby
<rubydubdub> given an array of methods `[m1, m2, m3, m4]` is there any way to dynamically/programmatically turn that into m1(m2(m3(m4())))?
<havenwood> rubydubdub: Yes. Is it an Array of Methods or an Array of Symbols corresponding to Methods?
<rubydubdub> either. they start as an array of symbols, but i can just [...].map{ |m| method(m)}
Ven`` has quit [Quit: Textual IRC Client: www.textualapp.com]
<havenwood> rubydubdub: Is the first (last in Array) method an exception that it doesn't take an argument?
Ven`` has joined #ruby
<rubydubdub> havenwood in that example, let say m4 is `def m4(*args) return true; end`
Ven`` has quit [Client Quit]
<EdwardIII> leitz: yeah? sounds interesting! is it to be used in rspec only? or anywhere?
jenrzzz has quit [Ping timeout: 265 seconds]
<havenwood> &>> [:puts, :Array, :to_s].reverse.then { |first_meth, *meths| meths.reduce(method(first_meth).call) { |acc, meth| method(meth).call(acc) } }
<rubydoc> # => main... check link for more (https://carc.in/#/r/9u56)
<havenwood> rubydubdub: contrived, but for example I
Ven`` has joined #ruby
TCZ has joined #ruby
<havenwood> rubydubdub: Or another example:
akem_ is now known as akem
<havenwood> &>> {value: 42, meths: [:puts, :Array]}.then { |value:, meths:| meths.reverse.reduce(value) { |acc, meth| method(meth).call(acc) } }
<rubydoc> # => 42... check link for more (https://carc.in/#/r/9u57)
<rubydubdub> havenwood thank you. testing it out now
ramfjord has quit [Ping timeout: 272 seconds]
<rubydubdub> hmmmm didn't quite work for me
<rubydubdub> there is a gist of an example im working with
<rubydubdub> if that helps
ramfjord has joined #ruby
infinityfye has quit [Quit: Leaving]
<havenwood> rubydubdub: %i[outer1 outer2 hello].then { |*meths, first_meth| meths.reverse.reduce(method(first_meth)) { |acc, meth| method(meth).call(acc) } }.call
<havenwood> rubydubdub: commented on your gist
<rubydubdub> Thank you soooo much!
<havenwood> rubydubdub: you're welcome
<havenwood> rubydubdub: You might prefer: first_meth, *meths = %i[outer1 outer2 hello].reverse
<rubydubdub> the %i is something new to me. time to do some reading :)
<havenwood> &>> %i[foo bar baz]
<rubydoc> # => [:foo, :bar, :baz] (https://carc.in/#/r/9u58)
<havenwood> rubydubdub: Just an Array of Symbols. :)
<havenwood> Shorthand
<rubydubdub> oh cool. thanks again
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<havenwood> you're welcome
<havenwood> happy coding!
<havenwood> rubydubdub: P.S. If you're not calling any private methods, you can switch `method(meth)` to `meth.to_proc`.
<havenwood> &>> method(:puts).call(42)
<rubydoc> # => 42... check link for more (https://carc.in/#/r/9u59)
<havenwood> &>> :puts.to_proc.call(42)
<rubydoc> stderr: -e:4:in `<main>': private method `puts' called for 42:Integer (NoMethodError)... check link for more (https://carc.in/#/r/9u5a)
<havenwood> rubydubdub: (Which I think is generally nicer, to respect privacy.)
zacts has quit [Quit: leaving]
<havenwood> rubydubdub: Or alternative to `meth.to_proc` is `public_method(meth)`
<havenwood> rubydubdub: The latter blows up immediately, the former when called.
<rubydubdub> that may be a good route to go for me.
xco has joined #ruby
ur5us has joined #ruby
jenrzzz has joined #ruby
zestril has quit [Ping timeout: 264 seconds]
zestril has joined #ruby
cognemo has quit [Quit: cognemo]
cognemo has joined #ruby
pwl has quit [Ping timeout: 246 seconds]
ur5us has quit [Ping timeout: 260 seconds]
SeepingN has joined #ruby
caef^ has joined #ruby
Liothen has quit [Ping timeout: 244 seconds]
Liothen has joined #ruby
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cnsvc has quit [Ping timeout: 240 seconds]
cnsvc has joined #ruby
<leitz> EdwardIII, sorry, I had minimized the window. It writes the rspec tests to check a url. https://github.com/LeamHall/ruby_admin_tools/blob/master/bin/uri_test_spec.rb
Swyper has joined #ruby
cnsvc has quit [Client Quit]
Swyper has quit [Read error: Connection reset by peer]
Swyper has joined #ruby
Swyper has quit [Remote host closed the connection]
ur5us has joined #ruby
Swyper has joined #ruby
ramfjord has quit [Ping timeout: 260 seconds]
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
rubydubdub has quit [Remote host closed the connection]
ramfjord has joined #ruby
alexherbo2 has quit [Ping timeout: 256 seconds]
donpdonp[m] has joined #ruby
dfucci has joined #ruby
alexherbo2 has joined #ruby
adu has quit [Quit: adu]
donpdonp|z has joined #ruby
dfucci has quit [Ping timeout: 264 seconds]
<donpdonp|z> im using a gem that does variable.try(:method) and ruby says no method 'try'. isnt Object.try part of ruby(2.7)?
leitz has quit [Quit: Leaving]
<SeepingN> isn't that a Rails thing or no?
<donpdonp|z> ah yeah i guess it is.
ramfjord has quit [Ping timeout: 256 seconds]
<donpdonp|z> any idea which gem i could include to get try without loading all of rails?
<SeepingN> I hate that. I do a lot of command line or console type stuff and when I don't have Rails I have to recreate things. bleh
<SeepingN> sorry, no
<donpdonp|z> ah looks like activesupport is it.
<donpdonp|z> thx for the help
<SeepingN> yeah probably
SeepingN has quit [Quit: The system is going down for reboot NOW!]
<adam12> donpdonp|z: What about variable&.method
<adam12> donpdonp|z: Not 100% 1-to-1 but fairly close.
ramfjord has joined #ruby
<donpdonp|z> i would but its not my gem
s2013 has joined #ruby
ap4y has joined #ruby
<leftylink> sounds like the gem needs to be fixed
jobewan has quit [Quit: jobewan]
<donpdonp|z> yup. the repo has turned off Issues, though https://github.com/Bloxy-info/web3-eth
<donpdonp|z> i just pulled out the try definition from activesupport and included it myself. seems to work ok :)
donpdonp|z has left #ruby ["The Lounge - https://donp.org/thelounge"]
manuelpinot has quit [Quit: Lost terminal]
braincrash has joined #ruby
dionysus69 has quit [Ping timeout: 258 seconds]
TCZ has quit [Quit: Leaving]
braincrash has quit [Ping timeout: 260 seconds]
TCZ has joined #ruby
Emmanuel_Chanel has quit [Quit: Leaving]
orbyt has quit [Quit: Textual IRC Client: www.textualapp.com]
orbyt has joined #ruby
Emmanuel_Chanel has joined #ruby
Emmanuel_Chanel has quit [Max SendQ exceeded]
dionysus69 has joined #ruby
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jenrzzz_ has joined #ruby
jenrzzz has quit [Ping timeout: 258 seconds]
alexherbo2 has quit [Read error: Connection reset by peer]
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
alexherbo2 has joined #ruby
Fusl has quit [Ping timeout: 246 seconds]
Fusl has joined #ruby
braincrash has joined #ruby
mnathani has quit []
hiroaki has quit [Ping timeout: 272 seconds]
SeepingN has joined #ruby
hiroaki has joined #ruby
braincrash has quit [Ping timeout: 260 seconds]
jenrzzz_ has quit [Ping timeout: 240 seconds]
stryek has quit [Quit: Connection closed for inactivity]
queip has quit [Ping timeout: 260 seconds]
leftylink has quit [Quit: Lost terminal]
leftylink has joined #ruby
drincruz has quit [Ping timeout: 272 seconds]
oneeggeach has joined #ruby
oneeggeach has quit [Client Quit]
TCZ is now known as simp_ai
FetidToot has quit [Quit: The Lounge - https://thelounge.chat]
skryking has quit [Quit: Konversation terminated!]
simp_ai is now known as TCZ
jenrzzz has joined #ruby
roshanavand_ has joined #ruby
SeepingN has quit [Quit: The system is going down for reboot NOW!]
roshanavand has quit [Ping timeout: 265 seconds]
roshanavand_ is now known as roshanavand
jenrzzz has quit [Ping timeout: 240 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]