From 661d1b82dcd1b89bbbac29b0a7bd637cef616e96 Mon Sep 17 00:00:00 2001 From: Jorge Manrubia Date: Fri, 10 Sep 2021 22:50:16 +0200 Subject: [PATCH 1/2] Prevent reopening parser classes Fixes https://github.com/basecamp/console1984/issues/30 --- config/protections.yml | 1 + test/tampering_cases/override_parser.rb | 5 +++++ 2 files changed, 6 insertions(+) create mode 100644 test/tampering_cases/override_parser.rb diff --git a/config/protections.yml b/config/protections.yml index f0588dd..8ed3eb5 100644 --- a/config/protections.yml +++ b/config/protections.yml @@ -5,6 +5,7 @@ validations: - PG - Mysql2 - IRB + - Parser forbidden_constant_reference: always: - Console1984 diff --git a/test/tampering_cases/override_parser.rb b/test/tampering_cases/override_parser.rb new file mode 100644 index 0000000..b8745eb --- /dev/null +++ b/test/tampering_cases/override_parser.rb @@ -0,0 +1,5 @@ +class ::Parser::AST::Processor + def on_const(node) + [:String] + end +end From fb02955646eae0cdecc1d8bd740457e3b565ee22 Mon Sep 17 00:00:00 2001 From: Jorge Manrubia Date: Fri, 10 Sep 2021 22:50:46 +0200 Subject: [PATCH 2/2] Bump version --- Gemfile.lock | 2 +- lib/console1984/version.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index d97dd5a..852c47d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -87,7 +87,7 @@ GIT PATH remote: . specs: - console1984 (0.1.13) + console1984 (0.1.14) colorize parser diff --git a/lib/console1984/version.rb b/lib/console1984/version.rb index 1cdb0fb..887cb4c 100644 --- a/lib/console1984/version.rb +++ b/lib/console1984/version.rb @@ -1,3 +1,3 @@ module Console1984 - VERSION = '0.1.13' + VERSION = '0.1.14' end