lib/rubikon/application/sandbox.rb in rubikon-0.4.1 vs lib/rubikon/application/sandbox.rb in rubikon-0.5.0

- old
+ new

@@ -33,14 +33,16 @@ # @param (see ClassMethods#method_missing) # @raise [NoMethodError] if a method is called that is defined inside # InstanceMethods and should therefore be protected # @see InstanceMethods def method_missing(name, *args, &block) - if InstanceMethods.method_defined?(name) || - InstanceMethods.private_method_defined?(name) + if @__app__.class.instance_methods(false).include?(name.to_s) || + !(InstanceMethods.method_defined?(name) || + InstanceMethods.private_method_defined?(name)) + @__app__.send(name, *args, &block) + else raise NoMethodError.new("Method `#{name}' is protected by the application sandbox", name) end - @__app__.send(name, *args, &block) end # Relay putc to the instance method # # This is used to hide <tt>Kernel#putc</tt> so that the application's