lib/ruboto/util/setup.rb in ruboto-1.1.1 vs lib/ruboto/util/setup.rb in ruboto-1.1.2
- old
+ new
@@ -137,18 +137,21 @@
regex = '(\>android-sdk.*macosx.zip)'
when LINUX
regex = '(\>android-sdk.*.tgz)'
when WINDOWS
regex = '(\>installer_.*.exe)'
- else #Error
- nil
+ else
+ raise "Unknown host os: #{android_package_os_id}"
end
- link = page_content.scan(/#{regex}/).to_s
- version = link.match( /(\d+).(\d+).(\d+)/ )[0]
+ link = page_content.scan(/#{regex}/)
+ raise "SDK link cannot be found on download page: #{SDK_DOWNLOAD_PAGE}" if link.nil?
+
+ version = link.to_s.match(/r(\d+.)?(\d+.)?(\d+)/)[0]
+ raise "SDK version cannot be determined from download page: #{SDK_DOWNLOAD_PAGE}" if version.nil?
- version
+ version.delete! 'r'
end
#########################################
#
# Check Methods
@@ -282,10 +285,10 @@
print 'Would you like to and install it? (Y/n): '
a = STDIN.gets.chomp.upcase
end
if accept_all || a == 'Y' || a.empty?
puts "sudo #{installer} install -y #{package_name}"
- `sudo #{installer} install -y #{package_name}`
+ IO.popen("sudo #{installer} install -y #{package_name}") {|io| while (l = io.gets) do; puts l; end }
else
puts
puts "You can install #{pretty_name} manually by:"
puts "sudo #{installer} install #{package_name}"
puts