Project

padlock

0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
Padlock is an environment-based component switch system.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

>= 2.1
 Project Readme

Padlock

"...even Nedry knew better than to mess with the raptor fences."

Padlock is a component switch system.

Define which components should be used in certain environments.

Padlock is a fork of Paddock, but uses the term component instead of feature to reduce domain collisions.

Setup

Put this somewhere like: config/initializers/padlock.rb

include Padlock

Padlock(Rails.env) do
  enable  :phone_system,  :in => [:development, :test]
  enable  :door_locks,    :in => :development
  enable  :raptor_fences
  disable :cryo_security
  disable :tyranosaur_fences, :in => :production
end

You name it, we got it.

Usage

# Check if component is enabled
if Padlock.component(:perimeter_fence)
  # do work
end

# Guard a block
Padlock.component(:perimeter_fence) do
  # do work
end

This is a unix system. I know this.

Testing

This might need some work.

You can define which components are enabled in a test:

before(:each) do
  Padlock.enable :component_i_am_testing
end

You think that kind of automation is easy? Or cheap?

Authors

We're not computer nerds. We prefer to be called "hackers."

  • Pat Nakajima
  • Brandon Keene

I prefer not to be too closely associated with the aforementioned "hackers."

  • Todd Persen

(c) Copyright 2010 Pivotal Labs, see LICENSE