Giter Club home page Giter Club logo

junctions's Introduction

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.