Class: Trokko::Scaffolders::DockerCompose
- Inherits:
-
Object
- Object
- Trokko::Scaffolders::DockerCompose
- Defined in:
- lib/trokko/scaffolders/docker_compose.rb
Overview
Generating docker-compose file according to configuration
Instance Attribute Summary collapse
-
#db ⇒ Object
readonly
Returns the value of attribute db.
-
#thor ⇒ Object
readonly
Returns the value of attribute thor.
Instance Method Summary collapse
- #generate ⇒ Object
-
#initialize(db:, thor:) ⇒ DockerCompose
constructor
A new instance of DockerCompose.
Constructor Details
#initialize(db:, thor:) ⇒ DockerCompose
Returns a new instance of DockerCompose.
9 10 11 12 |
# File 'lib/trokko/scaffolders/docker_compose.rb', line 9 def initialize(db:, thor:) @db = db @thor = thor end |
Instance Attribute Details
#db ⇒ Object (readonly)
Returns the value of attribute db.
7 8 9 |
# File 'lib/trokko/scaffolders/docker_compose.rb', line 7 def db @db end |
#thor ⇒ Object (readonly)
Returns the value of attribute thor.
7 8 9 |
# File 'lib/trokko/scaffolders/docker_compose.rb', line 7 def thor @thor end |
Instance Method Details
#generate ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/trokko/scaffolders/docker_compose.rb', line 14 def generate thor.template( 'templates/docker-compose.yml.erb', "#{thor.name}/docker-compose.yml", force: true, context: binding ) end |