Github | https://github.com/postmodern |
Blog | https://postmodern.github.io |
Pronouns | dude/dude |
Github | https://github.com/postmodern |
Blog | https://postmodern.github.io |
Pronouns | dude/dude |
Is there a RSpec matcher to expect that a value exists in an Array of expected values? If not, there should be. I don't like inverting my expect() statement to be:
expect(expected_values).to include(subject.thing_i_am_testing) # not ideal
Ideally it would look like:
expect(subject.foo).to eq_any_of(expected_values) # better
Is there any benefit to packaging up common rubocop configuration into a gem (aka inherited_gem) vs. just bundling said gem from git?
Examples:
https://github.com/ronin-rb/rubocop-ronin
https://github.com/Shopify/ruby-style-guide#readme
Is there a way to get deprecation warnings/notifications for projects from GitHub or rubygems.org? I just now discovered, after pushing some minor changes, that the async-io gem was deprecated in favor of io-endpoint 10 months ago; luckily it's just a name change so easy to fix.🤯 Need to improve my dependency monitoring.
Or what about methods that chain together multiple method calls, passing various arguments to each method call? Is more than one method call per method body too much complexity for an endless method?
def foo(arg,**kwargs) = bar(**kwargs).baz(arg)
vs.
def foo(arg,**kwargs)
bar(**kwargs).baz(arg)
end
What kind of methods should *not* be converted into endless methods? Methods that call `puts`? Methods include `==`? Methods with many args? How complex can a single-line method get before it should not be converted into an endless method?
Personally I think that methods who's body is a single equals comparison (ex: `@foo == 42`) look confusing when converted into an endless method due to the combination of `=` symbols.
def forty_two? = @foo == 42
vs.
def forty_two?
@foo == 42
end
Trying out new Vim colorschemes. Curious what other Rubyists/Crystalers use? I'm looking for a bright theme (aka not pastel) that goes well with a black background. Also want different colors for keywords vs names/identifiers; i.e. `class` and `Foo` should have different colors. Please no colorschemes that set `gui=italic`!
I like molokai, but it uses the same color for keywords and identifiers. I also like abstract, but it uses italics.
"the debate about types, TypeScript, and web development is, for example, largely anecdotal gossip not backed by much in terms of structured research – but when you’re trying to answer a question with huge ramifications, you really want proper research."
"This is the original sin of software dev: it’s a pop culture where we’re trained to accept gossip as evidence."
Periodic reminder that blog posts and talks == anecdotes, not proof. Take it with a grain of salt.
https://www.baldurbjarnason.com/2025/trusting-your-own-judgement-on-ai/
StackOverflow is doing their annual survey. Now is your chance to vote for Ruby and hopefully improving Ruby's ranking; and counteracting the "rUbY iS dYiNg" nonsense.
PSA: supply chain attacks (aka forking popular gems, changing the name slightly, and adding malicious code) are starting to show up on https://rubygems.org more often. Be cautious when adding a new gem to your project. Check who the author is, check the GitHub repository, look at the commit history, etc.
https://socket.dev/blog/malicious-ruby-gems-exfiltrate-telegram-tokens-and-messages-following-vietnam-ban