Skip to content

Commit

Permalink
fix one REXML bug, warn on another
Browse files Browse the repository at this point in the history
  • Loading branch information
sshaw committed Jul 16, 2013
1 parent 3eb36dd commit 5d1cd0b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion bin/itms
Expand Up @@ -104,6 +104,7 @@ module Command
end

files = []
warned = false
if @assets == true
files = asset_info["//asset[ .//*[ @key = 'proxy-encode-url' ]]"]
else
Expand All @@ -113,9 +114,13 @@ module Command

xpath = "//asset[ @type = '#{type}'"
if regions.any?
if !warned && RUBY_VERSION.start_with?("1.8")
warn "WARNING: you're using Ruby 1.8, which has known problems looking up assets by region, expect problems!"
warned = true
end
xpath << " and (%s)" % regions.map { |code| ".//territory = '#{code}'" }.join(" or ")
end
xpath << "and .//*[ @key = 'proxy-encode-url' ]]"
xpath << " and .//*[ @key = 'proxy-encode-url' ]]"

info = asset_info[xpath]
unknown = regions - info.map { |file| file[:territories] }.flatten
Expand Down

0 comments on commit 5d1cd0b

Please sign in to comment.