lib/xcode/install.rb in xcode-install-2.0.4 vs lib/xcode/install.rb in xcode-install-2.0.5
- old
+ new
@@ -273,11 +273,11 @@
xcodes = seeds.map { |x| Xcode.new(x) }.reject { |x| x.version < MINIMUM_VERSION }.sort do |a, b|
a.date_modified <=> b.date_modified
end
- xcodes.select { |x| x.url.end_with?('.dmg') }
+ xcodes.select { |x| x.url.end_with?('.dmg') || x.url.end_with?('.xip') }
end
def list_versions
seedlist.map(&:name)
end
@@ -303,9 +303,11 @@
if scan.count == 0
rg = %r{Xcode.* GM.*<\/p>}
scan = body.scan(rg)
end
+
+ return [] if scan.empty?
version = scan.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
links << Xcode.new(version, link, notes)