Module: Junebug::Generator

Extended by:
Generator
Included in:
Generator
Defined in:
lib/junebug/generator.rb

Instance Method Summary collapse

Instance Method Details

#generate(args) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/junebug/generator.rb', line 10

def generate(args)
  src_root = File.dirname(__FILE__) + '/../../deploy'
  app = ARGV.first
  FileUtils.cp_r(src_root, app)
  FileUtils.chmod(0755, app+'/wiki')
  FileUtils.cd app
  Junebug.connect
  Junebug.create
  
  user = Junebug::Models::User.find(1)
  
  puts <<EOS

***********************************

Welcome to Junebug!

To start your new wiki, do the following:

> cd #{app}
> ./wiki start

Open your browser to http://#{Junebug.config['host']}:#{Junebug.config['port']}#{Junebug.config['sitepath']}

Your admin account is:

username: #{user.username}
password: #{user.password}

Submit bug reports to [email protected]

EOS
end