Skip to content

Instantly share code, notes, and snippets.

@yahonda
Created October 26, 2024 02:24
Show Gist options
  • Save yahonda/3e55643d3c78dbe3843492cafd9ebcea to your computer and use it in GitHub Desktop.
Save yahonda/3e55643d3c78dbe3843492cafd9ebcea to your computer and use it in GitHub Desktop.
class C
class_eval "def throw_syntax_error; eval %(
'abc' + pluralize 'def'
); end", "lib/file.rb", 42
end
c = C.new
c.throw_syntax_error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment