summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--lib/drb/acl.rb18
-rw-r--r--sample/drb/acl.rb15
3 files changed, 20 insertions, 18 deletions
diff --git a/ChangeLog b/ChangeLog
index b51dd89..77baadb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Thu Aug 21 13:21:45 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
+
+ * lib/drb/acl.rb: split executable code into sample directory.
+ * sample/drb/acl.rb: ditto.
+
Thu Aug 21 12:55:35 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
* .gitignore: ignored temporary file for Changelog.
diff --git a/lib/drb/acl.rb b/lib/drb/acl.rb
index 29a3781..8d06b25 100644
--- a/lib/drb/acl.rb
+++ b/lib/drb/acl.rb
@@ -230,21 +230,3 @@ class ACL
end
end
-
-if __FILE__ == $0
- # example
- 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)
-end
-
diff --git a/sample/drb/acl.rb b/sample/drb/acl.rb
new file mode 100644
index 0000000..d93eb9c
--- /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)