Sha256: 3bb74a5dbc549f5feaffc7270b4f968d7d0927e0d4212ac3552cb67b448106e0

Contents?: true

Size: 785 Bytes

Versions: 2

Compression:

Stored size: 785 Bytes

Contents

require 'awestruct/engine'

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
          puts "Generating site: #{base_url}"
          @engine.run( @profile, @base_url, ( @profile ? @profile['base_url'] || @default_base_url : @default_base_url ), @force )
        rescue =>e
          puts e
          puts e.backtrace
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
awestruct-0.4.4 lib/awestruct/cli/generate.rb
awestruct-0.4.3 lib/awestruct/cli/generate.rb