Class: Taza::PartialGenerator
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- Taza::PartialGenerator
- Includes:
- Thor::Actions
- Defined in:
- lib/taza/generators/partial_generator.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/taza/generators/partial_generator.rb', line 6 def name @name end |
Class Method Details
.source_root ⇒ Object
12 13 14 |
# File 'lib/taza/generators/partial_generator.rb', line 12 def self.source_root File.dirname(__FILE__) end |
Instance Method Details
#partial ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/taza/generators/partial_generator.rb', line 17 def partial @name = site_name.underscore if File.directory?("lib/sites/#{name}") create_partial else say "No such site #{name} exists! ", :red say "Please run 'taza create #{name}'", :green end end |