Sha256: 1f1cfdf0352166b8c0db6b77d3d36fd89eae1142cb469279e72d66542c0c1364
Contents?: true
Size: 624 Bytes
Versions: 1
Compression:
Stored size: 624 Bytes
Contents
require 'rexml/document' desc "Update Graph API description file (optionally specify VERSION environment variable - defaults to \"v1.0\")" task :update_metadata do version = ENV['VERSION'] || "v1.0" file_name = File.absolute_path File.join(__FILE__, "../../data/metadata_#{version}.xml") uri = URI("https://graph.microsoft.com/#{version}/$metadata?detailed=true") xml = Net::HTTP .new(uri.hostname, uri.port) .tap { |h| h.use_ssl = uri.scheme == "https" } .get(uri).body doc = REXML::Document.new(xml) File.open(file_name, 'w') do |f| puts "writing to #{file_name}" doc.write f, 2 end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
microsoft_graph-0.1.2 | tasks/update_metadata.rb |