Class: Percheron::Actions::Create
- Inherits:
-
Object
- Object
- Percheron::Actions::Create
- Includes:
- Base
- Defined in:
- lib/percheron/actions/create.rb
Instance Method Summary collapse
- #execute! ⇒ Object
-
#initialize(unit, build: true, start: false, force: false, cmd: false) ⇒ Create
constructor
A new instance of Create.
Methods included from Base
#base_dir, #in_working_directory
Constructor Details
#initialize(unit, build: true, start: false, force: false, cmd: false) ⇒ Create
Returns a new instance of Create.
6 7 8 9 10 11 12 |
# File 'lib/percheron/actions/create.rb', line 6 def initialize(unit, build: true, start: false, force: false, cmd: false) @unit = unit @build = build @start = start @force = force @cmd = (cmd || unit.start_args) end |
Instance Method Details
#execute! ⇒ Object
14 15 16 17 18 19 |
# File 'lib/percheron/actions/create.rb', line 14 def execute! results = [] results << build_or_pull_image! results << create! results.compact.empty? ? nil : unit end |