Class: Jdt::Generator
- Inherits:
-
Thor
- Object
- Thor
- Jdt::Generator
- Includes:
- Thor::Actions
- Defined in:
- lib/jdt/generator/generator.rb
Direct Known Subclasses
ComponentGenerator, LanguageGenerator, LibraryGenerator, ModuleGenerator, PluginGenerator, TemplateGenerator
Instance Attribute Summary collapse
-
#author ⇒ Object
Returns the value of attribute author.
-
#creation_date ⇒ Object
Returns the value of attribute creation_date.
-
#description ⇒ Object
Returns the value of attribute description.
-
#location ⇒ Object
Returns the value of attribute location.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
Instance Attribute Details
#author ⇒ Object
Returns the value of attribute author.
11 12 13 |
# File 'lib/jdt/generator/generator.rb', line 11 def @author end |
#creation_date ⇒ Object
Returns the value of attribute creation_date.
11 12 13 |
# File 'lib/jdt/generator/generator.rb', line 11 def creation_date @creation_date end |
#description ⇒ Object
Returns the value of attribute description.
11 12 13 |
# File 'lib/jdt/generator/generator.rb', line 11 def description @description end |
#location ⇒ Object
Returns the value of attribute location.
11 12 13 |
# File 'lib/jdt/generator/generator.rb', line 11 def location @location end |
#name ⇒ Object
Returns the value of attribute name.
11 12 13 |
# File 'lib/jdt/generator/generator.rb', line 11 def name @name end |
Instance Method Details
#generate(name) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/jdt/generator/generator.rb', line 15 def generate(name) # set up variables with default values @name = name @version = "0.0.1" @author = "AUTHOR" @description = "DESCRIPTION" @creation_date = "#{Date::MONTHNAMES[Time.now.month]} #{Time.now.year}" @location = "." # create directory and files which every extension needs empty_directory(prefixed_name) template("README.erb", "#{prefixed_name}/README") #template("LICENSE.erb", "#{prefixed_name}/LICENSE") template("CHANGELOG.erb", "#{prefixed_name}/CHANGELOG") template("manifest.xml.erb", "#{prefixed_name}/manifest.xml") end |