Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor mockup generate to load external gem generators #17

Merged
merged 18 commits into from
Mar 19, 2014

Conversation

edwinvdgraaf
Copy link
Contributor

This change makes it possible to load additional generators by subclassing HtmlMockup::Generators::Base

@edwinvdgraaf
Copy link
Contributor Author

Quite some additional commits besides commit 8fe2b91, mainly because I had to find out (and experience) how travis ci works. We now have some basic testing in place, while not directly necessary we could increase our coverage over time.

Perhaps we should squash those commits?

While previously we relied on the inherited function, I removed this since it wasn't possible
to read out the arguments and description of the class, making decorating it for the help text
very hard.
@edwinvdgraaf edwinvdgraaf mentioned this pull request Mar 18, 2014
@edwinvdgraaf
Copy link
Contributor Author

Some extra elaboration, in ended up using a register function. Which has to be called after the class is declared, as can be seen e939bc3#diff-41b457dc0c1d9d7dfa9580bba5723da6R23

This is required because when using inherited the class hasn't been parsed, and thus has no arguments or description we can read from thor. While we could use custom properties defining these, I don't believe this outweights the one line to register the class. I've tried working with an asynchronous loop, in which the self.inherited just add the class to an array. However this requires a specific load order to work, which is also not that awesome. Think we should go this way.

I've added a generator to generate generators, at this point they cannot be loaded yet, but I guess we could use the Mockupfile for, we only have to create the context earlier in the CLI. See also #18.

flurin pushed a commit that referenced this pull request Mar 19, 2014
@flurin flurin merged commit 85df532 into master Mar 19, 2014
@flurin flurin deleted the feature-generators branch March 19, 2014 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants