FLOSS Ruby Projects
I have been writing RubyGems since 2008, and Rails plugins since 2005. Contributions to the community Along the way I have contributed to many projects, including rails’ active-record (PR #20921), annotate_models (PR #473), hashie (PR #313, PR #314, PR #315, PR #316, and PR #318), git-reflow (PR #155, and PR #159), memoist (PR #33), month (PR #7), neography (PR #74 and PR #104), masonry-rails (PR #14), zues-parallel_tests (PR #28), rusen (PR #5, and PR #6), gem-release (PR #37 and PR #38), gem-dependent (PR #11), RubyGems Guides (PR #211), sidekiq-unique-jobs (PR #194), keep-a-changelog (PR #224), rchardet (PR #28), clearance (PR #769), wwtd (PR #48), capistrano-ssh-doctor (PR #11), google-drive-ruby (PR #282), subroutine (PR #4), clockwork (PR #14), ruby toolbox catalog (PR #12), amazon-awis (PR #2), and appraisal (PR #128).
A reference implementation of a custom React renderer for Rails. Adds benchmarking info to Rails logs for parity with Rails view rendering benchmarking. I’ll put something here soon.
Performance Measured and Tuned Batch Processing of Records with Blocks in Rails. EachInBatches (Originally BolingForBatches) NOTE: I am resurrecting this code because I still have this recurring need, and Rail’s native batching doesn’t cut mustard. It is some of my most ancient code, and it isn’t pretty, but I hope to improve it over time. I often need to execute really large computations on really large data sets. I usually end up writing a rake task to do it, which calls methods in my models.
Collect errors from multiple objects on a single object, especially useful with the Form Object Presenter Pattern. I’ll put something here soon.
Organize data results from raw sql queries (as with PGresult, or Dossier) intelligently. I’ll put something here soon.
Bit Fields for Active Record What is a bit field? https://en.wikipedia.org/wiki/Bit_field What is a bitwise operation? https://en.wikipedia.org/wiki/Bitwise_operation flag_shih_tzu supports both :bit_operator and :in_list query modes, but only :in_list can will utilize a database index. What does it look like? class Lead < ActiveRecord::Base include FlagShihTzu has_flags 1 => :warm_up_email_sent, 2 => :follow_up_call_made, 3 => :final_email_sent, 4 => :appointment_scheduled, 5 => :not_interested, # You can specify use any integer column to use for flags!
Ruby Gemfile analysis. gem_bench is for static Gemfile and installed gem library source code analysis. gem_bench can also be used to trim down app load times by keeping your worst players on the bench. Gem: “Put me in coach!” You: ❨╯°□°❩╯︵┻━┻ Usage Works with Ruby >= 2.0 due to use of named parameters. Example! Getting tired of seeing this irb warning, perhaps? $ bundle exec rails console Loading staging environment (Rails M.
Enhancer of Rails’ content_for system. Allows defaults, and no_content_for overrides in partials. For Rails 3, 4. Why? Keep the views dry with content_for_with_default and friends! Complete flexibility in defining defaults and overrides. Remove most or all logic from views. Allow for no content to override a default. DryViews provides extensions to ActionView::Helpers::CaptureHelper, which is part of ActionPack: content_for_with_default no_content_for content_for (enhanced to play nice with the above methods) The rails rendering chain is sort of inside out so the template rendering happens first, and this is what makes it possible to override everything!
An Email Condom for your Ruby Server sanitize_email This gem allows you to override your mail delivery settings, globally or in a local context. It is like a Ruby encrusted condom for your email server, just in case it decides to have intercourse with other servers via sundry mail protocols. Summary It’s particularly helpful when you want to prevent the delivery of email (e.g. in development/test environments) or alter the to/cc/bcc (e.