diff options
author | zzak <zzak@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-12-05 02:55:07 +0000 |
---|---|---|
committer | zzak <zzak@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-12-05 02:55:07 +0000 |
commit | 342d2f2aa6037bd126c2247c6c6b9bf97f8c42bd (patch) | |
tree | 5d9b6891e2f74368315196925dbf2c12d3b1ab7e /lib/shell/filter.rb | |
parent | 895bb667b294ab2b762c83373c320a5bbf94dd3f (diff) | |
download | ruby-342d2f2aa6037bd126c2247c6c6b9bf97f8c42bd.tar.gz |
* doc/shell.rd, doc/shell.rd.ja: Removed stale doc files
* lib/shell.rb, lib/shell/*: Merge and updates docs from doc/shell.rd*
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38201 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/shell/filter.rb')
-rw-r--r-- | lib/shell/filter.rb | 36 |
1 files changed, 32 insertions, 4 deletions
diff --git a/lib/shell/filter.rb b/lib/shell/filter.rb index df41b420ea..d53ed06315 100644 --- a/lib/shell/filter.rb +++ b/lib/shell/filter.rb @@ -9,11 +9,12 @@ # # -class Shell +class Shell #:nodoc: + # Any result of command exection is a Filter. # - # Filter - # A method to require - # each() + # This class includes Enumerable, therefore a Filter object can use all + # Enumerable + # facilities. # class Filter include Enumerable @@ -29,6 +30,10 @@ class Shell @input = filter end + # call-seq: + # each(record_separator=nil) { block } + # + # Iterates a block for each line. def each(rs = nil) rs = @shell.record_separator unless rs if @input @@ -36,6 +41,11 @@ class Shell end end + # call-seq: + # < source + # + # Inputs from +source+, which is either a string of a file name or an IO + # object. def < (src) case src when String @@ -49,6 +59,11 @@ class Shell end end + # call-seq: + # > source + # + # Outputs from +source+, which is either a string of a file name or an IO + # object. def > (to) case to when String @@ -66,6 +81,11 @@ class Shell self end + # call-seq: + # >> source + # + # Appends the output to +source+, which is either a string of a file name + # or an IO object. def >> (to) begin Shell.cd(@shell.pwd).append(to, self) @@ -74,6 +94,10 @@ class Shell end end + # call-seq: + # | filter + # + # Processes a pipeline. def | (filter) filter.input = self if active? @@ -82,6 +106,10 @@ class Shell filter end + # call-seq: + # filter1 + filter2 + # + # Outputs +filter1+, and then +filter2+ using Join.new def + (filter) Join.new(@shell, self, filter) end |