447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
|
# File 'lib/manager.rb', line 447
def self.validate_feature_call modul, feature, coda
current.bad_spec "Missing `coda` as the last argument" unless Coda == coda
case feature
when AlternativeMethod
raise "The feature name crashes with alternative"\
" method name format reserved by manager gem, and cannot be used: #{feature}"
when /\A::(.+)/
[:constant, $1.to_sym]
when /\A\.(.+)/
[:singleton, $1.to_sym]
when /\A#(.+)/
[:instance, $1.to_sym]
when /\A=/
feature.gsub!(/\A(=+) ?/, "")
[:module, current.(modul, $1.length, feature)]
when nil
[:module, nil]
else
raise current.wrong_item(feature, "Invalid feature name")
end
end
|