Class: Zync::Generators::Base
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- Zync::Generators::Base
- Includes:
- Thor::Actions, Actions
- Defined in:
- lib/zync-gen/generators/base.rb
Direct Known Subclasses
Class Method Summary collapse
-
.base_root ⇒ Object
Returns the base root for a common set of generators.
-
.default_source_root ⇒ Object
Returns the default source root for a given generator.
-
.source_root(path = nil) ⇒ Object
Returns the source root for this generator.
Class Method Details
.base_root ⇒ Object
Returns the base root for a common set of generators.
19 20 21 |
# File 'lib/zync-gen/generators/base.rb', line 19 def self.base_root File.dirname(__FILE__) end |
.default_source_root ⇒ Object
Returns the default source root for a given generator.
30 31 32 33 34 |
# File 'lib/zync-gen/generators/base.rb', line 30 def self.default_source_root return unless generator_name path = File.(File.join(generator_name, 'templates'), base_root) path if File.exists?(path) end |
.source_root(path = nil) ⇒ Object
Returns the source root for this generator
24 25 26 27 |
# File 'lib/zync-gen/generators/base.rb', line 24 def self.source_root(path=nil) @_source_root = path if path @_source_root ||= default_source_root end |