Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 53 lines (41 sloc) 1.035 kb
1 2 3 4 5 6 7 8 9 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 43 44 45 46 47 48 49 50 51 52
require './gemfile_modifier.rb'
require './model_generator.rb'
require './bootstrap_installer.rb'
require './user_modifier.rb'
require './layout_modifier.rb'
require './association_builder.rb'

# This downcase hack is to prevent mixed-case app name errors.
app_name = ARGV[0] ? ARGV[0].downcase.gsub('_', '') : "myapp"
layout_name = ARGV[1] || "fixed"

puts "Creating #{app_name} app."
`rm -rf #{app_name}`
`rails new #{app_name}`

g = GemfileModifier.new(app_name)
g.modify
g.bundle

m = ModelGenerator.new(app_name)
m.generate
m.migrate

b = BootstrapInstaller.new(app_name, layout_name)
b.install
b.generate_layout
b.theme_scaffolds

u = UserModifier.new(app_name)
u.secure
u.repair_form
u.repair_show
u.repair_index
u.make_root_url

l = LayoutModifier.new(app_name)
l.remove_sidebar
l.expand_main_div
l.fix_nav_bar_links
l.fix_misc

a = AssociationBuilder.new(app_name)
a.build_associations
a.fix_index
a.fix_show
a.fix_form

`cp seeds.rb #{app_name}/db/`
Dir.chdir(app_name) { `rake db:seed` }
Dir.chdir(app_name) { `rails s` }


Something went wrong with that request. Please try again.