Class: Astromapper::Generator
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- Astromapper::Generator
- Includes:
- Thor::Actions
- Defined in:
- lib/astromapper/generator.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.source_root ⇒ Object
4 5 6 |
# File 'lib/astromapper/generator.rb', line 4 def self.source_root File.dirname(__FILE__) + "/../../templates" end |
Instance Method Details
#build_config_file ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/astromapper/generator.rb', line 7 def build_config_file @title = File.basename(destination_root).gsub('-', ' ') @name = full_name @uid = Digest::MD5.hexdigest("#{Time.now}--#{rand}") @year = Date.today.year template "config.erb", "_astromapper.yml" end |
#copy_templates ⇒ Object
14 15 16 |
# File 'lib/astromapper/generator.rb', line 14 def copy_templates copy_file "names.yml", "templates/names.yml" end |
#create_directories ⇒ Object
17 18 19 20 21 |
# File 'lib/astromapper/generator.rb', line 17 def create_directories empty_directory "templates" empty_directory "output" # empty_directory "images" end |