diff options
Diffstat (limited to 'spec/support/builders.rb')
-rw-r--r-- | spec/support/builders.rb | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/spec/support/builders.rb b/spec/support/builders.rb index a8f1afe3..896228d1 100644 --- a/spec/support/builders.rb +++ b/spec/support/builders.rb @@ -347,17 +347,6 @@ module Spec GitReader.new lib_path(spec.full_name) end - def build_svn(name, *args, &block) - opts = args.last.is_a?(Hash) ? args.last : {} - spec = build_with(SVNBuilder, name, args, &block) - SVNReader.new(opts[:path] || lib_path(spec.full_name)) - end - - def update_svn(name, *args, &block) - spec = build_with(SVNUpdater, name, args, &block) - SVNReader.new lib_path(spec.full_name) - end - private def build_with(builder, name, args, &blk) @@ -610,62 +599,6 @@ module Spec end - class SVNBuilder < LibBuilder - def _build(options) - path = options[:path] || _default_path - checkout_path = File.join(path, '.checkout') - super(options.merge(:path => path)) - Dir.chdir(path) do - `mkdir .repo_data && find . -maxdepth 1 ! \\( -name ".repo_data" -or -name "." \\) -exec mv {} \\.repo_data/ \\;` - `svnadmin create .repo` - `svn import .repo_data file://#{File.join(path, '.repo')} -m 'OMG INITIAL COMMIT'` - `mv .repo/* .` - end - - `mkdir #{checkout_path}` - Dir.chdir(checkout_path) do - `svn checkout file://#{path} .` - end - end - end - - class SVNUpdater < LibBuilder - def _build(options) - path = options[:path] || _default_path - checkout_path = File.join(path, '.checkout') - - Dir.chdir(checkout_path) do - current_ref = `svn info --revision HEAD file://#{checkout_path} | grep \"Revision\" | awk '{print $2}'`.strip - _default_files.keys.each do |prev_ref_path| - _default_files[prev_ref_path] << "\n#{Builders.constantize(name)}_PREV_REF = '#{current_ref}'" - end - super(options.merge(:path => checkout_path, :gemspec => false)) - `svn add --force *` - `svn commit -m "BUMP"` - end - end - end - - class SVNReader - attr_reader :path - - def initialize(path) - @path = path - end - - def ref_for(ref, len = nil) - ref = svn("info --revision #{ref} file://#{path} | grep \"Revision\" | awk '{print $2}'").strip - ref = ref[0..len] if len - ref - end - - private - - def svn(cmd) - Dir.chdir(@path) { `svn #{cmd}`.strip } - end - end - class GemBuilder < LibBuilder def _build(opts) |