Project

junctions

0.0
Low commit activity in last 3 years
No release in over a year
Description of Junctions.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 13.0, >= 13.0.6
~> 2.2, >= 2.2.33
~> 0.1.6
~> 0.21

Runtime

>= 5.2.4.3
 Project Readme

Junctions

Layered junctioning for Rails. Feature flags done right.

Junctions works by enabling conditional namespaced module inclusion. What that actually means is that features in a module can be enabled or disable by creating them in a particular namespace. For example:

module Core
  include Junctions
  def overridden_method
    puts('You are in core')
  end
end

module Wibble
  def overridden_method
    puts('Wibble')
  end
end

module Wobble
  def overridden_method
    puts('Something else')
  end
end

Including Junctions in Core means that if there is a 'junctions' setting as, for example, an environment variable

  junctions=wibble, wobble

would first load up Core, then Wibble and finally Wobble as modules and include each of them in turn. This has the effect of overriding the 'overridden_method' inside Core to display 'Something else' as the message. Likewise if the environment variable were:

  junctions=wibble

This would only include Wibble into the list of namespaces to override Core methods.

Ruby and Rails Versions

Junctions has been built for Ruby 2.5 and Rails 5. Although it was originally built for Ruby 1.8 and Rails 2, because of fundamental changes to later versions of rails and engines in particular, the decision was made to track the latest Rails version only.