568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
|
# File 'lib/optout.rb', line 568
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
|