Class: RubyYacht::App
- Inherits:
-
Object
- Object
- RubyYacht::App
- Defined in:
- lib/ruby_yacht/dsl/app.rb
Overview
This class models an app that's part of the local system.
See RubyYacht::App::DSL for information on configuring the app.
Defined Under Namespace
Classes: DSL
Instance Attribute Summary collapse
-
#database_name ⇒ Object
The name of the database that this app uses as its data store.
-
#name ⇒ Object
The name of the app.
-
#port ⇒ Object
The port that the app listens on.
-
#repository_name ⇒ Object
The name of the repository where the app's code is stored, relative To the project's repository domain.
-
#server_type ⇒ Object
The type of app this is, which determines what hooks and scripts we run when building it.
Instance Method Summary collapse
-
#container_name ⇒ Object
This method gets the name of the image / container that this app will run in.
-
#database ⇒ Object
This method gets the database that the app connects to.
-
#project ⇒ Object
The project that includes this app.
Instance Attribute Details
#database_name ⇒ Object
The name of the database that this app uses as its data store.
23 24 25 |
# File 'lib/ruby_yacht/dsl/app.rb', line 23 def database_name @database_name end |
#name ⇒ Object
The name of the app
7 8 9 |
# File 'lib/ruby_yacht/dsl/app.rb', line 7 def name @name end |
#port ⇒ Object
The port that the app listens on.
20 21 22 |
# File 'lib/ruby_yacht/dsl/app.rb', line 20 def port @port end |
#repository_name ⇒ Object
The name of the repository where the app's code is stored, relative To the project's repository domain.
11 12 13 |
# File 'lib/ruby_yacht/dsl/app.rb', line 11 def repository_name @repository_name end |
#server_type ⇒ Object
The type of app this is, which determines what hooks and scripts we run when building it.
For instance, this would be rails
for a Rails app.
17 18 19 |
# File 'lib/ruby_yacht/dsl/app.rb', line 17 def server_type @server_type end |
Instance Method Details
#container_name ⇒ Object
This method gets the name of the image / container that this app will run in.
32 33 34 35 36 37 38 39 |
# File 'lib/ruby_yacht/dsl/app.rb', line 32 def container_name project = self.project if project.system_prefix == self.name return "#{project.system_prefix}" else return "#{project.system_prefix}-#{self.name}" end end |
#database ⇒ Object
This method gets the database that the app connects to.
Returns
RubyYacht::Database
45 46 47 |
# File 'lib/ruby_yacht/dsl/app.rb', line 45 def database project.databases.find { |database| database.name == database_name } end |
#project ⇒ Object
The project that includes this app.
26 27 28 |
# File 'lib/ruby_yacht/dsl/app.rb', line 26 def project RubyYacht.configuration.projects.find { |project| project.apps.include?(self) } end |