Permalink
Browse files

Added oniguruma:sync task.

  • Loading branch information...
1 parent 6559ccb commit b890af7466bf3623c58a9336a98c2e68029e8b3a @brixen brixen committed Dec 5, 2011
Showing with 24 additions and 0 deletions.
  1. +24 −0 rakelib/oniguruma.rake
View
24 rakelib/oniguruma.rake
@@ -0,0 +1,24 @@
+# -*- ruby -*-
+
+require 'rakelib/git'
+
+namespace :oniguruma do
+ desc "Synchronize vendor/oniguruma with a current clone of rubinius/oniguruma"
+ task :sync do
+ unless dir = ENV['DIR']
+ raise "Use DIR= to specify a clone of oniguruma"
+ end
+
+ unless is_git_project dir, "oniguruma.git"
+ raise "#{dir} is not an oniguruma clone. Clone from 'git://github.com/rubinius/oniguruma.git'"
+ end
+
+ src_dir = "vendor/oniguruma"
+ rm_rf src_dir
+ rsync "#{dir}/*", src_dir
+
+ version = Dir.chdir(dir) { `git log --pretty=oneline -1`[0..7] }
+ sh "git add #{src_dir}"
+ sh "git commit -m 'Updated vendor/oniguruma to #{version}.' #{src_dir}"
+ end
+end

0 comments on commit b890af7

Please sign in to comment.