Sha256: 502b5074d9a3c8e451ecd8f75683e06db683518e04d897ed6408e012fda6df3d

Contents?: true

Size: 1.04 KB

Versions: 17

Compression:

Stored size: 1.04 KB

Contents

module RR

  # The settings of the current deployment are passed to Rubyrep through the
  # Initializer::run method.
  # This method yields a Configuration object for overwriting of the default
  # settings.
  # Accordingly a configuration file should look something like this:
  #
  #   Rubyrep::Initializer.run do |config|
  #     config.left = ...
  #   end
  class Initializer

    # Sets a new Configuration object
    # Current configuration values are lost and replaced with the default
    # settings.
    def self.reset
      @@configuration = Configuration.new
    end
    reset

    # Returns the current Configuration object
    def self.configuration
      @@configuration
    end

    # Allows direct overwriting of the Configuration
    def self.configuration=(configuration)
      @@configuration = configuration
    end

    # Yields the current Configuration object to enable overwriting of
    # configuration values.
    # Refer to the Initializer class documentation for a usage example.
    def self.run
      yield configuration
    end
  end
end

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
rubyrep-2.0.1 lib/rubyrep/initializer.rb
rubyrep-2.0.0 lib/rubyrep/initializer.rb
andyjeffries-rubyrep-1.2.1 lib/rubyrep/initializer.rb
rubyrep-1.2.0 lib/rubyrep/initializer.rb
rubyrep-1.1.2 lib/rubyrep/initializer.rb
rubyrep-1.1.1 lib/rubyrep/initializer.rb
rubyrep-1.1.0 lib/rubyrep/initializer.rb
rubyrep-1.0.9 lib/rubyrep/initializer.rb
rubyrep-1.0.8 lib/rubyrep/initializer.rb
rubyrep-1.0.3 lib/rubyrep/initializer.rb
rubyrep-1.0.4 lib/rubyrep/initializer.rb
rubyrep-1.0.5 lib/rubyrep/initializer.rb
rubyrep-1.0.6 lib/rubyrep/initializer.rb
rubyrep-1.0.7 lib/rubyrep/initializer.rb
rubyrep-1.0.0 lib/rubyrep/initializer.rb
rubyrep-1.0.2 lib/rubyrep/initializer.rb
rubyrep-1.0.1 lib/rubyrep/initializer.rb