Sha256: 3c964a69ff25f094c8832a0e0b21a6aac04a822d4f0597b59533766f90444923

Contents?: true

Size: 612 Bytes

Versions: 12

Compression:

Stored size: 612 Bytes

Contents

# frozen_string_literal: true

module ConvenientService
  module Examples
    module Rails
      module Gemfile
        module Services
          class AssertFileNotEmpty
            include RailsService::Config

            attribute :path, :string

            validates :path, presence: true if ConvenientService::Dependencies.support_has_result_params_validations_using_active_model_validations?

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

              success
            end
          end
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
convenient_service-0.12.0 lib/convenient_service/examples/rails/gemfile/services/assert_file_not_empty.rb
convenient_service-0.11.0 lib/convenient_service/examples/rails/gemfile/services/assert_file_not_empty.rb
convenient_service-0.10.1 lib/convenient_service/examples/rails/gemfile/services/assert_file_not_empty.rb
convenient_service-0.10.0 lib/convenient_service/examples/rails/gemfile/services/assert_file_not_empty.rb
convenient_service-0.9.0 lib/convenient_service/examples/rails/gemfile/services/assert_file_not_empty.rb
convenient_service-0.8.0 lib/convenient_service/examples/rails/gemfile/services/assert_file_not_empty.rb
convenient_service-0.7.0 lib/convenient_service/examples/rails/gemfile/services/assert_file_not_empty.rb
convenient_service-0.6.0 lib/convenient_service/examples/rails/gemfile/services/assert_file_not_empty.rb
convenient_service-0.5.0 lib/convenient_service/examples/rails/gemfile/services/assert_file_not_empty.rb
convenient_service-0.4.0 lib/convenient_service/examples/rails/gemfile/services/assert_file_not_empty.rb
convenient_service-0.3.1 lib/convenient_service/examples/rails/gemfile/services/assert_file_not_empty.rb
convenient_service-0.3.0 lib/convenient_service/examples/rails/gemfile/services/assert_file_not_empty.rb