简体   繁体   中英

How to create a multi module project(subproject) in Ruby

In java, there are various ways to create multiple module project. Maven provides extensive support for it.

I am wondering if such a feature is available in ruby.

Why we need it: A full-stack project has middle tier, front end html and js controller code. This will help in categorize each of them.

Modules and Gems

In Ruby, a Module is a class-like object that collects methods and constants, and can be mixed into other classes. That's probably not what you're really asking about, but other solutions generally build on top of Ruby's Module and Class semantics.

You're more likely to be looking for something like RubyGems and Bundler to manage libraries and dependencies. The documentation for each is fairly extensive.

Frameworks like Ruby on Rails also offer additional capabilities to inject gems and modules directly into the codebase, but it's arguably more common in Rails to build out these capabilities with gems and bundles. An exhaustive treatment of all the various ways to extend Rails (eg vendored gems, plugins, engines, etc.) is beyond the scope of a reasonable Stack Overflow answer, though. I mention some of them here in passing to help you search for the right documentation for your specific use cases.

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM