Sha256: 1978c9038598e6c4b575bd9d90934d57ffd9d1918bbf44e901aba8c70dd43193

Contents?: true

Size: 1008 Bytes

Versions: 13

Compression:

Stored size: 1008 Bytes

Contents

require 'awestruct/engine'
require 'awestruct/util/exception_helper'

module Awestruct
  module CLI
    class Generate

      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

      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
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
awestruct-0.6.7 lib/awestruct/cli/generate.rb
awestruct-0.6.6 lib/awestruct/cli/generate.rb
awestruct-0.6.5 lib/awestruct/cli/generate.rb
awestruct-0.6.4 lib/awestruct/cli/generate.rb
awestruct-0.6.3 lib/awestruct/cli/generate.rb
awestruct-0.6.2 lib/awestruct/cli/generate.rb
awestruct-0.6.1 lib/awestruct/cli/generate.rb
awestruct-0.6.0 lib/awestruct/cli/generate.rb
awestruct-0.6.0.RC1 lib/awestruct/cli/generate.rb
awestruct-0.6.0.alpha4 lib/awestruct/cli/generate.rb
awestruct-0.6.0.alpha3 lib/awestruct/cli/generate.rb
awestruct-0.6.0.alpha1 lib/awestruct/cli/generate.rb
awestruct-0.5.7 lib/awestruct/cli/generate.rb