lib/global_types/version_requirement.rb
# Type cast a value from user input (e.g. from a setter).
#
# @param [String, <String>, Gem::Requirement] value
# @return [Gem::Requirement]
Type cast a value from user input .
Type cast a value from user input .
def cast(value)
      case value
      when /[^,]+,[^,]+/
        Gem::Requirement.create value.split(/\s*,\s*/)
      when String, StringArray
        Gem::Requirement.create value
      when Gem::Requirement
        value
      else
        Gem::Requirement.default
      end
    rescue Gem::Requirement::BadRequirementError
      Gem::Requirement.default
    end
def cast ( value ) case value when / [^,]+,[^,]+ / Gem :: Requirement . create value . split ( / \s *, \s * / ) when String , StringArray Gem :: Requirement . create value when Gem :: Requirement value else Gem :: Requirement . default end rescue Gem :: Requirement :: BadRequirementError Gem :: Requirement . default end
Type cast a value from user input (e.g.
Type cast a value from user input ( e . g .
None
Gem::Requirement
value
None