class RubyYacht::App::DSL

This class provide’s the DSL for configuring an app.

Inside of the project configuration, you can call ‘app [name]` to add an app, and then pass it a block to configure the app, which will allow you to call these DSL methods.

Public Class Methods

new(server_type, name) click to toggle source

This initializer starts the DSL for the app.

### Parameters

  • **server_type: Symbol** The type of server this is.

  • **name: String** The name of the app.

# File lib/ruby_yacht/dsl/app.rb, line 64
def initialize(server_type, name)
  @server_type = server_type
  @name = name.to_sym
  load_custom_attributes
end

Public Instance Methods

check_required_attributes() click to toggle source

This method checks that all of the required attributes have been set on the object.

If they haven’t, this will raise an exception.

It also checks that the server type has been defined in the configuration.

# File lib/ruby_yacht/dsl/app.rb, line 102
def check_required_attributes
  super
  check_server_type @server_type, :app
end
database_name() click to toggle source

You can call ‘database ’foo’‘ to tell the app to use the database server named `foo`.

# File lib/ruby_yacht/dsl/app.rb, line 81
add_attribute :database_name, nil, false
port() click to toggle source

You can call ‘port 3000` to set the app’s ‘port`. It defaults to 8080.

# File lib/ruby_yacht/dsl/app.rb, line 91
add_attribute :port, 8080
repository_name() click to toggle source

You can call ‘repository_name ’foo/bar’‘ to set the app’s ‘repository_name`.

# File lib/ruby_yacht/dsl/app.rb, line 75
add_attribute :repository_name, nil, false
server_type() click to toggle source

You can call ‘server_type :foo` to set the app’s ‘server_type`.

# File lib/ruby_yacht/dsl/app.rb, line 86
add_attribute :server_type