Sha256: 411c018c45dff587d86c90eca711a390168d3b94c32d6b202a6ce2767105cd6e
Contents?: true
Size: 793 Bytes
Versions: 24
Compression:
Stored size: 793 Bytes
Contents
module Switchman module Shackles module ClassMethods def self.prepended(klass) klass.send(:remove_method, :ensure_handler) end # drops the save_handler and ensure_handler calls from the vanilla # Shackles' implementation. def activate!(environment) environment ||= :master activated_environments << environment old_environment = self.environment @environment = environment old_environment end # since activate! really is just a variable swap now, it's safe to use in # the ensure block, simplifying the implementation def activate(environment) old_environment = activate!(environment) yield ensure activate!(old_environment) end end end end
Version data entries
24 entries across 24 versions & 1 rubygems