class SvnCommandHelper::SvnFileCopyTransaction
svn file copy transaction @attr [String] from_base
from base uri @attr [String] to_base
to base uri @attr [String] file file basename
Attributes
file[R]
from_base[R]
to_base[R]
Public Class Methods
new(from_base:, to_base:, file:)
click to toggle source
Public Instance Methods
from()
click to toggle source
from uri @return [String] from uri
# File lib/svn_command_helper.rb, line 473 def from File.join(@from_base, @file) end
from_exist?()
click to toggle source
from uri exists? @return [Boolean]
# File lib/svn_command_helper.rb, line 494 def from_exist? Svn.exist_file?(from) end
glob_transactions(recursive = false)
click to toggle source
filename glob (like “hoge*”) to each single file transaction @param [Boolean] recursive list –recursive @return [Array<SvnFileCopyTransaction>] transactions
# File lib/svn_command_helper.rb, line 486 def glob_transactions(recursive = false) Svn.list_files(@from_base, recursive) .select{|entry| File.fnmatch(@file, entry.path)} .map{|entry| SvnFileCopyTransaction.new(from_base: @from_base, to_base: @to_base, file: entry.path)} end
relative_from(path)
click to toggle source
relative from path from given base uri @return [String] relative from path
# File lib/svn_command_helper.rb, line 518 def relative_from(path) File.join(relative_from_base(path), @file) end
relative_from_base(path)
click to toggle source
relative from base path from given base uri @return [String] relative from base path
# File lib/svn_command_helper.rb, line 506 def relative_from_base(path) Pathname.new(@from_base).relative_path_from(Pathname.new(path)).to_s end
relative_to(path)
click to toggle source
relative to path from given base uri @return [String] relative to path
# File lib/svn_command_helper.rb, line 524 def relative_to(path) File.join(relative_to_base(path), @file) end
relative_to_base(path)
click to toggle source
relative to base path from given base uri @return [String] relative to base path
# File lib/svn_command_helper.rb, line 512 def relative_to_base(path) Pathname.new(@to_base).relative_path_from(Pathname.new(path)).to_s end
to()
click to toggle source
to uri @return [String] to uri
# File lib/svn_command_helper.rb, line 479 def to File.join(@to_base, @file) end
to_exist?()
click to toggle source
to uri exists? @return [Boolean]
# File lib/svn_command_helper.rb, line 500 def to_exist? Svn.exist_file?(to) end