Logo Rails Bling
Logo Inverted Logo
  • Categories
  • agile
  • async
  • bundler
  • development
  • evented
  • federation
  • floss
  • git
  • Go
  • howto
  • humanitarian
  • logging
  • maintenance
  • management
  • refugees
  • resque
  • rspec
  • ruby
  • security
  • threaded
  • tools
Hero Image
Introducing silent_stream

ActiveSupport’s Stream Silencing - Without ActiveSupport SilentStream is an extraction of some parts of ActiveSupport’s Kernel Reporting Core Extentions. Since July 2014 silence_stream, silence_stderr, capture, silence, and quietly have been deprecated because they are not thread safe. See that discussion in the PR where it all went down. I rely on them a lot in single threaded code, and so I plan to keep them alive. With the exception of silence, which was just an alias of capture.

September 23, 2018 Read
Hero Image
Introducing require_bench

Ruby Bootstrapping Analysis Ruby app loading slowly, or never? Discover bootstrapping issues in Ruby by benchmarking “Kernel.require” Installation Add this line to your application’s Gemfile: gem 'require_bench' And then execute: $ bundle Or install it yourself as: $ gem install require_bench Usage Require the library where it will be loaded prior to any other requires you want to benchmark. require 'require_bench' By default this gem does nothing, hacks nothing, and has zero effects.

September 21, 2018 Read
Hero Image
Introducing anonymous_active_record

ActiveRecord Without a Database? Replacement for broken Class.new(ActiveRecord::Base). Very useful in testing Rails apps, and even more so for testing gems without having to specify full blown models. If you prefer an exceptionally hacky alternative that could also be used for real runtime code, see my other gem activerecord-tablefree! Installation Add this line to your application’s Gemfile: gem 'anonymous_active_record' And then execute: $ bundle Or install it yourself as: $ gem install anonymous_active_record Usage Require the library in your spec_helper or other test suite boot file.

January 4, 2018 Read
Hero Image
Maintaining oauth2

A Ruby wrapper for the OAuth 2.0 protocol UPDATE 2018-10-13: Version 1.4.1 has been released! I am now the lead maintainer of the oauth2 gem. I will work toward getting a version 2.0.0 released, which will not drop support for any currently supported Rubies. After that a 3.0.0 release will drop support for EOL Rubies. Oauth2 gem is looking for additional maintainers. See #307. A Ruby wrapper for the OAuth 2.

December 6, 2017 Read
Hero Image
Introducing activerecord-tablefree

ActiveRecord Without a Database? ActiveRecord Tablefree Models provides a simple mixin for creating models that are not bound to the database. This approach is useful for taking advantage of the features of ActiveRecord such as validation, relationships, nested_attributes, etc. This can also be very useful in testing where a mock-like object will suffice. This gem is exceptionally hacky. For an alternative solution, primarily aimed at testing, that is less hacky, see my other gem anonymous_active_record!

November 14, 2017 Read
Hero Image
Introducing resque-unique_at_runtime

Ensures that only one job for a given queue will be running concurrently. A semanticaly versioned Resque plugin which ensures for a given queue, that only one worker is working on a job at any given time. Resque::Plugins::UniqueAtRuntime differs from resque-lonely_job in that it is compatible with, and can be used at the same time as, resque-solo. Resque::Plugins::UniqueAtRuntime differs from resque_solo in that resque-solo offers queue-time uniqueness, while resque-unique_at_runtime offers runtime uniqueness.

October 1, 2017 Read
Hero Image
Gemfile Specs! New for gem_bench v1.0.2

Gemfile Specs! New for 1.0.2 Version constraints are important. Give the Gemfile some love in your CI build Create a spec/gemfile_spec.rb like: Rspec.describe "Gemfile" do it("has version constraint on every gem") do requirements = GemBench::StrictVersionRequirement.new({verbose: false}) expect(requirements.list_missing_version_constraints).to eq([]) end end Then your build will fail as soon as a gem is added without a proper constraint: Failures: 1) Gemfile has version constraint on every gem Failure/Error: expect(requirements.list_missing_version_constraints).to eq([]) expected: [] got: ["puma"] (compared using ==) # .

June 2, 2017 Read
Hero Image
Introducing resque-unique_by_arity

Magic hacks which allow integration of job multiple Resque plugins providing different types of job uniqueness Because some jobs have parameters that you do not want to consider for determination of uniqueness. resque_solo and resque-unique_at_runtime (a resque-lonely_job rewrite) will now work together! Without this gem they are fundamentally incompatible. I’ll put something here soon.

April 29, 2017 Read
Hero Image
Introducing debug_logging

Unobtrusive Call Stack Logging for the discerning Rubyist A new release is coming soon!

March 25, 2017 Read
Hero Image
Gem Source Grep! New for gem_bench v1.0.0

Find WAT Dragons! New for 1.0.0 Search the Ruby source code of all the gems loaded by your Gemfile for a specified regex, to find out which gems have wat DRAGONS. Gem: “I have no wat DRAGONS!” You: ❨╯°□°❩╯︵┻━┻ >> puts GemBench.find(look_for_regex: /wat/).starters.map {|gem| "#{gem.name} has wat DRAGONS at #{gem.stats}" }.join("\n") [GemBench] Will search for gems in ["/Users/pboling/.rvm/gems/ruby-2.4.0@floss/gems", "/Users/pboling/.rvm/gems/ruby-2.4.0@global/gems", "/Users/pboling/.rvm/gems/ruby-2.4.0@floss/bundler/gems"] [GemBench] Detected 11 loaded gems + 2 loaded gems which GemBench is configured to ignore.

February 26, 2017 Read
Hero Image
Maintaining dynamoid

Ruby ORM for Amazon’s DynamoDB. NOTE: This post has been updated for version 3 of dynamoid! For version 1.3.x use the 1-3-stable branch README. Installation Installing Dynamoid is pretty simple. First include the Gem in your Gemfile: gem 'dynamoid', '~> 2' Prerequisities Dynamoid depends on the aws-sdk, and this is tested on the current version of aws-sdk (~> 3), rails (>= 4). Hence the configuration as needed for aws to work will be dealt with by aws setup.

September 4, 2016 Read
Hero Image
Introducing activerecord-transactionable

Properly Implement ActiveRecord Transactions Provides a method, transaction_wrapper at the class and instance levels that can be used instead of ActiveRecord#transaction. Enables you to do transactions properly, with custom rescues and retry, including with or without locking. Installation Add this line to your application’s Gemfile: gem 'activerecord-transactionable' And then execute: $ bundle Or install it yourself as: $ gem install activerecord-transactionable Usage class Car < ActiveRecord::Base include Activerecord::Transactionable # Note lowercase "r" in Activerecord (different namespace than rails' module) validates_presence_of :name end When creating, saving, deleting within the transaction make sure to use the bang methods (!

March 28, 2016 Read
  • ««
  • «
  • 1
  • 2
  • 3
  • 4
  • 5
  • »
  • »»
Navigation
  • About
  • Skills
  • Experience
  • Projects
Contact me:
  • peter.boling a@t gmail.com
  • +1-925-252-5351

Toha Theme Logo Toha (tweaked by @pboling)
© 2024 Peter Boling
CC BY-SA 4.0
Powered by Hugo Logo