class Dir2svn::Sync
Utility to sync a folder to a Subversion working copy The working copy folder is the ‘target’
Attributes
do_puts[RW]
exclude[RW]
source[RW]
target[RW]
Public Class Methods
new(*args)
click to toggle source
# File lib/dir2svn.rb, line 15 def initialize(*args) @source = args[0] @target = args[1] @exclude = args[2] || '.svn,.trashbin,.folder,__generated.txt' if Gem.win_platform? @source = args[0].tr('\\', '/') @target = args[1].tr('\\', '/') # Ruby style paths work on MS Windows # when interacting directory with OS using system calls end @do_puts = args[3] || true end
Public Instance Methods
check_source_target_etc()
click to toggle source
# File lib/dir2svn.rb, line 28 def check_source_target_etc fail ERR1 if source.nil? || target.nil? unless File.exist? source puts "Source: #{source}" if do_puts fail ERR2 end end
run()
click to toggle source
# File lib/dir2svn.rb, line 43 def run check_source_target_etc svn_mkdir_target results = Dir2svn.sync_paths(source, target, exclude, do_puts) end
svn_mkdir_target()
click to toggle source
# File lib/dir2svn.rb, line 36 def svn_mkdir_target `svn mkdir --parents \"#{target}\" 2>>svn_mkdir.tmp 1>>svn_mkdir.tmp` svn_mkdir = File.read('svn_mkdir.tmp') File.delete('svn_mkdir.tmp') fail ERR3 if svn_mkdir.include? 'is not a working copy' end