From d70b3c9c00b94020ffaeeead718b2b94813a671c Mon Sep 17 00:00:00 2001 From: Samnang Chhun Date: Mon, 3 Oct 2011 15:47:24 +0700 Subject: [PATCH] lib/shellwords.rb: Update documentation to include example --- ChangeLog | 4 ++++ lib/shellwords.rb | 20 +++++++++++++------- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9abab60..e316f5d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Mon Oct 3 15:47:24 2011 Samnang Chhun + + * lib/shellwords.rb: Update Documentation to include example + Sun Oct 2 20:05:32 2011 Kazuki Tsujimoto * vm.c (rb_thread_mark), cont.c (cont_mark): revert r33369 and r33371 diff --git a/lib/shellwords.rb b/lib/shellwords.rb index f130061..3272eae 100644 --- a/lib/shellwords.rb +++ b/lib/shellwords.rb @@ -1,7 +1,5 @@ -# -# shellwords.rb: Manipulates strings a la UNIX Bourne shell -# - +## +# = Manipulates strings a la UNIX Bourne shell # # This module manipulates strings according to the word parsing rules # of the UNIX Bourne shell. @@ -9,13 +7,21 @@ # The shellwords() function was originally a port of shellwords.pl, # but modified to conform to POSIX / SUSv3 (IEEE Std 1003.1-2001). # -# Authors: +# == Example +# +# argv = Shellwords.split('here are "two words"') # or String#shellsplit +# argv #=> ["here", "are", "two words"] +# +# argv = Shellwords.escape("special's.txt") # or String#shellescape +# system("cat " + argv) +# +# == Authors: # - Wakou Aoyama # - Akinori MUSHA # -# Contact: +# == Contact: # - Akinori MUSHA (current maintainer) -# + module Shellwords # # Splits a string into an array of tokens in the same way the UNIX -- 1.7.6.1