jhass[m] changed the topic of #ruby to: Rules: https://ruby-community.com | Ruby 3.1.2, 3.0.4, 2.7.6: https://www.ruby-lang.org | Paste 4+ lines to: https://gist.github.com | Books: https://goo.gl/wpGhoQ
Babybinladen has quit [Quit: Connection closed]
Dean has quit [Quit: Lost terminal]
entropie has quit [Ping timeout: 246 seconds]
entropie has joined #ruby
crankharder has quit [Ping timeout: 244 seconds]
<michigan> constxd: https://clbin.com/Kk6tP I think I did it!
<michigan> It goes to ftp.usa.openbsd.org, finds the highest release number, chdirs to that directory, downloads ports.tar.gz, extracts it, and lists all the categories and then all the ports
crankharder has joined #ruby
<michigan> (I'm trying to give something back to the openbsd community by indexing all their ports inside a Rails app)
jl- has joined #ruby
crankharder has quit [Ping timeout: 276 seconds]
<constxd> nice :)
jl- has quit [Ping timeout: 276 seconds]
crankharder has joined #ruby
crankharder has quit [Ping timeout: 244 seconds]
dionysus69 has quit [Ping timeout: 240 seconds]
crankharder has joined #ruby
crankharder has quit [Ping timeout: 276 seconds]
markong has quit [Ping timeout: 246 seconds]
jpn has joined #ruby
<michigan> Can anyone tell why `File.read` at line 21 at https://gist.github.com/basicfeatures/4eb1f646730fc187d059d9da91385b82 gives me `Errno::ENOENT (No such file or directory @ rb_sysopen - ports/archivers/arc/pkg/DESCR)`, whereas if I run `File.read` outside of the loop, it seems to work fine?
jpn has quit [Ping timeout: 276 seconds]
stylo has joined #ruby
crankharder has joined #ruby
<michigan> Nevermind, I got this 👍
crankharder has quit [Ping timeout: 244 seconds]
<michigan> No I don't
<michigan> Can anybody tell why `File.read` won't seem to work inside this loop? https://clbin.com/xrimW
<weaksauce> it does
<weaksauce> it returns the array though
<weaksauce> or whatever you are iterating over
<weaksauce> do a puts file = File.open ..
<weaksauce> .
<weaksauce> michigan ^
<michigan> weaksauce: Howdy! Still nothing I'm afraid
<weaksauce> post more of the code instead of a pared down example michigan
<michigan> Here's the full thingie: https://clbin.com/bCfY5 👍
Ziyan has joined #ruby
<constxd> can you show the output
<weaksauce> yeah do some puts debugging
<weaksauce> p categories after you create that
<weaksauce> p ports
<weaksauce> make the filename separate and p that
swaggboi has quit [Read error: Connection timed out]
swaggboi has joined #ruby
<michigan> weaksauce: Strange, none of the puts i put inside that loop shows up
<weaksauce> and do a File.exist? filename
<weaksauce> are you running the right script?
<weaksauce> saving it?
Ziyan has quit [Read error: Connection reset by peer]
<michigan> No im trying it inside irb
Ziyan has joined #ruby
<weaksauce> Dir.pwd
<weaksauce> make sure you are in the right area
<michigan> Yep I am
<weaksauce> i also asked to have p ports
jhass has quit [Ping timeout: 240 seconds]
<michigan> Could it be some sorta conflict with Pathname maybe?
<michigan> sec
<weaksauce> i don't think the cwd changes inside a loop like that ... that would be madness
crankharder has joined #ruby
<weaksauce> the fact that you aren't getting any output is concerning
<weaksauce> oh wait
<weaksauce> yeah first doesn't take a block
<michigan> `p ports` works as expected: `["arc", "blosc", "brotli" ...`
<michigan> I'm getting the same for `each` too though
<weaksauce> either way first doesn't take a block
<weaksauce> so that code will never be run
<michigan> No wait actually, when I change first to each, I get: Errno::ENOENT (No such file or directory @ rb_sysopen - ports/archivers/bzip/pkg/DESCR)
<michigan> But that file does indeed exist
<weaksauce> how sure are you?
<weaksauce> File.exist? "ports/archivers/bzip/pkg/DESCR"
<michigan> running `puts file = File.read("ports/archivers/arc/pkg/DESCR")` outside of the loop works as expected
<michigan> im sure
<weaksauce> bzip is different than arc
<weaksauce> so do the thing on that
<michigan> my bad, but yeah its the same
<michigan> :/
jhass has joined #ruby
<weaksauce> there's nothing about each loops that make it any different though
<weaksauce> so the fact that it's failing on bzip leads me to believe that doesn't exist
<michigan> its the same with arc, i was just messing up the copy/paste..
<michigan> could you try running the entire thing? ports.tar.gz is a bit big though so it might take a while to unzip it
crankharder has quit [Ping timeout: 244 seconds]
Linux_Kerio has quit [Ping timeout: 240 seconds]
<weaksauce> michigan gem::package new doesn't work for me
<weaksauce> oh well i'll open it manually
<michigan> :D maybe its not the cleanest way to extract a tgz.. anyway works here after i `require "rubygems/package"`
swaggboi has quit [Read error: Connection timed out]
<weaksauce> yeah it doesn't always have that file
<weaksauce> michigan you are going to have to figure out a better way to get the files you want since that doesn't seem standard
<weaksauce> arc has it
<michigan> basically im trying to make an interactive and searchable index of OpenBSD's ports collection in Rails, downloading and unzipping the .tgz is the only way I can think of
crankharder has joined #ruby
<michigan> Its gotta be an absolute/relative path thing i bet, due to Pathname
crankharder has quit [Ping timeout: 244 seconds]
jl- has joined #ruby
jpn has joined #ruby
Ziyan has quit [Ping timeout: 244 seconds]
Ziyan has joined #ruby
swaggboi has joined #ruby
<weaksauce> i'm telling you michigan if you look around not all of the directories have DESC
rvalue has quit [Quit: ZNC - https://znc.in]
rvalue has joined #ruby
<weaksauce> er DESCR
jl- has quit [Ping timeout: 276 seconds]
<michigan> didnt notice that
jpn has quit [Ping timeout: 240 seconds]
<weaksauce> you will have to have a different approach to populating that list
<michigan> weaksauce!!! :D
<weaksauce> you can do recursive globs but even then i'm not sure
<michigan> removing all other folders except `ports/archivers/arc` makes the whole script work :D
crankharder has joined #ruby
<michigan> different approach in what way?
<michigan> also if there's anything else you see that could be improved do let me know. that thing is just a rough copy/paste experiment from old stackoverflow posts..
<weaksauce> i guess assuming that the file exists in the first place?
<weaksauce> you can just guard on that and have a pared down list of things
<weaksauce> or do a recursive glob
<weaksauce> and only match on things that end with DESCR
constxd has quit [Ping timeout: 264 seconds]
crankharder has quit [Ping timeout: 244 seconds]
crankharder has joined #ruby
swaggboi has quit [Read error: Connection timed out]
crankharder has quit [Ping timeout: 240 seconds]
crankharder has joined #ruby
swaggboi has joined #ruby
<michigan> weaksauce: Did as you said... I think we have it working now!
<weaksauce> nice michigan
crankharder has quit [Ping timeout: 244 seconds]
desnudopenguino has quit [Ping timeout: 264 seconds]
<michigan> weaksauce: https://clbin.com/frPmV thanks a lot for the help
<michigan> thanks for sharing my struggle!
<michigan> (got rid of "pathname" altogether, probably for the best)
jpn has joined #ruby
jpn has quit [Ping timeout: 276 seconds]
crankharder has joined #ruby
crankharder has quit [Ping timeout: 244 seconds]
desnudopenguino has joined #ruby
jpn has joined #ruby
jpn has quit [Ping timeout: 276 seconds]
jpn has joined #ruby
jpn has quit [Ping timeout: 276 seconds]
<michigan> I'm trying to grep a file for a line and then remove the junk surrounding it, but it only seems to add more junk: https://clbin.com/bVIuE
swaggboi has quit [Read error: Connection timed out]
jl- has joined #ruby
jl- has quit [Ping timeout: 276 seconds]
smp has quit [Remote host closed the connection]
smp has joined #ruby
swaggboi has joined #ruby
rvalue has quit [Ping timeout: 240 seconds]
<sam113101> michigan: select will return every line that starts with "COMMENT", not just the first one, hence why you're getting an array back
<sam113101> you're getting more "junk" because you're turning an array into a string, which is probably not what you want
<michigan> I think I understand what you mean
<michigan> Makes a whole lotta sense 👍
<michigan> What should I be using instead of select?
<michigan> The Makefiles only have one line containing `COMMENT` though
<sam113101> in that case you can use "find"
<michigan> sam113101: That is so amazing, thank you
rvalue has joined #ruby
crankharder has joined #ruby
<sam113101> np
<michigan> sam113101: It'll be online in an hour or so, please stick around.
crankharder has quit [Ping timeout: 276 seconds]
crankharder has joined #ruby
Sankalp has quit [Ping timeout: 240 seconds]
crankharder has quit [Ping timeout: 240 seconds]
Sankalp has joined #ruby
jpn has joined #ruby
jpn has quit [Ping timeout: 244 seconds]
stylo has quit [Quit: Connection closed for inactivity]
rvalue has quit [Read error: Connection reset by peer]
rvalue has joined #ruby
Sankalp has quit [Ping timeout: 276 seconds]
Sankalp has joined #ruby
jl- has joined #ruby
teclator has joined #ruby
jl- has quit [Ping timeout: 240 seconds]
crankharder has joined #ruby
crankharder has quit [Ping timeout: 276 seconds]
Ziyan has quit [Ping timeout: 240 seconds]
stylo has joined #ruby
Ziyan has joined #ruby
desnudopenguino has quit [Ping timeout: 244 seconds]
bastienleonard has quit [Ping timeout: 260 seconds]
crankharder has joined #ruby
crankharder has quit [Ping timeout: 240 seconds]
dionysus69 has joined #ruby
crankharder has joined #ruby
dionysus69 has quit [Ping timeout: 240 seconds]
crankharder has quit [Ping timeout: 276 seconds]
dionysus69 has joined #ruby
Linux_Kerio has joined #ruby
___nick___ has joined #ruby
jl- has joined #ruby
jl- has quit [Ping timeout: 244 seconds]
ur5us has joined #ruby
jpn has joined #ruby
swaggboi has quit [Read error: Connection timed out]
swaggboi has joined #ruby
Ziyan_ has joined #ruby
Ziyan has quit [Ping timeout: 244 seconds]
cxl has quit [Quit: bye]
swaggboi has quit [Read error: Connection timed out]
bastelfreak has quit [Ping timeout: 240 seconds]
cxl has joined #ruby
protektwar has joined #ruby
protektwar has quit [Changing host]
protektwar has joined #ruby
bastelfreak has joined #ruby
swaggboi has joined #ruby
crankharder has joined #ruby
crankharder has quit [Ping timeout: 240 seconds]
stylo has quit [Quit: Connection closed for inactivity]
crankharder has joined #ruby
jl- has joined #ruby
jl- has quit [Ping timeout: 240 seconds]
___nick___ has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
spawnmc has quit [Quit: Client closed]
___nick___ has joined #ruby
llua has quit [Quit: <Rudolph> shell code is what greycat reads to kids when he tucks them in]
llua has joined #ruby
protektwar has quit [Ping timeout: 240 seconds]
constxd has joined #ruby
Ziyan has joined #ruby
Ziyan_ has quit [Ping timeout: 244 seconds]
Ziyan has quit [Quit: Textual IRC Client: www.textualapp.com]
markong has joined #ruby
John_Ivan has quit [Remote host closed the connection]
John_Ivan has joined #ruby
crankharder has quit [Ping timeout: 244 seconds]
crankharder has joined #ruby
crankharder has quit [Ping timeout: 276 seconds]
crankharder has joined #ruby
crankharder has quit [Ping timeout: 244 seconds]
crankharder has joined #ruby
crankharder has quit [Ping timeout: 240 seconds]
crankharder has joined #ruby
jl- has joined #ruby
jl- has quit [Ping timeout: 276 seconds]
John_Ivan has quit [Remote host closed the connection]
John_Ivan has joined #ruby
crankharder has quit [Ping timeout: 276 seconds]
crankharder has joined #ruby
crankharder has quit [Ping timeout: 240 seconds]
crankharder has joined #ruby
bastienleonard has joined #ruby
John_Ivan has quit [Quit: Leaving]
John_Ivan has joined #ruby
Ziyan has joined #ruby
crankharder has quit [Ping timeout: 246 seconds]
crankharder has joined #ruby
Ziyan has quit [Ping timeout: 244 seconds]
Ziyan has joined #ruby
jl- has joined #ruby
protektwar has joined #ruby
protektwar has joined #ruby
protektwar has quit [Changing host]
jl- has quit [Ping timeout: 246 seconds]
desnudopenguino has joined #ruby
markong has quit [Ping timeout: 244 seconds]
lagash has quit [Ping timeout: 240 seconds]
slothby has joined #ruby
crankharder has quit [Ping timeout: 276 seconds]
crankharder has joined #ruby
crankharder has quit [Ping timeout: 244 seconds]
crankharder has joined #ruby
Furai has quit [Quit: WeeChat 3.5]
Furai has joined #ruby
crankharder has quit [Ping timeout: 240 seconds]
Ziyan has quit [Ping timeout: 244 seconds]
crankharder has joined #ruby
ur5us has quit [Ping timeout: 240 seconds]
John_Ivan has quit [Remote host closed the connection]
Ziyan has joined #ruby
bit4bit has joined #ruby
crankharder has quit [Ping timeout: 246 seconds]
bit4bit has quit [Remote host closed the connection]
bit4bit has joined #ruby
protektwar has quit [Ping timeout: 240 seconds]
crankharder has joined #ruby
crankharder has quit [Ping timeout: 246 seconds]
Ziyan has quit [Read error: Connection reset by peer]
Ziyan has joined #ruby
bit4bit has quit [Remote host closed the connection]
bit4bit has joined #ruby
dionysus69 has quit [Ping timeout: 240 seconds]
lagash has joined #ruby
teclator has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
crankharder has joined #ruby
crankharder has quit [Ping timeout: 240 seconds]
crankharder has joined #ruby
jl- has joined #ruby
crankharder has quit [Ping timeout: 244 seconds]
jl- has quit [Ping timeout: 264 seconds]
polishdub has joined #ruby
crankharder has joined #ruby
crankharder has quit [Ping timeout: 240 seconds]
crankharder has joined #ruby
___nick___ has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
___nick___ has joined #ruby
___nick___ has quit [Client Quit]
___nick___ has joined #ruby
crankharder has quit [Ping timeout: 240 seconds]
crankharder has joined #ruby
protektwar has joined #ruby
protektwar has quit [Changing host]
protektwar has joined #ruby
swaggboi has quit [Read error: Connection timed out]
crankharder has quit [Ping timeout: 244 seconds]
jpn has quit [Ping timeout: 276 seconds]
crankharder has joined #ruby
_ht has joined #ruby
crankharder has quit [Ping timeout: 240 seconds]
<mooff> i have a confession to make.
<mooff> "for foo in bar" has grown on me..
<mooff> in place of .each only, i find it slightly easier to read and write
swaggboi has joined #ruby
crankharder has joined #ruby
<constxd> W
John_Ivan has joined #ruby
crankharder has quit [Ping timeout: 276 seconds]
crankharder has joined #ruby
crankharder has quit [Ping timeout: 244 seconds]
crankharder has joined #ruby
<adam12> mooff: you monster :P
<michigan> Just made it work with http://70.34.221.122:3069/categories/1 after 1-2 days of non-stop programming
<michigan> About to pass out any second now :/
crankharder has quit [Ping timeout: 244 seconds]
crankharder has joined #ruby
jl- has joined #ruby
jl- has quit [Ping timeout: 256 seconds]
<leah2> mooff: but then you need end
howdoi has joined #ruby
<ox1eef> mooff: lately i used to avoid #each as a workaround to some other issue, and looks like under the hood it just uses #each
<ox1eef> btw using flock got me thinking of kodak black music. arguably much worse.
<havenwood> mooff: like ox1eef said, even if you don't want to use #each your `for` is going to turn into: [:send, {:mid=>:each, :flag=>0, :orig_argc=>0}, ...
<havenwood> mooff: And it's not as good with encapsulation.
<havenwood> #each is correct
John_Ivan has quit [Remote host closed the connection]
John_Ivan has joined #ruby
<leah2> as my styleguide says :p
<havenwood> You don't often see that ^ semicolon trick with block args, but it's handy to know it exists.
<leah2> huh
<leah2> since 1.9 o.o
llua has quit [Ping timeout: 240 seconds]
ur5us has joined #ruby
llua has joined #ruby
ur5us has quit [Ping timeout: 264 seconds]
darkdrgn2k has joined #ruby
<darkdrgn2k> hi all im getting " OpenIDConnect::Discovery::DiscoveryFailed (SSL_connect returned=1 errno=0 state=error: certificate verify failed (unable to get local issuer certificate)):
<darkdrgn2k> "
<darkdrgn2k> but curl into the domain in question works fine
<darkdrgn2k> does ruby use a differnt cert/ca stack?
<adam12> darkdrgn2k: It can.
<adam12> darkdrgn2k: How'd you install Ruby?
<darkdrgn2k> its part of a docker
<darkdrgn2k> (alpine linux but kinda old)
<adam12> Is it one of the official ruby images?
<adam12> Who's ca on the cert for that site?
<darkdrgn2k> FROM ruby:2.7.2-alpine AS base
<darkdrgn2k> and its trying to access a Lets Encrypt cert
<adam12> Lets Encrypt had to change their root cert a while back. I bet its' related.
<darkdrgn2k> yeh
<darkdrgn2k> well one of their root expired and they switched the a differnt one
<darkdrgn2k> but the expired root cause tones of problems
<darkdrgn2k> but, it does work from curl which is wierd
<adam12> curl from the host tho? or inside the container.
<darkdrgn2k> i tried using SSL_CERT_DIR/SSL_CERT_FILE to set to the OS directory but that didnt look
<darkdrgn2k> from inside the container
<darkdrgn2k> (docker exec)
<adam12> That is strange.
Sankalp has quit [Ping timeout: 244 seconds]
Pixi` has joined #ruby
crankharder has quit [Ping timeout: 256 seconds]
crankharder has joined #ruby
Pixi has quit [Ping timeout: 246 seconds]
<adam12> darkdrgn2k: Unfortunately I think it's the swd gem raising the exception, which is probably from the httpclient gem.
<adam12> darkdrgn2k: And that httpclient gem has this beautiful nugget: https://github.com/nahi/httpclient/blob/master/lib/httpclient/cacert.pem
<darkdrgn2k> hardcoded certs :/
_ht has quit [Remote host closed the connection]
<darkdrgn2k> got it thank
crankharder has quit [Ping timeout: 244 seconds]
Pixi` has quit [Ping timeout: 264 seconds]
___nick___ has quit [Ping timeout: 276 seconds]
crankharder has joined #ruby
crankharder has quit [Ping timeout: 276 seconds]
<michigan> Hello guys, I put up my app on https://github.com/basicfeatures/openports, any advice and constructive criticism would be much welcomed!
jl- has joined #ruby
jl- has quit [Ping timeout: 276 seconds]
darkdrgn2k has quit [Ping timeout: 255 seconds]
bastienleonard has quit [Ping timeout: 276 seconds]
crankharder has joined #ruby
crankharder has quit [Ping timeout: 240 seconds]
Ziyan has quit [Quit: Textual IRC Client: www.textualapp.com]
protektwar has quit [Ping timeout: 240 seconds]
crankharder has joined #ruby
Pixi has joined #ruby
crankharder has quit [Ping timeout: 240 seconds]
crankharder has joined #ruby
crankharder has quit [Ping timeout: 244 seconds]
sweetening7 has joined #ruby
cocalero has joined #ruby
cocalero_ has joined #ruby
cocalero has quit [Client Quit]
cocalero_ is now known as cocalero
crankharder has joined #ruby
sweetening7 has quit [Ping timeout: 276 seconds]
crankharder has quit [Ping timeout: 240 seconds]
crankharder has joined #ruby
smp has quit [Quit: ZNC 1.8.2 - https://znc.in]
smp has joined #ruby
swaggboi has quit [Read error: Connection timed out]
markong has joined #ruby
crankharder has quit [Ping timeout: 244 seconds]
crankharder has joined #ruby
crankharder has quit [Ping timeout: 244 seconds]
<mooff> i see the troll worked :P
<mooff> it's a truthful troll, though
swaggboi has joined #ruby
crankharder has joined #ruby
jpn has joined #ruby
<mooff> that it works through .each means it works with custom enumerables!
jpn has quit [Ping timeout: 240 seconds]
<mooff> and, imo, legitimises it somewhat in my mind.. it's just sugar for the most common kind of iteration :-)
crankharder has quit [Ping timeout: 276 seconds]
jpn has joined #ruby
crankharder has joined #ruby
jpn has quit [Ping timeout: 244 seconds]
<mooff> i saw it being used in a Ruby game dev tutorial and recoiled. now a year later i get guilty pleasure from using it :-)
crankharder has quit [Ping timeout: 244 seconds]
bit4bit has quit [Quit: Leaving]
crankharder has joined #ruby
crankharder has quit [Ping timeout: 276 seconds]
crankharder has joined #ruby
jl- has joined #ruby
crankharder has quit [Ping timeout: 276 seconds]
Linux_Kerio has quit [Ping timeout: 244 seconds]
crankharder has joined #ruby
jl- has quit [Ping timeout: 240 seconds]
crankharder has quit [Ping timeout: 244 seconds]
mbarbar_ has quit [*.net *.split]
mbarbar_ has joined #ruby
crankharder has joined #ruby
crankharder has quit [Ping timeout: 240 seconds]
crankharder has joined #ruby
crankharder has quit [Ping timeout: 240 seconds]
crankharder has joined #ruby
crankharder has quit [Ping timeout: 276 seconds]
crankharder has joined #ruby
crankharder has quit [Ping timeout: 244 seconds]
crankharder has joined #ruby
crankharder has quit [Ping timeout: 276 seconds]
crankharder has joined #ruby
cocalero has quit [Quit: Going offline, see ya! (www.adiirc.com)]
crankharder has quit [Ping timeout: 276 seconds]
crankharder has joined #ruby
crankharder has quit [Ping timeout: 276 seconds]
gr33n7007h has quit [Ping timeout: 248 seconds]
crankharder has joined #ruby