Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

init

  • Loading branch information...
commit 615ea02a2054000f60221da34e58410c5403c04b 1 parent 0048117
@cores cores authored
Showing with 40 additions and 35 deletions.
  1. +1 −1  README
  2. +39 −1 Rakefile
  3. +0 −33 lib/tasks/app_custom_files.rake
View
2  README
@@ -29,7 +29,7 @@ application: http://github.com/cores/mukift.
$ git clone http://github.com/cores/mukif.git
$ cd mukif
$ bundle install
- $ padrino rake app_custom_files:generate
+ $ rake app_custom_files:generate
+ set your database settings in 'config/database.rb'
$ padrino rake ar:create
$ padrino rake ar:migrate
View
40 Rakefile
@@ -3,5 +3,43 @@ require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
-require(File.join(File.dirname(__FILE__), 'config', 'boot'))
+config_path = File.join(File.dirname(__FILE__), 'config')
+if File.exist?(File.join(config_path, 'mukif.yml'))
+ require File.join(config_path, 'boot')
+end
+
+# app custom files task
+
+ # run
+ # $ rake app_custom_files:generate
+
+ namespace :app_custom_files do
+
+ desc "Create a copy of all the app custom files without the '.example' extension."
+ task :generate do
+ config_files = ['mukif.yml', 'bg_tasks.yml', 'database.rb', 'schedule.rb', 'auth_keys.rb']
+ seeds_files = ['app_data.rb', 'dummy_data.rb']
+ deploy_files = ['backup.rb', 'deploy.rb', 'prepare.rb']
+
+ root_path = File.dirname(__FILE__)
+
+ config_path = File.join(root_path, 'config')
+ config_files.each do |f|
+ file = File.join(config_path, f)
+ FileUtils.copy_file("#{file}.example", file) unless File.exist?(file)
+ end
+
+ seeds_path = File.join(root_path, 'db', 'seeds')
+ seeds_files.each do |f|
+ file = File.join(seeds_path, f)
+ FileUtils.copy_file("#{file}.example", file) unless File.exist?(file)
+ end
+
+ deploy_path = File.join(root_path, 'deploy')
+ deploy_files.each do |f|
+ file = File.join(deploy_path, f)
+ FileUtils.copy_file("#{file}.example", file) unless File.exist?(file)
+ end
+ end
+ end
View
33 lib/tasks/app_custom_files.rake
@@ -1,33 +0,0 @@
-
-# run
-# $ padrino rake app_custom_files:generate
-
-namespace :app_custom_files do
-
- desc "Create a copy of all the app custom files without the '.example' extension."
- task :generate do
- config_files = ['mukif.yml', 'bg_tasks.yml', 'database.rb', 'schedule.rb', 'auth_keys.rb']
- seeds_files = ['app_data.rb', 'dummy_data.rb']
- deploy_files = ['backup.rb', 'deploy.rb', 'prepare.rb']
-
- root_path = File.expand_path(File.join(File.dirname(__FILE__), '..', '..'))
-
- config_path = File.join(root_path, 'config')
- config_files.each do |f|
- file = File.join(config_path, f)
- FileUtils.copy_file("#{file}.example", file) unless File.exist?(file)
- end
-
- seeds_path = File.join(root_path, 'db', 'seeds')
- seeds_files.each do |f|
- file = File.join(seeds_path, f)
- FileUtils.copy_file("#{file}.example", file) unless File.exist?(file)
- end
-
- deploy_path = File.join(root_path, 'deploy')
- deploy_files.each do |f|
- file = File.join(deploy_path, f)
- FileUtils.copy_file("#{file}.example", file) unless File.exist?(file)
- end
- end
-end
Please sign in to comment.
Something went wrong with that request. Please try again.