summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/mailread.rb22
-rw-r--r--lib/open3.rb9
2 files changed, 15 insertions, 16 deletions
diff --git a/lib/mailread.rb b/lib/mailread.rb
index 2edcca002a..ee86d353eb 100644
--- a/lib/mailread.rb
+++ b/lib/mailread.rb
@@ -9,25 +9,25 @@ class Mail
@header = {}
@body = []
begin
- while f.gets()
- $_.chop!
- next if /^From / # skip From-line
- break if /^$/ # end of header
+ while line = f.gets()
+ line.chop!
+ next if /^From /=~line # skip From-line
+ break if /^$/=~line # end of header
- if /^(\S+):\s*(.*)/
+ if /^(\S+):\s*(.*)/=~line
(attr = $1).capitalize!
@header[attr] = $2
elsif attr
- sub!(/^\s*/, '')
- @header[attr] += "\n" + $_
+ line.sub!(/^\s*/, '')
+ @header[attr] += "\n" + line
end
end
- return unless $_
+ return unless line
- while f.gets()
- break if /^From /
- @body.push($_)
+ while line = f.gets()
+ break if /^From /=~line
+ @body.push(line)
end
ensure
f.close if opened
diff --git a/lib/open3.rb b/lib/open3.rb
index 9e34acffc9..27283f5019 100644
--- a/lib/open3.rb
+++ b/lib/open3.rb
@@ -43,13 +43,12 @@ end
if $0 == __FILE__
a = Open3.popen3("nroff -man")
Thread.start do
- while gets
- a[0].print $_
+ while line = gets
+ a[0].print line
end
a[0].close
end
- while a[1].gets
- print ":", $_
+ while line = a[1].gets
+ print ":", line
end
end
-