mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib: Convert tabs to spaces for ruby files per
http://redmine.ruby-lang.org/projects/ruby/wiki/DeveloperHowto#coding-style Patch by Steve Klabnik [Ruby 1.9 - Bug #4730] Patch by Jason Dew [Ruby 1.9 - Feature #4718] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
34276148c4
commit
7bbf2f3085
67 changed files with 3823 additions and 3814 deletions
|
@ -1,8 +1,8 @@
|
|||
#
|
||||
# shell/builtin-command.rb -
|
||||
# $Release Version: 0.7 $
|
||||
# $Revision$
|
||||
# by Keiju ISHITSUKA(keiju@ruby-lang.org)
|
||||
# $Release Version: 0.7 $
|
||||
# $Revision$
|
||||
# by Keiju ISHITSUKA(keiju@ruby-lang.org)
|
||||
#
|
||||
# --
|
||||
#
|
||||
|
@ -40,7 +40,7 @@ class Shell
|
|||
def each(rs = nil)
|
||||
rs = @shell.record_separator unless rs
|
||||
for str in @strings
|
||||
yield str + rs
|
||||
yield str + rs
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -53,11 +53,11 @@ class Shell
|
|||
|
||||
def each(rs = nil)
|
||||
if @cat_files.empty?
|
||||
super
|
||||
super
|
||||
else
|
||||
for src in @cat_files
|
||||
@shell.foreach(src, rs){|l| yield l}
|
||||
end
|
||||
for src in @cat_files
|
||||
@shell.foreach(src, rs){|l| yield l}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -71,31 +71,31 @@ class Shell
|
|||
|
||||
def each(rs = nil)
|
||||
if @pattern[0] == ?/
|
||||
@files = Dir[@pattern]
|
||||
@files = Dir[@pattern]
|
||||
else
|
||||
prefix = @shell.pwd+"/"
|
||||
@files = Dir[prefix+@pattern].collect{|p| p.sub(prefix, "")}
|
||||
prefix = @shell.pwd+"/"
|
||||
@files = Dir[prefix+@pattern].collect{|p| p.sub(prefix, "")}
|
||||
end
|
||||
rs = @shell.record_separator unless rs
|
||||
for f in @files
|
||||
yield f+rs
|
||||
yield f+rs
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# class Sort < Cat
|
||||
# def initialize(sh, *filenames)
|
||||
# super
|
||||
# end
|
||||
#
|
||||
# def each(rs = nil)
|
||||
# ary = []
|
||||
# super{|l| ary.push l}
|
||||
# for l in ary.sort!
|
||||
# yield l
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
# class Sort < Cat
|
||||
# def initialize(sh, *filenames)
|
||||
# super
|
||||
# end
|
||||
#
|
||||
# def each(rs = nil)
|
||||
# ary = []
|
||||
# super{|l| ary.push l}
|
||||
# for l in ary.sort!
|
||||
# yield l
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
|
||||
class AppendIO < BuiltInCommand
|
||||
def initialize(sh, io, filter)
|
||||
|
@ -107,7 +107,7 @@ class Shell
|
|||
def input=(filter)
|
||||
@input.input=filter
|
||||
for l in @input
|
||||
@io << l
|
||||
@io << l
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -122,9 +122,9 @@ class Shell
|
|||
|
||||
def input=(filter)
|
||||
begin
|
||||
super
|
||||
super
|
||||
ensure
|
||||
@io.close
|
||||
@io.close
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -138,9 +138,9 @@ class Shell
|
|||
def each(rs = nil)
|
||||
to = @shell.open(@to_filename, "w")
|
||||
begin
|
||||
super{|l| to << l; yield l}
|
||||
super{|l| to << l; yield l}
|
||||
ensure
|
||||
to.close
|
||||
to.close
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -153,7 +153,7 @@ class Shell
|
|||
|
||||
def each(rs = nil)
|
||||
while job = @jobs.shift
|
||||
job.each{|l| yield l}
|
||||
job.each{|l| yield l}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue