Rakefile in rabbit-2.0.5 vs Rakefile in rabbit-2.0.6

- old
+ new

@@ -23,11 +23,12 @@ require "gettext/task" base_dir = File.expand_path(File.dirname(__FILE__)) $LOAD_PATH.unshift(File.join(base_dir, 'lib')) -rsync_base_path = "rabbit@rabbit-shocker.org:public_html/" +rsync_local_path = "~/public_html/" +rsync_base_path = "rabbit@rabbit-shocker.org:#{rsync_local_path}" helper = Bundler::GemHelper.new(base_dir) def helper.version_tag version end @@ -148,28 +149,52 @@ end desc "generate HTML and needed files." task :generate => screenshots do Dir.chdir("doc") do + rm_rf("_site") sh("ruby", "-S", "jekyll") end end - desc "publish HTML." - task :publish => :generate do - sh("rsync", "-avz", "--delete", - "--exclude", "*.svn", - "--exclude", "*-raw.png", - "--exclude", "*.svg", - "--exclude", "*.rab", - "--exclude", "/download/", - "--exclude", "/samples/", - "doc/_site/", - rsync_base_path) + namespace :publish do + dependencies = ["html:generate"] + rsync_command_line = [ + "rsync", "-avz", "--delete", + "--exclude", "*.svn", + "--exclude", "*-raw.png", + "--exclude", "*.svg", + "--exclude", "*.rab", + "--exclude", "/download/", + "--exclude", "/samples/", + "doc/_site/", + ] + desc "publish HTML to remote." + task :remote => dependencies do + sh(*(rsync_command_line + [rsync_base_path])) + end + + desc "publish HTML to local." + task :local => dependencies do + sh(*(rsync_command_line + [File.expand_path(rsync_local_path)])) + end end end +task :update do + update_command = ["git", "pull", "--quiet", "--rebase"] + sh(*update_command) + related_projects = ["rabbirack", "rabbiter", "rabwii"] + related_projects.each do |project| + project_dir = "../#{project}" + next unless File.exist?(project_dir) + Dir.chdir(project_dir) do + sh(*update_command) + end + end +end + task :build => "gettext" task :package => "gettext" namespace :package do desc "Upload tar.gz." @@ -186,7 +211,16 @@ rabbit_tar_gz, "pkg/#{current_rabbit_tar_gz}", "#{rsync_base_path}download/") rm(rabbit_tar_gz) rm(htaccess) + end +end + +namespace :github do + namespace :post_receiver do + desc "Restart GitHub POST receiver" + task :restart do + touch("misc/github-post-receiver/tmp/restart.txt") + end end end