Sha256: ad0fb1b3ea68226f7c49eda7f396eda4c970ffabc0107f1110ca570c81a50c9f
Contents?: true
Size: 1.11 KB
Versions: 4
Compression:
Stored size: 1.11 KB
Contents
# frozen_string_literal: true module ConvenientService module Examples module Dry module V1 class Gemfile module Services class RunShellCommand include DryService::Config option :command option :debug, default: -> { false } contract do schema do required(:command).filled(:string) optional(:debug).value(:bool) end end step :result, in: :command def result ## # NOTE: When the command exit code is 0, `system` return `true`, and `false` otherwise. # - https://ruby-doc.org/core-3.1.2/Kernel.html#method-i-system # - https://stackoverflow.com/a/37329716/12201472 # if system(command) success else error(message: "#{command} returned non-zero exit code") end end end end end end end end end
Version data entries
4 entries across 4 versions & 1 rubygems