I declare steps that need to be done in order to install wordpress in an array in the beginning of my ruby script
$wordpress_cmds = [ "mkdir -p #{$web_root}#{$web_directory}#{$web_url}/public_html",
"cp -R #{$wordpress_current}/* #{$web_root}#{$web_directory}#{$web_url}/public_html",
"chown -R www-data:www-data #{$web_root}#{$web_directory}#{$web_url}",
]
Some of the variables are updated later on. Is there any way to get the latest values of all variables that are in the array when accessing the arrya?
Let's say that if my code is like I always get the initial value of the array not the one I want (with updated variables inside)
$web_root = '====='
$wordpress_cmds = ["#{$web_root}"]
puts $wordpress_cmds[0]
$web_root= "new value"
puts $wordpress_cmds[0]
$web_root.replace("new value")
puts $wordpress_cmds[0]
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)