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
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
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
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
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
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
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
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
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
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
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