lib/cicd/builder/mixlib/repo.rb in cicd-builder-0.9.45 vs lib/cicd/builder/mixlib/repo.rb in cicd-builder-0.9.46
- old
+ new
@@ -36,14 +36,17 @@
@logger.step __method__.to_s
clazz = getRepoClass()
if clazz.is_a?(Class) and not clazz.nil?
@repo = clazz.new(self)
method = @repo.method(verb)
- if method.owner == clazz
- @vars[:return_code] = @repo.send(verb)
- else
- @logger.error "#{clazz.name.to_s} cannot do action #{verb}"
- @vars[:return_code] = Errors::BUILDER_REPO_ACTION
+ unless method.owner == clazz
+ if @repo.respond_to?(verb)
+ @logger.warn "#{clazz.name.to_s} does not override action #{verb}"
+ @vars[:return_code] = @repo.send(verb)
+ else
+ @logger.error "#{clazz.name.to_s} does not implement action #{verb}"
+ @vars[:return_code] = Errors::BUILDER_REPO_ACTION
+ end
end
else
@logger.error "#{clazz.name.to_s} is not a valid repo class"
@vars[:return_code] = Errors::BUILDER_REPO_TYPE
end
\ No newline at end of file