Permalink
Browse files

Fixed conflict

  • Loading branch information...
2 parents edd7d3b + 6700f16 commit 497c11c4ab3bd29c88e63d0503b37d8fc1a4bfdd Winton Welsh committed Sep 9, 2008
Showing with 15 additions and 14 deletions.
  1. +6 −6 resources/git/plugins.rb
  2. +2 −1 tasks/app_helpers.rake
  3. +5 −4 tasks/db.rake
  4. +2 −3 tasks/git.rake
View
@@ -5,11 +5,11 @@
{ :repo => 'git@github.com:winton/rails_widget.git' },
{ :repo => 'git@github.com:winton/widgets.git', :to => 'app/widgets/widgets' },
{ :repo => 'git://github.com/mislav/will_paginate.git' },
- { :repo => 'git://github.com/rails/rails.git', :to => 'vendor/rails', :depth => 1 },
'haml'
]
-#git@github.com:winton/captcha.git
-#git@github.com:winton/admin.git
-#git://github.com/technoweenie/attachment_fu.git
-#git://github.com/jcnetdev/active_record_without_table.git
-#git://github.com/freelancing-god/thinking-sphinx.git
+#{ :repo => 'git://github.com/rails/rails.git', :to => 'vendor/rails', :depth => 1 }
+#{ :repo => 'git@github.com:winton/captcha.git' }
+#{ :repo => 'git@github.com:winton/admin.git' }
+#{ :repo => 'git://github.com/technoweenie/attachment_fu.git' }
+#{ :repo => 'git://github.com/jcnetdev/active_record_without_table.git' }
+#{ :repo => 'git://github.com/freelancing-god/thinking-sphinx.git' }
View
@@ -17,11 +17,12 @@ namespace :app_helpers do
desc 'Removes files created by rake app_helpers'
task :remove => [ 'app_helpers:db:remove', 'app_helpers:git:remove', 'app_helpers:views:remove', 'app_helpers:widgets:remove' ]
- def app_helper_resource(type, to, reverse=false)
+ def app_helper_resource(type, to, reverse=false, overwrite=true)
from = "#{File.dirname(__FILE__)}/../resources/#{type}"
from, to = to, from if reverse
puts "=> Removing old #{type}..."
puts to
+ return if File.exists?(to) && !overwrite
if File.directory?(from)
FileUtils.remove_dir(to, true) if File.exists?(to)
FileUtils.mkdir_p to
View
@@ -10,10 +10,10 @@ namespace :app_helpers do
namespace :db do
desc 'Creates a generic database.yml file'
task :config do
- return if ENV['db'] == 'false'
- puts('Database name?') unless ENV['db']
- File.open 'config/database.yml', 'w' do |file|
- file.write "development: &defaults
+ if ENV['db'] != 'false'
+ puts('Database name?') unless ENV['db']
+ File.open 'config/database.yml', 'w' do |file|
+ file.write "development: &defaults
adapter: mysql
database: #{ENV['db'] || STDIN.gets.strip}
username: root
@@ -26,6 +26,7 @@ test:
production:
<<: *defaults
"
+ end
end
end
View
@@ -14,9 +14,7 @@ namespace :app_helpers do
desc 'Copy config/plugins.rb to app'
task :plugins do
- unless File.exists?('config/plugins.rb')
- app_helper_resource 'git/plugins.rb', 'config/plugins.rb'
- end
+ app_helper_resource 'git/plugins.rb', 'config/plugins.rb', false, false
end
desc 'Removes files from rake app_helpers:git'
@@ -52,6 +50,7 @@ namespace :app_helpers do
task :update do
eval(File.read('config/plugins.rb')).each do |plugin|
puts plugin[:repo]
+ install_path = plugin[:to] || "vendor/plugins/#{File.basename(plugin[:repo], '.git')}"
Dir.chdir install_path do
`git pull origin #{git_head(plugin)}`
`git checkout #{git_head(plugin)}`

0 comments on commit 497c11c

Please sign in to comment.