Sha256: 4772d4f7f17c3d5900af6146ece332b0d1b18675c4714ed547b893b83e0d11c7

Contents?: true

Size: 1.17 KB

Versions: 2

Compression:

Stored size: 1.17 KB

Contents

require 'xcodeproj'
require 'xcodeproj/scheme'

class Xcodeproj::XCScheme::XML_Fromatter
  def write_element(node, output)
    @indentation = 3
    output << ' '*@level
    output << "<#{node.expanded_name}"

    @level += @indentation
    node.attributes.each_attribute do |attr|
      output << "\n"
      output << ' '*@level
      output << attr.to_string.sub(/=/, ' = ') # here's the patch (sub instead of gsub)
    end unless node.attributes.empty?

    output << ">"

    output << "\n"
    node.children.each { |child|
      next if child.kind_of?(REXML::Text) and child.to_s.strip.length == 0
      write(child, output)
      output << "\n"
    }
    @level -= @indentation
    output << ' '*@level
    output << "</#{node.expanded_name}>"
  end
end


class Xcodeproj::XCScheme
  alias construct_buildable_name_without_legacy_target construct_buildable_name

  def construct_buildable_name_with_legacy_target(build_target)
    if build_target.is_a? Xcodeproj::Project::Object::PBXLegacyTarget
      build_target.name
    else
      construct_buildable_name_without_legacy_target build_target
    end
  end

  alias construct_buildable_name construct_buildable_name_with_legacy_target

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
pebblex-0.0.7 lib/pebble_x/monkey_patches.rb
pebblex-0.0.6 lib/pebble_x/monkey_patches.rb