Sha256: 2a689742be8f179cd98b6420be65623211d654e134c11eba239f20cb62a96d96

Contents?: true

Size: 395 Bytes

Versions: 7

Compression:

Stored size: 395 Bytes

Contents

# frozen_string_literal: true

module Superbot
  module Validations
    def validates_project_path(path)
      unless Dir.exist? path
        raise ArgumentError, "directory #{path} does not exist"
      end

      entrypoint = File.join path, "main.rb"
      unless File.exist? entrypoint
        raise ArgumentError, "file #{entrypoint} does not exist"
      end

      path
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
superbot-0.3.3 lib/superbot/cli/validations.rb
superbot-0.3.2 lib/superbot/cli/validations.rb
superbot-0.1.4.rc2 lib/superbot/cli/validations.rb
superbot-0.1.4.rc1 lib/superbot/cli/validations.rb
superbot-0.1.3 lib/superbot/cli/validations.rb
superbot-0.1.2 lib/superbot/cli/validations.rb
superbot-0.1.1 lib/superbot/cli/validations.rb