Module: Perennial::Manifest::Mixin
- Defined in:
- lib/perennial/manifest.rb
Instance Method Summary collapse
-
#manifest(&blk) ⇒ Object
Called in your application to set the default namespace and app_name.
Instance Method Details
#manifest(&blk) ⇒ Object
Called in your application to set the default namespace and app_name. Also, if a block is provided it yields first with Manifest and then with the Loader class, making it simpler to setup.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/perennial/manifest.rb', line 17 def manifest(&blk) Manifest.namespace = self Manifest.app_name = self.name.to_s.underscore parent_folder = File.(File.dirname(__DIR__(0))) Settings.library_root = parent_folder = parent_folder / 'lib'/ Manifest.app_name attempt_require(( / 'core_ext'), ( / 'exceptions')) unless blk.nil? args = [] args << Manifest if blk.arity != 0 args << Loader if blk.arity > 1 || blk.arity < 0 blk.call(*args) end end |