Class: Wip::Initializer
- Inherits:
-
Object
- Object
- Wip::Initializer
- Defined in:
- lib/wip/initializer.rb
Overview
Builds a starter wip.yml. Detects an existing compose file next to the
target (the same filenames ComposeBridge auto-detects) to decide between
mode: compose and mode: container, since that's the one decision wip init can't leave to a placeholder.
Constant Summary collapse
- CONTAINER_TEMPLATE =
<<~YAML version: 1 mode: container defaults: container: app # TODO: name of the container wip creates image: your/image:tag # TODO: image to run workdir: /app sync: {} # optional; mirrors the source into a named volume instead of bind-mounting it live YAML
Instance Method Summary collapse
- #call ⇒ Object
- #compose? ⇒ Boolean
-
#initialize(dir: Dir.pwd) ⇒ Initializer
constructor
A new instance of Initializer.
Constructor Details
#initialize(dir: Dir.pwd) ⇒ Initializer
Returns a new instance of Initializer.
21 22 23 |
# File 'lib/wip/initializer.rb', line 21 def initialize(dir: Dir.pwd) @dir = dir end |
Instance Method Details
#call ⇒ Object
27 28 29 |
# File 'lib/wip/initializer.rb', line 27 def call compose? ? compose_template : CONTAINER_TEMPLATE end |
#compose? ⇒ Boolean
25 |
# File 'lib/wip/initializer.rb', line 25 def compose? = !!compose_file |