class AzureFunctionsCoreToolsAT4 < Formula desc "Azure Functions Core Tools 4.0" homepage "https://docs.microsoft.com/en-us/azure/azure-functions/functions-run-local#run-azure-functions-core-tools" url "https://functionscdn.azureedge.net/public/4.0.3971/Azure.Functions.Cli.osx-x64.4.0.3971.zip" version "4.0.3971" # make sure sha256 is lowercase. sha256 "9a852a5c5e28ea043e8c141e6e690c8535a4cc1996018ef25d902b1704914fdd" head "https://github.com/Azure/azure-functions-core-tools" @@telemetry = "\n Telemetry \n --------- \n The Azure Functions Core tools collect usage data in order to help us improve your experience." \ + "\n The data is anonymous and doesn\'t include any user specific or personal information. The data is collected by Microsoft." \ + "\n \n You can opt-out of telemetry by setting the FUNCTIONS_CORE_TOOLS_TELEMETRY_OPTOUT environment variable to \'1\' or \'true\' using your favorite shell.\n" def install prefix.install Dir["*"] chmod 0555, prefix/"func" chmod 0555, prefix/"gozip" bin.install_symlink prefix/"func" begin FileUtils.touch(prefix/"telemetryDefaultOn.sentinel") print @@telemetry rescue Exception end end test do assert_match version.to_s, shell_output("#{bin}/func") system bin/"func", "new", "-l", "C#", "-t", "HttpTrigger", "-n", "confusedDevTest" assert_predicate testpath/"confusedDevTest/function.json", :exist? end end