Skip to content

Instantly share code, notes, and snippets.

@michaeleisel
Created November 30, 2014 01:56
Show Gist options
  • Save michaeleisel/6d0f2cb942f22c24b130 to your computer and use it in GitHub Desktop.
Save michaeleisel/6d0f2cb942f22c24b130 to your computer and use it in GitHub Desktop.
require 'nokogiri'
if ARGV.size < 1
puts "please enter the file to use"
exit 1
end
storyboard = Nokogiri::XML(IO.read(ARGV[0]), &:noblanks).root
labels = storyboard.xpath("//label")
labels.each do |label|
width = label.at_xpath("//rect")[:width].to_f
label[:preferredMaxLayoutWidth] = width.to_s
end
puts storyboard.to_s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment