lib/xcode/install.rb in xcode-install-2.0.1 vs lib/xcode/install.rb in xcode-install-2.0.2
- old
+ new
@@ -265,20 +265,20 @@
end
def prereleases
body = spaceship.send(:request, :get, '/download/').body
- links = body.scan(%r{<a.+?href="(.+?.dmg)".*>(.*)</a>})
+ links = body.scan(%r{<a.+?href="(.+?\.(dmg|xip))".*>(.*)</a>})
links = links.map do |link|
parent = link[0].scan(%r{path=(/.*/.*/)}).first.first
match = body.scan(/#{Regexp.quote(parent)}(.+?.pdf)/).first
if match
link + [parent + match.first]
else
link + [nil]
end
end
- links = links.map { |pre| Xcode.new_prerelease(pre[1].strip.gsub(/.*Xcode /, ''), pre[0], pre[2]) }
+ links = links.map { |pre| Xcode.new_prerelease(pre[2].strip.gsub(/.*Xcode /, ''), pre[0], pre[3]) }
if links.count == 0
version = body.scan(%r{Xcode.* beta.*<\/p>}).last.gsub(/<.*?>/, '').gsub(/.*Xcode /, '')
link = body.scan(%r{<button .*"(.+?.xip)".*</button>}).first.first
notes = body.scan(%r{<a.+?href="(/go/\?id=xcode-.+?)".*>(.*)</a>}).first.first