Class: Shell::Cat
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
BuiltInCommand,
Filter
|
|
Instance Chain:
self,
BuiltInCommand,
Filter,
Enumerable
|
|
Inherits: |
Shell::BuiltInCommand
|
Defined in: | lib/shell/builtin-command.rb |
Class Method Summary
Instance Attribute Summary
Instance Method Summary
Filter - Inherited
#+ | Outputs |
#< | Inputs from |
#> | Outputs from |
#>> | Appends the output to |
#each | Iterates a block for each line. |
#inspect, #to_a, #to_s, | |
#| | Processes a pipeline. |
Constructor Details
.new(sh, *filenames) ⇒ Cat
# File 'lib/shell/builtin-command.rb', line 50
def initialize(sh, *filenames) super sh @cat_files = filenames end
Instance Method Details
#each(rs = nil)
[ GitHub ]# File 'lib/shell/builtin-command.rb', line 55
def each(rs = nil) if @cat_files.empty? super else for src in @cat_files @shell.foreach(src, rs){|l| yield l} end end end