Sha256: a7fe1f15e79fee4d86d48828c83d71e584a740df440db79b15c62099abe01503

Contents?: true

Size: 404 Bytes

Versions: 1

Compression:

Stored size: 404 Bytes

Contents

module Stevenson
  module Input
    class Url < Text
      include Base

      def collect!
        # Ask the user the question and apply the appropriate options
        answer = ask(@prompt) do |q|
          q.default = default
          q.validate = /https?:\/\/[\S]+/
          q.limit = @limit if @limit
        end

        # Return the user's answer
        answer.to_s
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
stevenson-1.0.1 lib/stevenson/input/url.rb