psych_shield 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. data/lib/psych_shield.rb +6 -16
  2. metadata +1 -2
@@ -34,8 +34,8 @@ class PsychShield
34
34
  end
35
35
 
36
36
  def self.allowed?(o)
37
- res = @@allowed_objects.include?(o.class.to_s)
38
- @@callback.call(o.class.to_s, res) if @@callback
37
+ res = @@allowed_objects.include?(o.to_s)
38
+ @@callback.call(o.to_s, res) if @@callback
39
39
  res
40
40
  end
41
41
 
@@ -52,20 +52,10 @@ module Psych
52
52
  module Visitors
53
53
  class ToRuby
54
54
 
55
- alias_method :shielded_revive_hash, :revive_hash
56
- def revive_hash hash, o
57
- unless PsychShield.allowed?(hash)
58
- return PsychShield::DeniedObject.new
59
- end
60
- shielded_revive_hash(hash,o)
61
- end
62
-
63
- alias_method :shielded_init_with, :init_with
64
- def init_with o, h, node
65
- unless PsychShield.allowed?(o)
66
- return PsychShield::DeniedObject.new
67
- end
68
- shielded_init_with(o,h,node)
55
+ alias_method :shielded_resolve_class, :resolve_class
56
+ def resolve_class klass
57
+ return unless PsychShield.allowed?(klass)
58
+ shielded_resolve_class(klass)
69
59
  end
70
60
 
71
61
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: psych_shield
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -46,4 +46,3 @@ signing_key:
46
46
  specification_version: 3
47
47
  summary: This gem provides a filter for the Psych YAML parser
48
48
  test_files: []
49
- has_rdoc: