In framework-like ruby projects, how is it possible to package a plugins as gems and then use\\unuse them inside the project, Most popular living example is Rails, but I seeking the abstracted concepts\\practices\\design patterns that can aid in building such project architecture.
Rails sourcecode is TOO big to navigate without a map.
Research Log: - In Rails, Railities are assumed to be a good place to start exploring how plugin architecture is implemented.
- In Ruby 1.8, there was a C extension called mixology that provides mix\\unmix constructs. - In Ruby 1.9.*, It is believed that Rails used alias_method_chain - In Ruby 2.0 prepend keyword is meant to be useful in solving such problem (I assume!)
One of the best introductions into topic I have seen so far was a Railscast where Ryan extracts some piece of his app into a gem:
http://railscasts.com/episodes/301-extracting-a-ruby-gem
Generally there are few rules to follow to make Your code easy extractable:
I hope these suggestions will put You on Your own Rails :)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.