From 9130ea679e39ae2c5f470a4414bd4a8b1c3fa147 Mon Sep 17 00:00:00 2001 From: merefield Date: Tue, 4 Jun 2024 13:45:10 +0100 Subject: [PATCH] mark out code for rubocop exception --- lib/discourse_chatbot/safe_ruby/lib/safe_ruby/runner.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/discourse_chatbot/safe_ruby/lib/safe_ruby/runner.rb b/lib/discourse_chatbot/safe_ruby/lib/safe_ruby/runner.rb index dd968b2..0fbe74f 100644 --- a/lib/discourse_chatbot/safe_ruby/lib/safe_ruby/runner.rb +++ b/lib/discourse_chatbot/safe_ruby/lib/safe_ruby/runner.rb @@ -43,6 +43,8 @@ def eval data = read.read begin + # The whole point of this library is to run code in a safe way + # rubocop:disable Security/MarshalLoad Marshal.load(data) rescue => e if @raise_errors @@ -54,6 +56,8 @@ def eval end def self.check(code, expected) + # The whole point of this library is to run code in a safe way + # rubocop:disable Security/Eval eval(code) == eval(expected) end