Class: Blacksand::Generators::NewSiteGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Defined in:
lib/generators/blacksand/new_site_generator.rb

Instance Method Summary collapse

Instance Method Details

#new_siteObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/generators/blacksand/new_site_generator.rb', line 7

def new_site
  puts "Create Site: #{name}"
  # site yaml
  create_file("db/sites/#{name}.yml", <<-YAML)
# 模板
templates:
  # - your template

# 原型
prototypes:
  # - your prototype
YAML

  # site theme
  if yes?("Install theme #{name} ?(Y/n)")
    generate 'themes_on_rails:theme', name
  end
end