<comeoooon>
Hello! I have this basic webscraper here: https://clbin.com/lUWfN -- but how do I exit the current iteration in `create_posts` and move on to the next item (incase something isn't right)?
<comeoooon>
Sorry if this is too basic of a question :)
<Zerock>
comeoooon: ordinarily you would simply write "next" but I don't know what that does in the case of map(). Maybe it inserts nil at that position, but I would test first. Alternatively, it doesn't look like you are actually using the output of map(), so you should probably instead use each(), and "next" would be appropriate there.
<havenwood>
comeoooon: consider running `rubocop -A` on your code for some linting.
<havenwood>
comeoooon: looks good overall.
<havenwood>
comeoooon: post an updated code link if you'd like more refined comments
<havenwood>
comeoooon: the thinks I'd fail on code review are `URI.open` and `link =` with questions about return values.
<comeoooon>
Fantastic :D
<havenwood>
things*
<havenwood>
and by "fail" I mean "politely comment on", I don't mean to come off harsh
<havenwood>
this code is nice to read, and the URI.open is a gotcha
<comeoooon>
Oh no by all means. What people sometimes get angry when you try to improve their code? :D
<comeoooon>
Thanks, that means a lot. Was under the impression it was a mess (esp the full version)
<gr33n7007h>
havenwood: what version of ruby has URI.read
<havenwood>
gr33n7007h: all versions
<gr33n7007h>
havenwood: i haven't got it
<havenwood>
gr33n7007h: require 'open-uri'
<gr33n7007h>
havenwood: yeah, with requiring open-uri, i don't seem to have it, weird.
<havenwood>
rrr
<havenwood>
yeah, you're right. memory is totally failing me here...
<gr33n7007h>
havenwood: no worries, i just couldn't remember ever seeing that method.
<havenwood>
gr33n7007h: I may be losing my mind here. I need sleep. Heh.
<havenwood>
Thank you for the sanity check!
<gr33n7007h>
havenwood: not a problem, sleep does the world of good for your brain :)
<havenwood>
100%
<Zerock>
is that a gem or is it included with ruby?
<gr33n7007h>
Zerock: it's a default gem
<gr33n7007h>
Zerock: meaning, they're a part of ruby and can always be required.
<Zerock>
neat
Ziyan has joined #ruby
leftylin1 is now known as leftylink
Sankalp has quit [Ping timeout: 252 seconds]
nirvdrum has quit [Quit: nirvdrum]
Sankalp has joined #ruby
nirvdrum has joined #ruby
nirvdrum has quit [Client Quit]
comet23 has joined #ruby
thomas25 has joined #ruby
<thomas25>
is gem install supposed to add the executable to PATH? (it does not do that on msys2 windows, it installed the gem into ~/.gem/ruby/2.7.0/gems/ and that's that
<comeoooon>
thomas25: I always add it manually to my .zshrc
<thomas25>
comeoooon, ok so this is the excpected behavior
<thomas25>
and a ruby file has a check `unless defined? (X)` can i define it via env vars?
John_Ivan has quit [Ping timeout: 256 seconds]
abraham has joined #ruby
abraham has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
duds- has quit [Read error: Connection reset by peer]
jpn has joined #ruby
duds- has joined #ruby
jpn has quit [Ping timeout: 256 seconds]
jpn has joined #ruby
Inoperable has quit [Excess Flood]
Furai has quit [Quit: WeeChat 3.6]
Inoperable has joined #ruby
ollysmith_ has quit [Quit: ZNC 1.8.2+deb2+b5 - https://znc.in]
jpn has quit [Ping timeout: 268 seconds]
ollysmith has joined #ruby
jpn has joined #ruby
Furai has joined #ruby
protektwar has joined #ruby
protektwar has quit [Changing host]
protektwar has joined #ruby
TomyWork has quit [Remote host closed the connection]
protektwar has quit [Ping timeout: 256 seconds]
polishdub has quit [Quit: leaving]
<havenwood>
depesz: The funny thing is that json-jwt doesn't mean to ship a `console` executable.
<havenwood>
depesz: The RubyGems default for executables is `spec.bindir = 'bin'` but json-jwt follows the Bundler convention of using `bin/, which should come with modifying the default to `spec.bindir = 'exe'` but the author didn't do that.
<havenwood>
I think they just didn't realize the RubyGems and Bundler conventions conflict. It causes an issue here.
<havenwood>
depesz: Maybe do a PR to the gem with `spec.bindir = 'exe'` to fix the issue upstream?