Sha256: 52ace7e6b3b1cf67dd41a790c67f66c4e25f7cb90572328fa7cb61f58c996da3

Contents?: true

Size: 1.36 KB

Versions: 16

Compression:

Stored size: 1.36 KB

Contents

require File.join(Redcar.asset_dir, "svnkit")
require 'java'
import 'org.tmatesoft.svn.core.io.SVNRepositoryFactory'

def scm_svn_fixtures
  File.expand_path(File.dirname(__FILE__) + "/../fixtures")
end

# minus 3 for '.' and '..' and '.svn'
def repo_file_count(path)
  (Dir.entries(path).size - 3).to_i
end

def parse_branch_path(branch_name)
  if branch_name == 'trunk'
    svn_module.trunk_path
  else
    svn_module.branch_path + "/#{branch_name}"
  end
end

def svn_repository
  "#{scm_svn_fixtures}/test_repo"
end

def working_copy
  "my_repo"
end

def working_copy_2
  "my_repo_2"
end

def svn_repository_url
  "file://" + File.expand_path(svn_repository)
end

def create_dir(path)
  FileUtils.mkdir_p "#{scm_svn_fixtures}/#{path}"
  File.expand_path("#{scm_svn_fixtures}/#{path}")
end

def get_dir(path)
  File.expand_path("#{scm_svn_fixtures}/#{path}")
end

def svn_module
  @svn_module ||= Redcar::Scm::Subversion::Manager.new
end

def svn_module_2
  @svn_module_2 ||= Redcar::Scm::Subversion::Manager.new
end

def reset_fixtures
  FileUtils.rm_rf scm_svn_fixtures
  FileUtils.mkdir_p scm_svn_fixtures
  FileUtils.mkdir_p File.dirname(svn_repository)
  SVNRepositoryFactory.createLocalRepository(Java::JavaIo::File.new(svn_repository),true,false)
  svn_module
end

Before do
  @svn_module = nil
  reset_fixtures
end

After do
  FileUtils.rm_rf(scm_svn_fixtures)
  @svn_module = nil
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
redcar-dev-0.12.17dev plugins/scm_svn/features/support/env.rb
redcar-dev-0.12.16dev-java plugins/scm_svn/features/support/env.rb
redcar-dev-0.12.15dev-java plugins/scm_svn/features/support/env.rb
redcar-dev-0.12.14dev-java plugins/scm_svn/features/support/env.rb
redcar-dev-0.12.13dev-java plugins/scm_svn/features/support/env.rb
redcar-dev-0.12.12dev-java plugins/scm_svn/features/support/env.rb
redcar-dev-0.12.11dev-java plugins/scm_svn/features/support/env.rb
redcar-dev-0.12.10dev-java plugins/scm_svn/features/support/env.rb
redcar-dev-0.12.9dev-java plugins/scm_svn/features/support/env.rb
redcar-dev-0.12.8dev-java plugins/scm_svn/features/support/env.rb
redcar-dev-0.12.7dev-java plugins/scm_svn/features/support/env.rb
redcar-dev-0.12.6dev-java plugins/scm_svn/features/support/env.rb
redcar-dev-0.12.4dev-java plugins/scm_svn/features/support/env.rb
redcar-dev-0.12.3dev-java plugins/scm_svn/features/support/env.rb
redcar-dev-0.12.1dev-java plugins/scm_svn/features/support/env.rb
redcar-dev-0.12.0dev-java plugins/scm_svn/features/support/env.rb