Class: SVN::SVNTree
Direct Known Subclasses
Instance Attribute Summary collapse
-
#items ⇒ Object
Returns the value of attribute items.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
- #[](*args) ⇒ Object
- #each(&block) ⇒ Object
-
#initialize(url, *args) ⇒ SVNTree
constructor
A new instance of SVNTree.
Constructor Details
#initialize(url, *args) ⇒ SVNTree
Returns a new instance of SVNTree.
10 11 12 13 |
# File 'lib/svn/svntree.rb', line 10 def initialize(url,*args) @url = url @items = SVN::SVNCommand.ls(url) end |
Instance Attribute Details
#items ⇒ Object
Returns the value of attribute items.
7 8 9 |
# File 'lib/svn/svntree.rb', line 7 def items @items end |
#url ⇒ Object
Returns the value of attribute url.
8 9 10 |
# File 'lib/svn/svntree.rb', line 8 def url @url end |
Instance Method Details
#[](*args) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/svn/svntree.rb', line 15 def [](*args) svn_tree = load_child(self) svn_tree.reject do |item| match = false args.each do |p| match = File.fnmatch(p,item,File::FNM_PATHNAME | File::FNM_DOTMATCH) break if match end !match end end |
#each(&block) ⇒ Object
28 29 30 31 32 33 34 35 36 |
# File 'lib/svn/svntree.rb', line 28 def each(&block) @items.each do |member| if member.rindex(/[\\|\/]/) == member.length - 1 block.call(SVNTree.new url + member) else block.call(member) end end end |