Members of the KDE Community are recommended to subscribe to the kde-community mailing list at to allow them to participate in important discussions and receive other important announcements

Commit 843bd0ac authored by Jonathan Riddell's avatar Jonathan Riddell 🏄

save the file with pretty printing

parent 192875c2
......@@ -25,6 +25,7 @@ require 'optparse'
class MetaInfoUpdater
attr_accessor :filename
attr_accessor :doc
def initialize(filename)
@filename = filename
......@@ -32,6 +33,17 @@ class MetaInfoUpdater
def open_file
puts "Filename #{@filename}"
# TODO check file exists etc
@doc = { |f| Nokogiri::XML(f, &:noblanks) }
component = @doc.at_css("component")
releases = component.add_child("<releases><release version='1.0' date='today'/></releases>")
puts component.to_xml(:indent => 2)
def save_file
#File.write("#{@filename}.new", @doc.to_xml(:indent => 2))
f ="#{@filename}.new", "w")
@doc.write_xml_to(f, {indent: 2})
......@@ -47,3 +59,4 @@ file_name = ARGV[0]
updater =
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment