我有这个对象:
{"wordFormId":"abandon",
"wordFormIdentity":1,
"ascii":97,
"wordId":"abandon",
"primary":true,
"posId":2}
如何删除ascii属性?我知道我可以将它设置为null但我认为它仍然会存在。我想做的是彻底删除它。
答案 0 :(得分:1)
# -*- mode: ruby -*-
# vi: set ft=ruby :
$script1 = <<SCRIPT
echo "Run this provisioner first to write a value to requiresreboot.txt... "
start-process "C:\\...\\vagrant_provisioning_file1.bat" -wait
SCRIPT
$script2 = <<SCRIPT
echo "Run this provisioner second... "
start-process "C:\\...\\vagrant_provisioning_file2.bat" -wait
SCRIPT
Vagrant.configure(2) do |config|
# Other vagrant setup.....
# ........................
File.new("requiresreboot.txt", "w+");
# Enable provisioning with a shell script 1.
config.vm.provision "shell", inline: $script1
file = File.open("requiresreboot.txt", "r")
contents = file.read
if contents == "max_rearms_reached"
print "Cannot extend Windows 7 trial: maximum number of rearms reached."
elsif contents == "true"
# trigger reload (reboot to apply changes for Windows trial renewal)
print "Windows trial renewal is required"
config.vm.provision :reload
elsif contents == "false"
print "No reload required, continuing with provisioning..."
end
file.close
# Enable provisioning with a shell script 2.
config.vm.provision "shell", inline: $script2
end