lib/puppet/type/cron.rb
# Verify that a value falls within the specified array.  Does case
# insensitive matching, and supports matching either the entire word
# or the first three letters of the word.
Verify that a value falls within the specified array.  Does case
insensitive matching, and supports matching either the entire word
or the first three letters of the word.
Verify that a value falls within the specified array . Does case insensitive matching and supports matching either the entire word or the first three letters of the word .
def alphacheck(value, ary)
      tmp = value.downcase
      if tmp.length == 3
        ary.each_with_index do |name, index|
          if tmp.casecmp(name[0..2]).zero?
            return index
          end
        end
      elsif ary.include?(tmp)
        return ary.index(tmp)
      end
      false
    end
def alphacheck ( value , ary ) tmp = value . downcase if tmp . length == 3 ary . each_with_index do | name , index | if tmp . casecmp ( name [ 0 .. 2 ] ) . zero? return index end end elsif ary . include? ( tmp ) return ary . index ( tmp ) end false end
Verify that a value falls within the specified array.
Verify that a value falls within the specified array .
# If they specified a shortened version of the name, then see # if we can lengthen it (e.g., mon => monday).
value
ary