DevHeads.net

Postings by Kevin Deisz

prettier for Ruby

Hi Ruby community,

I've released a plugin for prettier that supports the Ruby language, and it
got merged into the prettier org this morning. It's here:
<a href="https://github.com/prettier/plugin-ruby" title="https://github.com/prettier/plugin-ruby">https://github.com/prettier/plugin-ruby</a>. Instructions for usage and more
descriptions of what prettier is are in the README, but a short version is
that prettier is an opinionated, deterministic formatter that integrates
with most editors. Let me know if you have any issues/questions/feedback.

Feedback

Hi there,

I'm looking for feedback on <a href="https://bugs.ruby-lang.org/issues/14680" title="https://bugs.ruby-lang.org/issues/14680">https://bugs.ruby-lang.org/issues/14680</a> and
<a href="https://bugs.ruby-lang.org/issues/14344" title="https://bugs.ruby-lang.org/issues/14344">https://bugs.ruby-lang.org/issues/14344</a>. Sorry I haven't committed to Ruby
before and am not sure of the best way to go about getting more feedback
other than emailing this listserv.

Please let me know if there's a better way to go about getting feedback on
these. Thanks!

fast_underscore

Hi Ruby folks,

In the flavor of Sam Saffron's fast_blank gem for speeding up AS' blank?
method, I wrote a fast_underscore gem (
<a href="https://github.com/kddeisz/fast_underscore" title="https://github.com/kddeisz/fast_underscore">https://github.com/kddeisz/fast_underscore</a>) this weekend that does the same
for the AS underscore method (was noticing it in my stack profiling). Some
people may see a very small uptick in performance from their Rails apps
using this gem. YMMV.

minitest-keyword

Hi there,

<a href="https://github.com/kddeisz/minitest-keyword" title="https://github.com/kddeisz/minitest-keyword">https://github.com/kddeisz/minitest-keyword</a> minitest-keyword is a gem that
adds keyword arguments to minitest assertions, so for instance you don't
need to remember the order to assert_equal and end up getting bad debugging
errors.

PRs and feedback welcome on github.

iseq-rails-tools

Hi there everyone,

I just released iseq_rails_tools (
<a href="https://github.com/kddeisz/iseq-rails-tools" title="https://github.com/kddeisz/iseq-rails-tools">https://github.com/kddeisz/iseq-rails-tools</a>,
<a href="https://rubygems.org/gems/iseq_rails_tools" title="https://rubygems.org/gems/iseq_rails_tools">https://rubygems.org/gems/iseq_rails_tools</a>) a gem for taking advantage of
ruby 2.3's AOT bytecode compilation in Rails projects.

To use, add `gem 'iseq_rails_tools'` to your Gemfile and bundle install.
From then on when files are required, they will be precompiled. On my
work's production Rails app I'm seeing about a 30% increase in boot time.

Enjoy! PRs/feedback always welcome.

Callbacks in ruby

Hi everyone,

I've been struggling with something for a while and was hoping someone who
knows more about me than this would be able to help. I have this gist:
<a href="https://gist.github.com/kddeisz/d975ef9a5e45a88bacb03e9f2c1fcf67" title="https://gist.github.com/kddeisz/d975ef9a5e45a88bacb03e9f2c1fcf67">https://gist.github.com/kddeisz/d975ef9a5e45a88bacb03e9f2c1fcf67</a>. I'm
attempting to build in generic callbacks that I can port into a number of
our gems here (this is not an invitation for a discussion on the merits of
callbacks).

I've got them working nicely for before and after callbacks. My issue comes
with around callbacks.

String forward-slash operator

Would there be interest in a forward-slash operator on String as a shortcut
for File.join? I end up using File.join everywhere and it seems like
something so fundamental could benefit from an operator. For instance:

File.join('Documents', 'projects', 'ruby', 'string.c')

would become:

'Documents' / 'projects' / 'ruby' / 'string.c'

Thoughts?