Class: Trokko::Scaffolders::DockerCompose

Inherits:
Object
  • Object
show all
Defined in:
lib/trokko/scaffolders/docker_compose.rb

Overview

Generating docker-compose file according to configuration

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#dbObject (readonly)

Returns the value of attribute db.



7
8
9
# File 'lib/trokko/scaffolders/docker_compose.rb', line 7

def db
  @db
end

#thorObject (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

#generateObject



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