Module: SVN::SVNCommand
- Defined in:
- lib/svn/svntree.rb
Defined Under Namespace
Classes: ReposTree
Class Method Summary collapse
- .export(url, *args) ⇒ Object
- .info ⇒ Object
- .ls(path) ⇒ Object
- .repos_current_path ⇒ Object
- .repos_root_path ⇒ Object
Class Method Details
.export(url, *args) ⇒ Object
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/svn/svntree.rb', line 66 def export(url,*args) to_path = args.first to_path = to_path.chomp.strip if to_path.rindex(/[\/|\\]/) == to_path.length - 1 # Directory path_name = to_path else last_separator = to_path.rindex(/[\/|\\]/) if last_separator && last_separator > 0 # 有目录 path_name = to_path[0..last_separator] end end FileUtils.mkdir_p(path_name) unless File.directory? path_name `svn export --force #{url} #{to_path} ` end |
.info ⇒ Object
85 86 87 |
# File 'lib/svn/svntree.rb', line 85 def info() ret = `svn info` end |
.ls(path) ⇒ Object
62 63 64 |
# File 'lib/svn/svntree.rb', line 62 def ls(path) `svn list #{path}`.split("\n") end |
.repos_current_path ⇒ Object
89 90 91 92 |
# File 'lib/svn/svntree.rb', line 89 def repos_current_path svn_info = info().split("\n") get_svn_info_values(svn_info[1]) end |
.repos_root_path ⇒ Object
94 95 96 97 |
# File 'lib/svn/svntree.rb', line 94 def repos_root_path svn_info = info().split("\n") get_svn_info_values(svn_info[2]) end |