Various notes, links, and information about the Ruby programming language.

Feature Flags

Feature flags can be used to enable and disable code dynamically. This makes it easier to do Continuous Deployment since a new feature can be enabled in a limited manner.

There are a variety of gems which implement features flags in various ways:

Sources and Discussion

Invariants and Assertions

Software Assertions are statements in a routine which should always be true. There statements may or may not be disabled in production.

A simple version of this could be implemented just by raising exceptions. However there are gems which allow for better control and make the difference between exceptions and assertions more clear.

Building Gems

Guidelines for building/maintaining gem projects

When setting up TravisCI and CodeClimate, for a gem supporting Ruby 2.0 and up, the following .travis.yml can be used:

language: ruby
- linux
- osx
sudo: false
  - 2.0
  - 2.1
  - 2.2
  - 2.3
  - 2.4
  - 2.5
  - ruby-head
    - rvm: ruby-head
    - rvm: 2.0
      os: osx
    - rvm: 2.4
      os: osx
  - bundle exec codeclimate-test-reporter

You will also need to add the CODECLIMATEREPOTOKEN to the TravisCI environment variables, getting the value from the Code Climate repository Settings > Test Coverage.


Ruby Blog Entires