Sha256: 3ad6ec7e2f262be364deb11bb83eefb85f4e7e505801fcb7ae547d6e198b61ff

Contents?: true

Size: 898 Bytes

Versions: 6

Compression:

Stored size: 898 Bytes

Contents

require 'awestruct/engine'
require 'compass'

module Awestruct
  module CLI
    class Generate

      def initialize(config, profile=nil, base_url=nil, default_base_url='http://localhost:4242', force=false)
        @profile          = profile
        @base_url         = base_url
        @default_base_url = default_base_url
        @force            = force
        @engine           = Awestruct::Engine.new( config )
      end

      def run()
        begin
          base_url = @profile['base_url'] || @default_base_url
          $LOG.info "Generating site: #{base_url}" if $LOG.info?
          @engine.run( @profile, @base_url, ( @profile ? @profile['base_url'] || @default_base_url : @default_base_url ), @force )
        rescue =>e
          $LOG.error e if $LOG.error?
          $LOG.error e.backtrace.join("\n") if $LOG.error?
          return false
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
awestruct-0.5.4.beta1 lib/awestruct/cli/generate.rb
awestruct-0.5.3 lib/awestruct/cli/generate.rb
awestruct-0.5.2.1 lib/awestruct/cli/generate.rb
awestruct-0.5.2 lib/awestruct/cli/generate.rb
awestruct-0.5.1 lib/awestruct/cli/generate.rb
awestruct-0.5.1a lib/awestruct/cli/generate.rb