# frozen_string_literal: true require_relative '../../command' module Sumcli module Commands class Add class Service < Sumcli::Command DOCKER_FILE = 'docker-compose.yml' def initialize(name, options) @name = name @options = options end def execute(input: $stdin, output: $stdout) self.send("add_#{@name}") output.puts @name + ' added to docker-compose' end def add_postgres() generator.inject_into_file DOCKER_FILE, " db:\n" + " image: 'postgres:9.6.3'\n" + " ports:\n" + " - '5432'", after: "services:\n" end end end end end