Class: AmazonStaticSite::Generator
- Inherits:
-
Object
- Object
- AmazonStaticSite::Generator
- Defined in:
- lib/amazon_static_site/generator.rb
Instance Attribute Summary collapse
-
#folder ⇒ Object
readonly
Returns the value of attribute folder.
Instance Method Summary collapse
-
#initialize(folder = ARGV[1] || '.') ⇒ Generator
constructor
A new instance of Generator.
- #start ⇒ Object
Constructor Details
#initialize(folder = ARGV[1] || '.') ⇒ Generator
Returns a new instance of Generator.
5 6 7 8 |
# File 'lib/amazon_static_site/generator.rb', line 5 def initialize(folder = ARGV[1] || '.') require 'fileutils' @folder = folder.gsub(/\/$/, '') end |
Instance Attribute Details
#folder ⇒ Object (readonly)
Returns the value of attribute folder.
3 4 5 |
# File 'lib/amazon_static_site/generator.rb', line 3 def folder @folder end |
Instance Method Details
#start ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/amazon_static_site/generator.rb', line 10 def start print "Creating folder #{folder} ...".green FileUtils.mkdir_p(folder) print "OK\n".yellow print "Copying #{template} to #{destination} ...".green FileUtils.copy_entry template, destination print "OK\n".yellow print "Generating config #{destination}/config/site.yml ...".green generate_config print "OK\n".yellow end |