Method: Manager.validate_feature_call

Defined in:
lib/manager.rb

.validate_feature_call(modul, feature, coda) ⇒ Object



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
	#! When `coda` is an instance of `Manager::UnitTest`, which is a child of `BasicObject`, 
	# `coda ==` would not be defined. Hence this order. The `==` is not symmetric.
	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.add_described_header(modul, $1.length, feature)]
	when nil
		[:module, nil]
	else
		raise current.wrong_item(feature, "Invalid feature name")
	end
end