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/web_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, WebServer

Class Method Summary collapse

Class Method Details

.configurationObject

This method gets the current configuration for the system.



234
235
236
# File 'lib/ruby_yacht/dsl/configuration.rb', line 234

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.



219
220
221
222
223
224
225
226
227
228
229
230
231
# File 'lib/ruby_yacht/dsl/configuration.rb', line 219

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