Sha256: 536186febad2089216e8a380beee758ff940130de782645ab2bb8cacbed37f7a

Contents?: true

Size: 471 Bytes

Versions: 1

Compression:

Stored size: 471 Bytes

Contents

module ShellTastic

  module Utils
    # A dirty string check for nil empty or just whitespace
    # @param str [String] a string that needs to be checked
    # @return [Boolean, nil] true if str is empty, nil, or just whitespace
    def string_nil_or_blank? str
      # raise if command is empty or nil
      if str !~ /[^[:space:]]/ || str.nil? || str.empty?
        raise ShellTastic::CommandException.new("The command is emtpy or nil")
      end
    end


  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
shelltastic-0.3.0 lib/shelltastic/utils.rb