Module: RubyYacht

Defined in:
lib/ruby_yacht.rb,
lib/ruby_yacht/dsl/app.rb,
lib/ruby_yacht/dsl/dsl.rb,
lib/ruby_yacht/plugins.rb,
lib/ruby_yacht/dsl/hook.rb,
lib/ruby_yacht/dsl/project.rb,
lib/ruby_yacht/dsl/database.rb,
lib/ruby_yacht/dsl/dns_server.rb,
lib/ruby_yacht/dsl/server_type.rb,
lib/ruby_yacht/dsl/configuration.rb

Overview

This module groups together all the libraries for this gem.

Defined Under Namespace

Modules: DSL, Plugins, Runner Classes: App, Configuration, Database, DnsServer, Hook, Project, ServerType

Class Method Summary collapse

Class Method Details

.configurationObject

This method gets the current configuration for the system.


215
216
217
# File 'lib/ruby_yacht/dsl/configuration.rb', line 215

def self.configuration
  @configuration ||= Configuration.new
end

.configure(&block) ⇒ Object

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.


200
201
202
203
204
205
206
207
208
209
210
211
212
# File 'lib/ruby_yacht/dsl/configuration.rb', line 200

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

  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