Class: Awestruct::CLI::Generate

Inherits:
Object
  • Object
show all
Defined in:
lib/awestruct/cli/generate.rb

Instance Method Summary collapse

Constructor Details

#initialize(config, profile = nil, base_url = nil, default_base_url = 'http://localhost:4242', force = false) ⇒ Generate

Returns a new instance of Generate.



7
8
9
10
11
12
13
# File 'lib/awestruct/cli/generate.rb', line 7

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

Instance Method Details

#runObject



15
16
17
18
19
20
21
22
23
# File 'lib/awestruct/cli/generate.rb', line 15

def run()
  begin
    puts "Generating site"
    @engine.run( @profile, @base_url, @default_base_url, @force )
  rescue =>e
    puts e
    puts e.backtrace
  end
end