Skip to content
Browse files

layout_actions

  • Loading branch information...
1 parent 4da4d8e commit 8ac9ef14e9bd72492d88c5701efb926d678f51b2 @xdite committed Dec 16, 2012
Showing with 32 additions and 30 deletions.
  1. +1 −0 bin/bootstrappers
  2. +31 −29 lib/bootstrappers/app_builder.rb
  3. +0 −1 lib/bootstrappers/layout_actions.rb
View
1 bin/bootstrappers
@@ -2,6 +2,7 @@
require File.expand_path(File.join('..', 'lib', 'bootstrappers', 'generators', 'app_generator'), File.dirname(__FILE__))
require File.expand_path(File.join('..', 'lib', 'bootstrappers', 'actions'), File.dirname(__FILE__))
+require File.expand_path(File.join('..', 'lib', 'bootstrappers', 'layout_actions'), File.dirname(__FILE__))
require File.expand_path(File.join('..', 'lib', 'bootstrappers', 'app_builder'), File.dirname(__FILE__))
templates_root = File.expand_path(File.join("..", "templates"), File.dirname(__FILE__))
View
60 lib/bootstrappers/app_builder.rb
@@ -5,14 +5,12 @@ class AppBuilder < Rails::AppBuilder
include Bootstrappers::LayoutActions
-
def raise_delivery_errors
replace_in_file 'config/environments/development.rb',
'raise_delivery_errors = false', 'raise_delivery_errors = true'
end
-
def add_common_rake_tasks
directory 'tasks', 'lib/tasks'
end
@@ -21,22 +19,10 @@ def add_common_rake_tasks
def add_devise_gem
inject_into_file 'Gemfile', "\ngem 'devise'",
- :after => /gem 'jquery-rails'/
+ :after => /gem 'jquery-rails'/
end
- def use_mysql_config_template
-
- template 'mysql_database.yml.erb', 'config/database.yml',:force => true
- template 'mysql_database.yml.erb', 'config/database.yml.example', :force => true
- db_user_name = ask("What is your local database user name? [root]")
- db_password = ask("What is your local database password? ['']")
-
- replace_in_file 'config/database.yml', 'username: root', "username: #{db_user_name}" if db_user_name.present?
- replace_in_file 'config/database.yml', 'password: ""', "password: '#{db_password}'" if db_password.present?
-
-
- end
def create_capistrano_files
template 'capistrano/deploy_rb.erb', 'config/deploy.rb',:force => true
@@ -49,11 +35,29 @@ def create_database
bundle_command 'exec rake db:create'
end
- def generate_devise
+ def generate_devise
generate 'devise:install'
generate 'devise User'
end
+ def gitignore_files
+ concat_file 'bootstrappers_gitignore', '.gitignore'
+ ['app/models',
+ 'app/assets/images',
+ 'app/views/pages',
+ 'db/migrate',
+ 'log',
+ ].each do |dir|
+ empty_directory_with_gitkeep dir
+ end
+ end
+
+ def init_git
+ run 'git init'
+ end
+
+
+
def build_settings_from_config
template 'setting.rb', 'app/models/setting.rb',:force => true
@@ -69,20 +73,18 @@ def remove_routes_comment_lines
replace_in_file 'config/routes.rb', /Application\.routes\.draw do.*end/m, "Application.routes.draw do\nend"
end
- def gitignore_files
- concat_file 'bootstrappers_gitignore', '.gitignore'
- ['app/models',
- 'app/assets/images',
- 'app/views/pages',
- 'db/migrate',
- 'log',
- ].each do |dir|
- empty_directory_with_gitkeep dir
- end
- end
+ def use_mysql_config_template
+ template 'mysql_database.yml.erb', 'config/database.yml',:force => true
+ template 'mysql_database.yml.erb', 'config/database.yml.example', :force => true
+
+ db_user_name = ask("What is your local database user name? [root]")
+ db_password = ask("What is your local database password? ['']")
+
+ replace_in_file 'config/database.yml', 'username: root', "username: #{db_user_name}" if db_user_name.present?
+ replace_in_file 'config/database.yml', 'password: ""', "password: '#{db_password}'" if db_password.present?
- def init_git
- run 'git init'
end
+
+
end
end
View
1 lib/bootstrappers/layout_actions.rb
@@ -13,7 +13,6 @@ def remove_rails_logo_image
remove_file 'app/assets/images/rails.png'
end
-
def create_partials_directory
empty_directory 'app/views/application'
empty_directory 'app/views/pages'

0 comments on commit 8ac9ef1

Please sign in to comment.
Something went wrong with that request. Please try again.