Class: Taza::PartialGenerator

Inherits:
Thor::Group
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/taza/generators/partial_generator.rb

Direct Known Subclasses

FlowGenerator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#nameObject (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_rootObject



12
13
14
# File 'lib/taza/generators/partial_generator.rb', line 12

def self.source_root
  File.dirname(__FILE__)
end

Instance Method Details

#partialObject



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