summaryrefslogtreecommitdiff
path: root/sample/dir.rb
diff options
context:
space:
mode:
Diffstat (limited to 'sample/dir.rb')
-rw-r--r--sample/dir.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/sample/dir.rb b/sample/dir.rb
new file mode 100644
index 0000000000..81257cd917
--- /dev/null
+++ b/sample/dir.rb
@@ -0,0 +1,7 @@
+# directory access
+# list all files but .*/*~/*.o
+Dir.foreach(".") do |file|
+ unless file.start_with?('.') or file.end_with?('~', '.o')
+ puts file
+ end
+end