Sha256: 236ce97e0af7d57e3a2629e497ff852e84052f45cd099ef14a51be44b119d6b9
Contents?: true
Size: 684 Bytes
Versions: 1
Compression:
Stored size: 684 Bytes
Contents
# frozen_string_literal: true module ConvenientService module Examples module Standard module Gemfile module Services class AssertFileExists include ConvenientService::Standard::Config attr_reader :path def initialize(path:) @path = path end def result return failure(path: "Path is `nil`") if path.nil? return failure(path: "Path is empty") if path.empty? return error("File with path `#{path}` does NOT exist") unless ::File.exist?(path) success end end end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
convenient_service-0.12.0 | lib/convenient_service/examples/standard/gemfile/services/assert_file_exists.rb |