From 22875097b8a56b38c7617416af4f237e7cff6757 Mon Sep 17 00:00:00 2001 From: Sebastian Gumprich Date: Tue, 20 Oct 2020 12:06:19 +0200 Subject: [PATCH] fix quotes in library again ``` inspec> inspec.command("mysql -sN -e 'SHOW VARIABLES WHERE variable_name = \"version\"'").stdout.strip.split("\t")[1].split("-")[0].to_s => "8.0.21" inspec> inspec.command("mysql -sN -e 'SHOW VARIABLES WHERE variable_name = \"version\"'").stdout.strip.split('\t')[1].split('-')[0].to_s NoMethodError: undefined method `split' for nil:NilClass from (pry):10:in `load_with_context' ``` Signed-off-by: Sebastian Gumprich --- libraries/mysql_version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/mysql_version.rb b/libraries/mysql_version.rb index 3c1e615..7f949a0 100644 --- a/libraries/mysql_version.rb +++ b/libraries/mysql_version.rb @@ -27,6 +27,6 @@ def initialize(user, pass) end def mysql_version - inspec.command("mysql -sN -e 'SHOW VARIABLES WHERE variable_name = \"version\"'").stdout.strip.split('\t')[1].split('-')[0].to_s + inspec.command("mysql -sN -e 'SHOW VARIABLES WHERE variable_name = \"version\"'").stdout.strip.split("\t")[1].split('-')[0].to_s end end