lib/xcode/install.rb in xcode-install-2.3.0 vs lib/xcode/install.rb in xcode-install-2.3.1
- old
+ new
@@ -280,20 +280,20 @@
end
def prereleases
body = spaceship.send(:request, :get, '/download/').body
- links = body.scan(%r{<a.+?href="(.+?\.(dmg|xip))".*>(.*)</a>})
+ links = body.scan(%r{<a.+?href="(.+?/Xcode.+?/Xcode_(.+?)\.(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[2].strip.gsub(/.*Xcode /, ''), pre[0], pre[3]) }
+ links = links.map { |pre| Xcode.new_prerelease(pre[1].strip.tr('_', ' '), pre[0], pre[4]) }
if links.count.zero?
rg = %r{platform-title.*Xcode.* beta.*<\/p>}
scan = body.scan(rg)