Class: Awestruct::CLI::Generate
- Inherits:
-
Object
- Object
- Awestruct::CLI::Generate
- Defined in:
- lib/awestruct/cli/generate.rb
Instance Method Summary collapse
-
#initialize(config, profile = nil, base_url = nil, default_base_url = Options::DEFAULT_BASE_URL, force = false, generate = true) ⇒ Generate
constructor
A new instance of Generate.
- #run ⇒ Object
Constructor Details
#initialize(config, profile = nil, base_url = nil, default_base_url = Options::DEFAULT_BASE_URL, force = false, generate = true) ⇒ Generate
Returns a new instance of Generate.
8 9 10 11 12 13 14 15 |
# File 'lib/awestruct/cli/generate.rb', line 8 def initialize(config, profile=nil, base_url=nil, default_base_url=Options::DEFAULT_BASE_URL, force=false, generate=true) @profile = profile @base_url = base_url @default_base_url = default_base_url @force = force @generate = generate @engine = Awestruct::Engine.new( config ) end |
Instance Method Details
#run ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/awestruct/cli/generate.rb', line 17 def run() begin base_url = @base_url || @default_base_url $LOG.info "Generating site: #{base_url}" if $LOG.info? start_time = DateTime.now @engine.run( @profile, @base_url, @default_base_url, @force, @generate ) $LOG.trace "Total time in engine.run #{DateTime.now.to_time - start_time.to_time} seconds" rescue =>e ExceptionHelper.log_building_error e, '' return false end end |