Class: Jenerator::Generators::Component
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- Jenerator::Generators::Component
show all
- Includes:
- Actions, Thor::Actions
- Defined in:
- lib/jenerator/generators/component.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Methods included from Actions
#destination_root, included
Class Method Details
.banner ⇒ Object
10
|
# File 'lib/jenerator/generators/component.rb', line 10
def self.banner; "jenerator component [name]"; end
|
.source_root ⇒ Object
9
|
# File 'lib/jenerator/generators/component.rb', line 9
def self.source_root; File.expand_path(File.dirname(__FILE__)); end
|
Instance Method Details
#create_component ⇒ Object
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
# File 'lib/jenerator/generators/component.rb', line 28
def create_component
new_options = options.dup
options = new_options
options[:element] = "com_#{self.name.downcase}" if options[:element] == 'com_NAME'
options[:copyright] = "Copyright #{options[:author]}" if options[:copyright] == "Copyright Author"
self.destination_root = File.join(self.destination_root, options[:element])
empty_directory "code/administrator/components/#{options[:element]}"
empty_directory "code/site/components/#{options[:element]}"
empty_directory "packages"
empty_directory "tasks"
template "templates/joomla#{options[:joomla_version]}/component/manifest.xml.tt", destination_root("code", "manifest.xml"), options
template "templates/joomla#{options[:joomla_version]}/component/admin.php.tt",
destination_root("code/administrator/components/#{options[:element]}", "#{self.name.downcase}.php"), options
template "templates/joomla#{options[:joomla_version]}/component/site.php.tt",
destination_root("code/site/components/#{options[:element]}", "#{self.name.downcase}.php"), options
end
|