596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
|
# File 'lib/optout.rb', line 596
def validate!(opt)
return if opt.empty?
@file = Pathname.new(opt.value.to_s)
what = self.class.name.split("::")[-1].downcase
error = case
when !under?
"#{what} must be under '#{@under}'"
when !named?
"#{what} name must match '#{@named}'"
when !permissions?
"#{what} must have user permission of #{@permissions}"
when !exists?
"#{what} '#{@file}' does not exist"
when !creatable?
"can't create a #{what} at '#{@file}'"
end
raise OptionInvalid.new(opt.key, error) if error
end
|