summaryrefslogtreecommitdiff
path: root/chef-config/lib/chef-config/workstation_config_loader.rb
diff options
context:
space:
mode:
Diffstat (limited to 'chef-config/lib/chef-config/workstation_config_loader.rb')
-rw-r--r--chef-config/lib/chef-config/workstation_config_loader.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/chef-config/lib/chef-config/workstation_config_loader.rb b/chef-config/lib/chef-config/workstation_config_loader.rb
index bbec74911b..ea42211120 100644
--- a/chef-config/lib/chef-config/workstation_config_loader.rb
+++ b/chef-config/lib/chef-config/workstation_config_loader.rb
@@ -195,8 +195,8 @@ module ChefConfig
message = ""
message << "You have invalid ruby syntax in your config file #{config_file_path}\n\n"
message << "#{e.class.name}: #{e.message}\n"
- if file_line = e.message[/#{Regexp.escape(config_file_path)}:[\d]+/]
- line = file_line[/:([\d]+)$/, 1].to_i
+ if file_line = e.message[/#{Regexp.escape(config_file_path)}:\d+/]
+ line = file_line[/:(\d+)$/, 1].to_i
message << highlight_config_error(config_file_path, line)
end
raise ChefConfig::ConfigurationError, message
@@ -206,7 +206,7 @@ module ChefConfig
filtered_trace = e.backtrace.grep(/#{Regexp.escape(config_file_path)}/)
filtered_trace.each { |bt_line| message << " " << bt_line << "\n" }
unless filtered_trace.empty?
- line_nr = filtered_trace.first[/#{Regexp.escape(config_file_path)}:([\d]+)/, 1]
+ line_nr = filtered_trace.first[/#{Regexp.escape(config_file_path)}:(\d+)/, 1]
message << highlight_config_error(config_file_path, line_nr.to_i)
end
raise ChefConfig::ConfigurationError, message