Skip to content

Commit

Permalink
Merge pull request #1461 from fluent/revert-1415-use-basic-object-for…
Browse files Browse the repository at this point in the history
…-clean-room

Revert "Use BasicObject for cleanroom"
  • Loading branch information
repeatedly authored Feb 10, 2017
2 parents 8754bdb + d51f9d2 commit ebfb7fb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/fluent/plugin/filter_record_transformer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -308,10 +308,14 @@ def expand(str, placeholders, force_stringify = false)
raise "failed to expand `#{str}` : error = #{e}"
end

class CleanroomExpander < BasicObject
class CleanroomExpander
def expand(__str_to_eval__, tag, time, record, tag_parts, tag_prefix, tag_suffix, hostname)
instance_eval(__str_to_eval__)
end

(Object.instance_methods).each do |m|
undef_method m unless m.to_s =~ /^__|respond_to_missing\?|object_id|public_methods|instance_eval|method_missing|define_singleton_method|respond_to\?|new_ostruct_member/
end
end
end
end
Expand Down

0 comments on commit ebfb7fb

Please sign in to comment.