Sha256: 0ec2b412ef6d17db1938970a6b8e9cbc5cfbd8d04b74a50391382d73043dab3f

Contents?: true

Size: 636 Bytes

Versions: 4

Compression:

Stored size: 636 Bytes

Contents

# frozen_string_literal: true

module ConvenientService
  module Examples
    module Dry
      module V1
        class Gemfile
          module Services
            class AssertFileExists
              include DryService::Config

              option :path

              contract do
                schema do
                  required(:path).filled(:string)
                end
              end

              def result
                return error("File with path `#{path}` does NOT exist") unless ::File.exist?(path)

                success
              end
            end
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
convenient_service-0.17.0 lib/convenient_service/examples/dry/v1/gemfile/services/assert_file_exists.rb
convenient_service-0.16.0 lib/convenient_service/examples/dry/v1/gemfile/services/assert_file_exists.rb
convenient_service-0.15.0 lib/convenient_service/examples/dry/v1/gemfile/services/assert_file_exists.rb
convenient_service-0.14.0 lib/convenient_service/examples/dry/v1/gemfile/services/assert_file_exists.rb