<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
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
<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>
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
<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]
<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
<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. :)
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)
<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
<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.
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>
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")
<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
<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?
<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]
<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
<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)}