Sha256: 39ce9f805feaa6706e6e19d0358de76e808b71b6039488452d6b55d47a237a32

Contents?: true

Size: 702 Bytes

Versions: 14

Compression:

Stored size: 702 Bytes

Contents

# frozen_string_literal: true

module ConvenientService
  module Examples
    module Standard
      module Gemfile
        module Services
          class AssertFileNotEmpty
            include ConvenientService::Standard::Config

            attr_accessor :path

            def initialize(path:)
              @path = path
            end

            def result
              return failure(data: {path: "Path is `nil`"}) if path.nil?
              return failure(data: {path: "Path is empty"}) if path.empty?

              return error(message: "File with path `#{path}` is empty") if ::File.zero?(path)

              success
            end
          end
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
convenient_service-0.11.0 lib/convenient_service/examples/standard/gemfile/services/assert_file_not_empty.rb
convenient_service-0.10.1 lib/convenient_service/examples/standard/gemfile/services/assert_file_not_empty.rb
convenient_service-0.10.0 lib/convenient_service/examples/standard/gemfile/services/assert_file_not_empty.rb
convenient_service-0.9.0 lib/convenient_service/examples/standard/gemfile/services/assert_file_not_empty.rb
convenient_service-0.8.0 lib/convenient_service/examples/standard/gemfile/services/assert_file_not_empty.rb
convenient_service-0.7.0 lib/convenient_service/examples/standard/gemfile/services/assert_file_not_empty.rb
convenient_service-0.6.0 lib/convenient_service/examples/standard/gemfile/services/assert_file_not_empty.rb
convenient_service-0.5.0 lib/convenient_service/examples/standard/gemfile/services/assert_file_not_empty.rb
convenient_service-0.4.0 lib/convenient_service/examples/standard/gemfile/services/assert_file_not_empty.rb
convenient_service-0.3.1 lib/convenient_service/examples/standard/gemfile/services/assert_file_not_empty.rb
convenient_service-0.3.0 lib/convenient_service/examples/standard/gemfile/services/assert_file_not_empty.rb
convenient_service-0.2.1 lib/convenient_service/examples/standard/gemfile/services/assert_file_not_empty.rb
convenient_service-0.2.0 lib/convenient_service/examples/standard/gemfile/services/assert_file_not_empty.rb
convenient_service-0.1.0 lib/convenient_service/examples/standard/gemfile/services/assert_file_not_empty.rb