From bff692b94d74de24fe9b50a515f4bc844c3fb5be Mon Sep 17 00:00:00 2001 From: hsbt Date: Thu, 21 Aug 2014 04:23:43 +0000 Subject: * lib/drb/acl.rb: split executable code into sample directory. * sample/drb/acl.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- sample/drb/acl.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 sample/drb/acl.rb (limited to 'sample/drb') diff --git a/sample/drb/acl.rb b/sample/drb/acl.rb new file mode 100644 index 0000000000..d93eb9c1fc --- /dev/null +++ b/sample/drb/acl.rb @@ -0,0 +1,15 @@ +require 'drb/acl' + +list = %w(deny all + allow 192.168.1.1 + allow ::ffff:192.168.1.2 + allow 192.168.1.3 +) + +addr = ["AF_INET", 10, "lc630", "192.168.1.3"] + +acl = ACL.new +p acl.allow_addr?(addr) + +acl = ACL.new(list, ACL::DENY_ALLOW) +p acl.allow_addr?(addr) -- cgit v1.2.3