class RubyYacht::Project::DSL

This class provides a DSL for configuring a project.

You can access this inside RubyYacht::Configuration::DSL by calling ‘project`. It will create a RubyYacht::Project.

Public Class Methods

custom_attribute_method() click to toggle source

This method gets the attribute that server types can use to specify custom attributes for this DSL type.

This DSL uses ‘project_attributes`.

# File lib/ruby_yacht/dsl/project.rb, line 169
def self.custom_attribute_method
  :project_attributes
end
new(name) click to toggle source

This initializer creates a new project.

### Parameters

  • *name: String* The name of the project

# File lib/ruby_yacht/dsl/project.rb, line 69
def initialize(name)
  @name = name.to_sym
  load_custom_attributes
  load_app_initializers
end

Public Instance Methods

app() click to toggle source

You can call ‘app ’mars’‘ to add an app called `mars`. This takes a block for configuring the app, which allows you to call methods in RubyYacht::App::DSL

# File lib/ruby_yacht/dsl/project.rb, line 114
add_object_list :app, RubyYacht::App::DSL
check_out_locally() click to toggle source

You can call ‘check_out_locally` to set the project’s ‘check_out_locally` flag to `true`. The default is false.

# File lib/ruby_yacht/dsl/project.rb, line 106
add_boolean :check_out_locally
database() click to toggle source

You can call ‘database` to configure a database for the project. This takes a block for configuring the database, which allows you to call methods in RubyYacht::Database::DSL

# File lib/ruby_yacht/dsl/project.rb, line 122
add_object_list :database, RubyYacht::Database::DSL
dns_server() click to toggle source

You can call ‘dns_server` to configure the DNS for the project. This takes a block for configuring the DNS , which allows you to call methods in RubyYacht::DnsServer::DSL

This is optional.

# File lib/ruby_yacht/dsl/project.rb, line 140
add_object :dns_server, RubyYacht::DnsServer::DSL, required: false
load_app_initializers() click to toggle source

This method loads the special DSL methods for defining apps of a certain type.

For the app type with the name ‘foo`, this will create a `foo_app` method on the DSL that builds an app with the type `foo`.

# File lib/ruby_yacht/dsl/project.rb, line 149
def load_app_initializers
  RubyYacht.configuration.server_types.each do |server_type|
    main_method = server_type.container_type.to_s
    main_method += "_server" if server_type.container_type == :web
    method_name = "#{server_type.name}_#{main_method}"
    define_singleton_method method_name do |*args, &block|
      self.public_send(
        main_method,
        server_type.name,
        *args,
        &block
      ) 
    end
  end
end
repository() click to toggle source

You can call ‘repository ’github.com’‘ to set the project’s ‘repository` to `github.com`

# File lib/ruby_yacht/dsl/project.rb, line 87
add_attribute :repository
repository_protocol() click to toggle source

You can call ‘repository_protocol :https` to tell the scripts to check out the repositories over HTTPS rather than SSH.

# File lib/ruby_yacht/dsl/project.rb, line 93
add_attribute :repository_protocol, :ssh
system_prefix() click to toggle source

You can call ‘system_prefix ’my-apps’‘ to set the projects system_prefix` to `my-apps`

# File lib/ruby_yacht/dsl/project.rb, line 81
add_attribute :system_prefix
web_server() click to toggle source

You can call ‘web_server` to configure a web server for the project. This takes a block for configuring the server, which allows you to call methods in RubyYacht::WebServer::DSL

# File lib/ruby_yacht/dsl/project.rb, line 130
add_object_list :web_server, RubyYacht::WebServer::DSL