aboutsummaryrefslogtreecommitdiffstats
path: root/lib/shell.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-18 21:19:18 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-18 21:19:18 +0000
commit7bbf2f308580f468802cd7d32c94fce1b9f1779e (patch)
tree0a680f59e70a78d60e776d7b763e618fb2fec624 /lib/shell.rb
parent34276148c4450faa77bb298cfbe005f7c263f802 (diff)
downloadruby-7bbf2f308580f468802cd7d32c94fce1b9f1779e.tar.gz
* 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
Diffstat (limited to 'lib/shell.rb')
-rw-r--r--lib/shell.rb72
1 files changed, 36 insertions, 36 deletions
diff --git a/lib/shell.rb b/lib/shell.rb
index d2ce26d3b3..7d6b91c933 100644
--- a/lib/shell.rb
+++ b/lib/shell.rb
@@ -1,8 +1,8 @@
#
# shell.rb -
-# $Release Version: 0.7 $
-# $Revision: 1.9 $
-# by Keiju ISHITSUKA(keiju@ruby-lang.org)
+# $Release Version: 0.7 $
+# $Revision: 1.9 $
+# by Keiju ISHITSUKA(keiju@ruby-lang.org)
#
# --
#
@@ -25,7 +25,7 @@ class Shell
include Error
extend Exception2MessageMapper
-# @cascade = true
+ # @cascade = true
# debug: true -> normal debug
# debug: 1 -> eval definition debug
# debug: 2 -> detail inspect debug
@@ -41,7 +41,7 @@ class Shell
attr_accessor :cascade, :debug, :verbose
-# alias cascade? cascade
+ # alias cascade? cascade
alias debug? debug
alias verbose? verbose
@verbose = true
@@ -57,9 +57,9 @@ class Shell
def default_system_path
if @default_system_path
- @default_system_path
+ @default_system_path
else
- ENV["PATH"].split(":")
+ ENV["PATH"].split(":")
end
end
@@ -69,9 +69,9 @@ class Shell
def default_record_separator
if @default_record_separator
- @default_record_separator
+ @default_record_separator
else
- $/
+ $/
end
end
@@ -156,10 +156,10 @@ class Shell
notify("chdir(with block) #{path}") if verbose
cwd_old = @cwd
begin
- chdir(path, nil)
- yield
+ chdir(path, nil)
+ yield
ensure
- chdir(cwd_old, nil)
+ chdir(cwd_old, nil)
end
else
notify("chdir #{path}") if verbose
@@ -179,9 +179,9 @@ class Shell
notify("pushdir(with block) #{path}") if verbose
pushdir(path, nil)
begin
- yield
+ yield
ensure
- popdir
+ popdir
end
elsif path
notify("pushdir #{path}") if verbose
@@ -192,12 +192,12 @@ class Shell
else
notify("pushdir") if verbose
if pop = @dir_stack.pop
- @dir_stack.push @cwd
- chdir pop
- notify "dir stack: [#{@dir_stack.join ', '}]"
- self
+ @dir_stack.push @cwd
+ chdir pop
+ notify "dir stack: [#{@dir_stack.join ', '}]"
+ self
else
- Shell.Fail DirStackEmpty
+ Shell.Fail DirStackEmpty
end
end
Void.new(self)
@@ -265,32 +265,32 @@ class Shell
def self.notify(*opts, &block)
Shell::debug_output_synchronize do
if opts[-1].kind_of?(String)
- yorn = verbose?
+ yorn = verbose?
else
- yorn = opts.pop
+ yorn = opts.pop
end
return unless yorn
if @debug_display_thread_id
- if @debug_display_process_id
- prefix = "shell(##{Process.pid}:#{Thread.current.to_s.sub("Thread", "Th")}): "
- else
- prefix = "shell(#{Thread.current.to_s.sub("Thread", "Th")}): "
- end
+ if @debug_display_process_id
+ prefix = "shell(##{Process.pid}:#{Thread.current.to_s.sub("Thread", "Th")}): "
+ else
+ prefix = "shell(#{Thread.current.to_s.sub("Thread", "Th")}): "
+ end
else
- prefix = "shell: "
+ prefix = "shell: "
end
_head = true
STDERR.print opts.collect{|mes|
- mes = mes.dup
- yield mes if iterator?
- if _head
- _head = false
-# "shell" " + mes
- prefix + mes
- else
- " "* prefix.size + mes
- end
+ mes = mes.dup
+ yield mes if iterator?
+ if _head
+ _head = false
+ # "shell" " + mes
+ prefix + mes
+ else
+ " "* prefix.size + mes
+ end
}.join("\n")+"\n"
end
end