Created
March 12, 2010 15:24
-
-
Save vvs/330418 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# All elements (including nested elements) are registered so we can access them easily. | |
def acquire_element(name, clazz) | |
element = @elements[name + clazz.to_s] | |
return element if element | |
# ****** HERE ***** This block of code is EVIL!!!! <--------------------- | |
# Not registered in ant's type registry for this project (nested el?) | |
unless @helper.get_definition(name) | |
@project.log "Adding #{name} -> #{clazz.inspect}", 5 | |
@helper.add_data_type_definition(name, clazz) | |
end | |
@elements[name + clazz.to_s] = :give_it_something_to_prevent_endless_recursive_defs | |
@elements[name + clazz.to_s] = Element.new(self, name, clazz) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment