You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
342 B
14 lines
342 B
9 years ago
|
#!/usr/bin/env ruby
|
||
|
|
||
|
require 'rexml/document'
|
||
|
|
||
|
doc = REXML::Document.new(ARGF.read, ignore_whitespace_nodes: :all)
|
||
|
xpath = '//dict/key[text()="variablesdontexport"]/following-sibling::array'
|
||
|
vars = doc.elements[xpath].map(&:text)
|
||
|
|
||
|
vars.each do |var|
|
||
|
doc.elements["//key[text()='#{var}']/following-sibling::string"].text = ''
|
||
|
end
|
||
|
|
||
|
doc.write
|