module RubyYacht

This module groups together all the libraries for this gem.

Public Class Methods

configuration() click to toggle source

This method gets the current configuration for the system.

# File lib/ruby_yacht/dsl/configuration.rb, line 259
def self.configuration
  @configuration ||= Configuration.new
end
configure(&block) click to toggle source

This method adds configuration for the system.

If you pass a block to this method, it will be evaluated using the methods in RubyYacht::Configuration::DSL.

Any projects you define in that block will be added to the current list of projects.

# File lib/ruby_yacht/dsl/configuration.rb, line 242
def self.configure(&block)
  new_configuration = Configuration::DSL.new.run(block).create_object
  %w(projects hooks).each do |field|
    self.configuration.send("#{field}=", self.configuration.send(field) + new_configuration.send(field))
  end

  self.configuration.local_config = self.configuration.local_config.merge(new_configuration.local_config)

  new_configuration.server_types.each do |type|
    if self.configuration.server_types.any? { |existing| existing.name == type.name }
      raise "Server type already registered: #{type.name}"
    end
    self.configuration.server_types << type
  end
end