lib/buildmaster/svn_driver.rb in BuildMaster-0.8.0 vs lib/buildmaster/svn_driver.rb in BuildMaster-0.8.1

- old
+ new

@@ -10,25 +10,22 @@ @path = path analyze_entry_file(File.join(path, ".svn", "entries")) end def analyze_entry_file(path) - content = load_content(path) - xml = REXML::Document.new(content) - xml.root.each_element_with_attribute('name', '', 1) do |element| - @repository_root = element.attributes['repos'] + File.open(path, 'r') do |file| + parse_xml_load_repository_root(file) end end - def load_content(path) - buffer = StringIO.new - File.open(path, 'r') do |file| - while (line = file.gets) - buffer.puts(line) - end + private + def parse_xml_load_repository_root(file) + xml = REXML::Document.new(file) + xml.root.each_element_with_attribute('name', '', 1) do |element| + @repository_root = element.attributes['repos'] end - return buffer.string end + end class SvnDriver include Shell \ No newline at end of file