]> git.wincent.com - mkdtemp.git/commitdiff
Tweaks to keep YARD happy
authorWincent Colaiuta <win@wincent.com>
Thu, 29 Jul 2010 17:00:31 +0000 (19:00 +0200)
committerWincent Colaiuta <win@wincent.com>
Thu, 29 Jul 2010 17:00:31 +0000 (19:00 +0200)
- use ANSI C comment style for method documentation, not C99 style

- eliminate "empty" line betwee "Document-method" and "call-seq"

- drop LICENSE comments from version.rb file, which were getting
  inappropriately included in the output

Signed-off-by: Wincent Colaiuta <win@wincent.com>
ext/mkdtemp.c
lib/mkdtemp/version.rb

index 2a3e316ddd6417c4224bf50d29ba232be8263fe7..d7e6c5e64b500eb019067dc1779aeca65bac1ea7 100644 (file)
@@ -38,33 +38,33 @@ VALUE yield_block(VALUE ignored, VALUE block)
 {
     return rb_funcall(block, rb_intern("call"), 0);
 }
-
-// Document-method: mkdtemp
-//
-// call-seq:
-//     Dir.mkdtemp([string]) -> String or nil
-//     Dir.mkdtemp([string]) { ... } -> String or nil
-//
-// This method securely creates temporary directories. It is a wrapper for the
-// mkdtemp() function in the standard C library. It takes an optional String
-// parameter as a template describing the desired form of the directory name
-// and overwriting the template in-place; if no template is supplied then
-// "/tmp/temp.XXXXXX" is used as a default.
-//
-// If supplied a block, performs a Dir.chdir into the created directory and
-// yields to the block:
-//
-//      # this:            # is a shorthand for:
-//      Dir.mkdtemp do     #   dir = Dir.mkdtemp
-//        puts Dir.pwd     #   Dir.chdir dir do
-//      end                #     puts Dir.pwd
-//                         #   end
-//
-// Note that the exact implementation of mkdtemp() may vary depending on the
-// target system. For example, on Mac OS X at the time of writing, the man page
-// states that the template may contain "some number" of "Xs" on the end of the
-// string, whereas on Red Hat Enterprise Linux it states that the template
-// suffix "must be XXXXXX".
+/*
+ * Document-method: mkdtemp
+ * call-seq:
+ *     Dir.mkdtemp([string]) -> string
+ *     Dir.mkdtemp([string]) { ... } -> string
+ *
+ * This method securely creates temporary directories. It is a wrapper for the
+ * mkdtemp() function in the standard C library. It takes an optional String
+ * parameter as a template describing the desired form of the directory name
+ * and overwriting the template in-place; if no template is supplied then
+ * "/tmp/temp.XXXXXX" is used as a default.
+ *
+ * If supplied a block, performs a Dir.chdir into the created directory and
+ * yields to the block:
+ *
+ *      # this:            # is a shorthand for:
+ *      Dir.mkdtemp do     #   dir = Dir.mkdtemp
+ *        puts Dir.pwd     #   Dir.chdir dir do
+ *      end                #     puts Dir.pwd
+ *                         #   end
+ *
+ * Note that the exact implementation of mkdtemp() may vary depending on the
+ * target system. For example, on Mac OS X at the time of writing, the man page
+ * states that the template may contain "some number" of "Xs" on the end of the
+ * string, whereas on Red Hat Enterprise Linux it states that the template
+ * suffix "must be XXXXXX".
+ */
 static VALUE dir_mkdtemp_m(int argc, VALUE *argv, VALUE self)
 {
     VALUE template, block;
@@ -103,7 +103,7 @@ static VALUE dir_mkdtemp_m(int argc, VALUE *argv, VALUE self)
 void Init_mkdtemp()
 {
 #if 0
-    // for Yardoc, need to fake this here
+    // for YARD, need to fake this here
     VALUE rb_cDir = rb_define_class("Dir", rb_cObject);
 #endif
     rb_define_singleton_method(rb_cDir, "mkdtemp", dir_mkdtemp_m, -1);
index ecf9309cc60af4c6edae40d678ee905809c42ebf..61635f315ce44108351efff2fe13a0d008ba3ff4 100644 (file)
@@ -1,26 +1,3 @@
-# Copyright 2008-2010 Wincent Colaiuta. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-# 1. Redistributions of source code must retain the above copyright notice,
-#    this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright notice,
-#    this list of conditions and the following disclaimer in the documentation
-#    and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
 class Dir
   module Mkdtemp
     VERSION = '1.2.0.99'